---
 ui/spice-core.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ui/spice-core.c b/ui/spice-core.c
index ecdaf19c72..a818c9bf3b 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -663,12 +663,18 @@ static void do_reset(SpicePowerInstance *sin) {
     qemu_system_reset_request(SHUTDOWN_CAUSE_HOST_UI);
 }
 
+static void do_poweroff(SpicePowerInstance *sin) {
+    info_report("do_poweroff");
+    qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_QMP_QUIT);
+}
+
 static const SpicePowerInterface power_sif = {
     .base.type          = SPICE_INTERFACE_POWER,
     .base.description   = "power",
     .base.major_version = SPICE_INTERFACE_POWER_MAJOR,
     .base.minor_version = SPICE_INTERFACE_POWER_MINOR,
     .do_reset = do_reset,
+    .do_poweroff = do_poweroff,
 };
 static SpicePowerInstance power_sin = {
     .base.sif = &power_sif.base,
-- 
2.52.0

Reply via email to