From: Keir Fraser Date: Fri, 5 Sep 2008 11:41:38 +0000 (+0100) Subject: Fix HVM guest's save/restore by ignoring the null cdrom string X-Git-Tag: RELEASE-3.2.2~4 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=16841d7ad4dcce5d5cc07025231a27f4e92728c0;p=people%2Fvhanquez%2Fxen.git Fix HVM guest's save/restore by ignoring the null cdrom string When we use qcow in hvm config file, like disk=['tap:qcow:/img/qcow.img,hda,w',',hdc:cdrom,r'], HVM guest restore would fail. The patch fixes the issue by ignoring the null cdrom string. Signed-off-by: Dexuan Cui --- diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py index bef3a6cd4..d8d760b80 100644 --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -993,6 +993,11 @@ class XendConfig(dict): if o_dev_type == 'vbd' or o_dev_type == 'tap': blkdev_file = blkdev_uname_to_file(dev_uname) o_dev_uname = sxp.child_value(o_dev_info, 'uname') + + # Ignore a null cdrom definition string + if o_dev_uname is None: + continue + o_blkdev_file = blkdev_uname_to_file(o_dev_uname) if blkdev_file == o_blkdev_file: raise XendConfigError('The file "%s" is already used' %