cli: Make --cpu host-model and --cpu host-passthrough work
This commit is contained in:
parent
48eece46a7
commit
4fbee9aa41
|
@ -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>
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
|
Loading…
Reference in New Issue