mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
Update xend to support network configuration for qemu 0.8.1 based ioemu.
Remove the ne2000 option, the network device type can now be selected on a per-device basis by adding a model= property to the device's entry in the vif list. Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
This commit is contained in:
1 parent
8f4b90220c
commit
472b6cb977
3 files changed
+12
-25
No files matched your search
@@ -248,7 +248,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', 'ne2000', 'audio',
|
||||
dmargs = [ 'cdrom', 'boot', 'fda', 'fdb', 'audio',
|
||||
'localtime', 'serial', 'stdvga', 'isa', 'vcpus',
|
||||
'usb', 'usbdevice']
|
||||
ret = []
|
||||
@@ -257,11 +257,10 @@ class HVMImageHandler(ImageHandler):
|
||||
|
||||
# python doesn't allow '-' in variable names
|
||||
if a == 'stdvga': a = 'std-vga'
|
||||
if a == 'ne2000': a = 'nic-ne2000'
|
||||
if a == 'audio': a = 'enable-audio'
|
||||
|
||||
# Handle booleans gracefully
|
||||
if a in ['localtime', 'std-vga', 'isa', 'nic-ne2000', 'enable-audio', 'usb']:
|
||||
if a in ['localtime', 'std-vga', 'isa', 'enable-audio', 'usb']:
|
||||
if v != None: v = int(v)
|
||||
if v: ret.append("-%s" % a)
|
||||
else:
|
||||
@@ -300,24 +299,20 @@ class HVMImageHandler(ImageHandler):
|
||||
if type != 'ioemu':
|
||||
continue
|
||||
nics += 1
|
||||
if mac != None:
|
||||
continue
|
||||
mac = sxp.child_value(info, 'mac')
|
||||
bridge = sxp.child_value(info, 'bridge')
|
||||
if mac == None:
|
||||
mac = randomMAC()
|
||||
if bridge == None:
|
||||
bridge = 'xenbr0'
|
||||
ret.append("-macaddr")
|
||||
ret.append("%s" % mac)
|
||||
ret.append("-bridge")
|
||||
ret.append("%s" % bridge)
|
||||
bridge = sxp.child_value(info, 'bridge', 'xenbr0')
|
||||
model = sxp.child_value(info, 'model', 'rtl8139')
|
||||
ret.append("-net")
|
||||
ret.append("nic,vlan=%d,macaddr=%s,model=%s" %
|
||||
(nics, mac, model))
|
||||
ret.append("-net")
|
||||
ret.append("tap,vlan=%d,bridge=%s" % (nics, bridge))
|
||||
if name == 'vtpm':
|
||||
instance = sxp.child_value(info, 'pref_instance')
|
||||
ret.append("-instance")
|
||||
ret.append("%s" % instance)
|
||||
ret.append("-nics")
|
||||
ret.append("%d" % nics)
|
||||
return ret
|
||||
|
||||
def configVNC(self, config):
|
||||
|
||||
@@ -398,10 +398,6 @@ gopts.var('nographic', val='no|yes',
|
||||
fn=set_bool, default=0,
|
||||
use="Should device models use graphics?")
|
||||
|
||||
gopts.var('ne2000', val='no|yes',
|
||||
fn=set_bool, default=0,
|
||||
use="Should device models use ne2000?")
|
||||
|
||||
gopts.var('audio', val='no|yes',
|
||||
fn=set_bool, default=0,
|
||||
use="Should device models enable audio?")
|
||||
@@ -605,7 +601,7 @@ def configure_vifs(config_devs, vals):
|
||||
|
||||
def f(k):
|
||||
if k not in ['backend', 'bridge', 'ip', 'mac', 'script', 'type',
|
||||
'vifname', 'rate']:
|
||||
'vifname', 'rate', 'model']:
|
||||
err('Invalid vif option: ' + k)
|
||||
|
||||
config_vif.append([k, d[k]])
|
||||
@@ -619,7 +615,7 @@ def configure_hvm(config_image, vals):
|
||||
"""
|
||||
args = [ 'device_model', 'pae', 'vcpus', 'cdrom', 'boot', 'fda', 'fdb',
|
||||
'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'audio',
|
||||
'vnc', 'vncviewer', 'sdl', 'display', 'ne2000', 'acpi', 'apic',
|
||||
'vnc', 'vncviewer', 'sdl', 'display', 'acpi', 'apic',
|
||||
'xauthority', 'usb', 'usbdevice' ]
|
||||
for a in args:
|
||||
if (vals.__dict__[a]):
|
||||
|
||||