[qemu] Use xenstore to configure ioemu block devices.

- read ioemu block device config from xenstore
- don't require the ioemu: prefix on block devices any longer
- allow change of media associated with cdrom drives
- replace cdrom= option by :cdrom suffix on regular block device config:
  'file:/root/mytest.iso,hdc:cdrom,r'
- don't create default cdrom drive anymore - to create default empty
  cdrom drive use: ',hdc:cdrom,r'

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
This commit is contained in:
chris@kneesaa.uk.xensource.com committed 2006-08-03 18:28:29 +01:00
1 parent 931e1a3a50
commit ae97d42025
12 files changed
+278 -43

No files matched your search

+6 -19
View File
@@ -249,7 +249,7 @@ class HVMImageHandler(ImageHandler):
# Return a list of cmd line args to the device models based on the
# xm config file
def parseDeviceModelArgs(self, imageConfig, deviceConfig):
dmargs = [ 'cdrom', 'boot', 'fda', 'fdb', 'audio',
dmargs = [ 'boot', 'fda', 'fdb', 'audio',
'localtime', 'serial', 'stdvga', 'isa', 'vcpus',
'usb', 'usbdevice']
ret = []
@@ -277,24 +277,11 @@ class HVMImageHandler(ImageHandler):
for (name, info) in deviceConfig:
if name == 'vbd':
uname = sxp.child_value(info, 'uname')
typedev = sxp.child_value(info, 'dev')
(_, vbdparam) = string.split(uname, ':', 1)
if 'file:' in uname and not os.path.isfile(vbdparam):
raise VmError('Disk image does not exist: %s' % vbdparam)
if 'ioemu:' in typedev:
(emtype, vbddev) = string.split(typedev, ':', 1)
else:
emtype = 'vbd'
vbddev = typedev
if emtype == 'vbd':
continue;
vbddev_list = ['hda', 'hdb', 'hdc', 'hdd']
if vbddev not in vbddev_list:
raise VmError("hvm: for qemu vbd type=file&dev=hda~hdd")
ret.append("-%s" % vbddev)
ret.append("%s" % vbdparam)
if 'file:' in uname:
(_, vbdparam) = string.split(uname, ':', 1)
if not os.path.isfile(vbdparam):
raise VmError('Disk image does not exist: %s' %
vbdparam)
if name == 'vif':
type = sxp.child_value(info, 'type')
if type != 'ioemu':
+15 -8
View File
@@ -45,7 +45,17 @@ class BlkifController(DevController):
dev = sxp.child_value(config, 'dev')
(typ, params) = string.split(uname, ':', 1)
if 'ioemu:' in dev:
(_, dev) = string.split(dev, ':', 1)
try:
(dev, dev_type) = string.split(dev, ':', 1)
except ValueError:
dev_type = "disk"
try:
(typ, params) = string.split(uname, ':', 1)
except ValueError:
(typ, params) = ("", "")
back = { 'dev' : dev,
'type' : typ,
'params' : params,
@@ -58,13 +68,10 @@ class BlkifController(DevController):
'acm_ssidref': str(ssidref),
'acm_policy' : policy})
if 'ioemu:' in dev:
(dummy, dev1) = string.split(dev, ':', 1)
devid = blkif.blkdev_name_to_number(dev1)
front = {}
else:
devid = blkif.blkdev_name_to_number(dev)
front = { 'virtual-device' : "%i" % devid }
devid = blkif.blkdev_name_to_number(dev)
front = { 'virtual-device' : "%i" % devid,
'device-type' : dev_type
}
return (devid, back, front)
+1 -5
View File
@@ -392,10 +392,6 @@ gopts.var('isa', val='no|yes',
fn=set_bool, default=0,
use="Simulate an ISA only system?")
gopts.var('cdrom', val='FILE',
fn=set_value, default='',
use="Path to cdrom")
gopts.var('boot', val="a|b|c|d",
fn=set_value, default='c',
use="Default boot device")
@@ -629,7 +625,7 @@ def configure_vifs(config_devs, vals):
def configure_hvm(config_image, vals):
"""Create the config for HVM devices.
"""
args = [ 'device_model', 'pae', 'vcpus', 'cdrom', 'boot', 'fda', 'fdb',
args = [ 'device_model', 'pae', 'vcpus', 'boot', 'fda', 'fdb',
'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'audio',
'vnc', 'vncdisplay', 'vncconsole', 'sdl', 'display',
'acpi', 'apic', 'xauthority', 'usb', 'usbdevice' ]
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.