[Libguestfs] [PATCH] Don't set distro for non-Linux guests

Richard W.M. Jones rjones at redhat.com
Tue Apr 26 16:58:00 UTC 2011


On Tue, Apr 26, 2011 at 05:54:05PM +0100, Matthew Booth wrote:
> 'distro' isn't used anywhere for Windows guests. However, if it's set, it's
> required to be matched in virt-v2v.conf. Rather than have to update the config
> again, just don't set it for Windows guests.
> ---
>  lib/Sys/VirtConvert/Converter.pm |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/lib/Sys/VirtConvert/Converter.pm b/lib/Sys/VirtConvert/Converter.pm
> index 28c57d5..6b9f8f9 100644
> --- a/lib/Sys/VirtConvert/Converter.pm
> +++ b/lib/Sys/VirtConvert/Converter.pm
> @@ -102,7 +102,8 @@ sub convert
>      my %desc;
>  
>      $desc{os}               = $g->inspect_get_type($root);
> -    $desc{distro}           = $g->inspect_get_distro($root);
> +    $desc{distro}           = $g->inspect_get_distro($root)
> +        if $desc{os} eq 'linux';
>      $desc{product_name}     = $g->inspect_get_product_name($root);
>      $desc{major_version}    = $g->inspect_get_major_version($root);
>      $desc{minor_version}    = $g->inspect_get_minor_version($root);
> -- 

ACK.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/




More information about the Libguestfs mailing list