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

Pavel Hrdina phrdina at redhat.com
Mon Nov 12 15:20:16 UTC 2018


On Fri, Nov 09, 2018 at 04:36:38PM +0100, Andrea Bolognani wrote:
> 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

How about adding this new section before "XML OPTIONS"?  It would better
follow virt-install man page where the "GUEST OS SECTION" is before all
the devices sections.

Another point is that users might notice that better if it's before
"XML OPTIONS" where they will probably end reading man page because
they found what they were looking for.  I know, you should read the
whole man page but who does that? :)

Otherwise looks good.

Pavel

> +
> +
> +
> +
>  =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
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20181112/53a073ee/attachment.sig>


More information about the virt-tools-list mailing list