[Libguestfs] [PATCH v2 2/8] v2v: linux: Detect support for xennet if compiled into the kernel too.

Richard W.M. Jones rjones at redhat.com
Wed Apr 5 20:22:44 UTC 2017


On Wed, Apr 05, 2017 at 03:40:28PM +0100, Richard W.M. Jones wrote:
> Updates commit 7eb219d1938968c4d6bffda038aaace936f7efbf.
> ---
>  v2v/linux_kernels.ml | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/v2v/linux_kernels.ml b/v2v/linux_kernels.ml
> index 2efd070a6..9fbc43b60 100644
> --- a/v2v/linux_kernels.ml
> +++ b/v2v/linux_kernels.ml
> @@ -182,7 +182,8 @@ let detect_kernels (g : G.guestfs) inspect family bootloader =
>                 List.mem what modules || check_config kconf config_file in
>  
>               let supports_virtio = kernel_supports "virtio_net" "VIRTIO_NET" in
> -             let is_xen_kernel = List.mem "xennet" modules in
> +             let is_xen_kernel =
> +               kernel_supports "xennet" "XEN_NETDEV_FRONTEND" in
>  
>               (* If the package name is like "kernel-debug", then it's
>                * a debug kernel.

This patch is wrong.  Every recent distro kernel is detected as a
Xen kernel, because they all ship this driver.

I think the existing test probably only worked by accident because the
"xennet" driver was renamed, so the test accidentally failed to detect
any recent kernel.

Back to the drawing board on this one ...

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v




More information about the Libguestfs mailing list