parent
b5992b7753
commit
163b386dc7
@ -1,2 +1,2 @@
|
||||
SOURCES/libguestfs.keyring
|
||||
SOURCES/virt-v2v-2.2.0.tar.gz
|
||||
SOURCES/virt-v2v-2.3.4.tar.gz
|
||||
|
@ -1,2 +1,2 @@
|
||||
1bbc40f501a7fef9eef2a39b701a71aee2fea7c4 SOURCES/libguestfs.keyring
|
||||
a7eff6dd19ae599850fe414b5636431d2149e5a5 SOURCES/virt-v2v-2.2.0.tar.gz
|
||||
6c170400aeacfe53828b4fdbfdcbca2423b9e753 SOURCES/virt-v2v-2.3.4.tar.gz
|
||||
|
@ -1,27 +0,0 @@
|
||||
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
|
@ -1,78 +0,0 @@
|
||||
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
|
@ -1,44 +0,0 @@
|
||||
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
|
@ -1,49 +0,0 @@
|
||||
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
|
@ -1,4 +1,4 @@
|
||||
From ffcd5358b8f6e39962edc91aa036089adc4fcdb0 Mon Sep 17 00:00:00 2001
|
||||
From eaf5279f486590d24843ff63c9f95af33abffe39 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 2 Mar 2017 14:21:37 +0100
|
||||
Subject: [PATCH] RHEL: v2v: -i disk: force VNC as display (RHBZ#1372671)
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
From 907b8c0f9f0aaf3cf5ec71c8371ea252c4acf357 Mon Sep 17 00:00:00 2001
|
||||
From 71ab7854f53b0b9338de12d7dadb2c4754dfcff6 Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Wed, 8 Mar 2017 11:03:40 +0100
|
||||
Subject: [PATCH] RHEL: v2v: do not mention SUSE Xen hosts (RHBZ#1430203)
|
@ -1,30 +0,0 @@
|
||||
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). *)
|
||||
|
||||
(**/**)
|
||||
|
@ -1,25 +0,0 @@
|
||||
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
|
||||
|
@ -1,28 +0,0 @@
|
||||
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 =
|
@ -1,46 +0,0 @@
|
||||
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,51 +0,0 @@
|
||||
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
@ -0,0 +1,60 @@
|
||||
From 6dea82d823c344af0277bb35de789828cfd3e413 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Sat, 22 Apr 2023 09:06:01 +0100
|
||||
Subject: [PATCH] Update common submodule
|
||||
|
||||
Richard W.M. Jones (1):
|
||||
mlcustomize/SELinux_relabel.ml: Use Array.mem
|
||||
|
||||
Roman Kagan (1):
|
||||
mlcustomize: skip SELinux relabeling if it's disabled
|
||||
|
||||
(cherry picked from commit e83de8abe6c5388585885cef28d7a198b7bfc90c)
|
||||
---
|
||||
common | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Submodule common 70c10a07..38e6988c:
|
||||
diff --git a/common/mlcustomize/SELinux_relabel.ml b/common/mlcustomize/SELinux_relabel.ml
|
||||
index 5ecf7bd7..2f3a09bf 100644
|
||||
--- a/common/mlcustomize/SELinux_relabel.ml
|
||||
+++ b/common/mlcustomize/SELinux_relabel.ml
|
||||
@@ -24,10 +24,6 @@ open Printf
|
||||
|
||||
module G = Guestfs
|
||||
|
||||
-(* Simple reimplementation of Array.mem, available only with OCaml >= 4.03. *)
|
||||
-let array_find a l =
|
||||
- List.mem a (Array.to_list l)
|
||||
-
|
||||
let rec relabel (g : G.guestfs) =
|
||||
(* Is the guest using SELinux? (Otherwise this is a no-op). *)
|
||||
if is_selinux_guest g then (
|
||||
@@ -59,14 +55,24 @@ and use_setfiles g =
|
||||
g#aug_load ();
|
||||
debug_augeas_errors g;
|
||||
|
||||
+ let config_path = "/files/etc/selinux/config" in
|
||||
+ let config_keys = g#aug_ls config_path in
|
||||
+ (* SELinux may be disabled via a setting in config file *)
|
||||
+ let selinux_disabled =
|
||||
+ let selinuxmode_path = config_path ^ "/SELINUX" in
|
||||
+ if Array.mem selinuxmode_path config_keys then
|
||||
+ g#aug_get selinuxmode_path = "disabled"
|
||||
+ else
|
||||
+ false in
|
||||
+ if selinux_disabled then
|
||||
+ failwith "selinux disabled";
|
||||
+
|
||||
(* Get the SELinux policy name, eg. "targeted", "minimum".
|
||||
* Use "targeted" if not specified, just like libselinux does.
|
||||
*)
|
||||
let policy =
|
||||
- let config_path = "/files/etc/selinux/config" in
|
||||
let selinuxtype_path = config_path ^ "/SELINUXTYPE" in
|
||||
- let keys = g#aug_ls config_path in
|
||||
- if array_find selinuxtype_path keys then
|
||||
+ if Array.mem selinuxtype_path config_keys then
|
||||
g#aug_get selinuxtype_path
|
||||
else
|
||||
"targeted" in
|
@ -0,0 +1,152 @@
|
||||
From 1d69132b7b7209dbf231a4668b3a6531a6f9cdf3 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Fri, 19 May 2023 11:34:18 +0200
|
||||
Subject: [PATCH] update common submodule
|
||||
|
||||
Laszlo Ersek (2):
|
||||
options/keys: key_store_import_key(): un-constify "key" parameter
|
||||
options/keys: introduce unescape_device_mapper_lvm()
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=2168506
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
(cherry picked from commit b0dbe7c7728579d6c2128c733491755eee1a91b5)
|
||||
---
|
||||
common | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Submodule common 38e6988c..b636c3f2:
|
||||
diff --git a/common/options/options.h b/common/options/options.h
|
||||
index 94573ee0..94e8b9ee 100644
|
||||
--- a/common/options/options.h
|
||||
+++ b/common/options/options.h
|
||||
@@ -169,7 +169,8 @@ extern struct matching_key *get_keys (struct key_store *ks, const char *device,
|
||||
const char *uuid, size_t *nr_matches);
|
||||
extern void free_keys (struct matching_key *keys, size_t nr_matches);
|
||||
extern struct key_store *key_store_add_from_selector (struct key_store *ks, const char *selector);
|
||||
-extern struct key_store *key_store_import_key (struct key_store *ks, const struct key_store_key *key);
|
||||
+extern struct key_store *key_store_import_key (struct key_store *ks,
|
||||
+ struct key_store_key *key);
|
||||
extern bool key_store_requires_network (const struct key_store *ks);
|
||||
extern void free_key_store (struct key_store *ks);
|
||||
|
||||
diff --git a/common/options/keys.c b/common/options/keys.c
|
||||
index 48f1bc7c..52b27369 100644
|
||||
--- a/common/options/keys.c
|
||||
+++ b/common/options/keys.c
|
||||
@@ -260,8 +260,107 @@ key_store_add_from_selector (struct key_store *ks, const char *selector)
|
||||
return key_store_import_key (ks, &key);
|
||||
}
|
||||
|
||||
+/* Turn /dev/mapper/VG-LV into /dev/VG/LV, in-place. */
|
||||
+static void
|
||||
+unescape_device_mapper_lvm (char *id)
|
||||
+{
|
||||
+ static const char dev[] = "/dev/", dev_mapper[] = "/dev/mapper/";
|
||||
+ const char *input_start;
|
||||
+ char *output;
|
||||
+ enum { M_SCAN, M_FILL, M_DONE } mode;
|
||||
+
|
||||
+ if (!STRPREFIX (id, dev_mapper))
|
||||
+ return;
|
||||
+
|
||||
+ /* Start parsing "VG-LV" from "id" after "/dev/mapper/". */
|
||||
+ input_start = id + (sizeof dev_mapper - 1);
|
||||
+
|
||||
+ /* Start writing the unescaped "VG/LV" output after "/dev/". */
|
||||
+ output = id + (sizeof dev - 1);
|
||||
+
|
||||
+ for (mode = M_SCAN; mode < M_DONE; ++mode) {
|
||||
+ char c;
|
||||
+ const char *input = input_start;
|
||||
+ const char *hyphen_buffered = NULL;
|
||||
+ bool single_hyphen_seen = false;
|
||||
+
|
||||
+ do {
|
||||
+ c = *input;
|
||||
+
|
||||
+ switch (c) {
|
||||
+ case '-':
|
||||
+ if (hyphen_buffered == NULL)
|
||||
+ /* This hyphen may start an escaped hyphen, or it could be the
|
||||
+ * separator in VG-LV.
|
||||
+ */
|
||||
+ hyphen_buffered = input;
|
||||
+ else {
|
||||
+ /* This hyphen completes an escaped hyphen; unescape it. */
|
||||
+ if (mode == M_FILL)
|
||||
+ *output++ = '-';
|
||||
+ hyphen_buffered = NULL;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case '/':
|
||||
+ /* Slash characters are forbidden in VG-LV anywhere. If there's any,
|
||||
+ * we'll find it in the first (i.e., scanning) phase, before we output
|
||||
+ * anything back to "id".
|
||||
+ */
|
||||
+ assert (mode == M_SCAN);
|
||||
+ return;
|
||||
+
|
||||
+ default:
|
||||
+ /* Encountered a non-slash, non-hyphen character -- which also may be
|
||||
+ * the terminating NUL.
|
||||
+ */
|
||||
+ if (hyphen_buffered != NULL) {
|
||||
+ /* The non-hyphen character comes after a buffered hyphen, so the
|
||||
+ * buffered hyphen is supposed to be the single hyphen that separates
|
||||
+ * VG from LV in VG-LV. There are three requirements for this
|
||||
+ * separator: (a) it must be unique (we must not have seen another
|
||||
+ * such separator earlier), (b) it must not be at the start of VG-LV
|
||||
+ * (because VG would be empty that way), (c) it must not be at the end
|
||||
+ * of VG-LV (because LV would be empty that way). Should any of these
|
||||
+ * be violated, we'll catch that during the first (i.e., scanning)
|
||||
+ * phase, before modifying "id".
|
||||
+ */
|
||||
+ if (single_hyphen_seen || hyphen_buffered == input_start ||
|
||||
+ c == '\0') {
|
||||
+ assert (mode == M_SCAN);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* Translate the separator hyphen to a slash character. */
|
||||
+ if (mode == M_FILL)
|
||||
+ *output++ = '/';
|
||||
+ hyphen_buffered = NULL;
|
||||
+ single_hyphen_seen = true;
|
||||
+ }
|
||||
+
|
||||
+ /* Output the non-hyphen character (including the terminating NUL)
|
||||
+ * regardless of whether there was a buffered hyphen separator (which,
|
||||
+ * by now, we'll have attempted to translate and flush).
|
||||
+ */
|
||||
+ if (mode == M_FILL)
|
||||
+ *output++ = c;
|
||||
+ }
|
||||
+
|
||||
+ ++input;
|
||||
+ } while (c != '\0');
|
||||
+
|
||||
+ /* We must have seen the VG-LV separator. If that's not the case, we'll
|
||||
+ * catch it before modifying "id".
|
||||
+ */
|
||||
+ if (!single_hyphen_seen) {
|
||||
+ assert (mode == M_SCAN);
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
struct key_store *
|
||||
-key_store_import_key (struct key_store *ks, const struct key_store_key *key)
|
||||
+key_store_import_key (struct key_store *ks, struct key_store_key *key)
|
||||
{
|
||||
struct key_store_key *new_keys;
|
||||
|
||||
@@ -278,6 +377,7 @@ key_store_import_key (struct key_store *ks, const struct key_store_key *key)
|
||||
error (EXIT_FAILURE, errno, "realloc");
|
||||
|
||||
ks->keys = new_keys;
|
||||
+ unescape_device_mapper_lvm (key->id);
|
||||
ks->keys[ks->nr_keys] = *key;
|
||||
++ks->nr_keys;
|
||||
|
@ -0,0 +1,81 @@
|
||||
From 2558084d081c3dd9b0d681f3cf6789b48485cb62 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Mon, 15 May 2023 19:55:28 +0200
|
||||
Subject: [PATCH] LUKS-on-LVM conversion test: rename VGs and LVs
|
||||
|
||||
In preparation for a subsequent patch, rename "VG" to "Volume-Group", and
|
||||
"LV<n>" to "Logical-Volume-<n>", in the LUKS-on-LVM conversion test.
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168506
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20230515175529.290724-2-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit 0ecbe09c09cace1fe0d03cad3ac53000bfeb3cb6)
|
||||
---
|
||||
test-data/phony-guests/make-fedora-img.pl | 30 +++++++++++--------
|
||||
.../test-v2v-fedora-luks-on-lvm-conversion.sh | 8 ++---
|
||||
2 files changed, 21 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/test-data/phony-guests/make-fedora-img.pl b/test-data/phony-guests/make-fedora-img.pl
|
||||
index c30c0b53..830accfc 100755
|
||||
--- a/test-data/phony-guests/make-fedora-img.pl
|
||||
+++ b/test-data/phony-guests/make-fedora-img.pl
|
||||
@@ -224,23 +224,27 @@ EOF
|
||||
|
||||
# Create the Volume Group on /dev/sda2.
|
||||
$g->pvcreate ('/dev/sda2');
|
||||
- $g->vgcreate ('VG', ['/dev/sda2']);
|
||||
- $g->lvcreate ('Root', 'VG', 256);
|
||||
- $g->lvcreate ('LV1', 'VG', 32);
|
||||
- $g->lvcreate ('LV2', 'VG', 32);
|
||||
- $g->lvcreate ('LV3', 'VG', 64);
|
||||
+ $g->vgcreate ('Volume-Group', ['/dev/sda2']);
|
||||
+ $g->lvcreate ('Root', 'Volume-Group', 256);
|
||||
+ $g->lvcreate ('Logical-Volume-1', 'Volume-Group', 32);
|
||||
+ $g->lvcreate ('Logical-Volume-2', 'Volume-Group', 32);
|
||||
+ $g->lvcreate ('Logical-Volume-3', 'Volume-Group', 64);
|
||||
|
||||
# Format each Logical Group as a LUKS device, with a different password.
|
||||
- $g->luks_format ('/dev/VG/Root', 'FEDORA-Root', 0);
|
||||
- $g->luks_format ('/dev/VG/LV1', 'FEDORA-LV1', 0);
|
||||
- $g->luks_format ('/dev/VG/LV2', 'FEDORA-LV2', 0);
|
||||
- $g->luks_format ('/dev/VG/LV3', 'FEDORA-LV3', 0);
|
||||
+ $g->luks_format ('/dev/Volume-Group/Root', 'FEDORA-Root', 0);
|
||||
+ $g->luks_format ('/dev/Volume-Group/Logical-Volume-1', 'FEDORA-LV1', 0);
|
||||
+ $g->luks_format ('/dev/Volume-Group/Logical-Volume-2', 'FEDORA-LV2', 0);
|
||||
+ $g->luks_format ('/dev/Volume-Group/Logical-Volume-3', 'FEDORA-LV3', 0);
|
||||
|
||||
# Open the LUKS devices. This creates nodes like /dev/mapper/*-luks.
|
||||
- $g->cryptsetup_open ('/dev/VG/Root', 'FEDORA-Root', 'Root-luks');
|
||||
- $g->cryptsetup_open ('/dev/VG/LV1', 'FEDORA-LV1', 'LV1-luks');
|
||||
- $g->cryptsetup_open ('/dev/VG/LV2', 'FEDORA-LV2', 'LV2-luks');
|
||||
- $g->cryptsetup_open ('/dev/VG/LV3', 'FEDORA-LV3', 'LV3-luks');
|
||||
+ $g->cryptsetup_open ('/dev/Volume-Group/Root',
|
||||
+ 'FEDORA-Root', 'Root-luks');
|
||||
+ $g->cryptsetup_open ('/dev/Volume-Group/Logical-Volume-1',
|
||||
+ 'FEDORA-LV1', 'LV1-luks');
|
||||
+ $g->cryptsetup_open ('/dev/Volume-Group/Logical-Volume-2',
|
||||
+ 'FEDORA-LV2', 'LV2-luks');
|
||||
+ $g->cryptsetup_open ('/dev/Volume-Group/Logical-Volume-3',
|
||||
+ 'FEDORA-LV3', 'LV3-luks');
|
||||
|
||||
# Phony root filesystem.
|
||||
$g->mkfs ('ext2', '/dev/mapper/Root-luks', blocksize => 4096, label => 'ROOT');
|
||||
diff --git a/tests/test-v2v-fedora-luks-on-lvm-conversion.sh b/tests/test-v2v-fedora-luks-on-lvm-conversion.sh
|
||||
index 1a4068cf..7ad17e0d 100755
|
||||
--- a/tests/test-v2v-fedora-luks-on-lvm-conversion.sh
|
||||
+++ b/tests/test-v2v-fedora-luks-on-lvm-conversion.sh
|
||||
@@ -28,9 +28,9 @@ skip_if_skipped
|
||||
f=../test-data/phony-guests/fedora-luks-on-lvm.img
|
||||
requires test -f $f
|
||||
|
||||
-keys=(--key /dev/VG/Root:key:FEDORA-Root
|
||||
- --key /dev/VG/LV1:key:FEDORA-LV1
|
||||
- --key /dev/VG/LV2:key:FEDORA-LV2
|
||||
- --key /dev/VG/LV3:key:FEDORA-LV3)
|
||||
+keys=(--key /dev/Volume-Group/Root:key:FEDORA-Root
|
||||
+ --key /dev/Volume-Group/Logical-Volume-1:key:FEDORA-LV1
|
||||
+ --key /dev/Volume-Group/Logical-Volume-2:key:FEDORA-LV2
|
||||
+ --key /dev/Volume-Group/Logical-Volume-3:key:FEDORA-LV3)
|
||||
|
||||
$VG virt-v2v --debug-gc -i disk $f -o null "${keys[@]}"
|
@ -1,62 +0,0 @@
|
||||
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 =
|
@ -0,0 +1,34 @@
|
||||
From c8902c551014bc0163122d9fd2005d97d3cb38a5 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Mon, 15 May 2023 19:55:29 +0200
|
||||
Subject: [PATCH] LUKS-on-LVM conversion test: test /dev/mapper/VG-LV
|
||||
translation
|
||||
|
||||
In the LUKS-on-LVM conversion test, repeat the null conversion with such
|
||||
"--key" options that exercise the recent "/dev/mapper/VG-LV" ->
|
||||
"/dev/VG/LV" translation (unescaping) from libguestfs-common.
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168506
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20230515175529.290724-3-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit 3060af01e87fbffe1cb413938c3c5431f2242bd4)
|
||||
---
|
||||
tests/test-v2v-fedora-luks-on-lvm-conversion.sh | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/tests/test-v2v-fedora-luks-on-lvm-conversion.sh b/tests/test-v2v-fedora-luks-on-lvm-conversion.sh
|
||||
index 7ad17e0d..605b19fb 100755
|
||||
--- a/tests/test-v2v-fedora-luks-on-lvm-conversion.sh
|
||||
+++ b/tests/test-v2v-fedora-luks-on-lvm-conversion.sh
|
||||
@@ -34,3 +34,10 @@ keys=(--key /dev/Volume-Group/Root:key:FEDORA-Root
|
||||
--key /dev/Volume-Group/Logical-Volume-3:key:FEDORA-LV3)
|
||||
|
||||
$VG virt-v2v --debug-gc -i disk $f -o null "${keys[@]}"
|
||||
+
|
||||
+keys=(--key /dev/mapper/Volume--Group-Root:key:FEDORA-Root
|
||||
+ --key /dev/mapper/Volume--Group-Logical--Volume--1:key:FEDORA-LV1
|
||||
+ --key /dev/mapper/Volume--Group-Logical--Volume--2:key:FEDORA-LV2
|
||||
+ --key /dev/mapper/Volume--Group-Logical--Volume--3:key:FEDORA-LV3)
|
||||
+
|
||||
+$VG virt-v2v --debug-gc -i disk $f -o null "${keys[@]}"
|
@ -1,34 +0,0 @@
|
||||
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,48 +0,0 @@
|
||||
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,63 @@
|
||||
From 10192f8ee3a7900e76d5c9a0fb330eb5ff1fe22c Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Mon, 19 Jun 2023 18:27:29 +0200
|
||||
Subject: [PATCH] test-data/phony-guests: fix prerequisite list of
|
||||
"fedora-luks-on-lvm.img"
|
||||
|
||||
In the virt-v2v repo, commit 1e75569aa074 ("test-data/phony-guests: Allow
|
||||
virt-v2v to work against phony Fedora") is an ancestor of commit
|
||||
e4efe4b7d240 ("tests: add LUKS-on-LVM test"). The latter created a state
|
||||
where "fedora-static-bin" and LUKS on LVM testing would coexist (i.e.,
|
||||
where "fedora-static-bin" would be uploaded to the LUKS-on-LVM disk image
|
||||
as well), but the commit didn't spell out the dependency in
|
||||
"test-data/phony-guests/Makefile.am".
|
||||
|
||||
Do that now.
|
||||
|
||||
The problem can be triggered with:
|
||||
|
||||
> autoreconf -i
|
||||
> ./configure
|
||||
> make
|
||||
> make -C test-data/phony-guests fedora-luks-on-lvm.img
|
||||
|
||||
where the last command fails with
|
||||
|
||||
> make: Entering directory '.../test-data/phony-guests'
|
||||
> SRCDIR=. LAYOUT=luks-on-lvm ../../run --test ./make-fedora-img.pl
|
||||
> open: fedora-static-bin: No such file or directory at
|
||||
> .../test-data/phony-guests/make-fedora-img.pl line 373.
|
||||
|
||||
(In the guestfs-tools repo, the relative order (the descendancy) between
|
||||
both commits is the opposite. There, commit 27da4b0c4991 ("inspector: add
|
||||
LUKS-on-LVM test") came first, and commit eb0ff1859eb6
|
||||
("test-data/phony-guests: Allow virt-v2v to work against phony Fedora"),
|
||||
came second. The latter commit, in fact being a port of virt-v2v commit
|
||||
1e75569aa074, brought together "fedora-static-bin" with "LUKS on LVM"
|
||||
testing, and it correctly added "fedora-static-bin" as a pre-requisite
|
||||
for building "fedora-luks-on-lvm.img".)
|
||||
|
||||
Fixes: e4efe4b7d240b66b1d53fbe5a127f4f5966f6903
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168506
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20230619162729.153334-1-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit 13a6f4b9686e3fc385663bffc31c08d2c2bb7959)
|
||||
---
|
||||
test-data/phony-guests/Makefile.am | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/test-data/phony-guests/Makefile.am b/test-data/phony-guests/Makefile.am
|
||||
index 29dbd4d0..10c0241b 100644
|
||||
--- a/test-data/phony-guests/Makefile.am
|
||||
+++ b/test-data/phony-guests/Makefile.am
|
||||
@@ -103,7 +103,8 @@ fedora-btrfs.img: make-fedora-img.pl \
|
||||
# Make a (dummy) Fedora image with LUKS-on-LVM.
|
||||
fedora-luks-on-lvm.img: make-fedora-img.pl \
|
||||
fedora-journal.tar.xz \
|
||||
- fedora.db
|
||||
+ fedora.db \
|
||||
+ fedora-static-bin
|
||||
SRCDIR=$(srcdir) LAYOUT=luks-on-lvm $(top_builddir)/run --test ./$<
|
||||
|
||||
# Make a (dummy) Fedora image with LVM-on-LUKS.
|
@ -1,42 +0,0 @@
|
||||
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
|
||||
|
@ -0,0 +1,30 @@
|
||||
From 7a370cc7fcf4ba664eef73d4bac03dfc4d7041b3 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Thu, 29 Jun 2023 14:34:41 +0200
|
||||
Subject: [PATCH] lib/utils: fix typo
|
||||
|
||||
Fix a small comment typo from commit 4e7f20684373 ("lib: Improve security
|
||||
of in/out sockets when running virt-v2v as root", 2022-03-23).
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2182024
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20230629123443.188350-2-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit dab9629c01915efc3678885e8bb0ccc5da1802a3)
|
||||
---
|
||||
lib/utils.mli | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/utils.mli b/lib/utils.mli
|
||||
index 5687bf75..cf88a467 100644
|
||||
--- a/lib/utils.mli
|
||||
+++ b/lib/utils.mli
|
||||
@@ -62,7 +62,7 @@ val backend_is_libvirt : unit -> bool
|
||||
(** Return true iff the current backend is libvirt. *)
|
||||
|
||||
val chown_for_libvirt_rhbz_1045069 : string -> unit
|
||||
-(** If running and root, and if the backend is libvirt, libvirt
|
||||
+(** If running as root, and if the backend is libvirt, libvirt
|
||||
will run qemu as a non-root user. This prevents access
|
||||
to root-owned files and directories. To fix this, provide
|
||||
a function to chown things we might need to qemu:root so
|
@ -1,34 +0,0 @@
|
||||
From e7aa456e26e59bfa5cca1299ef2cb5299592d9da Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Wed, 5 Apr 2023 17:08:28 +0200
|
||||
Subject: [PATCH] detect_kernels: tighten "try" scope
|
||||
|
||||
We want to catch Not_found from (our own implementation of)
|
||||
"List.find_map". There's no need (and it makes no sense) to push the
|
||||
"prefix_len" calculation down into the "try" scope. Keep the "try" scope
|
||||
as narrow as possible.
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2175703
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Tested-by: Vera Wu <vwu@redhat.com>
|
||||
(ported from libguestfs-common commit 4003815a994944cab38d48cfc96f16382de62987)
|
||||
Message-Id: <20230405150829.171720-2-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
---
|
||||
convert/linux_kernels.ml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/convert/linux_kernels.ml b/convert/linux_kernels.ml
|
||||
index 6e9d2bdd..75ab94c4 100644
|
||||
--- a/convert/linux_kernels.ml
|
||||
+++ b/convert/linux_kernels.ml
|
||||
@@ -122,8 +122,8 @@ let detect_kernels (g : G.guestfs) inspect family bootloader =
|
||||
*)
|
||||
let modpath, version =
|
||||
let prefix = "/lib/modules/" in
|
||||
+ let prefix_len = String.length prefix in
|
||||
try
|
||||
- let prefix_len = String.length prefix in
|
||||
List.find_map (
|
||||
fun filename ->
|
||||
let filename_len = String.length filename in
|
@ -0,0 +1,96 @@
|
||||
From 522a927257cfa55ac87775165be23779e00076bb Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Thu, 29 Jun 2023 14:34:42 +0200
|
||||
Subject: [PATCH] lib/utils: make "chown_for_libvirt_rhbz_1045069" fail hard
|
||||
|
||||
Currently "chown_for_libvirt_rhbz_1045069" is best effort; if it fails, we
|
||||
suppress the exception (we log it in verbose mode only, even).
|
||||
|
||||
That's not proved helpful: it almost certainly leads to later errors, but
|
||||
those errors are less clear than the original (suppressed) exception.
|
||||
Namely, the user sees something like
|
||||
|
||||
> Failed to connect to '/tmp/v2v.sKlulY/in0': Permission denied
|
||||
|
||||
rather than
|
||||
|
||||
> Failed to connect socket to '/var/run/libvirt/virtqemud-sock-ro':
|
||||
> Connection refused
|
||||
|
||||
So just allow the exception to propagate outwards.
|
||||
|
||||
And then, now that "chown_for_libvirt_rhbz_1045069" will be able to fail,
|
||||
hoist the call to "On_exit.rm_rf" before the call to
|
||||
"chown_for_libvirt_rhbz_1045069", after creating the v2v temporary
|
||||
directory. In the current order, if "chown_for_libvirt_rhbz_1045069" threw
|
||||
an exception, then we'd leak the temp dir in the filesystem.
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2182024
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20230629123443.188350-3-lersek@redhat.com>
|
||||
[lersek@redhat.com: reinstate parens under "then" [Rich]]
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit 8bcf383510a3d9deaa9b4c069a45c1604c9d5f53)
|
||||
---
|
||||
lib/utils.ml | 23 +++++++++--------------
|
||||
lib/utils.mli | 5 +----
|
||||
2 files changed, 10 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/lib/utils.ml b/lib/utils.ml
|
||||
index 54431307..7b3aa2e2 100644
|
||||
--- a/lib/utils.ml
|
||||
+++ b/lib/utils.ml
|
||||
@@ -151,19 +151,14 @@ let backend_is_libvirt () =
|
||||
let rec chown_for_libvirt_rhbz_1045069 file =
|
||||
let running_as_root = Unix.geteuid () = 0 in
|
||||
if running_as_root && backend_is_libvirt () then (
|
||||
- try
|
||||
- let user = Option.value ~default:"qemu" (libvirt_qemu_user ()) in
|
||||
- let uid =
|
||||
- if String.is_prefix user "+" then
|
||||
- int_of_string (String.sub user 1 (String.length user - 1))
|
||||
- else
|
||||
- (Unix.getpwnam user).pw_uid in
|
||||
- debug "setting owner of %s to %d:root" file uid;
|
||||
- Unix.chown file uid 0
|
||||
- with
|
||||
- | exn -> (* Print exception, but continue. *)
|
||||
- debug "could not set owner of %s: %s"
|
||||
- file (Printexc.to_string exn)
|
||||
+ let user = Option.value ~default:"qemu" (libvirt_qemu_user ()) in
|
||||
+ let uid =
|
||||
+ if String.is_prefix user "+" then
|
||||
+ int_of_string (String.sub user 1 (String.length user - 1))
|
||||
+ else
|
||||
+ (Unix.getpwnam user).pw_uid in
|
||||
+ debug "setting owner of %s to %d:root" file uid;
|
||||
+ Unix.chown file uid 0
|
||||
)
|
||||
|
||||
(* Get the local user that libvirt uses to run qemu when we are
|
||||
@@ -206,8 +201,8 @@ let error_if_no_ssh_agent () =
|
||||
(* Create the directory containing inX and outX sockets. *)
|
||||
let create_v2v_directory () =
|
||||
let d = Mkdtemp.temp_dir "v2v." in
|
||||
- chown_for_libvirt_rhbz_1045069 d;
|
||||
On_exit.rm_rf d;
|
||||
+ chown_for_libvirt_rhbz_1045069 d;
|
||||
d
|
||||
|
||||
(* Wait for a file to appear until a timeout. *)
|
||||
diff --git a/lib/utils.mli b/lib/utils.mli
|
||||
index cf88a467..391a2a35 100644
|
||||
--- a/lib/utils.mli
|
||||
+++ b/lib/utils.mli
|
||||
@@ -67,10 +67,7 @@ val chown_for_libvirt_rhbz_1045069 : string -> unit
|
||||
to root-owned files and directories. To fix this, provide
|
||||
a function to chown things we might need to qemu:root so
|
||||
qemu can access them. Note that root normally ignores
|
||||
- permissions so can still access the resource.
|
||||
-
|
||||
- This is best-effort. If something fails then we carry
|
||||
- on and hope for the best. *)
|
||||
+ permissions so can still access the resource. *)
|
||||
|
||||
val error_if_no_ssh_agent : unit -> unit
|
||||
|
@ -1,97 +0,0 @@
|
||||
From 9449d21eeae81d4283e74d7cdccf776e695783f0 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Wed, 5 Apr 2023 17:08:29 +0200
|
||||
Subject: [PATCH] detect_kernels: deal with RHEL's kernel-core /
|
||||
kernel-modules-core split
|
||||
|
||||
In "kernel-5.14.0-269.el9", the "kernel-modules-core" subpackage got split
|
||||
from the "kernel-core" subpackage. Therefore, a single binary RPM
|
||||
containing *both* the "/boot/vmlinuz-5.14.0-269.el9.x86_64" file *and* the
|
||||
"/lib/modules/5.14.0-269.el9.x86_64" directory no longer exists. The file
|
||||
now belongs to "kernel-core", and the directory to "kernel-modules-core".
|
||||
|
||||
As a result, when we investigate the file list of "kernel-core" (based on
|
||||
"kernel-core" providing "/boot/vmlinuz-5.14.0-269.el9.x86_64"), the first
|
||||
match against "/lib/modules/" is not the actual module root directory
|
||||
"/lib/modules/5.14.0-269.el9.x86_64", but the nonsensical
|
||||
"/lib/modules/5.14.0-269.el9.x86_64/.vmlinuz.hmac" regular file. This
|
||||
latter file is never a directory, therefore we rule out "kernel-core" as a
|
||||
kernel package.
|
||||
|
||||
We also rule out "kernel-modules-core" (even earlier) because it does not
|
||||
contain "/boot/vmlinuz-5.14.0-269.el9.x86_64".
|
||||
|
||||
Now, the code already deals with the case if the prospective kernel
|
||||
package *does not provide a match* for the "/lib/modules/" prefix: in that
|
||||
case, we construct the modpath manually, from said prefix, and the version
|
||||
number found in "/boot/vmlinuz-<version>". This fallback is good, but it's
|
||||
unreachable if *there is* a candidate, it's just wrong (i.e., not a
|
||||
directory).
|
||||
|
||||
Perform the "is_dir" check on the candidate modpath earlier, so that we
|
||||
can fall back to the manual modpath construction if the modpath candidate
|
||||
exists, but is wrong.
|
||||
|
||||
With this, the original "is_dir" check becomes superfluous (duplicated)
|
||||
*except* when the "Not_found" branch is taken. Therefore, hoist the
|
||||
original "is_dir" check into that branch.
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2175703
|
||||
Reported-by: Vera Wu <vwu@redhat.com>
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Tested-by: Vera Wu <vwu@redhat.com>
|
||||
(ported from libguestfs-common commit 70c10a079a30ff3a84f38596d725a6c5d46e2470)
|
||||
Message-Id: <20230405150829.171720-3-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
---
|
||||
convert/linux_kernels.ml | 24 ++++++++++++++++++------
|
||||
1 file changed, 18 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/convert/linux_kernels.ml b/convert/linux_kernels.ml
|
||||
index 75ab94c4..d0b31643 100644
|
||||
--- a/convert/linux_kernels.ml
|
||||
+++ b/convert/linux_kernels.ml
|
||||
@@ -124,7 +124,7 @@ let detect_kernels (g : G.guestfs) inspect family bootloader =
|
||||
let prefix = "/lib/modules/" in
|
||||
let prefix_len = String.length prefix in
|
||||
try
|
||||
- List.find_map (
|
||||
+ let modpath, version = List.find_map (
|
||||
fun filename ->
|
||||
let filename_len = String.length filename in
|
||||
if filename_len > prefix_len &&
|
||||
@@ -134,17 +134,29 @@ let detect_kernels (g : G.guestfs) inspect family bootloader =
|
||||
Some (filename, version)
|
||||
) else
|
||||
None
|
||||
- ) files
|
||||
+ ) files in
|
||||
+ (* Fall back to the version in the vmlinuz file name not only if
|
||||
+ * a candidate pathname couldn't be found under /lib/modules/,
|
||||
+ * but also in case the candidate pathname doesn't reference a
|
||||
+ * directory. See RHBZ#2175703.
|
||||
+ *
|
||||
+ * Note that this "is_dir" check is deliberately kept outside of
|
||||
+ * the "find_map"'s mapper function above: we want the first
|
||||
+ * candidate *to be* a directory, and not the first candidate
|
||||
+ * *that is* a directory.
|
||||
+ *)
|
||||
+ if not (g#is_dir ~followsymlinks:true modpath) then
|
||||
+ raise Not_found;
|
||||
+ modpath, version
|
||||
with Not_found ->
|
||||
let version =
|
||||
String.sub vmlinuz 14 (String.length vmlinuz - 14) in
|
||||
let modpath = prefix ^ version in
|
||||
+ (* Check that the modpath exists. *)
|
||||
+ if not (g#is_dir ~followsymlinks:true modpath) then
|
||||
+ raise Not_found;
|
||||
modpath, version in
|
||||
|
||||
- (* Check that the modpath exists. *)
|
||||
- if not (g#is_dir ~followsymlinks:true modpath) then
|
||||
- raise Not_found;
|
||||
-
|
||||
(* Find the initramfs which corresponds to the kernel.
|
||||
* Since the initramfs is built at runtime, and doesn't have
|
||||
* to be covered by the RPM file list, this is basically
|
@ -0,0 +1,79 @@
|
||||
From f2e233b9e073327b1881ef17695380bc02a51f68 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Thu, 29 Jun 2023 14:34:43 +0200
|
||||
Subject: [PATCH] docs/virt-v2v: document libvirt system instance startup
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
It has frequently tripped us up that on RHEL / Fedora, installing the
|
||||
right set of libvirt RPMs (such as the one pulled in by
|
||||
"libvirt-daemon-kvm") does not result in an immediately running libvirt
|
||||
system instance. Document the need, and the simplest method, for starting
|
||||
libvirt up manually.
|
||||
|
||||
Thanks: Daniel Berrangé
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2182024
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20230629123443.188350-4-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit dcfea1b9b5d0f237f49c9eb870af93527093b40b)
|
||||
---
|
||||
docs/virt-v2v.pod | 23 ++++++++++++++++++++++-
|
||||
1 file changed, 22 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod
|
||||
index 0394b421..058eb800 100644
|
||||
--- a/docs/virt-v2v.pod
|
||||
+++ b/docs/virt-v2v.pod
|
||||
@@ -237,6 +237,8 @@ In this mode you have to specify a libvirt guest name or UUID on the
|
||||
command line. You may also specify a libvirt connection URI (see
|
||||
I<-ic>).
|
||||
|
||||
+See L</Starting the libvirt system instance> below.
|
||||
+
|
||||
=item B<-i> B<libvirtxml>
|
||||
|
||||
Set the input method to I<libvirtxml>.
|
||||
@@ -440,7 +442,8 @@ Set the output method to I<libvirt>. This is the default.
|
||||
In this mode, the converted guest is created as a libvirt guest. You
|
||||
may also specify a libvirt connection URI (see I<-oc>).
|
||||
|
||||
-See L<virt-v2v-output-local(1)>.
|
||||
+See L</Starting the libvirt system instance> below, and
|
||||
+L<virt-v2v-output-local(1)>.
|
||||
|
||||
=item B<-o> B<local>
|
||||
|
||||
@@ -1335,6 +1338,8 @@ see L<http://libvirt.org/auth.html>. Alternatively, use
|
||||
I<-oc qemu:///session>, which will write to your per-user libvirt
|
||||
instance.
|
||||
|
||||
+See also L</Starting the libvirt system instance>.
|
||||
+
|
||||
=item Writing to Openstack
|
||||
|
||||
Because of how Cinder volumes are presented as F</dev> block devices,
|
||||
@@ -1476,6 +1481,22 @@ option at all. The option was added when virt-v2v was rewritten in 2014.
|
||||
It is possible to specify a format string for controlling the output;
|
||||
see L<guestfs(3)/ADVANCED MACHINE READABLE OUTPUT>.
|
||||
|
||||
+=head2 Starting the libvirt system instance
|
||||
+
|
||||
+ Failed to connect socket to '/var/run/libvirt/virtqemud-sock': No such file or directory
|
||||
+ Failed to connect socket to '/var/run/libvirt/virtqemud-sock-ro': Connection refused
|
||||
+
|
||||
+If you have just installed libvirt and virt-v2v, then you may see the
|
||||
+errors above. This is caused by libvirt daemons that provide various
|
||||
+services not running straight after installation. (This may depend on
|
||||
+your distribution and vendor presets).
|
||||
+
|
||||
+To fix this on systemd-based distributions, do:
|
||||
+
|
||||
+ systemctl isolate multi-user.target
|
||||
+
|
||||
+See also L<https://bugzilla.redhat.com/2182024>.
|
||||
+
|
||||
=head1 FILES
|
||||
|
||||
=over 4
|
@ -1,17 +0,0 @@
|
||||
-----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-----
|
@ -0,0 +1,17 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmQ/zVsRHHJpY2hAYW5u
|
||||
ZXhpYS5vcmcACgkQkXOPc+G3aKDvNw//T5RStZ4lypgFgeCqM8HUce8AvEBmp2Bu
|
||||
eCFMsSHjyWvA5S9mw+D6EOhDIZiIyGoESbYzpXZxrXE8YYWKW51rlOaGcVxmU5ld
|
||||
mz3bz2iGRGpFsKzF1v0WDaLzhg8KX6Fw7hFlnDjTLjYqnwSgySf/aXVrPEZPwmwj
|
||||
iGqpCNokG5HmJNQ36x2JMmQxa135nbYXh/nvPTXU2gzx7i5By3D9ir2k6B/iLDPf
|
||||
NbQ7PDO9mSBKljeRvhrmM2zxXiAhb3WG9XWM/I4aHASh76BhR7lCg4GS94NbTNPj
|
||||
KAWAIGZN0TFRLOHsFwvOz9pibJQeDdjimakwDzSv9+gS+TlwU1isahpW8Ic/tIlC
|
||||
2BEucjM7MVuyLLqoGq5tKGbO/OZ7Rheg/wR0j2y+1afvCRgRupyAjtwlYjFpB/sp
|
||||
1tNmYAW9zOtJtp3MLfMCO820ZsBifprTk9dZqDCeH3HW9aJ8e1pJcpYF5G3gpVD/
|
||||
m32J9YFudmAV0Z3ePUnH/C5ZAzvE1u55SexnfZEqdyKZ+KOujZBrg4b/nID1xmo1
|
||||
jBZbYprNJTRluJCmIvY5/79Oob2GqAqOgjdUrQlEzPVRf6Kd5lAGIqkKr+5RlQvg
|
||||
9OmIvQu1wgiqpmxEuev/RDb8b8M632YAv5+6TACxpqhfZxkmSZ04XFKCZZw1/pDd
|
||||
NXR/cUUWEBI=
|
||||
=XPmg
|
||||
-----END PGP SIGNATURE-----
|
Loading…
Reference in new issue