[virt-tools-list] [virt-manager PATCH v2] virt-install: add support for option "--cpu host-model-only"

Chen Hanxiao chen_han_xiao at 126.com
Mon Jan 27 15:43:27 UTC 2014


From: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>

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 <chenhanxiao at cn.fujitsu.com>
---
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





More information about the virt-tools-list mailing list