WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH][VT] Add a option for enabling ne2000 NIC device mode

To: Ian Pratt <Ian.Pratt@xxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH][VT] Add a option for enabling ne2000 NIC device model
From: Edwin Zhai <edwin.zhai@xxxxxxxxx>
Date: Wed, 12 Oct 2005 20:14:04 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 12 Oct 2005 12:12:24 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.8i
Add a option for enabling ne2000 NIC device model
Signed-off-by: Yan Li <yanx.li@xxxxxxxxx>
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@xxxxxxxxx>
Signed-off-by: Edwin Zhai <edwin.zhai@xxxxxxxxx>
diff -r 067b9aacb6c2 tools/examples/xmexample.vmx
--- a/tools/examples/xmexample.vmx      Wed Oct 12 09:11:35 2005
+++ b/tools/examples/xmexample.vmx      Wed Oct 12 20:09:33 2005
@@ -117,6 +117,11 @@
 #nographic=0
 
 
+#----------------------------------------------------------------------------
+# enable ne2000, default = 0(use pcnet)
+ne2000=0
+
+
 #-----------------------------------------------------------------------------
 #   enable audio support
 #enable-audio=1
diff -r 067b9aacb6c2 tools/ioemu/hw/pc.c
--- a/tools/ioemu/hw/pc.c       Wed Oct 12 09:11:35 2005
+++ b/tools/ioemu/hw/pc.c       Wed Oct 12 20:09:33 2005
@@ -541,10 +541,10 @@
 
     if (pci_enabled) {
         for(i = 0; i < nb_nics; i++) {
-            if (nic_pcnet)
-                pci_pcnet_init(pci_bus, &nd_table[i]);
+            if (nic_ne2000)
+                pci_ne2000_init(pci_bus, &nd_table[i]);
             else
-                pci_ne2000_init(pci_bus, &nd_table[i]); 
+                pci_pcnet_init(pci_bus, &nd_table[i]); 
         }
         pci_piix3_ide_init(pci_bus, bs_table);
 #ifdef APIC_SUPPORT
diff -r 067b9aacb6c2 tools/ioemu/vl.c
--- a/tools/ioemu/vl.c  Wed Oct 12 09:11:35 2005
+++ b/tools/ioemu/vl.c  Wed Oct 12 20:09:33 2005
@@ -125,7 +125,7 @@
 QEMUTimer *polling_timer;
 int vm_running;
 int audio_enabled = 0;
-int nic_pcnet = 1;
+int nic_ne2000 = 0;
 int vcpus = 1;
 int sb16_enabled = 1;
 int adlib_enabled = 1;
@@ -2130,7 +2130,7 @@
            "-prep           Simulate a PREP system (default is PowerMAC)\n"
            "-g WxH[xDEPTH]  Set the initial VGA graphic mode\n"
 #endif
-           "-nic-pcnet     simulate an AMD PC-Net PCI ethernet adaptor\n"
+           "-nic-ne2000     simulate an Realtek ne2k PCI ethernet adaptor\n"
            "\n"
            "Network options:\n"
            "-nics n         simulate 'n' network cards [default=1]\n"
@@ -2247,7 +2247,7 @@
     QEMU_OPTION_no_code_copy,
     QEMU_OPTION_vcpus,
     QEMU_OPTION_pci,
-    QEMU_OPTION_nic_pcnet,
+    QEMU_OPTION_nic_ne2000,
     QEMU_OPTION_isa,
     QEMU_OPTION_prep,
     QEMU_OPTION_k,
@@ -2334,7 +2334,7 @@
     
     /* temporary options */
     { "pci", 0, QEMU_OPTION_pci },
-    { "nic-pcnet", 0, QEMU_OPTION_nic_pcnet },
+    { "nic-ne2000", 0, QEMU_OPTION_nic_ne2000 },
     { "cirrusvga", 0, QEMU_OPTION_cirrusvga },
     { "vgaacc", HAS_ARG, QEMU_OPTION_vgaacc },
     { NULL },
@@ -2839,8 +2839,8 @@
             case QEMU_OPTION_pci:
                 pci_enabled = 1;
                 break;
-            case QEMU_OPTION_nic_pcnet:
-                nic_pcnet = 1;
+            case QEMU_OPTION_nic_ne2000:
+                nic_ne2000 = 1;
                 break;
             case QEMU_OPTION_isa:
                 pci_enabled = 0;
diff -r 067b9aacb6c2 tools/ioemu/vl.h
--- a/tools/ioemu/vl.h  Wed Oct 12 09:11:35 2005
+++ b/tools/ioemu/vl.h  Wed Oct 12 20:09:33 2005
@@ -602,7 +602,7 @@
 
 /* pcnet.c */
 
-extern int nic_pcnet;
+extern int nic_ne2000;
 
 void pci_pcnet_init(PCIBus *bus, NetDriverState *nd);
 
diff -r 067b9aacb6c2 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Wed Oct 12 09:11:35 2005
+++ b/tools/python/xen/xend/image.py    Wed Oct 12 20:09:33 2005
@@ -257,7 +257,7 @@
     # 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',
+        dmargs = [ 'cdrom', 'boot', 'fda', 'fdb', 'ne2000', 
                    'localtime', 'serial', 'stdvga', 'isa', 'vcpus' ]
         ret = []
         for a in dmargs:
@@ -265,9 +265,10 @@
 
             # python doesn't allow '-' in variable names
             if a == 'stdvga': a = 'std-vga'
+            if a == 'ne2000': a = 'nic-ne2000'
 
             # Handle booleans gracefully
-            if a in ['localtime', 'std-vga', 'isa']:
+            if a in ['localtime', 'std-vga', 'isa', 'nic-ne2000']:
                 if v != None: v = int(v)
 
             log.debug("args: %s, val: %s" % (a,v))
diff -r 067b9aacb6c2 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Wed Oct 12 09:11:35 2005
+++ b/tools/python/xen/xm/create.py     Wed Oct 12 20:09:33 2005
@@ -363,6 +363,10 @@
 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('vnc', val='',
           fn=set_value, default=None,
@@ -540,7 +544,7 @@
     """
     args = [ 'memmap', 'device_model', 'vcpus', 'cdrom',
              'boot', 'fda', 'fdb', 'localtime', 'serial', 'macaddr', 'stdvga', 
-             'isa', 'nographic', 'vnc', 'vncviewer', 'sdl', 'display']
+             'isa', 'nographic', 'vnc', 'vncviewer', 'sdl', 'display', 
'ne2000']
     for a in args:
         if (vals.__dict__[a]):
             config_image.append([a, vals.__dict__[a]])


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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH][VT] Add a option for enabling ne2000 NIC device model, Edwin Zhai <=