]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
Fix HVM guest's save/restore by ignoring the null cdrom string
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 5 Sep 2008 11:41:38 +0000 (12:41 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 5 Sep 2008 11:41:38 +0000 (12:41 +0100)
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 <dexuan.cui@intel.com>
tools/python/xen/xend/XendConfig.py

index bef3a6cd4b59b09c5096681ae0af877b0d873f13..d8d760b809b74e216ee7826cb9ebd4165518ba1f 100644 (file)
@@ -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' %