[virt-tools-list] [virt-manager PATCH 3/3] add metod for button 'Clear CPU configuration'

Chen Hanxiao chenhanxiao at cn.fujitsu.com
Tue Nov 26 05:26:05 UTC 2013


From: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>

Add related metod for for button 'Clear CPU configuration'

Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
---
 virtManager/details.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/virtManager/details.py b/virtManager/details.py
index bb280bf..6537466 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -455,6 +455,7 @@ class vmmDetails(vmmGObjectUI):
             "on_cpu_sockets_changed": lambda *x: self.enable_apply(x, EDIT_TOPOLOGY),
             "on_cpu_threads_changed": lambda *x: self.enable_apply(x, EDIT_TOPOLOGY),
             "on_cpu_copy_host_clicked": self.config_cpu_copy_host,
+            "on_cpu_clear_clicked": self.config_cpu_clear,
             "on_cpu_topology_enable_toggled": self.config_cpu_topology_enable,
 
             "on_config_memory_changed": self.config_memory_changed,
@@ -1713,6 +1714,16 @@ class vmmDetails(vmmGObjectUI):
             self.err.show_err(_("Error copying host CPU: %s") % str(e))
             return
 
+    def config_cpu_clear(self, src_ignore):
+        try:
+            CPU = virtinst.CPU(self.vm.conn.get_backend())
+            CPU.clear_cpu()
+
+            self._refresh_cpu_config(CPU)
+        except Exception, e:
+            self.err.show_err(_("Error clearing CPU config: %s") % str(e))
+            return
+
     def config_cpu_topology_enable(self, src):
         do_enable = src.get_active()
         self.widget("cpu-topology-table").set_sensitive(do_enable)
-- 
1.8.2.1




More information about the virt-tools-list mailing list