ia64/xen-unstable

changeset 6987:21e7935b2025

Parse vcpus for VMX guest.

Vcpus are passed to device model and vmx domain builder.

Signed-off-by: Yan Li <yanx.li@intel.com>
Signed-off-by: Xin Li <xin.b.li@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Sep 21 09:58:15 2005 +0000 (2005-09-21)
parents 492fe12a6db4
children b8537442f3d6
files tools/examples/xmexample.vmx tools/ioemu/vl.c tools/libxc/xc_vmx_build.c tools/python/xen/xend/image.py tools/python/xen/xm/create.py
line diff
     1.1 --- a/tools/examples/xmexample.vmx	Wed Sep 21 09:56:34 2005 +0000
     1.2 +++ b/tools/examples/xmexample.vmx	Wed Sep 21 09:58:15 2005 +0000
     1.3 @@ -26,6 +26,10 @@ memory = 128
     1.4  # A name for your domain. All domains must have different names.
     1.5  name = "ExampleVMXDomain"
     1.6  
     1.7 +#-----------------------------------------------------------------------------
     1.8 +# the number of cpus guest platform has, default=1
     1.9 +vcpus=1
    1.10 +
    1.11  # Which CPU to start domain on? 
    1.12  #cpu = -1   # leave to Xen to pick
    1.13  
     2.1 --- a/tools/ioemu/vl.c	Wed Sep 21 09:56:34 2005 +0000
     2.2 +++ b/tools/ioemu/vl.c	Wed Sep 21 09:58:15 2005 +0000
     2.3 @@ -126,6 +126,7 @@ QEMUTimer *polling_timer;
     2.4  int vm_running;
     2.5  int audio_enabled = 0;
     2.6  int nic_pcnet = 1;
     2.7 +int vcpus = 1;
     2.8  int sb16_enabled = 1;
     2.9  int adlib_enabled = 1;
    2.10  int gus_enabled = 1;
    2.11 @@ -2105,6 +2106,7 @@ void help(void)
    2.12  	   "-snapshot       write to temporary files instead of disk image files\n"
    2.13             "-m megs         set virtual RAM size to megs MB [default=%d]\n"
    2.14             "-nographic      disable graphical output and redirect serial I/Os to console\n"
    2.15 +           "-vcpus          set CPU number of guest platform\n"
    2.16  #ifdef CONFIG_VNC
    2.17  	   "-vnc port             use vnc instead of sdl\n"
    2.18  	   "-vncport port         use a different port\n"
    2.19 @@ -2235,6 +2237,7 @@ enum {
    2.20      QEMU_OPTION_hdachs,
    2.21      QEMU_OPTION_L,
    2.22      QEMU_OPTION_no_code_copy,
    2.23 +    QEMU_OPTION_vcpus,
    2.24      QEMU_OPTION_pci,
    2.25      QEMU_OPTION_nic_pcnet,
    2.26      QEMU_OPTION_isa,
    2.27 @@ -2307,6 +2310,7 @@ const QEMUOption qemu_options[] = {
    2.28      { "hdachs", HAS_ARG, QEMU_OPTION_hdachs },
    2.29      { "L", HAS_ARG, QEMU_OPTION_L },
    2.30      { "no-code-copy", 0, QEMU_OPTION_no_code_copy },
    2.31 +    { "vcpus", 1, QEMU_OPTION_vcpus },
    2.32  #ifdef TARGET_PPC
    2.33      { "prep", 0, QEMU_OPTION_prep },
    2.34      { "g", 1, QEMU_OPTION_g },
    2.35 @@ -2646,6 +2650,9 @@ int main(int argc, char **argv)
    2.36              case QEMU_OPTION_S:
    2.37                  start_emulation = 0;
    2.38                  break;
    2.39 +            case QEMU_OPTION_vcpus:
    2.40 +                vcpus = atoi(optarg);
    2.41 +                fprintf(logfile, "qemu: the number of cpus is %d\n", vcpus);
    2.42              case QEMU_OPTION_pci:
    2.43                  pci_enabled = 1;
    2.44                  break;
     3.1 --- a/tools/libxc/xc_vmx_build.c	Wed Sep 21 09:56:34 2005 +0000
     3.2 +++ b/tools/libxc/xc_vmx_build.c	Wed Sep 21 09:58:15 2005 +0000
     3.3 @@ -626,6 +626,10 @@ static int setup_guest(int xc_handle,
     3.4      /* Mask all upcalls... */
     3.5      for ( i = 0; i < MAX_VIRT_CPUS; i++ )
     3.6          shared_info->vcpu_data[i].evtchn_upcall_mask = 1;
     3.7 +
     3.8 +    shared_info->n_vcpu = vcpus;
     3.9 +    printf(" VCPUS:         %d\n", shared_info->n_vcpu);
    3.10 +
    3.11      munmap(shared_info, PAGE_SIZE);
    3.12  
    3.13      /* Populate the event channel port in the shared page */
     4.1 --- a/tools/python/xen/xend/image.py	Wed Sep 21 09:56:34 2005 +0000
     4.2 +++ b/tools/python/xen/xend/image.py	Wed Sep 21 09:58:15 2005 +0000
     4.3 @@ -336,7 +336,7 @@ class VmxImageHandler(ImageHandler):
     4.4      # xm config file
     4.5      def parseDeviceModelArgs(self, config):
     4.6          dmargs = [ 'cdrom', 'boot', 'fda', 'fdb',
     4.7 -                   'localtime', 'serial', 'stdvga', 'isa' ] 
     4.8 +                   'localtime', 'serial', 'stdvga', 'isa', 'vcpus' ] 
     4.9          ret = []
    4.10          for a in dmargs:
    4.11              v = sxp.child_value(config, a)
     5.1 --- a/tools/python/xen/xm/create.py	Wed Sep 21 09:56:34 2005 +0000
     5.2 +++ b/tools/python/xen/xm/create.py	Wed Sep 21 09:58:15 2005 +0000
     5.3 @@ -496,7 +496,7 @@ def configure_vfr(opts, config, vals):
     5.4  def configure_vmx(opts, config_image, vals):
     5.5      """Create the config for VMX devices.
     5.6      """
     5.7 -    args = [ 'memmap', 'device_model', 'cdrom',
     5.8 +    args = [ 'memmap', 'device_model', 'vcpus', 'cdrom',
     5.9               'boot', 'fda', 'fdb', 'localtime', 'serial', 'macaddr', 'stdvga', 
    5.10               'isa', 'nographic', 'vnc', 'vncviewer', 'sdl', 'display']
    5.11      for a in args: