[PATCH 11/13] microvm: suspend the system as requested

Annie Li posted 13 patches 5 months, 3 weeks ago
Maintainers: "Dr. David Alan Gilbert" <dave@treblig.org>, "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Sergio Lopez <slp@redhat.com>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>
There is a newer version of this series
[PATCH 11/13] microvm: suspend the system as requested
Posted by Annie Li 5 months, 3 weeks ago
Once the microvm guest requests to go to sleep state and
sets the GED register with S3 type, QEMU needs to continue
suspending the system.

Signed-off-by: Annie Li <annie.li@oracle.com>
---
 hw/acpi/generic_event_device.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c
index 5a1ac8e362..bc53551a45 100644
--- a/hw/acpi/generic_event_device.c
+++ b/hw/acpi/generic_event_device.c
@@ -213,6 +213,9 @@ static void ged_regs_write(void *opaque, hwaddr addr, uint64_t data,
         if (slp_en && slp_typ == ACPI_GED_SLP_TYP_S5) {
             qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
         }
+        if (slp_en && slp_typ == ACPI_GED_SLP_TYP_S3) {
+            qemu_system_suspend_request();
+        }
         return;
     case ACPI_GED_REG_SLEEP_STS:
         return;
-- 
2.43.5