cpu: clear config first if user requests host-model-only

Clears the existing CPU config if user picks 'Application Default'
in the virt-manager UI, since otherwise we might leave a stale vendor
or flags defined.
This commit is contained in:
Cole Robinson 2017-03-05 14:03:48 -05:00
parent 0910c8dcfc
commit a3508f2269
1 changed files with 1 additions and 0 deletions

View File

@ -87,6 +87,7 @@ class CPU(XMLBuilder):
self.clear() self.clear()
elif val == self.SPECIAL_MODE_HOST_MODEL_ONLY: elif val == self.SPECIAL_MODE_HOST_MODEL_ONLY:
if self.conn.caps.host.cpu.model: if self.conn.caps.host.cpu.model:
self.clear()
self.model = self.conn.caps.host.cpu.model self.model = self.conn.caps.host.cpu.model
else: else:
raise RuntimeError("programming error: unknown " raise RuntimeError("programming error: unknown "