---
 server/power-channel-client.cpp | 10 ++++++++++
 server/spice-power.h            |  1 +
 2 files changed, 11 insertions(+)

diff --git a/server/power-channel-client.cpp b/server/power-channel-client.cpp
index ee0b3a2d..036f1cba 100644
--- a/server/power-channel-client.cpp
+++ b/server/power-channel-client.cpp
@@ -72,6 +72,16 @@ bool PowerChannelClient::handle_message(uint16_t type, 
uint32_t size, void *mess
             sif->do_reset(sin);
             break;
         }
+        case SPICE_MSGC_POWER_POWEROFF: {
+            spice_debug("Got a SPICE_MSGC_POWER_POWEROFF message");
+            if (!sif->do_poweroff) {
+                spice_debug("PowerChannelClient handle_message() no poweroff 
impl");
+                this->get_client()->get_main()->push_notify("Server does not 
support power off action.");
+                return TRUE;
+            }
+            sif->do_poweroff(sin);
+            break;
+        }
         default:
             return RedChannelClient::handle_message(type, size, message);
     }
diff --git a/server/spice-power.h b/server/spice-power.h
index 27d26399..b60794e8 100644
--- a/server/spice-power.h
+++ b/server/spice-power.h
@@ -39,6 +39,7 @@ struct SpicePowerInterface {
     SpiceBaseInterface base;
 
     void (*do_reset)(SpicePowerInstance *sin);
+    void (*do_poweroff)(SpicePowerInstance *sin);
 };
 
 struct SpicePowerInstance {
-- 
2.52.0

Reply via email to