---
 ui/spice-core.c  | 13 +++++++++++++
 ui/ui-hmp-cmds.c |  1 +
 2 files changed, 14 insertions(+)

diff --git a/ui/spice-core.c b/ui/spice-core.c
index 8a6050f4ae..bdc18e8245 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -658,6 +658,16 @@ void qemu_spice_display_init_done(void)
     qemu_add_vm_change_state_handler(vm_change_state_handler, NULL);
 }
 
+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,
+};
+static SpicePowerInstance power_sin = {
+    .base.sif = &power_sif.base,
+};
+
 static void qemu_spice_init(void)
 {
     QemuOpts *opts = QTAILQ_FIRST(&qemu_spice_opts.head);
@@ -841,6 +851,9 @@ static void qemu_spice_init(void)
 
     qemu_spice_display_stop();
 
+    info_report("add power instance/interface");
+    qemu_spice.add_interface(&power_sin.base);
+
     g_free(x509_key_file);
     g_free(x509_cert_file);
     g_free(x509_cacert_file);
diff --git a/ui/ui-hmp-cmds.c b/ui/ui-hmp-cmds.c
index 6c93d452c9..9543ee11b0 100644
--- a/ui/ui-hmp-cmds.c
+++ b/ui/ui-hmp-cmds.c
@@ -204,6 +204,7 @@ void hmp_info_spice(Monitor *mon, const QDict *qdict)
         [SPICE_CHANNEL_USBREDIR] = "usbredir",
         [SPICE_CHANNEL_PORT] = "port",
         [SPICE_CHANNEL_WEBDAV] = "webdav",
+        [SPICE_CHANNEL_POWER] = "power",
     };
 
     info = qmp_query_spice(NULL);
-- 
2.52.0

Reply via email to