Skip to contentSkip to conversation

Show "bootable" information only once

PATCH New Masaki Kanno 1 participant 1 message Jun 9, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Show "bootable" information only once

Hi,

"bootable" information is shown twice as follows.

# xm list --long vm2
(domain
    <<snip>>
    (device
        (vbd
            (protocol x86_32-abi)
            (uuid 743df7e2-eea8-0da5-7a1f-7b8483b34299)
            (bootable 1)
            (dev hda1:disk)
            (uname file:/xen/root-vm2.img)
            (mode w)
            (backend 0)
            (bootable 1)
            (VDI )
        )
    )
    <<snip>>
)

"bootable" information is shown only once by this patch.

# xm list --long vm2
(domain
    <<snip>>
    (device
        (vbd
            (protocol x86_32-abi)
            (uuid 0c851aa8-5e84-830c-f396-fe41a91a2d27)
            (bootable 1)
            (dev hda1:disk)
            (uname file:/xen/root-vm2.img)
            (mode w)
            (backend 0)
            (VDI )
        )
    )
    <<snip>>
)

Best regards,
Kan

tools/python/xen/xend/XendConfig.py +3 -4
diff -r 4448fae52553 tools/python/xen/xend/XendConfig.py
@@ -1100,12 +1100,11 @@
                             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])

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel