xend: Show "bootable" information only once in 'xm list --long'
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 16 Jun 2009 09:55:36 +0000 (10:55 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 16 Jun 2009 09:55:36 +0000 (10:55 +0100)
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
tools/python/xen/xend/XendConfig.py

index 6ac11928f66e12c4db0d03e351706d32e83e1957..87bb3721e093cfad9971508aa0cbca5473b40418 100644 (file)
@@ -1100,12 +1100,11 @@ class XendConfig(dict):
                             configs = controller.configurations(txn)
                             for config in configs:
                                 if sxp.name(config) in ('vbd', 'tap'):
-                                    # The bootable flag is never written to the
-                                    # store as part of the device config.
                                     dev_uuid = sxp.child_value(config, 'uuid')
                                     dev_type, dev_cfg = self['devices'][dev_uuid]
-                                    is_bootable = dev_cfg.get('bootable', 0)
-                                    config.append(['bootable', int(is_bootable)])
+                                    if sxp.child_value(config, 'bootable', None) is None:
+                                        is_bootable = dev_cfg.get('bootable', 0)
+                                        config.append(['bootable', int(is_bootable)])
                                     config.append(['VDI', dev_cfg.get('VDI', '')])
 
                                 sxpr.append(['device', config])