parent
04fa0855ca
commit
9a6097dfb9
@ -1,2 +1,2 @@
|
||||
SOURCES/libguestfs.keyring
|
||||
SOURCES/virt-v2v-2.0.7.tar.gz
|
||||
SOURCES/virt-v2v-2.2.0.tar.gz
|
||||
|
@ -1,2 +1,2 @@
|
||||
1bbc40f501a7fef9eef2a39b701a71aee2fea7c4 SOURCES/libguestfs.keyring
|
||||
2d898dc22eca44c9d73d664dc7e901fe437570bc SOURCES/virt-v2v-2.0.7.tar.gz
|
||||
a7eff6dd19ae599850fe414b5636431d2149e5a5 SOURCES/virt-v2v-2.2.0.tar.gz
|
||||
|
@ -0,0 +1,27 @@
|
||||
From 019809794742e1990af3c14b953f8c307f629b7c Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Thu, 12 Jan 2023 12:27:26 +0100
|
||||
Subject: [PATCH] test-v2v-fedora-btrfs-conversion: spell out btrfs feature
|
||||
group dependency
|
||||
|
||||
In case the libguestfs appliance lacks the btrfs feature group, we create
|
||||
a zero-sized phony Fedora/BTRFS image variant, causing this test case to
|
||||
fail. In that situation, the test should just be skipped.
|
||||
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Acked-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
---
|
||||
tests/test-v2v-fedora-btrfs-conversion.sh | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/tests/test-v2v-fedora-btrfs-conversion.sh b/tests/test-v2v-fedora-btrfs-conversion.sh
|
||||
index c78f8ae2..14099893 100755
|
||||
--- a/tests/test-v2v-fedora-btrfs-conversion.sh
|
||||
+++ b/tests/test-v2v-fedora-btrfs-conversion.sh
|
||||
@@ -27,5 +27,6 @@ set -x
|
||||
skip_if_skipped
|
||||
f=../test-data/phony-guests/fedora-btrfs.img
|
||||
requires test -f $f
|
||||
+requires test -s $f
|
||||
|
||||
$VG virt-v2v --debug-gc -i disk $f -o null
|
@ -0,0 +1,78 @@
|
||||
From 224243b8e26aa299bd99dd24662c4df10a3f612c Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Thu, 12 Jan 2023 12:31:10 +0100
|
||||
Subject: [PATCH] test-v2v-i-ova: spell out ntfs feature group dependency
|
||||
|
||||
"windows.img" is created as an empty phony image if the libguestfs
|
||||
appliance lacks the ntfs feature group.
|
||||
|
||||
"tests/Makefile.am" deals well with this, because for the "central"
|
||||
"windows.vmdk" target, we restrict the VMDK conversion to a non-empty
|
||||
"windows.img". Subsequently, dependent test cases check for "windows.vmdk"
|
||||
specifically, and if that file is missing, the tests are skipped (they
|
||||
exit with code 77).
|
||||
|
||||
"test-v2v-i-ova.sh" and "test-v2v-i-ova-directory.sh" are exceptions
|
||||
however. They perform the same conversion manually (in their own separate
|
||||
workspace directories). They assume that, if "windows.img" exists, it can
|
||||
be converted to VMDK. When the image size is zero, the conversion breaks,
|
||||
and both test cases fail. Skip both tests if "windows.img" is empty.
|
||||
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Acked-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
[lersek@redhat.com: replace further occurrences of windows.img with $f]
|
||||
---
|
||||
tests/test-v2v-i-ova-directory.sh | 7 ++++---
|
||||
tests/test-v2v-i-ova.sh | 7 ++++---
|
||||
2 files changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/tests/test-v2v-i-ova-directory.sh b/tests/test-v2v-i-ova-directory.sh
|
||||
index fff236f5..ec858464 100755
|
||||
--- a/tests/test-v2v-i-ova-directory.sh
|
||||
+++ b/tests/test-v2v-i-ova-directory.sh
|
||||
@@ -25,7 +25,9 @@ set -e
|
||||
set -x
|
||||
|
||||
skip_if_skipped
|
||||
-requires test -f ../test-data/phony-guests/windows.img
|
||||
+f=../test-data/phony-guests/windows.img
|
||||
+requires test -f $f
|
||||
+requires test -s $f
|
||||
|
||||
export VIRT_TOOLS_DATA_DIR="$srcdir/../test-data/fake-virt-tools"
|
||||
export VIRTIO_WIN="$srcdir/../test-data/fake-virtio-win"
|
||||
@@ -39,8 +41,7 @@ vmdk=test-ova.vmdk
|
||||
ovf=test-v2v-i-ova.ovf
|
||||
mf=test-ova.mf
|
||||
|
||||
-qemu-img convert ../test-data/phony-guests/windows.img \
|
||||
- -O vmdk $d/$vmdk
|
||||
+qemu-img convert $f -O vmdk $d/$vmdk
|
||||
cp "$srcdir/$ovf" $d/$ovf
|
||||
sha1=`do_sha1 $d/$ovf`
|
||||
echo "SHA1($ovf)= $sha1" > $d/$mf
|
||||
diff --git a/tests/test-v2v-i-ova.sh b/tests/test-v2v-i-ova.sh
|
||||
index a55966a7..7d988330 100755
|
||||
--- a/tests/test-v2v-i-ova.sh
|
||||
+++ b/tests/test-v2v-i-ova.sh
|
||||
@@ -25,7 +25,9 @@ set -e
|
||||
set -x
|
||||
|
||||
skip_if_skipped
|
||||
-requires test -f ../test-data/phony-guests/windows.img
|
||||
+f=../test-data/phony-guests/windows.img
|
||||
+requires test -f $f
|
||||
+requires test -s $f
|
||||
|
||||
export VIRT_TOOLS_DATA_DIR="$srcdir/../test-data/fake-virt-tools"
|
||||
export VIRTIO_WIN="$srcdir/../test-data/fake-virtio-win"
|
||||
@@ -41,8 +43,7 @@ mf=test-ova.mf
|
||||
ova=test-ova.ova
|
||||
raw=TestOva-sda
|
||||
|
||||
-qemu-img convert ../test-data/phony-guests/windows.img \
|
||||
- -O vmdk $d/$vmdk
|
||||
+qemu-img convert $f -O vmdk $d/$vmdk
|
||||
cp "$srcdir/$ovf" $d/$ovf
|
||||
sha1=`do_sha1 $d/$ovf`
|
||||
echo "SHA1($ovf)= $sha1" > $d/$mf
|
@ -0,0 +1,44 @@
|
||||
From d78c3bdcda04885ee7b826a5ce43d07e778641cd Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kuparinen <copper_fin@hotmail.com>
|
||||
Date: Fri, 13 Jan 2023 21:20:28 +0100
|
||||
Subject: [PATCH] Translated using Weblate (Finnish)
|
||||
|
||||
Currently translated at 1.9% (25 of 1305 strings)
|
||||
|
||||
Translation: libguestfs/virt-v2v-docs-master
|
||||
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/virt-v2v-docs-master/fi/
|
||||
---
|
||||
po-docs/fi.po | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/po-docs/fi.po b/po-docs/fi.po
|
||||
index 29d8ee26..5da30f77 100644
|
||||
--- a/po-docs/fi.po
|
||||
+++ b/po-docs/fi.po
|
||||
@@ -8,7 +8,7 @@ msgstr ""
|
||||
"Project-Id-Version: virt-v2v 1.43.1\n"
|
||||
"Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
|
||||
"POT-Creation-Date: 2020-08-13 13:17+0200\n"
|
||||
-"PO-Revision-Date: 2022-01-25 17:16+0000\n"
|
||||
+"PO-Revision-Date: 2023-01-13 20:20+0000\n"
|
||||
"Last-Translator: Jan Kuparinen <copper_fin@hotmail.com>\n"
|
||||
"Language-Team: Finnish <https://translate.fedoraproject.org/projects/"
|
||||
"libguestfs/virt-v2v-docs-master/fi/>\n"
|
||||
@@ -17,7 +17,7 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
-"X-Generator: Weblate 4.10.1\n"
|
||||
+"X-Generator: Weblate 4.15\n"
|
||||
|
||||
#. type: =end
|
||||
#: common/mlcustomize/customize-options.pod:1
|
||||
@@ -4694,7 +4694,7 @@ msgstr ""
|
||||
#. type: =item
|
||||
#: docs/virt-v2v-support.pod:86
|
||||
msgid "Oracle Linux"
|
||||
-msgstr ""
|
||||
+msgstr "Oracle Linux"
|
||||
|
||||
#. type: =item
|
||||
#: docs/virt-v2v-support.pod:88
|
@ -0,0 +1,49 @@
|
||||
From f395335881974767e4dbdbf73c1abf3bed961f5d Mon Sep 17 00:00:00 2001
|
||||
From: Temuri Doghonadze <temuri.doghonadze@gmail.com>
|
||||
Date: Fri, 13 Jan 2023 21:20:28 +0100
|
||||
Subject: [PATCH] Translated using Weblate (Georgian)
|
||||
|
||||
Currently translated at 8.6% (38 of 439 strings)
|
||||
|
||||
Translation: libguestfs/virt-v2v-master
|
||||
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/virt-v2v-master/ka/
|
||||
---
|
||||
po/ka.po | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/po/ka.po b/po/ka.po
|
||||
index 4dc891df..26d41f6b 100644
|
||||
--- a/po/ka.po
|
||||
+++ b/po/ka.po
|
||||
@@ -6,10 +6,10 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: virt-v2v 2.1.1\n"
|
||||
-"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
|
||||
-"component=libguestfs&product=Virtualization+Tools\n"
|
||||
+"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug."
|
||||
+"cgi?component=libguestfs&product=Virtualization+Tools\n"
|
||||
"POT-Creation-Date: 2022-12-10 12:01+0000\n"
|
||||
-"PO-Revision-Date: 2022-12-06 18:19+0000\n"
|
||||
+"PO-Revision-Date: 2023-01-13 20:20+0000\n"
|
||||
"Last-Translator: Temuri Doghonadze <temuri.doghonadze@gmail.com>\n"
|
||||
"Language-Team: Georgian <https://translate.fedoraproject.org/projects/"
|
||||
"libguestfs/virt-v2v-master/ka/>\n"
|
||||
@@ -18,7 +18,7 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
-"X-Generator: Weblate 4.14.2\n"
|
||||
+"X-Generator: Weblate 4.15\n"
|
||||
|
||||
#: input/input_ova.ml:134 common/mltools/tools_utils.ml:235
|
||||
msgid "%s"
|
||||
@@ -2062,7 +2062,7 @@ msgstr ""
|
||||
#: common/mltools/getopt-c.c:198
|
||||
#, c-format
|
||||
msgid "%s: %s: integer out of range\n"
|
||||
-msgstr ""
|
||||
+msgstr "%s: %s: მთელი მნიშვნელობა დიაპაზონს გარეთაა\n"
|
||||
|
||||
#: common/mltools/getopt-c.c:388
|
||||
#, c-format
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,30 @@
|
||||
From 9a5c900fdb532d553a78339a6887417dd6de70e5 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 16 Jan 2023 12:22:17 +0000
|
||||
Subject: [PATCH] convert: windows: Document what copy_qemu_ga function returns
|
||||
|
||||
Just updates the comment.
|
||||
|
||||
(cherry picked from commit 7499ab10ea387b1dfd6fdd6feb2632b66545a257)
|
||||
---
|
||||
convert/windows_virtio.mli | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/convert/windows_virtio.mli b/convert/windows_virtio.mli
|
||||
index 73ec95c7..82aad69b 100644
|
||||
--- a/convert/windows_virtio.mli
|
||||
+++ b/convert/windows_virtio.mli
|
||||
@@ -39,8 +39,11 @@ val install_drivers
|
||||
devices if we managed to install those, or legacy devices if we didn't. *)
|
||||
|
||||
val copy_qemu_ga : Guestfs.guestfs -> Types.inspect -> string list
|
||||
-(** copy MSIs (idealy just one) with QEMU Guest Agent to Windows guest. The
|
||||
- MSIs are not installed by this function. *)
|
||||
+(** copy MSIs (ideally just one) with QEMU Guest Agent to Windows guest. The
|
||||
+ MSIs are not installed by this function.
|
||||
+
|
||||
+ Returns a list of the copied [*.msi] files (empty list indicates no
|
||||
+ qemu-ga installer(s) could be located). *)
|
||||
|
||||
(**/**)
|
||||
|
@ -0,0 +1,25 @@
|
||||
From 48f15935cff53836eae4c1c9afb0be8ab4f13bea Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 16 Jan 2023 15:12:16 +0000
|
||||
Subject: [PATCH] convert: windows: Remove unused 'open Utils'
|
||||
|
||||
No function from Utils was being used by Windows_virtio, so remove the
|
||||
unnecessary line.
|
||||
|
||||
(cherry picked from commit 26b9cd1f87f06c31cdf3020e003078737a417889)
|
||||
---
|
||||
convert/windows_virtio.ml | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/convert/windows_virtio.ml b/convert/windows_virtio.ml
|
||||
index 2ce92ece..6b642d21 100644
|
||||
--- a/convert/windows_virtio.ml
|
||||
+++ b/convert/windows_virtio.ml
|
||||
@@ -25,7 +25,6 @@ open Common_gettext.Gettext
|
||||
open Regedit
|
||||
|
||||
open Types
|
||||
-open Utils
|
||||
|
||||
module G = Guestfs
|
||||
|
@ -0,0 +1,28 @@
|
||||
From 4623b2aab891fdbeda0486ad00f1fa2a7f5533fe Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 19 Jan 2023 08:51:30 +0000
|
||||
Subject: [PATCH] -o kubevirt: Fix mistake in error message
|
||||
|
||||
The error message was copied from output_local.ml:
|
||||
|
||||
virt-v2v: error: -o local: -op option cannot be used in this output mode
|
||||
|
||||
Reported-by: Xiaodai Wang
|
||||
(cherry picked from commit be322ed49b1131e30a0b70f16d31fd29fca32b81)
|
||||
---
|
||||
output/output_kubevirt.ml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/output/output_kubevirt.ml b/output/output_kubevirt.ml
|
||||
index 63ee8197..0a74dbbe 100644
|
||||
--- a/output/output_kubevirt.ml
|
||||
+++ b/output/output_kubevirt.ml
|
||||
@@ -47,7 +47,7 @@ module Kubevirt = struct
|
||||
if options.output_options <> [] then
|
||||
error (f_"no -oo (output options) are allowed here");
|
||||
if options.output_password <> None then
|
||||
- error_option_cannot_be_used_in_output_mode "local" "-op";
|
||||
+ error_option_cannot_be_used_in_output_mode "kubevirt" "-op";
|
||||
|
||||
(* -os must be set to a directory. *)
|
||||
let output_storage =
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,46 @@
|
||||
From 6b7ef3efe748a72edad0faa508e91b340038a586 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 20 Jan 2023 09:11:52 +0000
|
||||
Subject: [PATCH] -o kubevirt: Move "cpu" element under "domain"
|
||||
|
||||
Apparently this element doesn't go in the obvious place (under
|
||||
"resources", next to memory), but in a whole new section under "cpu",
|
||||
which makes no logical sense but here we are. Also verified this
|
||||
against Kubevirt examples/vm-template-fedora.yaml
|
||||
|
||||
Reported-by: Ming Xie
|
||||
Fixes: commit bfa62b4683d312fc2fa9bb3c08963fc4846831b9
|
||||
(cherry picked from commit 8db50a85f0363d90918edd1af4fc20ddc245b421)
|
||||
---
|
||||
output/create_kubevirt_yaml.ml | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/output/create_kubevirt_yaml.ml b/output/create_kubevirt_yaml.ml
|
||||
index 205e9be3..689555e4 100644
|
||||
--- a/output/create_kubevirt_yaml.ml
|
||||
+++ b/output/create_kubevirt_yaml.ml
|
||||
@@ -65,13 +65,13 @@ let create_kubevirt_yaml source inspect
|
||||
let memory_str = sprintf "%LdMi" (source.s_memory /^ 1024_L /^ 1024_L) in
|
||||
List.push_back resources ("requests", Assoc ["memory", String memory_str]);
|
||||
|
||||
- (* # vCPUs. XXX vendor, model, topology *)
|
||||
- List.push_back resources ("cpu", Assoc ["cores", Int source.s_vcpu]);
|
||||
-
|
||||
(* Machine features. *)
|
||||
let features = List.map (fun name -> name, List []) source.s_features in
|
||||
List.push_back resources ("features", Assoc features);
|
||||
|
||||
+ (* # vCPUs. XXX vendor, model, topology *)
|
||||
+ let cpu = "cpu", Assoc ["cores", Int source.s_vcpu] in
|
||||
+
|
||||
(* XXX firmware, display, sound *)
|
||||
|
||||
(* XXX guestcaps: rng, balloon, vsock, virtio 1.0 *)
|
||||
@@ -109,6 +109,7 @@ let create_kubevirt_yaml source inspect
|
||||
if !devices <> [] then
|
||||
List.push_back domain ("devices", Assoc !devices);
|
||||
List.push_back domain ("resources", Assoc !resources);
|
||||
+ List.push_back domain cpu;
|
||||
|
||||
let spec = ref [] in
|
||||
List.push_back spec ("domain", Assoc !domain);
|
@ -1,27 +0,0 @@
|
||||
From 42da4736c2078801c0a5ebbe3825086f9b8d25ea Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 12 Apr 2022 11:53:45 +0100
|
||||
Subject: [PATCH] output: Remove unused dummy.c
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This was removed when I removed -o json support, but I did not delete
|
||||
the file from git. “make maintainer-check-extra-dist” complained
|
||||
about this.
|
||||
|
||||
Fixes: commit 4e6b389b4e27c8d13e57fcaf777d96ad7e08650b
|
||||
(cherry picked from commit 0a1286df1725560e2789134d12022fc52572f9b0)
|
||||
---
|
||||
output/dummy.c | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
delete mode 100644 output/dummy.c
|
||||
|
||||
diff --git a/output/dummy.c b/output/dummy.c
|
||||
deleted file mode 100644
|
||||
index ebab6198..00000000
|
||||
--- a/output/dummy.c
|
||||
+++ /dev/null
|
||||
@@ -1,2 +0,0 @@
|
||||
-/* Dummy source, to be used for OCaml-based tools with no C sources. */
|
||||
-enum { foo = 1 };
|
@ -1,79 +0,0 @@
|
||||
From 7b22bc65e5df2bbe9f5ccf8ab05e67afb5a4cb8f Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Tue, 10 May 2022 12:53:07 +0200
|
||||
Subject: [PATCH] adopt inversion of SELinux relabeling in virt-customize
|
||||
|
||||
Remove "--selinux-relabel" options.
|
||||
|
||||
Do not add any "--no-selinux-relabel" options; rely on the internal check
|
||||
for SELinux support instead ("is_selinux_guest" in
|
||||
"common/mlcustomize/SELinux_relabel.ml").
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1554735
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2075718
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20220510105307.15402-1-lersek@redhat.com>
|
||||
Acked-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
[lersek@redhat.com: incorporate common submodule update]
|
||||
(cherry picked from commit 0c24fc6015ce7719acff3bcead7eb227b6de3f21)
|
||||
---
|
||||
common | 2 +-
|
||||
tests/test-v2v-conversion-of.sh | 7 -------
|
||||
2 files changed, 1 insertion(+), 8 deletions(-)
|
||||
|
||||
Submodule common 201632e4..af6cb55b (rewind):
|
||||
diff --git a/common/mlcustomize/guest_packages.ml b/common/mlcustomize/guest_packages.ml
|
||||
index 7c29a2ab..4c3c34ed 100644
|
||||
--- a/common/mlcustomize/guest_packages.ml
|
||||
+++ b/common/mlcustomize/guest_packages.ml
|
||||
@@ -73,9 +73,9 @@ let install_command packages package_management =
|
||||
| "zypper" -> sprintf "zypper -n in -l %s" quoted_args
|
||||
|
||||
| "unknown" ->
|
||||
- error_unknown_package_manager "--install"
|
||||
+ error_unknown_package_manager (s_"--install")
|
||||
| pm ->
|
||||
- error_unimplemented_package_manager "--install" pm
|
||||
+ error_unimplemented_package_manager (s_"--install") pm
|
||||
|
||||
let update_command package_management =
|
||||
match package_management with
|
||||
@@ -103,9 +103,9 @@ let update_command package_management =
|
||||
| "zypper" -> "zypper -n update -l"
|
||||
|
||||
| "unknown" ->
|
||||
- error_unknown_package_manager "--update"
|
||||
+ error_unknown_package_manager (s_"--update")
|
||||
| pm ->
|
||||
- error_unimplemented_package_manager "--update" pm
|
||||
+ error_unimplemented_package_manager (s_"--update") pm
|
||||
|
||||
let uninstall_command packages package_management =
|
||||
let quoted_args = String.concat " " (List.map quote packages) in
|
||||
@@ -127,6 +127,6 @@ let uninstall_command packages package_management =
|
||||
| "zypper" -> sprintf "zypper -n rm %s" quoted_args
|
||||
|
||||
| "unknown" ->
|
||||
- error_unknown_package_manager "--uninstall"
|
||||
+ error_unknown_package_manager (s_"--uninstall")
|
||||
| pm ->
|
||||
- error_unimplemented_package_manager "--uninstall" pm
|
||||
+ error_unimplemented_package_manager (s_"--uninstall") pm
|
||||
diff --git a/tests/test-v2v-conversion-of.sh b/tests/test-v2v-conversion-of.sh
|
||||
index 5a974d1b..5c5cae7c 100755
|
||||
--- a/tests/test-v2v-conversion-of.sh
|
||||
+++ b/tests/test-v2v-conversion-of.sh
|
||||
@@ -53,13 +53,6 @@ fi
|
||||
# Some guests need special virt-builder parameters.
|
||||
# See virt-builder --notes "$guestname"
|
||||
declare -a extra
|
||||
-case "$guestname" in
|
||||
- fedora*|rhel*|centos*)
|
||||
- extra[${#extra[*]}]='--selinux-relabel'
|
||||
- ;;
|
||||
- *)
|
||||
- ;;
|
||||
-esac
|
||||
|
||||
# Don't try to update Windows versions.
|
||||
case "$guestname" in
|
@ -0,0 +1,51 @@
|
||||
From 8009825c396358137576af522acc0b6b20243bac Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 20 Jan 2023 09:49:04 +0000
|
||||
Subject: [PATCH] -o kubevirt: Error on invalid output guest names
|
||||
|
||||
Kubevirt supports something like RFC 1123 names (without the length
|
||||
restriction). Helpfully it prints the regexp that it uses the
|
||||
validate the names, so just use the same regexp.
|
||||
|
||||
Note that virt-v2v never renames guests (since that would add
|
||||
unpredictability for automation). You must use the -on option to
|
||||
rename the guest if the name is wrong. Hence this is an error, not a
|
||||
warning or an attempt to rename the guest.
|
||||
|
||||
Reported-by: Ming Xie
|
||||
Fixes: commit bfa62b4683d312fc2fa9bb3c08963fc4846831b9
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2162332
|
||||
(cherry picked from commit 8a9c914544a49bed13eb5baf42290f835bdee7b5)
|
||||
---
|
||||
output/output_kubevirt.ml | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/output/output_kubevirt.ml b/output/output_kubevirt.ml
|
||||
index 0a74dbbe..00e6a8a5 100644
|
||||
--- a/output/output_kubevirt.ml
|
||||
+++ b/output/output_kubevirt.ml
|
||||
@@ -29,6 +29,11 @@ open Utils
|
||||
open Output
|
||||
open Create_kubevirt_yaml
|
||||
|
||||
+(* Valid output names for Kubevirt (RHBZ#2162332). *)
|
||||
+let rfc1123_re =
|
||||
+ PCRE.compile ~anchored:true
|
||||
+ "[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*"
|
||||
+
|
||||
module Kubevirt = struct
|
||||
type poptions = output_allocation * string * string * string
|
||||
|
||||
@@ -60,6 +65,12 @@ module Kubevirt = struct
|
||||
|
||||
let output_name = Option.default source.s_name options.output_name in
|
||||
|
||||
+ if not (PCRE.matches rfc1123_re output_name) then
|
||||
+ error (f_"-o kubevirt: the guest name must contain only lowercase \
|
||||
+ alphanumeric characters, '-' or '.', and must start and \
|
||||
+ end with an alphanumeric character. Rerun virt-v2v with \
|
||||
+ the '-on name' option to rename it.");
|
||||
+
|
||||
options.output_alloc, options.output_format, output_name, output_storage
|
||||
|
||||
let setup dir options source =
|
File diff suppressed because it is too large
Load Diff
@ -1,105 +0,0 @@
|
||||
From 0699afed37343d73c6803cabec466e1c3ca229b0 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Mon, 13 Jun 2022 19:01:32 +0200
|
||||
Subject: [PATCH] output/create_libvirt_xml: wire up the QEMU guest agent
|
||||
|
||||
The intent (even before RHBZ#2028764) has been to install the QEMU guest
|
||||
agent in the converted domain unconditionally. Therefore, in order for the
|
||||
GA to be actually accessible from the host side, augment the libvirt
|
||||
output module with a "guest agent connection" also unconditionally.
|
||||
|
||||
For starters, the domain needs a virtio-serial device. Then there must be
|
||||
a port on the device that (in the guest) the GA identifies by name, and
|
||||
that (on the host) is exposed as a listening socket (usually in the unix
|
||||
address family). The adress of that port (usually a pathname, i.e., for a
|
||||
unix domain socket) is then passed to whatever host-side application wants
|
||||
to talk to the GA.
|
||||
|
||||
The minimal domain XML fragment for that ("minimal" for our purposes) is
|
||||
|
||||
<controller type='virtio-serial' model='virtio'>
|
||||
<channel type='unix'>
|
||||
<target type='virtio' name='org.qemu.guest_agent.0'/>
|
||||
</channel>
|
||||
|
||||
The "controller" element is needed because "controller/@model" is where we
|
||||
regulate "virtio" vs. "virtio-transitional".
|
||||
|
||||
Everything else is filled in by libvirt. Notably, libvirt (a) creates and
|
||||
binds the unix domain socket itself (usually
|
||||
"/var/lib/libvirt/qemu/channel/target/DOMAIN/org.qemu.guest_agent.0"), (b)
|
||||
passes the file descriptor to QEMU, and (c) figures out the socket
|
||||
pathname for commands such as
|
||||
|
||||
virsh domfsinfo DOMAIN
|
||||
virsh domhostname DOMAIN --source agent
|
||||
virsh domifaddr DOMAIN --source agent
|
||||
virsh guestinfo DOMAIN
|
||||
|
||||
For QEMU, the corresponding options would be
|
||||
|
||||
-chardev socket,id=agent,server=on,wait=off,path=/tmp/DOMAIN-agent \
|
||||
-device virtio-serial-pci,id=vioserial \
|
||||
-device virtserialport,bus=vioserial.0,nr=1,chardev=agent,name=org.qemu.guest_agent.0 \
|
||||
|
||||
Note the "path=/tmp/DOMAIN-agent" property of "-chardev"; virt-v2v would
|
||||
have to generate that (in place of the "fd=nnnn" property that libvirt
|
||||
passes to QEMU).
|
||||
|
||||
Omit extending the QEMU output module for now, as the QGA protocol is
|
||||
based on JSON, and one needs "virsh" or "virt-manager" (or another
|
||||
management application interface) anyway, for efficiently exchanging
|
||||
messages with QGA. I don't know of end-user tools that directly connect to
|
||||
"/tmp/DOMAIN-agent".
|
||||
|
||||
Don't modify the RHV and OpenStack outputs either; both of these
|
||||
management products likely configure the virtio-serial device
|
||||
automatically, for the agent access.
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2028764
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20220613170135.12557-2-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
Tested-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit 48c6ea27c5a7053e418622f7450e3f9ef05c923f)
|
||||
---
|
||||
output/create_libvirt_xml.ml | 11 +++++++++++
|
||||
tests/test-v2v-i-ova.xml | 4 ++++
|
||||
2 files changed, 15 insertions(+)
|
||||
|
||||
diff --git a/output/create_libvirt_xml.ml b/output/create_libvirt_xml.ml
|
||||
index 68d0a909..531a4f75 100644
|
||||
--- a/output/create_libvirt_xml.ml
|
||||
+++ b/output/create_libvirt_xml.ml
|
||||
@@ -524,6 +524,17 @@ let create_libvirt_xml ?pool source inspect
|
||||
e "console" ["type", "pty"] [];
|
||||
];
|
||||
|
||||
+ (* Given that we install the QEMU Guest Agent for both Linux and Windows
|
||||
+ * guests unconditionally, create the virtio-serial device that's needed for
|
||||
+ * communication between the host and the agent.
|
||||
+ *)
|
||||
+ List.push_back_list devices [
|
||||
+ e "controller" ["type", "virtio-serial"; "model", virtio_model] [];
|
||||
+ e "channel" ["type", "unix"] [
|
||||
+ e "target" ["type", "virtio"; "name", "org.qemu.guest_agent.0"] []
|
||||
+ ]
|
||||
+ ];
|
||||
+
|
||||
List.push_back_list body [
|
||||
e "devices" [] !devices;
|
||||
];
|
||||
diff --git a/tests/test-v2v-i-ova.xml b/tests/test-v2v-i-ova.xml
|
||||
index 6b8cda62..da1db473 100644
|
||||
--- a/tests/test-v2v-i-ova.xml
|
||||
+++ b/tests/test-v2v-i-ova.xml
|
||||
@@ -49,5 +49,9 @@
|
||||
<input type='tablet' bus='usb'/>
|
||||
<input type='mouse' bus='ps2'/>
|
||||
<console type='pty'/>
|
||||
+ <controller type='virtio-serial' model='virtio'/>
|
||||
+ <channel type='unix'>
|
||||
+ <target type='virtio' name='org.qemu.guest_agent.0'/>
|
||||
+ </channel>
|
||||
</devices>
|
||||
</domain>
|
@ -1,82 +0,0 @@
|
||||
From 82c7526e052d2aa64a6754ff0e1082937e3ee4bc Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Mon, 13 Jun 2022 19:01:34 +0200
|
||||
Subject: [PATCH] convert_linux: extract qemu-guest-agent package name
|
||||
|
||||
In commit a30383e35d34 ("v2v: linux: do not install qemu-guest-agent if
|
||||
already installed", 2019-09-20), the name of the package providing the
|
||||
QEMU guest agent was hard-coded as "qemu-guest-agent", regardless of
|
||||
distro family. Turns out this is actually correct (and may have been
|
||||
intentional, only it was not specifically documented): in all OS families
|
||||
currently recognized by our "family" function (`RHEL_family, `ALT_family,
|
||||
`SUSE_family, `Debian_family), the *binary* package is indeed called
|
||||
"qemu-guest-agent":
|
||||
|
||||
- https://brewweb.engineering.redhat.com/brew/packageinfo?packageID=47646
|
||||
- http://rpmfind.net/linux/rpm2html/search.php?query=qemu-guest-agent&submit=Search+...&system=&arch=
|
||||
- https://packages.altlinux.org/en/sisyphus/srpms/qemu/
|
||||
- https://packages.debian.org/search?keywords=qemu-guest-agent&searchon=names&suite=all§ion=all
|
||||
|
||||
As a way of documenting this, extract the mapping to a new helper function
|
||||
named "qga_pkg_of_family".
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2028764
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
Message-Id: <20220613170135.12557-4-lersek@redhat.com>
|
||||
(cherry picked from commit f65e8e68fb4eb9b8d40ac0fe7bfc3122a13e5251)
|
||||
---
|
||||
convert/convert_linux.ml | 33 +++++++++++++++++++++++++--------
|
||||
1 file changed, 25 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/convert/convert_linux.ml b/convert/convert_linux.ml
|
||||
index 79462aa1..2ddbc07a 100644
|
||||
--- a/convert/convert_linux.ml
|
||||
+++ b/convert/convert_linux.ml
|
||||
@@ -56,6 +56,16 @@ let convert (g : G.guestfs) source inspect keep_serial_console _ =
|
||||
| "debian" | "ubuntu" | "linuxmint" | "kalilinux" -> `Debian_family
|
||||
| _ -> assert false in
|
||||
|
||||
+ (* map the OS family name to the qemu-guest-agent package name *)
|
||||
+ let qga_pkg_of_family =
|
||||
+ function
|
||||
+ | `RHEL_family
|
||||
+ | `ALT_family
|
||||
+ | `SUSE_family
|
||||
+ | `Debian_family -> Some "qemu-guest-agent"
|
||||
+ | _ -> None
|
||||
+ in
|
||||
+
|
||||
assert (inspect.i_package_format = "rpm" || inspect.i_package_format = "deb");
|
||||
|
||||
(* Fail early if i_apps is empty. Certain steps such as kernel
|
||||
@@ -539,14 +549,21 @@ let convert (g : G.guestfs) source inspect keep_serial_console _ =
|
||||
|
||||
and install_linux_tools () =
|
||||
(* It is not fatal if we fail to install the QEMU guest agent. *)
|
||||
- let has_qemu_guest_agent =
|
||||
- List.exists (
|
||||
- fun { G.app2_name = name } ->
|
||||
- name = "qemu-guest-agent"
|
||||
- ) inspect.i_apps in
|
||||
- if not has_qemu_guest_agent then
|
||||
- (* FIXME -- install qemu-guest-agent here *)
|
||||
- ()
|
||||
+ match qga_pkg_of_family family with
|
||||
+ | None -> warning (f_"The name of the package that provides the QEMU Guest \
|
||||
+ Agent for this guest OS is unknown. The guest agent \
|
||||
+ will not be installed. Please consider reporting a \
|
||||
+ bug according to the BUGS section of the virt-v2v(1) \
|
||||
+ manual.")
|
||||
+ | Some qga_pkg ->
|
||||
+ let has_qemu_guest_agent =
|
||||
+ List.exists (
|
||||
+ fun { G.app2_name = name } ->
|
||||
+ name = qga_pkg
|
||||
+ ) inspect.i_apps in
|
||||
+ if not has_qemu_guest_agent then
|
||||
+ (* FIXME -- install qemu-guest-agent here *)
|
||||
+ ()
|
||||
|
||||
and configure_kernel () =
|
||||
(* Previously this function would try to install kernels, but we
|
@ -0,0 +1,62 @@
|
||||
From 8802e8b4135c913f206508c8f7650a9f99ee6667 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 30 Jan 2023 09:17:33 +0000
|
||||
Subject: [PATCH] v2v: Remove use of ~anchored
|
||||
|
||||
In various places we used PCRE.compile ~anchored:true (PCRE2_ANCHORED)
|
||||
thinking it means that the regular expression is anchored at both
|
||||
ends. However this is not what it means (it only anchors the start).
|
||||
Replace with ^...$
|
||||
|
||||
(cherry picked from commit 8c316ed125e26583edc72eb9e953499b0078dcbd)
|
||||
---
|
||||
in-place/in_place.ml | 4 ++--
|
||||
inspector/inspector.ml | 4 ++--
|
||||
v2v/v2v.ml | 4 ++--
|
||||
3 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/in-place/in_place.ml b/in-place/in_place.ml
|
||||
index 55541814..f76651e6 100644
|
||||
--- a/in-place/in_place.ml
|
||||
+++ b/in-place/in_place.ml
|
||||
@@ -29,8 +29,8 @@ open Types
|
||||
open Utils
|
||||
|
||||
(* Matches --mac command line parameters. *)
|
||||
-let mac_re = PCRE.compile ~anchored:true "([[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}):(network|bridge|ip):(.*)"
|
||||
-let mac_ip_re = PCRE.compile ~anchored:true "([[:xdigit:]]|:|\\.)+"
|
||||
+let mac_re = PCRE.compile "^([[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}):(network|bridge|ip):(.*)$"
|
||||
+let mac_ip_re = PCRE.compile "^([[:xdigit:]]|:|\\.)+$"
|
||||
|
||||
let rec main () =
|
||||
let set_string_option_once optname optref arg =
|
||||
diff --git a/inspector/inspector.ml b/inspector/inspector.ml
|
||||
index 13d58df3..d12d85c2 100644
|
||||
--- a/inspector/inspector.ml
|
||||
+++ b/inspector/inspector.ml
|
||||
@@ -30,8 +30,8 @@ open Utils
|
||||
open DOM
|
||||
|
||||
(* Matches --mac command line parameters. *)
|
||||
-let mac_re = PCRE.compile ~anchored:true "([[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}):(network|bridge|ip):(.*)"
|
||||
-let mac_ip_re = PCRE.compile ~anchored:true "([[:xdigit:]]|:|\\.)+"
|
||||
+let mac_re = PCRE.compile "^([[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}):(network|bridge|ip):(.*)$"
|
||||
+let mac_ip_re = PCRE.compile "^([[:xdigit:]]|:|\\.)+$"
|
||||
|
||||
let rec main () =
|
||||
let set_string_option_once optname optref arg =
|
||||
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
|
||||
index 1e8d03ef..7a01eab5 100644
|
||||
--- a/v2v/v2v.ml
|
||||
+++ b/v2v/v2v.ml
|
||||
@@ -34,8 +34,8 @@ open Types
|
||||
open Utils
|
||||
|
||||
(* Matches --mac command line parameters. *)
|
||||
-let mac_re = PCRE.compile ~anchored:true "([[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}):(network|bridge|ip):(.*)"
|
||||
-let mac_ip_re = PCRE.compile ~anchored:true "([[:xdigit:]]|:|\\.)+"
|
||||
+let mac_re = PCRE.compile "^([[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}):(network|bridge|ip):(.*)$"
|
||||
+let mac_ip_re = PCRE.compile "^([[:xdigit:]]|:|\\.)+$"
|
||||
|
||||
let rec main () =
|
||||
let set_string_option_once optname optref arg =
|
@ -1,122 +0,0 @@
|
||||
From 50a74177b3577952159d87335cf40c0ad3e51b4d Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Fri, 17 Jun 2022 11:53:37 +0200
|
||||
Subject: [PATCH] RHV outputs: limit copied disk count to 23
|
||||
|
||||
We currently support virtio-blk (commonly) or IDE (unusually) for exposing
|
||||
disks to the converted guest; refer to "guestcaps.gcaps_block_bus" in
|
||||
"lib/create_ovf.ml". When using virtio-blk (i.e., in the common case), RHV
|
||||
can deal with at most 23 disks, as it plugs each virtio-blk device in a
|
||||
separate slot on the PCI(e) root bus; and the other slots are reserved for
|
||||
various purposes. When a domain has too many disks, the problem only
|
||||
becomes apparent once the copying finishes and an import is attempted.
|
||||
Modify the RHV outputs to fail relatively early when a domain has more
|
||||
than 23 disks that need to be copied.
|
||||
|
||||
Notes:
|
||||
|
||||
- With IDE, the theoretical limit may even be as low as 4. However, in the
|
||||
"Output_module.setup" function, we don't have access to
|
||||
"guestcaps.gcaps_block_bus", and in practice the IDE limitation has not
|
||||
caused surprises. So for now stick with 23, assuming virtio-blk.
|
||||
Modifying the "Output_module.setup" parameter list just for this seems
|
||||
overkill.
|
||||
|
||||
- We could move the new check to an even earlier step, namely
|
||||
"Output_module.parse_options", due to the v2v directory deliberately
|
||||
existing (and having been populated with input sockets) at that time.
|
||||
However, even discounting the fact that "parse_options" is not a good
|
||||
name for including this kind of step, "parse_options" does not have
|
||||
access to the v2v directory name, and modifying the signature just for
|
||||
this is (again) overkill.
|
||||
|
||||
- By adding the check to "Output_module.setup", we waste *some* effort
|
||||
(namely, the conversion occurs between "parse_options" and "setup"),
|
||||
but: (a) the "rhv-disk-uuid" count check (against the disk count) is
|
||||
already being done in the rhv-upload module's "setup" function, (b) in
|
||||
practice the slowest step ought to be the copying, and placing the new
|
||||
check in "setup" is early enough to prevent that.
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2051564
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20220617095337.9122-1-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit e186cc2bea99a077990f192953e1bf6c9ba70e79)
|
||||
---
|
||||
output/output.ml | 5 +++++
|
||||
output/output.mli | 7 +++++++
|
||||
output/output_rhv.ml | 1 +
|
||||
output/output_rhv_upload.ml | 1 +
|
||||
output/output_vdsm.ml | 1 +
|
||||
5 files changed, 15 insertions(+)
|
||||
|
||||
diff --git a/output/output.ml b/output/output.ml
|
||||
index 10e685c4..5c6670b9 100644
|
||||
--- a/output/output.ml
|
||||
+++ b/output/output.ml
|
||||
@@ -64,6 +64,11 @@ let get_disks dir =
|
||||
in
|
||||
loop [] 0
|
||||
|
||||
+let error_if_disk_count_gt dir n =
|
||||
+ let socket = sprintf "%s/in%d" dir n in
|
||||
+ if Sys.file_exists socket then
|
||||
+ error (f_"this output module doesn't support copying more than %d disks") n
|
||||
+
|
||||
let output_to_local_file ?(changeuid = fun f -> f ())
|
||||
output_alloc output_format filename size socket =
|
||||
(* Check nbdkit is installed and has the required plugin. *)
|
||||
diff --git a/output/output.mli b/output/output.mli
|
||||
index 533a0c51..8d3d6865 100644
|
||||
--- a/output/output.mli
|
||||
+++ b/output/output.mli
|
||||
@@ -76,6 +76,13 @@ val get_disks : string -> (int * int64) list
|
||||
(** Examines the v2v directory and opens each input socket (in0 etc),
|
||||
returning a list of input disk index and size. *)
|
||||
|
||||
+val error_if_disk_count_gt : string -> int -> unit
|
||||
+(** This function lets an output module enforce a maximum disk count.
|
||||
+ [error_if_disk_count_gt dir n] checks whether the domain has more than [n]
|
||||
+ disks that need to be copied, by examining the existence of input NBD socket
|
||||
+ "in[n]" in the v2v directory [dir]. If the socket exists, [error] is
|
||||
+ called. *)
|
||||
+
|
||||
val output_to_local_file : ?changeuid:((unit -> unit) -> unit) ->
|
||||
Types.output_allocation ->
|
||||
string -> string -> int64 -> string ->
|
||||
diff --git a/output/output_rhv.ml b/output/output_rhv.ml
|
||||
index 119207fd..8571e07b 100644
|
||||
--- a/output/output_rhv.ml
|
||||
+++ b/output/output_rhv.ml
|
||||
@@ -56,6 +56,7 @@ module RHV = struct
|
||||
(options.output_alloc, options.output_format, output_name, output_storage)
|
||||
|
||||
let rec setup dir options source =
|
||||
+ error_if_disk_count_gt dir 23;
|
||||
let disks = get_disks dir in
|
||||
let output_alloc, output_format, output_name, output_storage = options in
|
||||
|
||||
diff --git a/output/output_rhv_upload.ml b/output/output_rhv_upload.ml
|
||||
index 828996b3..f2ced4f4 100644
|
||||
--- a/output/output_rhv_upload.ml
|
||||
+++ b/output/output_rhv_upload.ml
|
||||
@@ -133,6 +133,7 @@ after their uploads (if you do, you must supply one for each disk):
|
||||
else PCRE.matches (Lazy.force rex_uuid) uuid
|
||||
|
||||
let rec setup dir options source =
|
||||
+ error_if_disk_count_gt dir 23;
|
||||
let disks = get_disks dir in
|
||||
let output_conn, output_format,
|
||||
output_password, output_name, output_storage,
|
||||
diff --git a/output/output_vdsm.ml b/output/output_vdsm.ml
|
||||
index a1e8c246..23d1b9cd 100644
|
||||
--- a/output/output_vdsm.ml
|
||||
+++ b/output/output_vdsm.ml
|
||||
@@ -119,6 +119,7 @@ For each disk you must supply one of each of these options:
|
||||
compat, ovf_flavour)
|
||||
|
||||
let setup dir options source =
|
||||
+ error_if_disk_count_gt dir 23;
|
||||
let disks = get_disks dir in
|
||||
let output_alloc, output_format,
|
||||
output_name, output_storage,
|
@ -0,0 +1,34 @@
|
||||
From 628ee708464ee3d266609167c48e92f883849e4d Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 30 Jan 2023 09:01:38 +0000
|
||||
Subject: [PATCH] -o kubevirt: Replace PCRE ~anchored with ^...$
|
||||
|
||||
Because this regexp was not anchored at both ends it would still
|
||||
report a match for incorrect names.
|
||||
|
||||
Fixes: commit 8a9c914544a49bed13eb5baf42290f835bdee7b5
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2162332
|
||||
Reported-by: Ming Xie
|
||||
|
||||
Cherry picked from commit 050a0ba714ddf2a5d81515c886032016aa75342c.
|
||||
I did not include the update to the common module since picking that
|
||||
would pull in the large changes made to the virtio driver code.
|
||||
---
|
||||
output/output_kubevirt.ml | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/output/output_kubevirt.ml b/output/output_kubevirt.ml
|
||||
index ee89fdbf..fdf0f279 100644
|
||||
--- a/output/output_kubevirt.ml
|
||||
+++ b/output/output_kubevirt.ml
|
||||
@@ -31,8 +31,8 @@ open Create_kubevirt_yaml
|
||||
|
||||
(* Valid output names for Kubevirt (RHBZ#2162332). *)
|
||||
let rfc1123_re =
|
||||
- PCRE.compile ~anchored:true
|
||||
- "[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*"
|
||||
+ PCRE.compile
|
||||
+ "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"
|
||||
|
||||
module Kubevirt = struct
|
||||
type poptions = bool * output_allocation * string * string * string
|
@ -1,49 +0,0 @@
|
||||
From 81a201269e5451cd76348e0da6d0ef4c0fb4c0dd Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Fri, 1 Jul 2022 15:30:42 +0200
|
||||
Subject: [PATCH] convert: document networking dependency of "--key ID:clevis"
|
||||
|
||||
Virt-v2v enables appliance networking already, for the sake of
|
||||
"unconfigure_vmware". We now have a second use case for networking: "--key
|
||||
ID:clevis". Update the comment in the code.
|
||||
|
||||
(Short log for libguestfs-common commit range 35467027f657..af6cb55bc58a:
|
||||
|
||||
Laszlo Ersek (12):
|
||||
options: fix UUID comparison logic bug in get_keys()
|
||||
mltools/tools_utils: remove unused function "key_store_to_cli"
|
||||
mltools/tools_utils: allow multiple "--key" options for OCaml tools too
|
||||
options: replace NULL-termination with number-of-elements in get_keys()
|
||||
options: wrap each passphrase from get_keys() into a struct
|
||||
options: add back-end for LUKS decryption with Clevis+Tang
|
||||
options: introduce selector type "key_clevis"
|
||||
options: generalize "--key" selector parsing for C-language utilities
|
||||
mltools/tools_utils-c: handle internal type error with abort()
|
||||
mltools/tools_utils: generalize "--key" selector parsing for OCaml utils
|
||||
options, mltools/tools_utils: parse "--key ID:clevis" options
|
||||
options, mltools/tools_utils: add helper for network dependency
|
||||
).
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1809453
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20220628115856.5820-1-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit 98fa5ab2685371c681282ce5de704877af27be74)
|
||||
---
|
||||
convert/convert.ml | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/convert/convert.ml b/convert/convert.ml
|
||||
index 5e0e6c2b..b678dc92 100644
|
||||
--- a/convert/convert.ml
|
||||
+++ b/convert/convert.ml
|
||||
@@ -57,7 +57,8 @@ let rec convert dir options source =
|
||||
* sure this is not too large because each vCPU consumes guest RAM.
|
||||
*)
|
||||
g#set_smp (min 8 (Sysconf.nr_processors_online ()));
|
||||
- (* The network is only used by the unconfigure_vmware () function. *)
|
||||
+ (* The network is used by the unconfigure_vmware () function, and the "--key
|
||||
+ * ID:clevis" command line options (if any). *)
|
||||
g#set_network true;
|
||||
List.iter (
|
||||
fun { s_disk_id = i } ->
|
@ -0,0 +1,48 @@
|
||||
From a9630d3981cbf7f6083e82f4e22cff981d11a8b3 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 2 Feb 2023 12:29:00 +0000
|
||||
Subject: [PATCH] -o libvirt: Add correct xmlns:libosinfo for Rocky Linux
|
||||
|
||||
Also a small whitespace fix and improve the warning message.
|
||||
|
||||
Updates: commit db831c167b7bf757aa79dbe3db5fa8c5fd8cfc99
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2166618
|
||||
Reported-by: Ming Xie
|
||||
(cherry picked from commit ebfdca56bca69284f289e3db8a6e6baf6bc617f0)
|
||||
---
|
||||
output/create_libvirt_xml.ml | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/output/create_libvirt_xml.ml b/output/create_libvirt_xml.ml
|
||||
index e1c1f616..388fae5b 100644
|
||||
--- a/output/create_libvirt_xml.ml
|
||||
+++ b/output/create_libvirt_xml.ml
|
||||
@@ -47,6 +47,10 @@ let get_osinfo_id = function
|
||||
when major >= 8 ->
|
||||
Some (sprintf "http://centos.org/centos/%d" major)
|
||||
|
||||
+ | { i_type = "linux"; i_distro = "rocky";
|
||||
+ i_major_version = major; i_minor_version = minor } ->
|
||||
+ Some (sprintf "http://rockylinux.org/rocky/%d.%d" major minor)
|
||||
+
|
||||
| { i_type = "linux"; i_distro = "sles";
|
||||
i_major_version = major; i_minor_version = 0;
|
||||
i_product_name = product } when String.find product "Desktop" >= 0 ->
|
||||
@@ -140,7 +144,8 @@ let get_osinfo_id = function
|
||||
| { i_type = typ; i_distro = distro;
|
||||
i_major_version = major; i_minor_version = minor; i_arch = arch;
|
||||
i_product_name = product } ->
|
||||
- warning (f_"unknown guest operating system: %s %s %d.%d %s (%s)")
|
||||
+ warning (f_"get_osinfo_id: unknown guest operating system: \
|
||||
+ %s %s %d.%d %s (%s)")
|
||||
typ distro major minor arch product;
|
||||
None
|
||||
|
||||
@@ -160,7 +165,6 @@ let create_libvirt_xml ?pool source inspect
|
||||
| Some genid -> List.push_back body (e "genid" [] [PCData genid])
|
||||
);
|
||||
|
||||
-
|
||||
(match get_osinfo_id inspect with
|
||||
| None -> ()
|
||||
| Some osinfo_id ->
|
@ -0,0 +1,42 @@
|
||||
From 227313ca73d24eaaa0b82aca94de2278bca0f95b Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 6 Feb 2023 12:13:25 +0000
|
||||
Subject: [PATCH] convert: linux: Require host cpu for all RHEL-alike >= 9
|
||||
|
||||
RHEL >= 9 and compatible distros like Rocky >= 9 will not boot using
|
||||
the default qemu CPU. You will see an error at boot:
|
||||
|
||||
Fatal glibc error: CPU does not support x86-64-v2
|
||||
|
||||
Instead you need to use -cpu host.
|
||||
|
||||
In commit f28757c6d1 ("convert_linux: set "gcaps_default_cpu = false"
|
||||
for x86_64 RHEL-9.0+ guests") we fixed this specifically for RHEL >= 9.
|
||||
|
||||
This commit extends the same fix to all RHEL family distros.
|
||||
|
||||
Updates: commit f28757c6d100060c65212ea55cfa59d308dcb850
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2166619
|
||||
Reported-by: Ming Xie
|
||||
Thanks: Laszlo Ersek
|
||||
(cherry picked from commit 9f12b95bbe7bc2850ce4ba134c46a3cc5fd1167d)
|
||||
---
|
||||
convert/convert_linux.ml | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/convert/convert_linux.ml b/convert/convert_linux.ml
|
||||
index 41767e62..27bc4ae4 100644
|
||||
--- a/convert/convert_linux.ml
|
||||
+++ b/convert/convert_linux.ml
|
||||
@@ -202,9 +202,9 @@ let convert (g : G.guestfs) source inspect keep_serial_console _ =
|
||||
|
||||
(* RHEL >= 9.0 on x86_64 requires the processor to support the "x86-64-v2"
|
||||
* microarchitecture level, which the default QEMU VCPU model does not
|
||||
- * satisfy. Refer to RHBZ#2076013.
|
||||
+ * satisfy. Refer to RHBZ#2076013 RHBZ#2166619.
|
||||
*)
|
||||
- let default_cpu_suffices = inspect.i_distro <> "rhel" ||
|
||||
+ let default_cpu_suffices = family <> `RHEL_family ||
|
||||
inspect.i_arch <> "x86_64" ||
|
||||
inspect.i_major_version < 9 in
|
||||
|
@ -1,114 +0,0 @@
|
||||
From 672b9795e85b48f337b3da2d6fa393e7788d79a1 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 1 Jul 2022 11:18:53 +0100
|
||||
Subject: [PATCH] tests: Add a simple test of -o local -of qcow2 -oo compressed
|
||||
|
||||
This only tests that it doesn't completely fail, which it did before
|
||||
we fixed nbdcopy. I checked the file sizes manually and with
|
||||
compression the resulting file is about half the size.
|
||||
|
||||
This test is a clone of tests/test-v2v-of-option.sh. In order to
|
||||
compare the sizes across the two tests, and to keep the tests fairly
|
||||
similar I added an ls -l command to the original test.
|
||||
|
||||
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
|
||||
(cherry picked from commit 7505750972b49e1a448c519a27998bd5f20be60a)
|
||||
---
|
||||
tests/Makefile.am | 2 +
|
||||
tests/test-v2v-o-local-qcow2-compressed.sh | 53 ++++++++++++++++++++++
|
||||
tests/test-v2v-of-option.sh | 2 +
|
||||
3 files changed, 57 insertions(+)
|
||||
create mode 100755 tests/test-v2v-o-local-qcow2-compressed.sh
|
||||
|
||||
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
||||
index e787a86c..a26ecf7a 100644
|
||||
--- a/tests/Makefile.am
|
||||
+++ b/tests/Makefile.am
|
||||
@@ -82,6 +82,7 @@ TESTS = \
|
||||
test-v2v-networks-and-bridges.sh \
|
||||
test-v2v-o-glance.sh \
|
||||
test-v2v-o-libvirt.sh \
|
||||
+ test-v2v-o-local-qcow2-compressed.sh \
|
||||
test-v2v-o-null.sh \
|
||||
test-v2v-o-openstack.sh \
|
||||
test-v2v-o-qemu.sh \
|
||||
@@ -241,6 +242,7 @@ EXTRA_DIST += \
|
||||
test-v2v-networks-and-bridges-expected.xml \
|
||||
test-v2v-o-glance.sh \
|
||||
test-v2v-o-libvirt.sh \
|
||||
+ test-v2v-o-local-qcow2-compressed.sh \
|
||||
test-v2v-o-null.sh \
|
||||
test-v2v-o-openstack.sh \
|
||||
test-v2v-o-qemu.sh \
|
||||
diff --git a/tests/test-v2v-o-local-qcow2-compressed.sh b/tests/test-v2v-o-local-qcow2-compressed.sh
|
||||
new file mode 100755
|
||||
index 00000000..32c9ebbe
|
||||
--- /dev/null
|
||||
+++ b/tests/test-v2v-o-local-qcow2-compressed.sh
|
||||
@@ -0,0 +1,53 @@
|
||||
+#!/bin/bash -
|
||||
+# libguestfs virt-v2v test script
|
||||
+# Copyright (C) 2014-2022 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, write to the Free Software
|
||||
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
+
|
||||
+# Test -o local -of qcow2 -oo compressed.
|
||||
+
|
||||
+set -e
|
||||
+
|
||||
+source ./functions.sh
|
||||
+set -e
|
||||
+set -x
|
||||
+
|
||||
+skip_if_skipped
|
||||
+requires test -f ../test-data/phony-guests/windows.img
|
||||
+
|
||||
+# This requires fixed nbdcopy >= 1.13.5.
|
||||
+requires nbdcopy --version
|
||||
+nbdcopy --version | {
|
||||
+ IFS=' .' read name major minor release
|
||||
+ requires test \( "$major" -gt 1 \) -o \
|
||||
+ \( "$major" -eq 1 -a "$minor" -gt 13 \) -o \
|
||||
+ \( "$major" -eq 1 -a "$minor" -eq 13 -a "$release" -ge 5 \)
|
||||
+}
|
||||
+
|
||||
+export VIRT_TOOLS_DATA_DIR="$srcdir/../test-data/fake-virt-tools"
|
||||
+
|
||||
+d=test-v2v-o-local-qcow2-compressed.d
|
||||
+rm -rf $d
|
||||
+cleanup_fn rm -rf $d
|
||||
+mkdir $d
|
||||
+
|
||||
+$VG virt-v2v --debug-gc \
|
||||
+ -i disk ../test-data/phony-guests/windows.img \
|
||||
+ -o local -of qcow2 -oo compressed -os $d
|
||||
+
|
||||
+# Test the libvirt XML metadata and a disk was created.
|
||||
+ls -l $d
|
||||
+test -f $d/windows.xml
|
||||
+test -f $d/windows-sda
|
||||
diff --git a/tests/test-v2v-of-option.sh b/tests/test-v2v-of-option.sh
|
||||
index bdfd3418..6c5f5938 100755
|
||||
--- a/tests/test-v2v-of-option.sh
|
||||
+++ b/tests/test-v2v-of-option.sh
|
||||
@@ -42,6 +42,8 @@ $VG virt-v2v --debug-gc \
|
||||
-i libvirt -ic "$libvirt_uri" windows \
|
||||
-o local -os $d -of qcow2
|
||||
|
||||
+ls -l $d
|
||||
+
|
||||
# Test the disk is qcow2 format.
|
||||
if [ "$(guestfish disk-format $d/windows-sda)" != qcow2 ]; then
|
||||
echo "$0: test failed: output is not qcow2"
|
@ -1,80 +0,0 @@
|
||||
From ba2963bc57c8c8a3d6f7cc2fd274c9ebd4ddb7d8 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Wed, 6 Jul 2022 12:32:15 +0200
|
||||
Subject: [PATCH] convert/convert_linux: complete the remapping of NVMe devices
|
||||
|
||||
In commit 75872bf282d7 ("input: -i vmx: Add support for NVMe devices",
|
||||
2022-04-08), we missed that pathnames such as
|
||||
|
||||
/dev/nvme0n1[p1]
|
||||
|
||||
would not match our "rex_device_cciss" and "rex_device" regular
|
||||
expressions.
|
||||
|
||||
As a consequence, we don't remap such pathnames now in the boot config
|
||||
files with Augeas.
|
||||
|
||||
Add a new regex and associated mapping logic for this kind of pathname.
|
||||
|
||||
Notes:
|
||||
|
||||
(1) "rex_device_cciss" could be extended internally with an alternative
|
||||
pattern:
|
||||
|
||||
^/dev/(cciss/c\\d+d\\d+|nvme\\d+n1)(?:p(\\d+))?$
|
||||
^^^^^^^^^^^
|
||||
|
||||
but Rich suggested we should add a separate, complete regexp for
|
||||
maintainability.
|
||||
|
||||
(2) Even with a separate regexp, we could reuse the existent CCISS pattern
|
||||
handler:
|
||||
|
||||
if PCRE.matches rex_device_cciss value ||
|
||||
PCRE.matches rex_device_nvme value then (
|
||||
let device = PCRE.sub 1
|
||||
and part = try PCRE.sub 2 with Not_found -> "" in
|
||||
"/dev/" ^ replace device ^ part
|
||||
)
|
||||
|
||||
Namely, although "PCRE.matches" creates/updates global state, and
|
||||
"PCRE.sub" reads that state, the "||" operator in OCaml has short-circuit
|
||||
behavior, and both regexps have the same structure.
|
||||
|
||||
But, using the same maintainability argument, let's keep the handler logic
|
||||
for NVMe detached.
|
||||
|
||||
Fixes: 75872bf282d7f2322110caca70963717b43806b1
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2101665
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20220706103215.5607-1-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit 4368b94ee1724c16aa35c0ee42ce4c51ce037b5a)
|
||||
---
|
||||
convert/convert_linux.ml | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/convert/convert_linux.ml b/convert/convert_linux.ml
|
||||
index 59d143bd..a66ff1e4 100644
|
||||
--- a/convert/convert_linux.ml
|
||||
+++ b/convert/convert_linux.ml
|
||||
@@ -1199,6 +1199,7 @@ let convert (g : G.guestfs) source inspect keep_serial_console _ =
|
||||
(* Map device names for each entry. *)
|
||||
let rex_resume = PCRE.compile "^resume=(/dev/[-a-z\\d/_]+)(.*)$"
|
||||
and rex_device_cciss = PCRE.compile "^/dev/(cciss/c\\d+d\\d+)(?:p(\\d+))?$"
|
||||
+ and rex_device_nvme = PCRE.compile "^/dev/(nvme\\d+n1)(?:p(\\d+))?$"
|
||||
and rex_device = PCRE.compile "^/dev/([a-z]+)(\\d*)?$" in
|
||||
|
||||
let rec replace_if_device path value =
|
||||
@@ -1221,6 +1222,11 @@ let convert (g : G.guestfs) source inspect keep_serial_console _ =
|
||||
and part = try PCRE.sub 2 with Not_found -> "" in
|
||||
"/dev/" ^ replace device ^ part
|
||||
)
|
||||
+ else if PCRE.matches rex_device_nvme value then (
|
||||
+ let device = PCRE.sub 1
|
||||
+ and part = try PCRE.sub 2 with Not_found -> "" in
|
||||
+ "/dev/" ^ replace device ^ part
|
||||
+ )
|
||||
else if PCRE.matches rex_device value then (
|
||||
let device = PCRE.sub 1
|
||||
and part = try PCRE.sub 2 with Not_found -> "" in
|
@ -1,49 +0,0 @@
|
||||
From c34fe9a52abdde05cb31c5bd2c99237652e1b0dc Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Mon, 11 Jul 2022 09:01:56 +0200
|
||||
Subject: [PATCH] input-xen: sync "-ip" limitations language from input-vmware
|
||||
manual
|
||||
|
||||
My analysis in <https://bugzilla.redhat.com/show_bug.cgi?id=1854275#c33>
|
||||
was partially wrong; I had missed that for the xen+ssh transport, the
|
||||
client-side libvirt library launches a naked "ssh" utility, underneath
|
||||
"Libvirt.Connect.connect_auth":
|
||||
|
||||
setup [input/input_xen_ssh.ml]
|
||||
Libvirt.Connect.connect_auth
|
||||
no effect of "-ip"
|
||||
Nbdkit_ssh.create_ssh [input/nbdkit_ssh.ml]
|
||||
starts nbdkit with the ssh
|
||||
plugin honoring "-ip"
|
||||
|
||||
Which requires a password just the same, and ignores "-ip" just the same.
|
||||
|
||||
Recommend the ssh agent in the docs.
|
||||
|
||||
Fixes: 46298c6514710013c59828b4933f0b3b1a354566
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1854275
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2062360
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20220711070157.5399-2-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit ae067a9ce0eb5631940a8cc5dcc5ee056903276b)
|
||||
---
|
||||
docs/virt-v2v-input-xen.pod | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/docs/virt-v2v-input-xen.pod b/docs/virt-v2v-input-xen.pod
|
||||
index ad5772de..80ad94f7 100644
|
||||
--- a/docs/virt-v2v-input-xen.pod
|
||||
+++ b/docs/virt-v2v-input-xen.pod
|
||||
@@ -32,6 +32,11 @@ server to the Xen host. For example:
|
||||
$ ssh root@xen.example.com
|
||||
[ logs straight into the shell, no password is requested ]
|
||||
|
||||
+Note that support for non-interactive authentication via the I<-ip>
|
||||
+option is incomplete. Some operations remain that still require the
|
||||
+user to enter the password manually. Therefore ssh-agent is recommended
|
||||
+over the I<-ip> option. See L<https://bugzilla.redhat.com/1854275>.
|
||||
+
|
||||
With some modern ssh implementations, legacy crypto policies required
|
||||
to interoperate with RHEL 5 sshd are disabled. To enable them you may
|
||||
need to run this command on the conversion server (ie. ssh client),
|
@ -1,4 +1,4 @@
|
||||
From fd0c34d843bb5ba9e1b33e0dfd1250943c760a70 Mon Sep 17 00:00:00 2001
|
||||
From f00e06aecd8e2040de6447e05fb721cb1f14720e Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Tue, 26 Mar 2019 09:42:25 +0100
|
||||
Subject: [PATCH] RHEL: point to KB for supported v2v hypervisors/guests
|
@ -1,82 +0,0 @@
|
||||
From 3f7f730ac9cbf38267839ffcebd6b6fd721123c5 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Mon, 11 Jul 2022 09:01:57 +0200
|
||||
Subject: [PATCH] input-xen: replace "enable LEGACY crypto" advice with
|
||||
targeted ssh options
|
||||
|
||||
- "KexAlgorithms": the Fedora 35 ssh binary, using the DEFAULT
|
||||
crypto-policy, cannot log in to RHEL5 sshd without relaxing
|
||||
"KexAlgorithms". The server offers three algorithms:
|
||||
"diffie-hellman-group-exchange-sha1", "diffie-hellman-group14-sha1",
|
||||
"diffie-hellman-group1-sha1"; and according to RFC 9142,
|
||||
"diffie-hellman-group14-sha1" is the least deprecated from those. (The
|
||||
RFC marks it as MAY be implemented, and marks the other two as SHOULD
|
||||
NOT be implemented.) Recommend "diffie-hellman-group14-sha1".
|
||||
|
||||
- "MACs": the Fedora 35 ssh binary, using the FUTURE crypto-policy, cannot
|
||||
log in to RHEL5 sshd without relaxing "MACs". The server offers
|
||||
"hmac-md5", "hmac-sha1", "hmac-ripemd160", "hmac-ripemd160@openssh.com",
|
||||
"hmac-sha1-96", "hmac-md5-96". After eliminating the MD5-based algos
|
||||
(MD5 is considered completely broken), and the one based on truncated
|
||||
SHA1, we're left with "hmac-sha1", "hmac-ripemd160", and
|
||||
"hmac-ripemd160@openssh.com". RIPEMD-160 is generally trusted, but it is
|
||||
compiled out of the Fedora 35 "ssh" client binary. Therefore only
|
||||
"hmac-sha1" remains.
|
||||
|
||||
- "HostKeyAlgorithms", "PubkeyAcceptedAlgorithms": these options control
|
||||
the usage of public key algorithms, for authenticating the server to the
|
||||
client, and vice versa, respectively. RHEL5 sshd only supports "ssh-rsa"
|
||||
and "ssh-dss", and from those, "ssh-rsa" is more commonly used (for
|
||||
example, "ssh-keygen" defaults to creating "ssh-rsa" keys). Recommend
|
||||
"ssh-rsa".
|
||||
|
||||
- "PubkeyAcceptedKeyTypes": this is the old ("legacy") name for
|
||||
"PubkeyAcceptedAlgorithms". As of this writing, the latest upstream
|
||||
release of libssh (also packaged in Fedora 35 -- libssh-0.9.6-1.fc35)
|
||||
does not recognize the new "PubkeyAcceptedAlgorithms" option name, only
|
||||
the original "PubkeyAcceptedKeyTypes". openssh-8.7p1-3.fc35 recognizes
|
||||
both option variants. Include "PubkeyAcceptedKeyTypes" in the
|
||||
recommendation along with "PubkeyAcceptedAlgorithms", for backward and
|
||||
forward compatbility.
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2062360
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20220711070157.5399-3-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit af4a0454cdd21bb5e86f2dbfaa153e83afca3988)
|
||||
---
|
||||
docs/virt-v2v-input-xen.pod | 20 +++++++++++++++-----
|
||||
1 file changed, 15 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/docs/virt-v2v-input-xen.pod b/docs/virt-v2v-input-xen.pod
|
||||
index 80ad94f7..1775fc31 100644
|
||||
--- a/docs/virt-v2v-input-xen.pod
|
||||
+++ b/docs/virt-v2v-input-xen.pod
|
||||
@@ -37,12 +37,22 @@ option is incomplete. Some operations remain that still require the
|
||||
user to enter the password manually. Therefore ssh-agent is recommended
|
||||
over the I<-ip> option. See L<https://bugzilla.redhat.com/1854275>.
|
||||
|
||||
-With some modern ssh implementations, legacy crypto policies required
|
||||
-to interoperate with RHEL 5 sshd are disabled. To enable them you may
|
||||
-need to run this command on the conversion server (ie. ssh client),
|
||||
-but read L<update-crypto-policies(8)> first:
|
||||
+With some modern ssh implementations, legacy crypto algorithms required
|
||||
+to interoperate with RHEL 5 sshd are disabled. To enable them, you may
|
||||
+need to add the following C<Host> stanza to your F<~/.ssh/config>:
|
||||
|
||||
- # update-crypto-policies --set LEGACY
|
||||
+ Host xen.example.com
|
||||
+ KexAlgorithms +diffie-hellman-group14-sha1
|
||||
+ MACs +hmac-sha1
|
||||
+ HostKeyAlgorithms +ssh-rsa
|
||||
+ PubkeyAcceptedKeyTypes +ssh-rsa
|
||||
+ PubkeyAcceptedAlgorithms +ssh-rsa
|
||||
+
|
||||
+(C<PubkeyAcceptedKeyTypes> and C<PubkeyAcceptedAlgorithms> have
|
||||
+identical meaning; the former is the old option name, the latter is the
|
||||
+new one. Virt-v2v uses both C<libssh> and C<ssh> when converting a guest
|
||||
+from Xen, and on some operating systems, C<libssh> and C<ssh> may not
|
||||
+both accept the same option variant.)
|
||||
|
||||
=head2 Test libvirt connection to remote Xen host
|
||||
|
@ -1,172 +0,0 @@
|
||||
From ea881513e9c15b0a816d3ba4afe471ff2f591a03 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 14 Jul 2022 12:44:27 +0100
|
||||
Subject: [PATCH] common: Adapt to renamed function On_exit.rmdir ->
|
||||
On_exit.rm_rf
|
||||
|
||||
This function was renamed to make it clearer what it does (and that
|
||||
it's potentially dangerous). The functionality is unchanged.
|
||||
|
||||
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
|
||||
(cherry picked from commit 2eb6441264deb0411d36dabaf8fb2da9f07c8439)
|
||||
---
|
||||
common | 2 +-
|
||||
input/OVA.ml | 2 +-
|
||||
input/parse_domain_from_vmx.ml | 2 +-
|
||||
lib/nbdkit.ml | 2 +-
|
||||
lib/qemuNBD.ml | 2 +-
|
||||
lib/utils.ml | 2 +-
|
||||
output/python_script.ml | 2 +-
|
||||
7 files changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
Submodule common af6cb55b..fd964c1b:
|
||||
diff --git a/common/mlcustomize/guest_packages.ml b/common/mlcustomize/guest_packages.ml
|
||||
index 4c3c34ed..7c29a2ab 100644
|
||||
--- a/common/mlcustomize/guest_packages.ml
|
||||
+++ b/common/mlcustomize/guest_packages.ml
|
||||
@@ -73,9 +73,9 @@ let install_command packages package_management =
|
||||
| "zypper" -> sprintf "zypper -n in -l %s" quoted_args
|
||||
|
||||
| "unknown" ->
|
||||
- error_unknown_package_manager (s_"--install")
|
||||
+ error_unknown_package_manager "--install"
|
||||
| pm ->
|
||||
- error_unimplemented_package_manager (s_"--install") pm
|
||||
+ error_unimplemented_package_manager "--install" pm
|
||||
|
||||
let update_command package_management =
|
||||
match package_management with
|
||||
@@ -103,9 +103,9 @@ let update_command package_management =
|
||||
| "zypper" -> "zypper -n update -l"
|
||||
|
||||
| "unknown" ->
|
||||
- error_unknown_package_manager (s_"--update")
|
||||
+ error_unknown_package_manager "--update"
|
||||
| pm ->
|
||||
- error_unimplemented_package_manager (s_"--update") pm
|
||||
+ error_unimplemented_package_manager "--update" pm
|
||||
|
||||
let uninstall_command packages package_management =
|
||||
let quoted_args = String.concat " " (List.map quote packages) in
|
||||
@@ -127,6 +127,6 @@ let uninstall_command packages package_management =
|
||||
| "zypper" -> sprintf "zypper -n rm %s" quoted_args
|
||||
|
||||
| "unknown" ->
|
||||
- error_unknown_package_manager (s_"--uninstall")
|
||||
+ error_unknown_package_manager "--uninstall"
|
||||
| pm ->
|
||||
- error_unimplemented_package_manager (s_"--uninstall") pm
|
||||
+ error_unimplemented_package_manager "--uninstall" pm
|
||||
diff --git a/common/mltools/on_exit.ml b/common/mltools/on_exit.ml
|
||||
index 53ccb68a..cae12e73 100644
|
||||
--- a/common/mltools/on_exit.ml
|
||||
+++ b/common/mltools/on_exit.ml
|
||||
@@ -52,7 +52,7 @@ let do_actions () =
|
||||
List.iter (do_action (fun file -> Unix.unlink file)) !files;
|
||||
List.iter (do_action (
|
||||
fun dir ->
|
||||
- let cmd = sprintf "rm -rf %s" (Filename.quote dir) in
|
||||
+ let cmd = sprintf "rm -rf -- %s" (Filename.quote dir) in
|
||||
ignore (Tools_utils.shell_command cmd)
|
||||
)
|
||||
) !rmdirs;
|
||||
@@ -102,7 +102,7 @@ let unlink filename =
|
||||
register ();
|
||||
List.push_front filename files
|
||||
|
||||
-let rmdir dir =
|
||||
+let rm_rf dir =
|
||||
register ();
|
||||
List.push_front dir rmdirs
|
||||
|
||||
diff --git a/common/mltools/on_exit.mli b/common/mltools/on_exit.mli
|
||||
index a02e3db3..9bcf104f 100644
|
||||
--- a/common/mltools/on_exit.mli
|
||||
+++ b/common/mltools/on_exit.mli
|
||||
@@ -47,7 +47,7 @@ val f : (unit -> unit) -> unit
|
||||
val unlink : string -> unit
|
||||
(** Unlink a single temporary file on exit. *)
|
||||
|
||||
-val rmdir : string -> unit
|
||||
+val rm_rf : string -> unit
|
||||
(** Recursively remove a temporary directory on exit (using [rm -rf]). *)
|
||||
|
||||
val kill : ?signal:int -> int -> unit
|
||||
diff --git a/input/OVA.ml b/input/OVA.ml
|
||||
index 9e9c3712..09ceee98 100644
|
||||
--- a/input/OVA.ml
|
||||
+++ b/input/OVA.ml
|
||||
@@ -78,7 +78,7 @@ let rec parse_ova ova =
|
||||
else (
|
||||
let tmpdir =
|
||||
let t = Mkdtemp.temp_dir ~base_dir:large_tmpdir "ova." in
|
||||
- On_exit.rmdir t;
|
||||
+ On_exit.rm_rf t;
|
||||
t in
|
||||
|
||||
match detect_file_type ova with
|
||||
diff --git a/input/parse_domain_from_vmx.ml b/input/parse_domain_from_vmx.ml
|
||||
index 947ca414..7aca2c24 100644
|
||||
--- a/input/parse_domain_from_vmx.ml
|
||||
+++ b/input/parse_domain_from_vmx.ml
|
||||
@@ -375,7 +375,7 @@ and find_nics vmx =
|
||||
let parse_domain_from_vmx vmx_source =
|
||||
let tmpdir =
|
||||
let t = Mkdtemp.temp_dir "vmx." in
|
||||
- On_exit.rmdir t;
|
||||
+ On_exit.rm_rf t;
|
||||
t in
|
||||
|
||||
(* If the transport is SSH, fetch the file from remote, else
|
||||
diff --git a/lib/nbdkit.ml b/lib/nbdkit.ml
|
||||
index 07896684..1137b6bb 100644
|
||||
--- a/lib/nbdkit.ml
|
||||
+++ b/lib/nbdkit.ml
|
||||
@@ -105,7 +105,7 @@ let add_filter_if_available cmd filter =
|
||||
let run_unix socket cmd =
|
||||
(* Create a temporary directory where we place the PID file. *)
|
||||
let piddir = Mkdtemp.temp_dir "v2vnbdkit." in
|
||||
- On_exit.rmdir piddir;
|
||||
+ On_exit.rm_rf piddir;
|
||||
|
||||
let id = unique () in
|
||||
let pidfile = piddir // sprintf "nbdkit%d.pid" id in
|
||||
diff --git a/lib/qemuNBD.ml b/lib/qemuNBD.ml
|
||||
index bbb65f41..c3dd1666 100644
|
||||
--- a/lib/qemuNBD.ml
|
||||
+++ b/lib/qemuNBD.ml
|
||||
@@ -69,7 +69,7 @@ let run_unix socket { disk; snapshot; format; imgopts } =
|
||||
|
||||
(* Create a temporary directory where we place the PID file. *)
|
||||
let piddir = Mkdtemp.temp_dir "v2vqemunbd." in
|
||||
- On_exit.rmdir piddir;
|
||||
+ On_exit.rm_rf piddir;
|
||||
|
||||
let id = unique () in
|
||||
let pidfile = piddir // sprintf "qemunbd%d.pid" id in
|
||||
diff --git a/lib/utils.ml b/lib/utils.ml
|
||||
index 7116a4f9..84b9a93f 100644
|
||||
--- a/lib/utils.ml
|
||||
+++ b/lib/utils.ml
|
||||
@@ -204,7 +204,7 @@ let error_if_no_ssh_agent () =
|
||||
let create_v2v_directory () =
|
||||
let d = Mkdtemp.temp_dir "v2v." in
|
||||
chown_for_libvirt_rhbz_1045069 d;
|
||||
- On_exit.rmdir d;
|
||||
+ On_exit.rm_rf d;
|
||||
d
|
||||
|
||||
(* Wait for a file to appear until a timeout. *)
|
||||
diff --git a/output/python_script.ml b/output/python_script.ml
|
||||
index 54ccd1b5..ecf46c2d 100644
|
||||
--- a/output/python_script.ml
|
||||
+++ b/output/python_script.ml
|
||||
@@ -33,7 +33,7 @@ type script = {
|
||||
|
||||
let create ?(name = "script.py") code =
|
||||
let tmpdir = Mkdtemp.temp_dir "v2v." in
|
||||
- On_exit.rmdir tmpdir;
|
||||
+ On_exit.rm_rf tmpdir;
|
||||
let path = tmpdir // name in
|
||||
with_open_out path (fun chan -> output_string chan code);
|
||||
{ tmpdir; path }
|
@ -1,171 +0,0 @@
|
||||
From 0d92a42aab3fb0e7569294675666976724156128 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 14 Jul 2022 13:15:49 +0100
|
||||
Subject: [PATCH] -o rhv: Unmount the temporary NFS mountpoint as late as
|
||||
possible
|
||||
|
||||
To partially avoid a potential race against nbdkit or qemu-nbd
|
||||
releasing files on the mountpoint before they exit, unmount as late as
|
||||
we can.
|
||||
|
||||
See also https://bugzilla.redhat.com/show_bug.cgi?id=1953286#c26
|
||||
|
||||
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
|
||||
(cherry picked from commit e96357fc3b26aaf96eaa21afa36c894a27af6261)
|
||||
---
|
||||
common | 2 +-
|
||||
output/output_rhv.ml | 4 ++--
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
Submodule common fd964c1b..1000604f:
|
||||
diff --git a/common/mltools/on_exit.ml b/common/mltools/on_exit.ml
|
||||
index cae12e73..f8ef74e1 100644
|
||||
--- a/common/mltools/on_exit.ml
|
||||
+++ b/common/mltools/on_exit.ml
|
||||
@@ -23,39 +23,39 @@ open Common_gettext.Gettext
|
||||
open Unix
|
||||
open Printf
|
||||
|
||||
-(* List of files to unlink. *)
|
||||
-let files = ref []
|
||||
+type action =
|
||||
+ | Unlink of string (* filename *)
|
||||
+ | Rm_rf of string (* directory *)
|
||||
+ | Kill of int * int (* signal, pid *)
|
||||
+ | Fn of (unit -> unit) (* generic function *)
|
||||
|
||||
-(* List of directories to remove. *)
|
||||
-let rmdirs = ref []
|
||||
-
|
||||
-(* List of PIDs to kill. *)
|
||||
-let kills = ref []
|
||||
-
|
||||
-(* List of functions to call. *)
|
||||
-let fns = ref []
|
||||
+(* List of (priority, action). *)
|
||||
+let actions = ref []
|
||||
|
||||
(* Perform a single exit action, printing any exception but
|
||||
* otherwise ignoring failures.
|
||||
*)
|
||||
-let do_action f arg =
|
||||
- try f arg with exn -> debug "%s" (Printexc.to_string exn)
|
||||
+let do_action action =
|
||||
+ try
|
||||
+ match action with
|
||||
+ | Unlink file -> Unix.unlink file
|
||||
+ | Rm_rf dir ->
|
||||
+ let cmd = sprintf "rm -rf -- %s" (Filename.quote dir) in
|
||||
+ ignore (Tools_utils.shell_command cmd)
|
||||
+ | Kill (signal, pid) ->
|
||||
+ kill pid signal
|
||||
+ | Fn f -> f ()
|
||||
+ with exn -> debug "%s" (Printexc.to_string exn)
|
||||
|
||||
(* Make sure the actions are performed only once. *)
|
||||
let done_actions = ref false
|
||||
|
||||
-(* Perform the exit actions. *)
|
||||
+(* Perform the exit actions in priority order (lowest prio first). *)
|
||||
let do_actions () =
|
||||
if not !done_actions then (
|
||||
- List.iter (do_action (fun f -> f ())) !fns;
|
||||
- List.iter (do_action (fun (signal, pid) -> kill pid signal)) !kills;
|
||||
- List.iter (do_action (fun file -> Unix.unlink file)) !files;
|
||||
- List.iter (do_action (
|
||||
- fun dir ->
|
||||
- let cmd = sprintf "rm -rf -- %s" (Filename.quote dir) in
|
||||
- ignore (Tools_utils.shell_command cmd)
|
||||
- )
|
||||
- ) !rmdirs;
|
||||
+ let actions = List.sort (fun (a, _) (b, _) -> compare a b) !actions in
|
||||
+ let actions = List.map snd actions in
|
||||
+ List.iter do_action actions
|
||||
);
|
||||
done_actions := true
|
||||
|
||||
@@ -94,18 +94,18 @@ let register () =
|
||||
);
|
||||
registered := true
|
||||
|
||||
-let f fn =
|
||||
+let f ?(prio = 5000) fn =
|
||||
register ();
|
||||
- List.push_front fn fns
|
||||
+ List.push_front (prio, Fn fn) actions
|
||||
|
||||
-let unlink filename =
|
||||
+let unlink ?(prio = 5000) filename =
|
||||
register ();
|
||||
- List.push_front filename files
|
||||
+ List.push_front (prio, Unlink filename) actions
|
||||
|
||||
-let rm_rf dir =
|
||||
+let rm_rf ?(prio = 5000) dir =
|
||||
register ();
|
||||
- List.push_front dir rmdirs
|
||||
+ List.push_front (prio, Rm_rf dir) actions
|
||||
|
||||
-let kill ?(signal = Sys.sigterm) pid =
|
||||
+let kill ?(prio = 5000) ?(signal = Sys.sigterm) pid =
|
||||
register ();
|
||||
- List.push_front (signal, pid) kills
|
||||
+ List.push_front (prio, Kill (signal, pid)) actions
|
||||
diff --git a/common/mltools/on_exit.mli b/common/mltools/on_exit.mli
|
||||
index 9bcf104f..66a85542 100644
|
||||
--- a/common/mltools/on_exit.mli
|
||||
+++ b/common/mltools/on_exit.mli
|
||||
@@ -28,6 +28,12 @@
|
||||
killing another process, so we provide simple
|
||||
wrappers for those common actions here.
|
||||
|
||||
+ Actions can be ordered by setting the optional [?prio]
|
||||
+ parameter in the range 0..9999. By default actions
|
||||
+ have priority 5000. Lower numbered actions run first.
|
||||
+ Higher numbered actions run last. So to have an action
|
||||
+ run at the very end before exit you might use [~prio:9999]
|
||||
+
|
||||
Note this module registers signal handlers for
|
||||
SIGINT, SIGQUIT, SIGTERM and SIGHUP. This means
|
||||
that any program that links with mltools.cmxa
|
||||
@@ -39,18 +45,20 @@
|
||||
Your cleanup action might no longer run unless the
|
||||
program calls {!Stdlib.exit}. *)
|
||||
|
||||
-val f : (unit -> unit) -> unit
|
||||
+val f : ?prio:int -> (unit -> unit) -> unit
|
||||
(** Register a function [f] which runs when the program exits.
|
||||
Similar to [Stdlib.at_exit] but also runs if the program is
|
||||
- killed with a signal that we can catch. *)
|
||||
+ killed with a signal that we can catch.
|
||||
|
||||
-val unlink : string -> unit
|
||||
+ [?prio] is the priority, default 5000. See the description above. *)
|
||||
+
|
||||
+val unlink : ?prio:int -> string -> unit
|
||||
(** Unlink a single temporary file on exit. *)
|
||||
|
||||
-val rm_rf : string -> unit
|
||||
+val rm_rf : ?prio:int -> string -> unit
|
||||
(** Recursively remove a temporary directory on exit (using [rm -rf]). *)
|
||||
|
||||
-val kill : ?signal:int -> int -> unit
|
||||
+val kill : ?prio:int -> ?signal:int -> int -> unit
|
||||
(** Kill [PID] on exit. The signal sent defaults to [Sys.sigterm].
|
||||
|
||||
Use this with care since you can end up unintentionally killing
|
||||
diff --git a/output/output_rhv.ml b/output/output_rhv.ml
|
||||
index 8571e07b..15a2c14a 100644
|
||||
--- a/output/output_rhv.ml
|
||||
+++ b/output/output_rhv.ml
|
||||
@@ -204,8 +204,8 @@ module RHV = struct
|
||||
if run_command cmd <> 0 then
|
||||
error (f_"mount command failed, see earlier errors.\n\nThis probably means you didn't specify the right %s path [-os %s], or else you need to rerun virt-v2v as root.") domain_class os;
|
||||
|
||||
- (* Make sure it is unmounted at exit. *)
|
||||
- On_exit.f (
|
||||
+ (* Make sure it is unmounted at exit, as late as possible (prio=9999) *)
|
||||
+ On_exit.f ~prio:9999 (
|
||||
fun () ->
|
||||
let cmd = [ "umount"; mp ] in
|
||||
ignore (run_command cmd);
|
@ -1,179 +0,0 @@
|
||||
From 96efdcf54c887ae88d54332df12a5f5dd962fd0a Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 15 Jul 2022 11:25:45 +0100
|
||||
Subject: [PATCH] output: Permit output modes to wait on the local NBD server
|
||||
|
||||
Output.output_to_local_file is used by several output modes that write
|
||||
to local files or devices. It launches an instance of qemu-nbd or
|
||||
nbdkit connected to the local file.
|
||||
|
||||
Previously we unconditionally added an On_exit handler to kill the NBD
|
||||
server. This is usually safe because nbdcopy --flush has guaranteed
|
||||
that the data was written through to permanent storage, and so killing
|
||||
the NBD server is just there to prevent orphaned processes.
|
||||
|
||||
However for output to RHV (-o rhv) we actually need the NBD server to
|
||||
be cleaned up before we exit. See the analysis here:
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1953286#c26
|
||||
|
||||
Allow an alternate strategy of waiting for the NBD server to exit
|
||||
during virt-v2v shutdown.
|
||||
|
||||
We only need this in virt-v2v so implement it here instead of pushing
|
||||
it all the way into the On_exit module.
|
||||
|
||||
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
|
||||
(cherry picked from commit e2a1a7b4dfb6a9e44260da10a7e7029c09753b5c)
|
||||
---
|
||||
output/output.ml | 91 ++++++++++++++++++++++++++++-------------------
|
||||
output/output.mli | 17 +++++++--
|
||||
2 files changed, 69 insertions(+), 39 deletions(-)
|
||||
|
||||
diff --git a/output/output.ml b/output/output.ml
|
||||
index 496c32b6..8f83a324 100644
|
||||
--- a/output/output.ml
|
||||
+++ b/output/output.ml
|
||||
@@ -69,7 +69,10 @@ let error_if_disk_count_gt dir n =
|
||||
if Sys.file_exists socket then
|
||||
error (f_"this output module doesn't support copying more than %d disks") n
|
||||
|
||||
+type on_exit_kill = Kill | KillAndWait
|
||||
+
|
||||
let output_to_local_file ?(changeuid = fun f -> f ()) ?(compressed = false)
|
||||
+ ?(on_exit_kill = Kill)
|
||||
output_alloc output_format filename size socket =
|
||||
(* Check nbdkit is installed and has the required plugin. *)
|
||||
if not (Nbdkit.is_installed ()) then
|
||||
@@ -94,46 +97,60 @@ let output_to_local_file ?(changeuid = fun f -> f ()) ?(compressed = false)
|
||||
fun () -> g#disk_create ?preallocation filename output_format size
|
||||
);
|
||||
|
||||
- match output_format with
|
||||
- | "raw" ->
|
||||
- let cmd = Nbdkit.create "file" in
|
||||
- Nbdkit.add_arg cmd "file" filename;
|
||||
- if Nbdkit.version nbdkit_config >= (1, 22, 0) then (
|
||||
- let cmd = Nbdkit.add_arg cmd "cache" "none" in
|
||||
- cmd
|
||||
- );
|
||||
- let _, pid = Nbdkit.run_unix socket cmd in
|
||||
+ let pid =
|
||||
+ match output_format with
|
||||
+ | "raw" ->
|
||||
+ let cmd = Nbdkit.create "file" in
|
||||
+ Nbdkit.add_arg cmd "file" filename;
|
||||
+ if Nbdkit.version nbdkit_config >= (1, 22, 0) then (
|
||||
+ let cmd = Nbdkit.add_arg cmd "cache" "none" in
|
||||
+ cmd
|
||||
+ );
|
||||
+ let _, pid = Nbdkit.run_unix socket cmd in
|
||||
+ pid
|
||||
|
||||
- (* --exit-with-parent should ensure nbdkit is cleaned
|
||||
- * up when we exit, but it's not supported everywhere.
|
||||
- *)
|
||||
- On_exit.kill pid
|
||||
+ | "qcow2" ->
|
||||
+ let cmd =
|
||||
+ if compressed then (
|
||||
+ let qemu_quote str = String.replace str "," ",," in
|
||||
+ let image_opts = [ "driver=compress";
|
||||
+ "file.driver=qcow2";
|
||||
+ "file.file.driver=file";
|
||||
+ "file.file.filename=" ^ qemu_quote filename ] in
|
||||
+ let image_opts = String.concat "," image_opts in
|
||||
+ let cmd = QemuNBD.create image_opts in
|
||||
+ QemuNBD.set_image_opts cmd true;
|
||||
+ cmd
|
||||
+ )
|
||||
+ else (* not compressed *) (
|
||||
+ let cmd = QemuNBD.create filename in
|
||||
+ QemuNBD.set_format cmd (Some "qcow2");
|
||||
+ cmd
|
||||
+ ) in
|
||||
+ QemuNBD.set_snapshot cmd false;
|
||||
+ let _, pid = QemuNBD.run_unix socket cmd in
|
||||
+ pid
|
||||
|
||||
- | "qcow2" ->
|
||||
- let cmd =
|
||||
- if compressed then (
|
||||
- let qemu_quote str = String.replace str "," ",," in
|
||||
- let image_opts = [ "driver=compress";
|
||||
- "file.driver=qcow2";
|
||||
- "file.file.driver=file";
|
||||
- "file.file.filename=" ^ qemu_quote filename ] in
|
||||
- let image_opts = String.concat "," image_opts in
|
||||
- let cmd = QemuNBD.create image_opts in
|
||||
- QemuNBD.set_image_opts cmd true;
|
||||
- cmd
|
||||
- )
|
||||
- else (* not compressed *) (
|
||||
- let cmd = QemuNBD.create filename in
|
||||
- QemuNBD.set_format cmd (Some "qcow2");
|
||||
- cmd
|
||||
- ) in
|
||||
- QemuNBD.set_snapshot cmd false;
|
||||
- let _, pid = QemuNBD.run_unix socket cmd in
|
||||
- On_exit.kill pid
|
||||
+ | _ ->
|
||||
+ error (f_"output mode only supports raw or qcow2 format (format: %s)")
|
||||
+ output_format in
|
||||
+
|
||||
+ match on_exit_kill with
|
||||
+ | Kill ->
|
||||
+ (* Kill the NBD server on exit. (For nbdkit we use --exit-with-parent
|
||||
+ * but it's not supported everywhere).
|
||||
+ *)
|
||||
+ On_exit.kill pid
|
||||
|
||||
- | _ ->
|
||||
- error (f_"output mode only supports raw or qcow2 format (format: %s)")
|
||||
- output_format
|
||||
+ | KillAndWait ->
|
||||
+ On_exit.f (
|
||||
+ fun () ->
|
||||
+ kill pid Sys.sigterm;
|
||||
+ (* Errors from the NBD server don't matter. On successful
|
||||
+ * completion we've already committed the data to disk.
|
||||
+ *)
|
||||
+ ignore (waitpid [] pid)
|
||||
+ )
|
||||
|
||||
let disk_path os name i =
|
||||
let outdisk = sprintf "%s/%s-sd%s" os name (drive_name i) in
|
||||
diff --git a/output/output.mli b/output/output.mli
|
||||
index c1f0f53d..c4486311 100644
|
||||
--- a/output/output.mli
|
||||
+++ b/output/output.mli
|
||||
@@ -83,14 +83,27 @@ val error_if_disk_count_gt : string -> int -> unit
|
||||
"in[n]" in the v2v directory [dir]. If the socket exists, [error] is
|
||||
called. *)
|
||||
|
||||
+type on_exit_kill = Kill | KillAndWait
|
||||
+
|
||||
val output_to_local_file : ?changeuid:((unit -> unit) -> unit) ->
|
||||
- ?compressed:bool ->
|
||||
+ ?compressed:bool -> ?on_exit_kill:on_exit_kill ->
|
||||
Types.output_allocation ->
|
||||
string -> string -> int64 -> string ->
|
||||
unit
|
||||
(** When an output mode wants to create a local file with a
|
||||
particular format (only "raw" or "qcow2" allowed) then
|
||||
- this common function can be used. *)
|
||||
+ this common function can be used.
|
||||
+
|
||||
+ Optional parameter [?on_exit_kill] controls how the NBD server
|
||||
+ is cleaned up. The default is {!Kill} which registers an
|
||||
+ {!On_exit.kill} handler that kills (but does not wait for)
|
||||
+ the server when virt-v2v exits. Most callers should use this.
|
||||
+
|
||||
+ Setting [~on_exit_kill:KillAndWait] should be used if the NBD
|
||||
+ server must fully exit before we continue with the rest of
|
||||
+ virt-v2v shut down. This is only necessary if some other action
|
||||
+ (such as unmounting a host filesystem or removing a host device)
|
||||
+ depends on the NBD server releasing resources. *)
|
||||
|
||||
val disk_path : string -> string -> int -> string
|
||||
(** For [-o disk|qemu], return the output disk name of the i'th disk,
|
@ -1,33 +0,0 @@
|
||||
From f820585c37beb648ab856818179091349a604523 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 15 Jul 2022 11:37:46 +0100
|
||||
Subject: [PATCH] -o rhv: Wait for the NBD server to exit to avoid a race with
|
||||
unmounting
|
||||
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1953286#c26
|
||||
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
|
||||
(cherry picked from commit 2fbd578b4e6884a23063ad67ee36f02c4eb6c668)
|
||||
---
|
||||
output/output_rhv.ml | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/output/output_rhv.ml b/output/output_rhv.ml
|
||||
index 15a2c14a..45f831e3 100644
|
||||
--- a/output/output_rhv.ml
|
||||
+++ b/output/output_rhv.ml
|
||||
@@ -175,7 +175,14 @@ module RHV = struct
|
||||
chmod filename 0o666
|
||||
)
|
||||
in
|
||||
- output_to_local_file ~changeuid
|
||||
+
|
||||
+ (* We have to wait for the NBD server to exit rather than just
|
||||
+ * killing it, otherwise it races with unmounting. See:
|
||||
+ * https://bugzilla.redhat.com/show_bug.cgi?id=1953286#c26
|
||||
+ *)
|
||||
+ let on_exit_kill = Output.KillAndWait in
|
||||
+
|
||||
+ output_to_local_file ~changeuid ~on_exit_kill
|
||||
output_alloc output_format filename size socket
|
||||
) (List.combine disks filenames);
|
||||
|
@ -1,66 +0,0 @@
|
||||
From 29c6ee9322da082e3be9faa94cf4a6840b49cd97 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Fri, 22 Jul 2022 09:36:27 +0200
|
||||
Subject: [PATCH] output/create_libvirt_xml: relax VCPU feature checking for
|
||||
"qemu64"
|
||||
|
||||
When the source domain doesn't specify a VCPU model ("s_cpu_model" is
|
||||
None), and the guest OS is assumed to work with the default VCPU model
|
||||
("gcaps_default_cpu" is true), we don't output any <cpu> element. In that
|
||||
case, libvirtd augments the domain config with:
|
||||
|
||||
[1] <cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
</cpu>
|
||||
|
||||
where the @check='none' attribute ensures that the converted domain will
|
||||
be launched, for example, on an Intel host, despite the "qemu64" VCPU
|
||||
model containing AMD-only feature flags such as "svm".
|
||||
|
||||
However, if the source domain explicitly specifies the "qemu64" model
|
||||
(mostly seen with "-i libvirt -ic qemu://..."), we presently output
|
||||
|
||||
[2] <cpu match='minimum'>
|
||||
<model fallback='allow'>qemu64</model>
|
||||
</cpu>
|
||||
|
||||
which libvirtd completes as
|
||||
|
||||
[3] <cpu mode='custom' match='minimum' check='partial'>
|
||||
<model fallback='allow'>qemu64</model>
|
||||
</cpu>
|
||||
|
||||
In [3], cpu/@match='minimum' and cpu/model/@fallback='allow' are both
|
||||
laxer than @match='exact' and @fallback='forbid', respectively, in [1].
|
||||
|
||||
However, cpu/@check='partial' in [3] is stricter than @check='none' in
|
||||
[1]; it causes libvirtd to catch the "svm" feature flag on an Intel host,
|
||||
and prevents the converted domain from starting.
|
||||
|
||||
The "qemu64" VCPU model is supposed to run on every possible host
|
||||
<https://gitlab.com/qemu-project/qemu/-/blob/master/docs/system/cpu-models-x86.rst.inc>,
|
||||
therefore make an exception for the explicitly specified "qemu64" VCPU
|
||||
model, and generate the @check='none' attribute.
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2107503
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20220722073627.6511-1-lersek@redhat.com>
|
||||
Acked-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit e5297c3180fd3ebea41a40f4c5a66969a24b9ff3)
|
||||
---
|
||||
output/create_libvirt_xml.ml | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/output/create_libvirt_xml.ml b/output/create_libvirt_xml.ml
|
||||
index 531a4f75..bd01304d 100644
|
||||
--- a/output/create_libvirt_xml.ml
|
||||
+++ b/output/create_libvirt_xml.ml
|
||||
@@ -192,6 +192,8 @@ let create_libvirt_xml ?pool source inspect
|
||||
List.push_back cpu_attrs ("mode", "host-passthrough");
|
||||
| Some model ->
|
||||
List.push_back cpu_attrs ("match", "minimum");
|
||||
+ if model = "qemu64" then
|
||||
+ List.push_back cpu_attrs ("check", "none");
|
||||
(match source.s_cpu_vendor with
|
||||
| None -> ()
|
||||
| Some vendor ->
|
@ -1,59 +0,0 @@
|
||||
From 9e1c78a4dda8e8f504fd8f01d7ff5a02e6d3b8ff Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Fri, 29 Jul 2022 12:57:03 +0200
|
||||
Subject: [PATCH] input-xen: cover RHEL9 OpenSSL crypto settings
|
||||
|
||||
In [master] commit af4a0454cdd2 ("input-xen: replace "enable LEGACY
|
||||
crypto" advice with targeted ssh options", 2022-07-11), we documented how
|
||||
the libssh / openssh crypto settings needed to be relaxed, for connecting
|
||||
to RHEL5 sshd. [rhel-9.1 commit: 3f7f730ac9cb.]
|
||||
|
||||
It turns out that in RHEL9, the non-LEGACY crypto policies disable SHA1 in
|
||||
signature algorithms even at the OpenSSL level. Explain how the user can
|
||||
re-enable that separately, for individual virt-v2v invocations.
|
||||
|
||||
The method depends on Rich's libvirt commit 45912ac399ab ("rpc: Pass
|
||||
OPENSSL_CONF through to ssh invocations", 2022-07-25), which is is going
|
||||
to be released in upstream libvirt v8.6.0.
|
||||
|
||||
Thanks: Dmitry Belyavskiy & Rich Jones
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2062360
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20220729105703.10150-1-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit ddab06d5eb99696f5fd1073b8ec91efbc8c3e4ab)
|
||||
---
|
||||
docs/virt-v2v-input-xen.pod | 20 ++++++++++++++++++++
|
||||
1 file changed, 20 insertions(+)
|
||||
|
||||
diff --git a/docs/virt-v2v-input-xen.pod b/docs/virt-v2v-input-xen.pod
|
||||
index 1775fc31..9c3981e1 100644
|
||||
--- a/docs/virt-v2v-input-xen.pod
|
||||
+++ b/docs/virt-v2v-input-xen.pod
|
||||
@@ -54,6 +54,26 @@ new one. Virt-v2v uses both C<libssh> and C<ssh> when converting a guest
|
||||
from Xen, and on some operating systems, C<libssh> and C<ssh> may not
|
||||
both accept the same option variant.)
|
||||
|
||||
+When connecting to RHEL 5 sshd from RHEL 9, the SHA1 algorithm's use in
|
||||
+signatures has to be re-enabled at the OpenSSL level, in addition to the
|
||||
+above SSH configuration. Create a file called F<$HOME/openssl-sha1.cnf>
|
||||
+with the following contents:
|
||||
+
|
||||
+ .include /etc/ssl/openssl.cnf
|
||||
+ [openssl_init]
|
||||
+ alg_section = evp_properties
|
||||
+ [evp_properties]
|
||||
+ rh-allow-sha1-signatures = yes
|
||||
+
|
||||
+and export the following variable into the environment of the
|
||||
+C<virt-v2v> process:
|
||||
+
|
||||
+ OPENSSL_CONF=$HOME/openssl-sha1.cnf
|
||||
+
|
||||
+Note that the C<OPENSSL_CONF> environment variable will only take effect
|
||||
+if the libvirt client library used by virt-v2v is at least version
|
||||
+8.6.0.
|
||||
+
|
||||
=head2 Test libvirt connection to remote Xen host
|
||||
|
||||
Use the L<virsh(1)> command to list the guests on the remote Xen host:
|
@ -1,46 +0,0 @@
|
||||
From 83fc438139c49ffae330d5caeece1e52bcb1d18e Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Fri, 5 Aug 2022 10:44:26 +0200
|
||||
Subject: [PATCH] convert_linux: remove LVM2 "devices file"
|
||||
|
||||
A recent feature of LVM2 is the "devices file"
|
||||
<https://man7.org/linux/man-pages/man8/lvmdevices.8.html>. It speeds up
|
||||
LVM2 PV discovery on a normal system, but an old devices file in a
|
||||
converted domain (with different hardware) can prevent the assembly of
|
||||
volume groups.
|
||||
|
||||
In particular, when converting a physical system to a guest with virt-p2v,
|
||||
the original system will have used "sys_wwid"-type identifiers in the LVM2
|
||||
devices file, and those are guaranteed not to match any virtio-blk disks
|
||||
in the output domain.
|
||||
|
||||
We've seen a similar issue in the past under RHBZ#1164853, so just extend
|
||||
the same scrubbing with the new pathname.
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2112801
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20220805084426.9200-1-lersek@redhat.com>
|
||||
Acked-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit 8e4b732e8b4343c169c658338da53fb0ede7e512)
|
||||
---
|
||||
convert/convert_linux.ml | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/convert/convert_linux.ml b/convert/convert_linux.ml
|
||||
index a66ff1e4..2aaa438e 100644
|
||||
--- a/convert/convert_linux.ml
|
||||
+++ b/convert/convert_linux.ml
|
||||
@@ -1402,11 +1402,11 @@ let convert (g : G.guestfs) source inspect keep_serial_console _ =
|
||||
* device names. blkid will rebuild these on demand.
|
||||
*
|
||||
* Delete the LVM cache since it will contain references to the
|
||||
- * old devices (RHBZ#1164853).
|
||||
+ * old devices (RHBZ#1164853, RHBZ#2112801).
|
||||
*)
|
||||
List.iter g#rm_f [
|
||||
"/etc/blkid/blkid.tab"; "/etc/blkid.tab";
|
||||
- "/etc/lvm/cache/.cache"
|
||||
+ "/etc/lvm/cache/.cache"; "/etc/lvm/devices/system.devices"
|
||||
];
|
||||
in
|
||||
|
@ -1,48 +0,0 @@
|
||||
From 380fa6663e9b373d87e446fc03601e9e44f985f6 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 9 Aug 2022 19:09:08 +0100
|
||||
Subject: [PATCH] convert: linux: Add support for Zstandard compressed kernel
|
||||
modules
|
||||
|
||||
OpenSUSE uses *.ko.zst for kernel modules. This commit adds support
|
||||
in the same way as the existing support for *.ko.xz. Note this
|
||||
requires a corresponding change to libguestfs to support Zstandard
|
||||
compression in the guestfs_file_architecture API:
|
||||
|
||||
https://github.com/libguestfs/libguestfs/commit/0e784824e82a88e522873fec5db1a11943d637ed
|
||||
|
||||
Reported-by: Xiaodai Wang
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2116811
|
||||
(cherry picked from commit 315c016dbea899587649a4bbf1865390cb4e1d3c)
|
||||
---
|
||||
convert/linux_kernels.ml | 10 +++++++---
|
||||
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/convert/linux_kernels.ml b/convert/linux_kernels.ml
|
||||
index 307de572..6e9d2bdd 100644
|
||||
--- a/convert/linux_kernels.ml
|
||||
+++ b/convert/linux_kernels.ml
|
||||
@@ -65,8 +65,8 @@ let print_kernel_info chan prefix ki =
|
||||
ki.ki_supports_isa_pvpanic ki.ki_supports_virtio_socket
|
||||
ki.ki_is_xen_pv_only_kernel ki.ki_is_debug
|
||||
|
||||
-let rex_ko = PCRE.compile "\\.k?o(?:\\.xz)?$"
|
||||
-let rex_ko_extract = PCRE.compile "/([^/]+)\\.k?o(?:\\.xz)?$"
|
||||
+let rex_ko = PCRE.compile "\\.k?o(?:\\.(?:xz|zst))?$"
|
||||
+let rex_ko_extract = PCRE.compile "/([^/]+)\\.k?o(?:\\.(?:xz|zst))?$"
|
||||
|
||||
let detect_kernels (g : G.guestfs) inspect family bootloader =
|
||||
(* What kernel/kernel-like packages are installed on the current guest? *)
|
||||
@@ -203,7 +203,11 @@ let detect_kernels (g : G.guestfs) inspect family bootloader =
|
||||
let all_candidates = List.flatten (
|
||||
List.map (
|
||||
fun f ->
|
||||
- [ "/" ^ f ^ ".o"; "/" ^ f ^ ".ko"; "/" ^ f ^ ".ko.xz" ]
|
||||
+ [ "/" ^ f ^ ".o";
|
||||
+ "/" ^ f ^ ".ko";
|
||||
+ "/" ^ f ^ ".ko.xz";
|
||||
+ "/" ^ f ^ ".ko.zst";
|
||||
+ ]
|
||||
) candidates
|
||||
) in
|
||||
let candidate =
|
@ -1,98 +0,0 @@
|
||||
From 7dd396af54df3f7563aa3a42b3c17547710aec67 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Wed, 17 Aug 2022 16:47:36 +0200
|
||||
Subject: [PATCH] convert_linux: start the QEMU guest agent in a
|
||||
distro-specific way
|
||||
|
||||
The current command "service <package-name> start" does not apply to
|
||||
RHEL-6; the service name ("qemu-ga") differs from the package name
|
||||
("qemu-guest-agent") there.
|
||||
|
||||
Overhaul the logic -- detach the command from the package name; cover the
|
||||
RHEL, ALT, SUSE and Debian families separately. Remove the "chkconfig"
|
||||
command, as in all tested / investigated cases, it is unnecessary.
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2028764
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20220817144736.18850-1-lersek@redhat.com>
|
||||
Acked-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit ad2b4f2e50950a5798a75359badb526290aa92e7)
|
||||
---
|
||||
convert/convert_linux.ml | 56 ++++++++++++++++++++++++++++------------
|
||||
1 file changed, 40 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/convert/convert_linux.ml b/convert/convert_linux.ml
|
||||
index 2aaa438e..b8e9ad15 100644
|
||||
--- a/convert/convert_linux.ml
|
||||
+++ b/convert/convert_linux.ml
|
||||
@@ -66,6 +66,34 @@ let convert (g : G.guestfs) source inspect keep_serial_console _ =
|
||||
| _ -> None
|
||||
in
|
||||
|
||||
+ let qga_svc_start_cmd family distro major =
|
||||
+ match family, distro, major with
|
||||
+ | `RHEL_family, ( "rhel" | "centos" | "scientificlinux" | "redhat-based" |
|
||||
+ "oraclelinux" ), 6 ->
|
||||
+ (* https://bugzilla.redhat.com/show_bug.cgi?id=2028764#c52 *)
|
||||
+ Some "service qemu-ga start"
|
||||
+
|
||||
+ | `RHEL_family, _, _ ->
|
||||
+ (* https://bugzilla.redhat.com/show_bug.cgi?id=2028764#c52 *)
|
||||
+ Some "systemctl start qemu-guest-agent"
|
||||
+
|
||||
+ | `ALT_family, _, _ ->
|
||||
+ (* https://bugzilla.redhat.com/show_bug.cgi?id=2028764#c45 *)
|
||||
+ Some "systemctl start qemu-guest-agent"
|
||||
+
|
||||
+ | `SUSE_family, _, _ ->
|
||||
+ (* https://bugzilla.redhat.com/show_bug.cgi?id=2028764#c51 *)
|
||||
+ None
|
||||
+
|
||||
+ | `Debian_family, _, _ ->
|
||||
+ (* https://bugzilla.redhat.com/show_bug.cgi?id=2028764#c42 *)
|
||||
+ Some "service qemu-guest-agent start"
|
||||
+
|
||||
+ | _ ->
|
||||
+ (* should never be called when "qga_pkg_of_family" returns None *)
|
||||
+ assert false
|
||||
+ in
|
||||
+
|
||||
assert (inspect.i_package_format = "rpm" || inspect.i_package_format = "deb");
|
||||
|
||||
(* Fail early if i_apps is empty. Certain steps such as kernel
|
||||
@@ -615,23 +643,19 @@ let convert (g : G.guestfs) source inspect keep_serial_console _ =
|
||||
\ \ rm -f %s\n\
|
||||
fi\n" selinux_enforcing selinux_enforcing);
|
||||
|
||||
- (* Start the agent now and at subsequent boots. The following
|
||||
- * commands should work on both sysvinit distros / distro versions
|
||||
- * (regardless of "/etc/rc.d/" vs. "/etc/init.d/" being the scheme
|
||||
- * in use) and systemd distros (via redirection to systemctl).
|
||||
- *
|
||||
- * On distros where the chkconfig command is redirected to
|
||||
- * systemctl, the chkconfig command is likely superfluous. That's
|
||||
- * because on systemd distros, the QGA package comes with such
|
||||
- * runtime dependencies / triggers that the presence of the
|
||||
- * virtio-serial port named "org.qemu.guest_agent.0" automatically
|
||||
- * starts the agent during (second and later) boots. However, even
|
||||
- * on such distros, the chkconfig command should do no harm.
|
||||
+ (* On all the distro families covered by "qga_pkg_of_family" and
|
||||
+ * "qga_svc_start_cmd", the QEMU guest agent service is always
|
||||
+ * enabled by package installation for *subsequent* boots. Package
|
||||
+ * installation may or may not enable the service for the current
|
||||
+ * (i.e., first) boot, however, so try that here manually.
|
||||
*)
|
||||
- fbs "start qga"
|
||||
- (sprintf "#!/bin/sh\n\
|
||||
- service %s start\n\
|
||||
- chkconfig %s on\n" qga_pkg qga_pkg)
|
||||
+ match qga_svc_start_cmd family inspect.i_distro inspect.i_major_version
|
||||
+ with
|
||||
+ | None -> ()
|
||||
+ | Some start_cmd ->
|
||||
+ fbs "start qga"
|
||||
+ (sprintf "#!/bin/sh\n\
|
||||
+ %s\n" start_cmd)
|
||||
with
|
||||
| Guest_packages.Unknown_package_manager msg
|
||||
| Guest_packages.Unimplemented_package_manager msg ->
|
@ -1,17 +0,0 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmLFq4sRHHJpY2hAYW5u
|
||||
ZXhpYS5vcmcACgkQkXOPc+G3aKCdDg/+LQr8ro5P9iKSDRNwLJ4jHmoXOqZVkSqO
|
||||
KHk+kHuqFwSruEHxVGZwf9jYBNOuGD9K1d6AFWfYbRS2jEZpiA22ZX1Ym67PF5Fp
|
||||
dw72BmWHBOzJ8YO6vauvpaRNLPypSgr3RwJUPlRYw847MFDrn71EVOBv7dqwVp0q
|
||||
LqBk1wj/M3wKVV2DL8u0JE+CArSmqYSCCnyl2oq0VfIlhYbPQ4iprqTr5HWdd2fs
|
||||
Mc0JkQiuYLoV3V7MP8U0qncktABZ/6gNuTSiUAsWLGSLaH67MNEfqjF4OyEU95cA
|
||||
qivB53LEIebIAO07E9bLeFeXx7WLZsPI3Ms5m+aFWqjCLHl7h0qarHsrMMe+SBI6
|
||||
aSK+BzPzVHfzrqGRnL+95EQI0Vw9g5yLkxkm69KYGbukMulFdGgI24cGqHKEFadu
|
||||
NbrSE/6ydkdKS8NGKeyM+Y5RMoWh379nQcksj8dB6Vv2NV31KQvde9mFxnV92FOn
|
||||
1gYbIRwKPM1cc3VF6E3qlmIuBq59vagsJ/rcKg8fe8LNpNiOfi+Cmk8gYs9WuDFH
|
||||
/RWCYd3XMWxYQ5ZGi3rCVw4ijZbdHGwc1+sH9/ExLGDVuUJQfJ0fpdjR4mYnghav
|
||||
tFKc6EjxJknCR7D4HahVdzFbT/XrD0KpQ5JxToLDA3o7ecPJ42ExfKL53OwYjM/t
|
||||
LUUDntYK6sk=
|
||||
=Grra
|
||||
-----END PGP SIGNATURE-----
|
@ -0,0 +1,17 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmO9fDsRHHJpY2hAYW5u
|
||||
ZXhpYS5vcmcACgkQkXOPc+G3aKAa2g//RQunlKur+nTvnmfpY7gYJJxuJqF0XAq0
|
||||
aWoMF3GTGKbmgsKjvRMd3biVeNSeYRz8+cgy+ns7Ci7rlRw2fxG5INtZXX1rjVRN
|
||||
9j5xQo+fYLHtp48OB2NIZ9qi5dAqSDgdgZ1oHFzzWJJ4dHw9zoMDUW77g8Hi74g4
|
||||
jCXoxq61LMAfNpB8hFrN44xgDD3N15A8IWZEy81bBRQBER6yreZ4Ey1WrgCbF/ti
|
||||
4RjUt98THxbQ1/fP5bDCXpagVSS3h70ZPyYl2gRFVNeEmPekUj4YZP4CvCEb74TF
|
||||
HFJU6go2YzLah+UeG/z1ln8jl2BZdKd0K58tCHwsYvpOeQ1P0jopR6vtnKEAO9py
|
||||
6YV2N5JOEA/EQsLDzyn8Hdk70WgceDjCo6Lkpukblk3sL8WfcnoGSysXWrRfQXnC
|
||||
ktf2yE3vA5IOdd3Bs6yXKSvgp/vmfuLHjAlC7m4Si5MnVuhRWVcrdGmQEKuWb6hO
|
||||
4GRFNiUWZOSDjxWo93M9U3Ur3iv5chb+i9wYLEceKysk4+IKjbqfutg195m1N3GU
|
||||
Qn4sF6clXMRM5vzU9BUx4Y6kZLki8dWYgxNirw9/u/APfqHiycT08pCVZ7iCnExP
|
||||
Q7MpgL6fFNgnwR1hEVHxO6a0kxK0jJh/cWBFHKx6Pkqv4GdXOpUcoKWmugbViLoE
|
||||
gjRPHbHXzVM=
|
||||
=bDBY
|
||||
-----END PGP SIGNATURE-----
|
Loading…
Reference in new issue