From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arun Sharma Subject: [PATCH][5/9] Allow multiple disk images per guest. Date: Mon, 25 Jul 2005 14:01:18 -0700 Message-ID: <20050725210118.GA24365@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Pratt , Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Allow multiple disk images per guest. Signed-off-by: Yunfeng Zhao Signed-off-by: Arun Sharma diff -r f677804084e1 -r ba6a148b0754 tools/python/xen/xend/image.py --- a/tools/python/xen/xend/image.py Fri Jul 15 19:48:02 2005 +++ b/tools/python/xen/xend/image.py Fri Jul 15 21:23:07 2005 @@ -284,18 +284,19 @@ ret.append("%s" % v) # Handle hd img related options - device = sxp.child(self.vm.config, 'device') - vbdinfo = sxp.child(device, 'vbd') - if not vbdinfo: - raise VmError("vmx: missing vbd configuration") - uname = sxp.child_value(vbdinfo, 'uname') - vbddev = sxp.child_value(vbdinfo, 'dev') - (vbdtype, vbdparam) = string.split(uname, ':', 1) - vbddev_list = ['hda', 'hdb', 'hdc', 'hdd'] - if vbdtype != 'file' or vbddev not in vbddev_list: - raise VmError("vmx: for qemu vbd type=file&dev=hda~hdd") - ret.append("-%s" % vbddev) - ret.append("%s" % vbdparam) + devices = sxp.children(self.vm.config, 'device') + for device in devices: + vbdinfo = sxp.child(device, 'vbd') + if not vbdinfo: + raise VmError("vmx: missing vbd configuration") + uname = sxp.child_value(vbdinfo, 'uname') + vbddev = sxp.child_value(vbdinfo, 'dev') + (vbdtype, vbdparam) = string.split(uname, ':', 1) + vbddev_list = ['hda', 'hdb', 'hdc', 'hdd'] + if vbdtype != 'file' or vbddev not in vbddev_list: + raise VmError("vmx: for qemu vbd type=file&dev=hda~hdd") + ret.append("-%s" % vbddev) + ret.append("%s" % vbdparam) # Handle graphics library related options vnc = sxp.child_value(self.vm.config, 'vnc')