ia64/xen-unstable

changeset 5854:7ac99b43f879

Allow multiple disk images per guest.

Signed-off-by: Yunfeng Zhao <yunfeng.zhao@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Jul 25 21:02:34 2005 +0000 (2005-07-25)
parents 9b713b8d1100
children 82af26d5d134
files tools/python/xen/xend/image.py
line diff
     1.1 --- a/tools/python/xen/xend/image.py	Mon Jul 25 21:02:24 2005 +0000
     1.2 +++ b/tools/python/xen/xend/image.py	Mon Jul 25 21:02:34 2005 +0000
     1.3 @@ -284,18 +284,19 @@ class VmxImageHandler(ImageHandler):
     1.4  		ret.append("%s" % v)
     1.5  
     1.6          # Handle hd img related options
     1.7 -        device = sxp.child(self.vm.config, 'device')
     1.8 -        vbdinfo = sxp.child(device, 'vbd')
     1.9 -        if not vbdinfo:
    1.10 -            raise VmError("vmx: missing vbd configuration")
    1.11 -        uname = sxp.child_value(vbdinfo, 'uname')
    1.12 -        vbddev = sxp.child_value(vbdinfo, 'dev')
    1.13 -        (vbdtype, vbdparam) = string.split(uname, ':', 1)
    1.14 -        vbddev_list = ['hda', 'hdb', 'hdc', 'hdd']
    1.15 -        if vbdtype != 'file' or vbddev not in vbddev_list:
    1.16 -            raise VmError("vmx: for qemu vbd type=file&dev=hda~hdd")
    1.17 -        ret.append("-%s" % vbddev)
    1.18 -        ret.append("%s" % vbdparam)
    1.19 +        devices = sxp.children(self.vm.config, 'device')
    1.20 +        for device in devices:
    1.21 +            vbdinfo = sxp.child(device, 'vbd')
    1.22 +            if not vbdinfo:
    1.23 +                raise VmError("vmx: missing vbd configuration")
    1.24 +            uname = sxp.child_value(vbdinfo, 'uname')
    1.25 +            vbddev = sxp.child_value(vbdinfo, 'dev')
    1.26 +            (vbdtype, vbdparam) = string.split(uname, ':', 1)
    1.27 +            vbddev_list = ['hda', 'hdb', 'hdc', 'hdd']
    1.28 +            if vbdtype != 'file' or vbddev not in vbddev_list:
    1.29 +                raise VmError("vmx: for qemu vbd type=file&dev=hda~hdd")
    1.30 +            ret.append("-%s" % vbddev)
    1.31 +            ret.append("%s" % vbdparam)
    1.32  
    1.33  	# Handle graphics library related options
    1.34  	vnc = sxp.child_value(self.vm.config, 'vnc')