cli: Make --cpu host-model and --cpu host-passthrough work

This commit is contained in:
Cole Robinson 2014-02-02 15:49:42 -05:00
parent 48eece46a7
commit 4fbee9aa41
3 changed files with 6 additions and 4 deletions

View File

@ -14,7 +14,5 @@
<on_crash>destroy</on_crash>
<devices>
</devices>
<cpu mode="custom" match="exact">
<model>host-passthrough</model>
</cpu>
<cpu mode="host-passthrough"/>
</domain>

View File

@ -1014,7 +1014,7 @@ promptlist.append(p7)
p8 = PromptTest("virt-xml --connect %(TESTURI)s --confirm test "
"--edit --cpu host-passthrough")
p8.add("Define 'test' with the changed XML", "yes", num_lines=12)
p8.add("Define 'test' with the changed XML", "yes", num_lines=10)
promptlist.append(p8)

View File

@ -1438,6 +1438,9 @@ class ParserCPU(VirtCLIParser):
elif (val == "host-model-only" and
self.guest.conn.caps.host.cpu.model):
inst.cpu.model = self.guest.conn.caps.host.cpu.model
elif val == "host-model" or val == "host-passthrough":
inst.cpu.model = None
inst.cpu.mode = val
else:
inst.cpu.model = val
@ -1458,6 +1461,7 @@ class ParserCPU(VirtCLIParser):
inst.cpu.add_feature(feature_name, policy)
self.set_param(None, "model", setter_cb=set_model_cb)
self.set_param("cpu.mode", "mode")
self.set_param("cpu.match", "match")
self.set_param("cpu.vendor", "vendor")