[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [patch] Introduce per machine based max_cpu variable

From: Anthony Liguori
Subject: Re: [Qemu-devel] [patch] Introduce per machine based max_cpu variable
Date: Tue, 30 Sep 2008 10:18:49 -0500
User-agent: Thunderbird (X11/20080723)

Jes Sorensen wrote:
Index: qemu/hw/an5206.c
--- qemu.orig/hw/an5206.c +++ qemu/hw/an5206.c @@ -88,8 +88,9 @@
static void an5206_init(ram_addr_t ram_s } QEMUMachine
an5206_machine = { - "an5206", - "Arnewsh 5206", - an5206_init, -
512, + .name = "an5206", + .desc = "Arnewsh 5206", + .init =
an5206_init, + .ram_require = 512, + .max_cpus = 1, };

Anthony> Your change would be greatly simplified if you defined
Anthony> max_cpus to be such that it was the maximum number of vcpus -
Anthony> 1.

Anthony> Then the default value of 0 would be sufficient for most
Anthony> machine types.

Hi Anthony,

I thought about this, but I think it's a really bad idea. It will
cause confusion over time and I think it is quite reasonable to
require all machines to define the maximum number of CPUs they
support. Thats why I defined the error message so it was quite easy
for anyone to fixup in case I got one of them wrong.

I really think it's better to do this right than hack it.

If it were 'max_cpu' then the meaning is pretty clear. On a UP system, the max_cpu is 0.

You could also make it max_aps which makes it even more clear. A UP system doesn't have any APs.

The other option is to have max_cpus == 0 be equivalent to max_cpus == 1. But don't print anything. Basically, I don't like the idea of modifying every machine definition when they all have almost the exact same value for the field.


Anthony Liguori

reply via email to

[Prev in Thread] Current Thread [Next in Thread]