[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 20/42] machine: add cpu-hotplug machine option
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [RFC 20/42] machine: add cpu-hotplug machine option |
Date: |
Wed, 11 May 2016 12:00:51 -0300 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Wed, May 11, 2016 at 04:00:19PM +0200, Igor Mammedov wrote:
> On Tue, 10 May 2016 17:27:18 -0300
> Eduardo Habkost <address@hidden> wrote:
>
> > On Mon, May 02, 2016 at 02:33:29PM +0200, Igor Mammedov wrote:
> > > Signed-off-by: Igor Mammedov <address@hidden>
> >
> > If a machine class simply doesn't support CPU hotplug at all, is
> > silently ignoring "cpu-hotplug=on" the right thing to do?
> >
> > Shouldn't we exit with an error if the machine class doesn't
> > support CPU hotplug and the user tries to enable it?
> We have a bunch of such options in generic MachineClass
> and it was upto concrete machine to implement such checks.
Yes, and my proposal is to make this more robust from now on, and
make machines stop silently ignoring unsupported options.
>
> So I hadn't even considered to make such check in generic code
> nor think that's a right thing to do, if that's what you are asking.
If only 1 or 2 machines support CPU hotplug, I don't think it
would be reasonable to have the option available at every machine
class and require most classes to add an extra check like:
if (machine->cpu_hotplug)
error_setg(errp, "CPU hotplug not supported");
A check like the following, in common code:
if (!machine_class->cpu_hotplug_supported && machine->cpu_hotplug)
error_setg(errp, "CPU hotplug not supported")
would avoid duplicating code in every machine class, and only
require the following extra line in the machine classes that
really support CPU hotplug:
machine_class->cpu_hotplug_supported = true;
Or, even better: we can avoid registering the cpu-hotplug
property at all if the subclass doesn't support CPU hotplug. You
can do that at machine_class_base_init, e.g.:
static void machine_class_base_init(ObjectClass *oc, void *data)
{
/* [...] */
MachineClass *mc = MACHINE_CLASS(oc);
if (mc->cpu_hotplug_supported) {
object_class_property_add_str(oc, "cpu-hotplug",
machine_get_cpu_hotplug,
machine_set_cpu_hotplug, NULL);
object_class_property_set_description(oc, "cpu-hotplug",
"Set on to enable CPU
hotplug",
NULL);
}
}
--
Eduardo
- Re: [Qemu-devel] [RFC 12/42] pc: initialize legacy hotplug only for 2.6 and older machine types, (continued)
- [Qemu-devel] [RFC 03/42] pc: acpi: remove AML for empty/not used GPE handlers, Igor Mammedov, 2016/05/02
- [Qemu-devel] [RFC 08/42] pc: acpi: consolidate legacy CPU hotplug in one file, Igor Mammedov, 2016/05/02
- [Qemu-devel] [RFC 15/42] acpi: extend ACPI interface to provide send_event hook, Igor Mammedov, 2016/05/02
- [Qemu-devel] [RFC 16/42] pc: use AcpiDeviceIfClass.send_event to issue GPE events, Igor Mammedov, 2016/05/02
- [Qemu-devel] [RFC 17/42] docs: update ACPI CPU hotplug spec with new protocol, Igor Mammedov, 2016/05/02
- [Qemu-devel] [RFC 20/42] machine: add cpu-hotplug machine option, Igor Mammedov, 2016/05/02
- [Qemu-devel] [RFC 13/42] tests: bios-tables-test: update tables with CPHP turned off by default, Igor Mammedov, 2016/05/02
- [Qemu-devel] [RFC 10/42] pc: piix4/ich9: add 'cpu-hotplug-legacy' property, Igor Mammedov, 2016/05/02
- [Qemu-devel] [RFC 19/42] pc: add generic CPU unplug callbacks, Igor Mammedov, 2016/05/02
- [Qemu-devel] [RFC 18/42] acpi: hardware side of CPU hotplug, Igor Mammedov, 2016/05/02
- [Qemu-devel] [RFC 22/42] pc: piix4: initialize new CPU hotplug hw, Igor Mammedov, 2016/05/02
- [Qemu-devel] [RFC 21/42] pc: q35: initialize new CPU hotplug hw, Igor Mammedov, 2016/05/02
- [Qemu-devel] [RFC 25/42] tests: acpi: update cphp_legacy case with new ProcessorID values, Igor Mammedov, 2016/05/02
- [Qemu-devel] [RFC 26/42] pc: acpi: introduce AcpiDeviceIfClass.madt_cpu hook, Igor Mammedov, 2016/05/02