diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2020-09-15 14:09:02 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-09-17 14:16:19 +0200 |
commit | 50aef1318166c2a5551d43fb99c5a517f54fcf3c (patch) | |
tree | 6973a710f7858d63cc3bf2ce4d6863191a16dbf9 /hw/i386/microvm.c | |
parent | 9927a6329a4ce832b4b529903b0a1e1f580cbf0f (diff) |
x86: move acpi_dev from pc/microvm
Both pc and microvm machine types have a acpi_dev field.
Move it to the common base type.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Sergio Lopez <slp@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Message-id: 20200915120909.20838-15-kraxel@redhat.com
Diffstat (limited to 'hw/i386/microvm.c')
-rw-r--r-- | hw/i386/microvm.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index 04209eb38f..9df15354ce 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -143,7 +143,7 @@ static void microvm_devices_init(MicrovmMachineState *mms) sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, x86ms->gsi[GED_MMIO_IRQ]); sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal); - mms->acpi_dev = ACPI_DEVICE_IF(dev); + x86ms->acpi_dev = HOTPLUG_HANDLER(dev); } if (mms->pic == ON_OFF_AUTO_ON || mms->pic == ON_OFF_AUTO_AUTO) { @@ -469,11 +469,13 @@ static void microvm_powerdown_req(Notifier *notifier, void *data) { MicrovmMachineState *mms = container_of(notifier, MicrovmMachineState, powerdown_req); + X86MachineState *x86ms = X86_MACHINE(mms); - if (mms->acpi_dev) { - Object *obj = OBJECT(mms->acpi_dev); + if (x86ms->acpi_dev) { + Object *obj = OBJECT(x86ms->acpi_dev); AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_GET_CLASS(obj); - adevc->send_event(mms->acpi_dev, ACPI_POWER_DOWN_STATUS); + adevc->send_event(ACPI_DEVICE_IF(x86ms->acpi_dev), + ACPI_POWER_DOWN_STATUS); } } |