ia64/xen-unstable

changeset 7368:c81c8a2821aa

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>
author kaf24@firebug.cl.cam.ac.uk
date Wed Oct 12 17:04:11 2005 +0100 (2005-10-12)
parents d6e99066959a
children f8c725f1fce8
files tools/examples/xmexample.vmx tools/ioemu/hw/pc.c tools/ioemu/vl.c tools/ioemu/vl.h tools/python/xen/xend/image.py tools/python/xen/xm/create.py
line diff
     1.1 --- a/tools/examples/xmexample.vmx	Wed Oct 12 17:01:38 2005 +0100
     1.2 +++ b/tools/examples/xmexample.vmx	Wed Oct 12 17:04:11 2005 +0100
     1.3 @@ -117,6 +117,11 @@ vncviewer=1
     1.4  #nographic=0
     1.5  
     1.6  
     1.7 +#----------------------------------------------------------------------------
     1.8 +# enable ne2000, default = 0(use pcnet)
     1.9 +ne2000=0
    1.10 +
    1.11 +
    1.12  #-----------------------------------------------------------------------------
    1.13  #   enable audio support
    1.14  #enable-audio=1
     2.1 --- a/tools/ioemu/hw/pc.c	Wed Oct 12 17:01:38 2005 +0100
     2.2 +++ b/tools/ioemu/hw/pc.c	Wed Oct 12 17:04:11 2005 +0100
     2.3 @@ -541,10 +541,10 @@ void pc_init(int ram_size, int vga_ram_s
     2.4  
     2.5      if (pci_enabled) {
     2.6          for(i = 0; i < nb_nics; i++) {
     2.7 -            if (nic_pcnet)
     2.8 -                pci_pcnet_init(pci_bus, &nd_table[i]);
     2.9 +            if (nic_ne2000)
    2.10 +                pci_ne2000_init(pci_bus, &nd_table[i]);
    2.11              else
    2.12 -                pci_ne2000_init(pci_bus, &nd_table[i]); 
    2.13 +                pci_pcnet_init(pci_bus, &nd_table[i]); 
    2.14          }
    2.15          pci_piix3_ide_init(pci_bus, bs_table);
    2.16  #ifdef APIC_SUPPORT
     3.1 --- a/tools/ioemu/vl.c	Wed Oct 12 17:01:38 2005 +0100
     3.2 +++ b/tools/ioemu/vl.c	Wed Oct 12 17:04:11 2005 +0100
     3.3 @@ -125,7 +125,7 @@ QEMUTimer *gui_timer;
     3.4  QEMUTimer *polling_timer;
     3.5  int vm_running;
     3.6  int audio_enabled = 0;
     3.7 -int nic_pcnet = 1;
     3.8 +int nic_ne2000 = 0;
     3.9  int vcpus = 1;
    3.10  int sb16_enabled = 1;
    3.11  int adlib_enabled = 1;
    3.12 @@ -2130,7 +2130,7 @@ void help(void)
    3.13             "-prep           Simulate a PREP system (default is PowerMAC)\n"
    3.14             "-g WxH[xDEPTH]  Set the initial VGA graphic mode\n"
    3.15  #endif
    3.16 -           "-nic-pcnet     simulate an AMD PC-Net PCI ethernet adaptor\n"
    3.17 +           "-nic-ne2000     simulate an Realtek ne2k PCI ethernet adaptor\n"
    3.18             "\n"
    3.19             "Network options:\n"
    3.20             "-nics n         simulate 'n' network cards [default=1]\n"
    3.21 @@ -2247,7 +2247,7 @@ enum {
    3.22      QEMU_OPTION_no_code_copy,
    3.23      QEMU_OPTION_vcpus,
    3.24      QEMU_OPTION_pci,
    3.25 -    QEMU_OPTION_nic_pcnet,
    3.26 +    QEMU_OPTION_nic_ne2000,
    3.27      QEMU_OPTION_isa,
    3.28      QEMU_OPTION_prep,
    3.29      QEMU_OPTION_k,
    3.30 @@ -2334,7 +2334,7 @@ const QEMUOption qemu_options[] = {
    3.31      
    3.32      /* temporary options */
    3.33      { "pci", 0, QEMU_OPTION_pci },
    3.34 -    { "nic-pcnet", 0, QEMU_OPTION_nic_pcnet },
    3.35 +    { "nic-ne2000", 0, QEMU_OPTION_nic_ne2000 },
    3.36      { "cirrusvga", 0, QEMU_OPTION_cirrusvga },
    3.37      { "vgaacc", HAS_ARG, QEMU_OPTION_vgaacc },
    3.38      { NULL },
    3.39 @@ -2839,8 +2839,8 @@ int main(int argc, char **argv)
    3.40              case QEMU_OPTION_pci:
    3.41                  pci_enabled = 1;
    3.42                  break;
    3.43 -            case QEMU_OPTION_nic_pcnet:
    3.44 -                nic_pcnet = 1;
    3.45 +            case QEMU_OPTION_nic_ne2000:
    3.46 +                nic_ne2000 = 1;
    3.47                  break;
    3.48              case QEMU_OPTION_isa:
    3.49                  pci_enabled = 0;
     4.1 --- a/tools/ioemu/vl.h	Wed Oct 12 17:01:38 2005 +0100
     4.2 +++ b/tools/ioemu/vl.h	Wed Oct 12 17:04:11 2005 +0100
     4.3 @@ -602,7 +602,7 @@ void pci_ne2000_init(PCIBus *bus, NetDri
     4.4  
     4.5  /* pcnet.c */
     4.6  
     4.7 -extern int nic_pcnet;
     4.8 +extern int nic_ne2000;
     4.9  
    4.10  void pci_pcnet_init(PCIBus *bus, NetDriverState *nd);
    4.11  
     5.1 --- a/tools/python/xen/xend/image.py	Wed Oct 12 17:01:38 2005 +0100
     5.2 +++ b/tools/python/xen/xend/image.py	Wed Oct 12 17:04:11 2005 +0100
     5.3 @@ -257,7 +257,7 @@ class VmxImageHandler(ImageHandler):
     5.4      # Return a list of cmd line args to the device models based on the
     5.5      # xm config file
     5.6      def parseDeviceModelArgs(self, imageConfig, deviceConfig):
     5.7 -        dmargs = [ 'cdrom', 'boot', 'fda', 'fdb',
     5.8 +        dmargs = [ 'cdrom', 'boot', 'fda', 'fdb', 'ne2000', 
     5.9                     'localtime', 'serial', 'stdvga', 'isa', 'vcpus' ]
    5.10          ret = []
    5.11          for a in dmargs:
    5.12 @@ -265,9 +265,10 @@ class VmxImageHandler(ImageHandler):
    5.13  
    5.14              # python doesn't allow '-' in variable names
    5.15              if a == 'stdvga': a = 'std-vga'
    5.16 +            if a == 'ne2000': a = 'nic-ne2000'
    5.17  
    5.18              # Handle booleans gracefully
    5.19 -            if a in ['localtime', 'std-vga', 'isa']:
    5.20 +            if a in ['localtime', 'std-vga', 'isa', 'nic-ne2000']:
    5.21                  if v != None: v = int(v)
    5.22  
    5.23              log.debug("args: %s, val: %s" % (a,v))
     6.1 --- a/tools/python/xen/xm/create.py	Wed Oct 12 17:01:38 2005 +0100
     6.2 +++ b/tools/python/xen/xm/create.py	Wed Oct 12 17:04:11 2005 +0100
     6.3 @@ -364,6 +364,10 @@ gopts.var('nographic', val='no|yes',
     6.4            fn=set_bool, default=0,
     6.5            use="Should device models use graphics?")
     6.6  
     6.7 +gopts.var('ne2000', val='no|yes',
     6.8 +          fn=set_bool, default=0,
     6.9 +          use="Should device models use ne2000?")
    6.10 +
    6.11  gopts.var('vnc', val='',
    6.12            fn=set_value, default=None,
    6.13            use="""Should the device model use VNC?""")
    6.14 @@ -540,7 +544,7 @@ def configure_vmx(opts, config_image, va
    6.15      """
    6.16      args = [ 'memmap', 'device_model', 'vcpus', 'cdrom',
    6.17               'boot', 'fda', 'fdb', 'localtime', 'serial', 'macaddr', 'stdvga', 
    6.18 -             'isa', 'nographic', 'vnc', 'vncviewer', 'sdl', 'display']
    6.19 +             'isa', 'nographic', 'vnc', 'vncviewer', 'sdl', 'display', 'ne2000']
    6.20      for a in args:
    6.21          if (vals.__dict__[a]):
    6.22              config_image.append([a, vals.__dict__[a]])