1
0
mirror of https://src.fedoraproject.org/rpms/virt-manager.git synced 2025-07-16 09:04:55 +00:00
Files
virt-manager/0007-cpu-Drop-vendor-and-features-if-setting-host-model-b.patch
Cole Robinson d8c77829e2 Fix new VM disk image names when VM name changes (bz #1169141)
Fix missing virt-install dep on pygobject (bz #1195794)
Fix changing VM video type away from qxl (bz #1182710)
Clear vendor field when changing CPU (bz #1190851)
Drop bogus network domain name validation (bz #1195873)
2015-03-27 17:05:35 -04:00

64 lines
2.4 KiB
Diff

From: Cole Robinson <crobinso@redhat.com>
Date: Thu, 26 Mar 2015 17:08:15 -0400
Subject: [PATCH virt-manager] cpu: Drop vendor and features if setting
host-model (bz 1190851)
Otherwise via virt-manager we can try to set a <cpu> with a <vendor>
but no <model>, and libvirt complains.
(cherry picked from commit dc1737e623aef0f661cc28c0c5b87f847fc2526b)
---
tests/xmlparse-xml/change-minimal-guest-out.xml | 2 +-
tests/xmlparse.py | 1 +
virtinst/cpu.py | 5 +++++
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/tests/xmlparse-xml/change-minimal-guest-out.xml b/tests/xmlparse-xml/change-minimal-guest-out.xml
index 5363080..f3be5c0 100644
--- a/tests/xmlparse-xml/change-minimal-guest-out.xml
+++ b/tests/xmlparse-xml/change-minimal-guest-out.xml
@@ -23,7 +23,7 @@
<label>frob</label>
</seclabel>
<cpu mode="custom" match="exact">
- <model>foobar</model>
+ <model fallback="allow">foobar</model>
<topology sockets="1" cores="4" threads="1"/>
<feature policy="forbid" name="x2apic"/>
</cpu>
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index c4bcb20..477de22 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -251,6 +251,7 @@ class XMLParseTest(unittest.TestCase):
check = self._make_checker(guest.cpu)
check("model", None, "foobar")
+ check("model_fallback", None, "allow")
check("cores", None, 4)
guest.cpu.add_feature("x2apic", "forbid")
guest.cpu.set_topology_defaults(guest.vcpus)
diff --git a/virtinst/cpu.py b/virtinst/cpu.py
index 551364c..b12fd30 100644
--- a/virtinst/cpu.py
+++ b/virtinst/cpu.py
@@ -59,6 +59,10 @@ class CPU(XMLBuilder):
if (val == self.SPECIAL_MODE_HOST_MODEL or
val == self.SPECIAL_MODE_HOST_PASSTHROUGH):
self.model = None
+ self.vendor = None
+ self.model_fallback = None
+ for f in self.features:
+ self.remove_feature(f)
self.mode = val
elif val == self.SPECIAL_MODE_HOST_COPY:
self.copy_host_cpu()
@@ -161,6 +165,7 @@ class CPU(XMLBuilder):
self.match = "exact"
return val
model = XMLProperty("./model", set_converter=_set_model)
+ model_fallback = XMLProperty("./model/@fallback")
match = XMLProperty("./@match")
vendor = XMLProperty("./vendor")