[virt-manager PATCH v2 3/3] add method for button 'Clear CPU Configuration'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx>

add related method for for button 'Clear CPU Configuration'

Signed-off-by: Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx>
---
 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 clear 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

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux