On Fri, Apr 01, 2022 at 12:27:58PM +0200, Laszlo Ersek wrote:
On 03/24/22 10:13, Richard W.M. Jones wrote:
virt-p2v needs an NBD server running on the p2v machine to export the disks. Originally we used qemu-nbd since that was the only choice. In 2017, I added support for nbdkit as an alternative to qemu-nbd.
So now we're in the situation where either server can be used (see virt-p2v.git/nbd.c). For added complexity we also support both servers in either systemd socket activation (SA) mode or "no-SA" mode, so that's 4 combinations.
This is silly, we should support only one NBD server, and since systemd socket activation is well-supported and more flexible, we should just use it.
So the question is *which* NBD server to support. That's not so much a technical matter since both servers can easily serve a local block device (always raw format). However I do think that nbdkit might genuinely be the better choice here:
- qemu-nbd links to the whole qemu block layer, nbdkit can be shipped with just the plugin we need, so it should be smaller with less code surface
- nbdkit-file-plugin has a better method of not trashing the host page cache
- could use nbdkit --exit-with-parent feature (which we don't at the moment)
- nbdkit is widely available in distros these days
Also that file uses AI_ADDRCONFIG so I guess it has problems with IPv6.
This patch removes qemu-nbd support, as the first step.
"test-virt-p2v.sh" is simply removed, as the remaining "test-virt-p2v-nbdkit.sh" is mostly identical.
The package references for the various distros, in "dependencies.m4", come from: - https://packages.debian.org/sid/amd64/nbdkit/filelist - https://aur.archlinux.org/packages/nbdkit
Ref: https://listman.redhat.com/archives/libguestfs/2022-March/028475.html Suggested-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> ---
Notes: v2: - update package names for nbdkit, extend commit message [Rich] - keep the skip check for nbdkit in "test-virt-p2v-nbdkit.sh" [Rich]
@@ -128,33 +130,34 @@ ifelse(SUSE,1, ifelse(OPENMANDRIVA,1, dnl Used by the virt-p2v binary. pcre libxml2 gtk`'GTK_VERSION dbus-libs
dnl Run as external programs by the p2v binary. /usr/bin/ssh - /usr/bin/qemu-nbd + nbdkit-server + nbdkit-file-plugin which
I'm not able to check if this hunk is correct or not as I don't seem to be able to find any information online (positive or negative) about openmandriva having an nbdkit package. But anyway ... Reviewed-by: Richard W.M. Jones <rjones@redhat.com> 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