On Thu, Mar 31, 2022 at 03:24:44PM +0200, Laszlo Ersek wrote:
On 03/31/22 14:27, Richard W.M. Jones wrote:
On Thu, Mar 31, 2022 at 09:22:02AM +0200, Laszlo Ersek wrote:
diff --git a/dependencies.m4 b/dependencies.m4 index 40b3786cb0b7..20d068028dbe 100644 --- a/dependencies.m4 +++ b/dependencies.m4 @@ -23,39 +23,40 @@ dnl only runs on the virt-v2v conversion server. ifelse(REDHAT,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 + /usr/sbin/nbdkit + /usr/lib64/nbdkit/plugins/nbdkit-file-plugin.so
This should be:
- /usr/bin/qemu-nbd + nbdkit-server + nbdkit-file-plugin
All Fedora & RHEL packages we've ever shipped should recognise these virtual Provides and install just the nbdkit server and the file plugin, without pulling in any complicated dependencies.
I used pathnames rather than package names just to stick with the tradition of "/usr/bin/qemu-nbd".
I think I used the path because RHEL & Fedora have the same server in differently named packages (qemu-img-rhev or qemu-img). But in all Fedora & RHEL for many years, depending on “nbdkit-server” will pull in just the server. Don't depend on “nbdkit” because that is a meta-package which pulls in the server and a basic set of plugins and filters for everyday use, which is not what we want here.
Secondly, there is no package called "nbdkit-file-plugin"; it's called "nbdkit-basic-plugins".
Do you mean that "nbdkit-file-plugin" is resolvable due to the work done for <https://bugzilla.redhat.com/show_bug.cgi?id=2059291> (and before that, manually listed Provides:?)
Before and after that bug was fixed, there was always a “Provides: nbdkit-file-plugin” which means that simply depending on nbdkit-file-plugin is sufficient. (That patch generates the Provides, previously I added them by hand.)
... I think that dnf behaves very misleadingly here. Consider:
# dnf search nbdkit-file-plugin No matches found.
That's unexpected!
(Because I *did* try that yesterday.) At the same time:
# dnf install nbdkit-file-plugin Dependencies resolved. ====================================================================================================================== Package Architecture Version Repository Size ====================================================================================================================== Installing: nbdkit-basic-plugins x86_64 1.28.6-1.fc35 updates 204 k Installing dependencies: nbdkit-server x86_64 1.28.6-1.fc35 updates 130 k
Transaction Summary ====================================================================================================================== Install 2 Packages
Total download size: 334 k Installed size: 719 k Is this ok [y/N]:
This is very non-intuitive. A virtual "provides" apparently satisfies "install", but does not satisfy "search". IMO that's simply a bug in dnf, one that keeps tricking me.
Yup, I didn't expect that at all, it seems like a bug of some sort. ...
diff --git a/test-virt-p2v-nbdkit.sh b/test-virt-p2v-nbdkit.sh index 9adb195f9249..8e91d45c4014 100755 --- a/test-virt-p2v-nbdkit.sh +++ b/test-virt-p2v-nbdkit.sh @@ -1,28 +1,27 @@ #!/bin/bash - # libguestfs virt-p2v test script # Copyright (C) 2014-2019 Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>.
-# Test virt-p2v in non-GUI mode using nbdkit instead of qemu-nbd. +# Test virt-p2v in non-GUI mode using nbdkit.
set -e
$TEST_FUNCTIONS skip_if_skipped skip_if_backend uml -skip_unless nbdkit file --version
Don't we want to keep this line? The p2v-building instructions say that nbdkit is optional, so we should skip the test if it's not available.
I removed this line because the qemu-nbd based "sibling" test case, "test-virt-p2v.sh", which this patch removes, has a hard dependency on qemu-nbd (i.e., it does not include a similar "skip_unless" line), despite the docs listing qemu-nbd as optional too. And now with this patch, nbdkit takes the place of qemu-nbd.
If your argument is that the lack of "skip_unless qemu-nbd --version" is a preexistent bug in "test-virt-p2v.sh", then I agree to keep "skip_unless nbdkit file --version" here.
Yes, I think that was a bug in the removed test. (We can also argue that we should now require nbdkit and enforce that in ./configure, but I guess it'll be useful to build virt-p2v without nbdkit some time, especially on ancient RHEL where we might be injecting our self-built nbdkit in a later build step). Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html