[virt-tools-list] [PATCH virt-manager] Allow empty cpu model

Ken ICHIKAWA ichikawa.ken at jp.fujitsu.com
Tue Mar 19 04:53:46 UTC 2013


If we specify cpu model and apply once, we could not specify empty
cpu model again with following error.
"Error changing VM configuration: internal error Non-empty feature
list specified without CPU model"
That is not useful to restore default cpu model.
This patch fixes above issue.

Signed-off-by: Ken ICHIKAWA <ichikawa.ken at jp.fujitsu.com>
---
 src/virtManager/domain.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/virtManager/domain.py b/src/virtManager/domain.py
index 947cdf8..246cb27 100644
--- a/src/virtManager/domain.py
+++ b/src/virtManager/domain.py
@@ -460,6 +460,11 @@ class vmmDomain(vmmLibvirtObject):
 
             guest.cpu.model = model or None
 
+            if guest.cpu.model == None:
+                for f in guest.cpu.features:
+                    guest.cpu.remove_feature(f)
+                return
+
             origfeatures = guest.cpu.features
             def set_feature(fname, fpol):
                 for f in origfeatures:
-- 
1.7.1




More information about the virt-tools-list mailing list