Salil Mehta <salil.me...@opnsrc.net> writes:

> Hello,
>
> Came across below code excerpt in x86/microvm code and wanted to know
> why 'has_hotpluggable_cpus' flag has been set to 'false' while various
> hot(un)plug APIs have been defined?
>
> static void microvm_class_init(ObjectClass *oc, void *data)
> {
>     X86MachineClass *x86mc = X86_MACHINE_CLASS(oc);
>     MachineClass *mc = MACHINE_CLASS(oc);
>     HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc);
>
>     mc->init = microvm_machine_state_init;
>
>     mc->family = "microvm_i386";
>     [...]
>     mc->max_cpus = 288;
>     mc->has_hotpluggable_cpus = false;  --------> This one
>     [...]

>From the original commit that added it:

  It's a minimalist machine type without PCI nor ACPI support, designed
  for short-lived guests. microvm also establishes a baseline for
  benchmarking and optimizing both QEMU and guest operating systems,
  since it is optimized for both boot time and footprint.

Generally hotplug requires a dance between the VMM and the firmware to
properly shutdown and restart hotplug devices. The principle
communication mechanism for this is ACPI.

>
>     /* hotplug (for cpu coldplug) */
>     mc->get_hotplug_handler = microvm_get_hotplug_handler;
>     hc->pre_plug = microvm_device_pre_plug_cb;
>     hc->plug = microvm_device_plug_cb;
>     hc->unplug_request = microvm_device_unplug_request_cb;
>     hc->unplug = microvm_device_unplug_cb;
>     [...]
> }
>
>
> Best regards
> Salil


-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro

Reply via email to