]> git.proxmox.com Git - qemu.git/blobdiff - vl.c
machine struct - specify max_cpus at the per machine level (Jes Sorensen)
[qemu.git] / vl.c
diff --git a/vl.c b/vl.c
index 439d31778431b2d178cc75b769ff4d990a74ec04..5fe288e08612c113911e9ded463ce0692814b2a1 100644 (file)
--- 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";