Mailing List Archive

Add a option for enabling ne2000 NIC device model
# HG changeset patch
# User kaf24@firebug.cl.cam.ac.uk
# Node ID c81c8a2821aa0cf8595e2372b9ea5d6bd1fb2b84
# Parent d6e99066959acf9f25b5515a67a2d15a7946a510
Add a option for enabling ne2000 NIC device model

Signed-off-by: Yan Li <yanx.li@intel.com>
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>

diff -r d6e99066959a -r c81c8a2821aa tools/examples/xmexample.vmx
--- a/tools/examples/xmexample.vmx Wed Oct 12 16:01:38 2005
+++ b/tools/examples/xmexample.vmx Wed Oct 12 16:04:11 2005
@@ -117,6 +117,11 @@
#nographic=0


+#----------------------------------------------------------------------------
+# enable ne2000, default = 0(use pcnet)
+ne2000=0
+
+
#-----------------------------------------------------------------------------
# enable audio support
#enable-audio=1
diff -r d6e99066959a -r c81c8a2821aa tools/ioemu/hw/pc.c
--- a/tools/ioemu/hw/pc.c Wed Oct 12 16:01:38 2005
+++ b/tools/ioemu/hw/pc.c Wed Oct 12 16:04:11 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 d6e99066959a -r c81c8a2821aa tools/ioemu/vl.c
--- a/tools/ioemu/vl.c Wed Oct 12 16:01:38 2005
+++ b/tools/ioemu/vl.c Wed Oct 12 16:04:11 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 d6e99066959a -r c81c8a2821aa tools/ioemu/vl.h
--- a/tools/ioemu/vl.h Wed Oct 12 16:01:38 2005
+++ b/tools/ioemu/vl.h Wed Oct 12 16:04:11 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 d6e99066959a -r c81c8a2821aa tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py Wed Oct 12 16:01:38 2005
+++ b/tools/python/xen/xend/image.py Wed Oct 12 16:04:11 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 d6e99066959a -r c81c8a2821aa tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py Wed Oct 12 16:01:38 2005
+++ b/tools/python/xen/xm/create.py Wed Oct 12 16:04:11 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-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog