[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Update xend to support network configuration for qemu 0.8.1 based ioemu.



# HG changeset patch
# User chris@xxxxxxxxxxxxxxxxxxxxxxxx
# Node ID 6d8f2d78d7c8fe510d14d6ab9766f0bce11b936a
# Parent  b450f21472a0574fbc382f2f84ea0a8295aa6423
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@xxxxxxxxxxxxx>
---
 tools/examples/xmexample.hvm   |    6 +-----
 tools/python/xen/xend/image.py |   23 +++++++++--------------
 tools/python/xen/xm/create.py  |    8 ++------
 3 files changed, 12 insertions(+), 25 deletions(-)

diff -r b450f21472a0 -r 6d8f2d78d7c8 tools/examples/xmexample.hvm
--- a/tools/examples/xmexample.hvm      Wed Jul 12 19:16:10 2006 +0100
+++ b/tools/examples/xmexample.hvm      Wed Jul 12 19:16:12 2006 +0100
@@ -54,7 +54,7 @@ name = "ExampleHVMDomain"
 
 # Optionally define mac and/or bridge for the network interfaces.
 # Random MACs are assigned if not given.
-#vif = [ 'type=ioemu, mac=00:16:3e:00:00:11, bridge=xenbr0' ]
+#vif = [ 'type=ioemu, mac=00:16:3e:00:00:11, bridge=xenbr0, model=ne2k_pci' ]
 # type=ioemu specify the NIC is an ioemu device not netfront
 vif = [ 'type=ioemu, bridge=xenbr0' ]
 
@@ -146,10 +146,6 @@ stdvga=0
 #   then xm console or minicom can connect
 serial='pty'
 
-#----------------------------------------------------------------------------
-# enable ne2000, default = 0(use pcnet)
-ne2000=0
-
 
 #-----------------------------------------------------------------------------
 #   enable audio support
diff -r b450f21472a0 -r 6d8f2d78d7c8 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Wed Jul 12 19:16:10 2006 +0100
+++ b/tools/python/xen/xend/image.py    Wed Jul 12 19:16:12 2006 +0100
@@ -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):
diff -r b450f21472a0 -r 6d8f2d78d7c8 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Wed Jul 12 19:16:10 2006 +0100
+++ b/tools/python/xen/xm/create.py     Wed Jul 12 19:16:12 2006 +0100
@@ -397,10 +397,6 @@ gopts.var('nographic', val='no|yes',
 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,
@@ -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]):

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.