aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
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";