# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 21e7935b20252fd9bc7853bb2bdd8269643b615a
# Parent 492fe12a6db40dd6053e8cea64da821601c5579a
Parse vcpus for VMX guest.
Vcpus are passed to device model and vmx domain builder.
Signed-off-by: Yan Li <yanx.li@xxxxxxxxx>
Signed-off-by: Xin Li <xin.b.li@xxxxxxxxx>
diff -r 492fe12a6db4 -r 21e7935b2025 tools/examples/xmexample.vmx
--- a/tools/examples/xmexample.vmx Wed Sep 21 09:56:34 2005
+++ b/tools/examples/xmexample.vmx Wed Sep 21 09:58:15 2005
@@ -25,6 +25,10 @@
# A name for your domain. All domains must have different names.
name = "ExampleVMXDomain"
+
+#-----------------------------------------------------------------------------
+# the number of cpus guest platform has, default=1
+vcpus=1
# Which CPU to start domain on?
#cpu = -1 # leave to Xen to pick
diff -r 492fe12a6db4 -r 21e7935b2025 tools/ioemu/vl.c
--- a/tools/ioemu/vl.c Wed Sep 21 09:56:34 2005
+++ b/tools/ioemu/vl.c Wed Sep 21 09:58:15 2005
@@ -126,6 +126,7 @@
int vm_running;
int audio_enabled = 0;
int nic_pcnet = 1;
+int vcpus = 1;
int sb16_enabled = 1;
int adlib_enabled = 1;
int gus_enabled = 1;
@@ -2105,6 +2106,7 @@
"-snapshot write to temporary files instead of disk image
files\n"
"-m megs set virtual RAM size to megs MB [default=%d]\n"
"-nographic disable graphical output and redirect serial I/Os
to console\n"
+ "-vcpus set CPU number of guest platform\n"
#ifdef CONFIG_VNC
"-vnc port use vnc instead of sdl\n"
"-vncport port use a different port\n"
@@ -2235,6 +2237,7 @@
QEMU_OPTION_hdachs,
QEMU_OPTION_L,
QEMU_OPTION_no_code_copy,
+ QEMU_OPTION_vcpus,
QEMU_OPTION_pci,
QEMU_OPTION_nic_pcnet,
QEMU_OPTION_isa,
@@ -2307,6 +2310,7 @@
{ "hdachs", HAS_ARG, QEMU_OPTION_hdachs },
{ "L", HAS_ARG, QEMU_OPTION_L },
{ "no-code-copy", 0, QEMU_OPTION_no_code_copy },
+ { "vcpus", 1, QEMU_OPTION_vcpus },
#ifdef TARGET_PPC
{ "prep", 0, QEMU_OPTION_prep },
{ "g", 1, QEMU_OPTION_g },
@@ -2646,6 +2650,9 @@
case QEMU_OPTION_S:
start_emulation = 0;
break;
+ case QEMU_OPTION_vcpus:
+ vcpus = atoi(optarg);
+ fprintf(logfile, "qemu: the number of cpus is %d\n", vcpus);
case QEMU_OPTION_pci:
pci_enabled = 1;
break;
diff -r 492fe12a6db4 -r 21e7935b2025 tools/libxc/xc_vmx_build.c
--- a/tools/libxc/xc_vmx_build.c Wed Sep 21 09:56:34 2005
+++ b/tools/libxc/xc_vmx_build.c Wed Sep 21 09:58:15 2005
@@ -626,6 +626,10 @@
/* Mask all upcalls... */
for ( i = 0; i < MAX_VIRT_CPUS; i++ )
shared_info->vcpu_data[i].evtchn_upcall_mask = 1;
+
+ shared_info->n_vcpu = vcpus;
+ printf(" VCPUS: %d\n", shared_info->n_vcpu);
+
munmap(shared_info, PAGE_SIZE);
/* Populate the event channel port in the shared page */
diff -r 492fe12a6db4 -r 21e7935b2025 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py Wed Sep 21 09:56:34 2005
+++ b/tools/python/xen/xend/image.py Wed Sep 21 09:58:15 2005
@@ -336,7 +336,7 @@
# xm config file
def parseDeviceModelArgs(self, config):
dmargs = [ 'cdrom', 'boot', 'fda', 'fdb',
- 'localtime', 'serial', 'stdvga', 'isa' ]
+ 'localtime', 'serial', 'stdvga', 'isa', 'vcpus' ]
ret = []
for a in dmargs:
v = sxp.child_value(config, a)
diff -r 492fe12a6db4 -r 21e7935b2025 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py Wed Sep 21 09:56:34 2005
+++ b/tools/python/xen/xm/create.py Wed Sep 21 09:58:15 2005
@@ -496,7 +496,7 @@
def configure_vmx(opts, config_image, vals):
"""Create the config for VMX devices.
"""
- args = [ 'memmap', 'device_model', 'cdrom',
+ args = [ 'memmap', 'device_model', 'vcpus', 'cdrom',
'boot', 'fda', 'fdb', 'localtime', 'serial', 'macaddr', 'stdvga',
'isa', 'nographic', 'vnc', 'vncviewer', 'sdl', 'display']
for a in args:
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|