From: Chen Hanxiao <[email protected]>

commit 7003a3a52821e2813d41989ab7a88d2b7aa590f1 introduced
a "nearest host cpu model" option.
This patch add an option "--cpu host-model-only" to virt-install.

Signed-off-by: Chen Hanxiao <[email protected]>
---
v2: change host-model-basic to host-model-only

 man/virt-install.pod | 5 +++++
 virtinst/cli.py      | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/man/virt-install.pod b/man/virt-install.pod
index 35b74e2..a0a6c6c 100644
--- a/man/virt-install.pod
+++ b/man/virt-install.pod
@@ -174,6 +174,11 @@ Expose the host CPUs configuration to the guest. This 
enables the guest to
 take advantage of many of the host CPUs features (better performance), but
 may cause issues if migrating the guest to a host without an identical CPU.
 
+=item B<--cpu host-model-only>
+
+Expose the nearest host CPU model configuration to the guest.
+It is the best CPU which can be used for a guest on any of the hosts.
+
 =back
 
 Use --cpu=? to see a list of all available sub options. Complete details at 
L<http://libvirt.org/formatdomain.html#elementsCPU>
diff --git a/virtinst/cli.py b/virtinst/cli.py
index e4d20d9..5bb7954 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -1435,6 +1435,9 @@ class ParserCPU(VirtCLIParser):
             ignore = cliname
             if val == "host":
                 inst.cpu.copy_host_cpu()
+            elif (val == "host-model-only" and
+                  self.guest.conn.caps.host.cpu.model):
+                inst.cpu.model = self.guest.conn.caps.host.cpu.model
             else:
                 inst.cpu.model = val
 
-- 
1.8.4.2


_______________________________________________
virt-tools-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-tools-list

Reply via email to