mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
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
This commit is contained in:
parent
4b32e16880
commit
b2097003ec
30 changed files with 59 additions and 8 deletions
16
vl.c
16
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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue