Add a option for enabling ne2000 NIC device model
PATCH 1/1 Add a option for enabling ne2000 NIC device model
Add a option for enabling ne2000 NIC device model
Signed-off-by Yan Li <[email protected]>
Signed-off-by Xiaofeng Ling <[email protected]>
Signed-off-by Edwin Zhai <[email protected]>
tools/examples/xmexample.vmx +5 -0
@@ -117,6 +117,11 @@ #nographic=0 +#---------------------------------------------------------------------------- +# enable ne2000, default = 0(use pcnet) +ne2000=0 + + #----------------------------------------------------------------------------- # enable audio support #enable-audio=1
tools/ioemu/hw/pc.c +3 -3
@@ -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
tools/ioemu/vl.c +6 -6
@@ -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 ;
tools/ioemu/vl.h +1 -1
@@ -602,7 +602,7 @@/* pcnet.c */ -extern int nic_pcnet; +extern int nic_ne2000;void pci_pcnet_init (PCIBus *bus,NetDriverState *nd);
tools/python/xen/xend/image.py +3 -2
@@ -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))
tools/python/xen/xm/create.py +5 -1
@@ -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]])