[virt-tools-list] [virt-manager PATCH 3/5] virt-xml: Accept --os-variant option

Andrea Bolognani abologna at redhat.com
Fri Nov 9 15:36:38 UTC 2018


We're not doing anything with it yet, but having the
parser accept it means we can write tests and see how
their output changes once we wire it up in earnest.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 man/virt-xml.pod | 30 ++++++++++++++++++++++++++++++
 virt-xml         |  5 +++++
 2 files changed, 35 insertions(+)

diff --git a/man/virt-xml.pod b/man/virt-xml.pod
index bae492ac..a40c37a7 100644
--- a/man/virt-xml.pod
+++ b/man/virt-xml.pod
@@ -244,6 +244,30 @@ For any option, use --option=? to see a list of all available sub options, examp
 
 
 
+=head1 GUEST OS OPTIONS
+
+=over 4
+
+=item B<--os-variant> OS_VARIANT
+
+Optimize the guest configuration for a specific operating system (ex.
+'fedora29', 'rhel7', 'win10'). While not required, specifying this
+options is HIGHLY RECOMMENDED, as it can greatly increase performance
+by specifying virtio among other guest tweaks.
+
+If the guest has been installed using virt-manager version 2.0.0 or newer,
+providing this information should not be necessary, as the OS variant will
+have been stored in the guest configuration during installation and virt-xml
+will retrieve it from there automatically.
+
+Use the command "osinfo-query os" to get the list of the accepted OS
+variants.
+
+=back
+
+
+
+
 =head1 MISCELLANEOUS OPTIONS
 
 =over 4
@@ -331,6 +355,12 @@ Create a 10G qcow2 disk image and attach it to 'fedora18' for the next VM startu
   # virt-xml fedora18 --add-device \
     --disk /var/lib/libvirt/images/newimage.qcow2,format=qcow2,size=10
 
+Same as above, but ensure the disk is attached to the most appropriate bus
+for the guest OS by providing information about it on the command line:
+
+  # virt-xml fedora18 --os-variant fedora18 --add-device \
+    --disk /var/lib/libvirt/images/newimage.qcow2,format=qcow2,size=10
+
 Hotunplug the disk vdb from the running domain 'rhel7':
 
   # virt-xml rhel7 --update --remove-device --disk target=vdb
diff --git a/virt-xml b/virt-xml
index 9bdde95d..e34b5aac 100755
--- a/virt-xml
+++ b/virt-xml
@@ -371,6 +371,11 @@ def parse_args():
     cli.add_boot_options(g)
     cli.add_device_options(g)
 
+    osg = parser.add_argument_group(_("OS options"))
+    osg.add_argument("--os-variant", dest="distro_variant",
+        help=_("The OS variant installed in the guest, "
+               "e.g. 'fedora29', 'rhel7', 'win10 etc."))
+
     misc = parser.add_argument_group(_("Miscellaneous Options"))
     cli.add_misc_options(misc, prompt=False, printxml=False, dryrun=False)
 
-- 
2.19.1




More information about the virt-tools-list mailing list