summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-07 20:39:39 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-07 20:39:39 +0000
commitb2097003ecad43a34851e57969eadf74181d0080 (patch)
treec229dde888def014a1f161ac7fb2737a1cd54347 /vl.c
parent4b32e1688000d306a676b0a5b89629b9d8da1ed7 (diff)
downloadqemu-b2097003ecad43a34851e57969eadf74181d0080.tar.gz
machine struct - specify max_cpus at the per machine level (Jes Sorensen)
Introduce a max_cpus per-machine variable, allowing individual boards to limit it's number of CPUs. Check requested number of CPUs in setup code and exit if it exceeds the supported number for the machine. This also renders the static MAX_CPUS check obsolete, so remove this from vl.c. Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5443 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/vl.c b/vl.c
index 439d317784..5fe288e086 100644
--- a/vl.c
+++ b/vl.c
@@ -213,13 +213,6 @@ int usb_enabled = 0;
static VLANState *first_vlan;
int smp_cpus = 1;
const char *vnc_display;
-#if defined(TARGET_SPARC)
-#define MAX_CPUS 16
-#elif defined(TARGET_I386)
-#define MAX_CPUS 255
-#else
-#define MAX_CPUS 1
-#endif
int acpi_enabled = 1;
int fd_bootchk = 1;
int no_reboot = 0;
@@ -9195,7 +9188,7 @@ int main(int argc, char **argv)
break;
case QEMU_OPTION_smp:
smp_cpus = atoi(optarg);
- if (smp_cpus < 1 || smp_cpus > MAX_CPUS) {
+ if (smp_cpus < 1) {
fprintf(stderr, "Invalid number of CPUs\n");
exit(1);
}
@@ -9312,6 +9305,13 @@ int main(int argc, char **argv)
}
}
+ if (smp_cpus > machine->max_cpus) {
+ fprintf(stderr, "Number of SMP cpus requested (%d), exceeds max cpus "
+ "supported by machine `%s' (%d)\n", smp_cpus, machine->name,
+ machine->max_cpus);
+ exit(1);
+ }
+
if (nographic) {
if (serial_device_index == 0)
serial_devices[0] = "stdio";