[virt-tools-list] [PATCH] Edit description immediately without a shutdown

Marcus Karlsson mk at acc.umu.se
Thu Oct 11 21:40:01 UTC 2012


Editing the description of a running guest will show a dialog that
changes will take effect after the next guest shutdown. However, libvirt
can change the description of a guest while it is running.

Teach virt-manager to edit the description of a running guest without
requiring a shutdown.
---
 src/virtManager/details.py |    1 +
 src/virtManager/domain.py  |    7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/src/virtManager/details.py b/src/virtManager/details.py
index c53c67f..e57903a 100644
--- a/src/virtManager/details.py
+++ b/src/virtManager/details.py
@@ -2033,6 +2033,7 @@ class vmmDetails(vmmGObjectUI):
             desc_widget = self.widget("overview-description")
             desc = desc_widget.get_buffer().get_property("text") or ""
             add_define(self.vm.define_description, desc)
+            add_hotplug(self.vm.hotplug_description, desc)
 
         return self._change_config_helper(df, da, hf, ha)
 
diff --git a/src/virtManager/domain.py b/src/virtManager/domain.py
index 82680b8..227e8c1 100644
--- a/src/virtManager/domain.py
+++ b/src/virtManager/domain.py
@@ -813,6 +813,13 @@ class vmmDomain(vmmLibvirtObject):
         devobj.passwd = newval or None
         self.update_device(devobj)
 
+    def hotplug_description(self, desc):
+        flags = (libvirt.VIR_DOMAIN_AFFECT_LIVE |
+                libvirt.VIR_DOMAIN_AFFECT_CONFIG)
+        self._backend.setMetadata(
+                libvirt.VIR_DOMAIN_METADATA_DESCRIPTION,
+                desc, None, None, flags)
+
 
     ########################
     # Libvirt API wrappers #
-- 
1.7.10.4




More information about the virt-tools-list mailing list