Rebase to stable branch version 2.0.5

resolves: rhbz#2059287
Fix -o qemu warning
resolves: rhbz#2082603
This commit is contained in:
Richard W.M. Jones 2022-05-12 17:59:23 +01:00
parent d529cb77d0
commit 6efd7f7327
14 changed files with 237 additions and 18 deletions

View File

@ -1,4 +1,4 @@
From 4c6b1576ba995798a0016c5c4f42fb03b4ce88ac Mon Sep 17 00:00:00 2001
From 170691bd25cc00cd0c341057ca780d99e9150a2a Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Sun, 28 Sep 2014 19:14:43 +0100
Subject: [PATCH] RHEL: v2v: Select correct qemu binary for -o qemu mode
@ -16,7 +16,7 @@ support cases.
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/output/output_qemu.ml b/output/output_qemu.ml
index 29adcba9..579defbd 100644
index 3269fba5..7f2e9284 100644
--- a/output/output_qemu.ml
+++ b/output/output_qemu.ml
@@ -137,7 +137,7 @@ module QEMU = struct

View File

@ -1,4 +1,4 @@
From 02f1ebdbd7326f80694f121c651d95704dc368d9 Mon Sep 17 00:00:00 2001
From d053640fad8704f74077c4b1f563e8607d5b9e39 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 30 Sep 2014 10:50:27 +0100
Subject: [PATCH] RHEL: v2v: Disable the --qemu-boot / -oo qemu-boot option
@ -81,7 +81,7 @@ index 4e912b6c..7d0bafff 100644
=item B<--quiet>
diff --git a/output/output_qemu.ml b/output/output_qemu.ml
index 579defbd..08c40139 100644
index 7f2e9284..527d3c5e 100644
--- a/output/output_qemu.ml
+++ b/output/output_qemu.ml
@@ -63,6 +63,9 @@ module QEMU = struct

View File

@ -1,4 +1,4 @@
From f2173a0cf42ede328a3c613ac648380ce86b47dc Mon Sep 17 00:00:00 2001
From 6552310e58e3cf9eb517b8a5665815d953e3efa2 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 24 Apr 2015 09:45:41 -0400
Subject: [PATCH] RHEL: Fix list of supported sound cards to match RHEL qemu

View File

@ -1,4 +1,4 @@
From 4b4ead25912ee5ade2e628318cc4e1e4d74c027c Mon Sep 17 00:00:00 2001
From 91c1d9bbad617ec63d570a0cfc3e5c629cf15f92 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Sun, 30 Aug 2015 03:21:57 -0400
Subject: [PATCH] RHEL: Fixes for libguestfs-winsupport.

View File

@ -1,4 +1,4 @@
From f197a2bac96aeb6de6a562b5581404ee115abe98 Mon Sep 17 00:00:00 2001
From 8b00d9f0187d782f68ceeaf382bf1edc39c47dac 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)

View File

@ -1,4 +1,4 @@
From 39ffa687155c8128a4f5522bb1fd0f85f7a91709 Mon Sep 17 00:00:00 2001
From 3aa84da24f500bba3fd367395c99c78edbaecd86 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)

View File

@ -1,4 +1,4 @@
From eabbcf32e4dac9bf98e5b2c6fd8cd1c26b6dcfd0 Mon Sep 17 00:00:00 2001
From 941b2b5e1e14320f923f474ce3e7434f80d5a2c9 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

View File

@ -1,4 +1,4 @@
From b0bc2ed33be2e098a4f22d9687be3e11b5c4e0a7 Mon Sep 17 00:00:00 2001
From 5699dad4751848b7230e21d26dce93053e55538e Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 30 Jun 2021 11:15:52 +0100
Subject: [PATCH] RHEL: Disable -o glance

View File

@ -1,4 +1,4 @@
From 7f5478bbeb20579634017aedd32bd9414ac12c58 Mon Sep 17 00:00:00 2001
From f534c095598a0802e6ccec7a3ae6c043e2ce76fa Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 2 Dec 2021 11:56:05 +0000
Subject: [PATCH] RHEL: Remove the --in-place option

View File

@ -1,4 +1,4 @@
From 02894a3140efd40e02ce0f13aa76609e1ed87026 Mon Sep 17 00:00:00 2001
From 86a6532b2411ac652299058095ca9014239d2401 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 11 Apr 2022 11:01:46 +0100
Subject: [PATCH] output: Remove -o json mode

View File

@ -1,4 +1,4 @@
From d96c489a5866c75de6ffdac20847cc5d194c4ad5 Mon Sep 17 00:00:00 2001
From 8c122a68329f00ebd9db370d48780618b9e3af1e 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

View File

@ -0,0 +1,216 @@
From 5d976b2bcddff8e074895f12ed7abbdf5b4202df 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 0a231b3e..48527b87:
diff --git a/common/mlcustomize/customize-options.pod b/common/mlcustomize/customize-options.pod
index 71b545da..a83c80a5 100644
--- a/common/mlcustomize/customize-options.pod
+++ b/common/mlcustomize/customize-options.pod
@@ -206,6 +206,19 @@ the image was built, use this option.
See also: L</LOG FILE>.
+=item B<--no-selinux-relabel>
+
+Do not attempt to correct the SELinux labels of files in the guest.
+
+In such guests that support SELinux, customization automatically
+relabels files so that they have the correct SELinux label. (The
+relabeling is performed immediately, but if the operation fails,
+customization will instead touch F</.autorelabel> on the image to
+schedule a relabel operation for the next time the image boots.) This
+option disables the automatic relabeling.
+
+The option is a no-op for guests that do not support SELinux.
+
=item B<--password> USER:SELECTOR
Set the password for C<USER>. (Note this option does I<not>
@@ -297,16 +310,6 @@ It cannot delete directories, only regular files.
=back
-=item B<--selinux-relabel>
-
-Relabel files in the guest so that they have the correct SELinux label.
-
-This will attempt to relabel files immediately, but if the operation fails
-this will instead touch F</.autorelabel> on the image to schedule a
-relabel operation for the next time the image boots.
-
-You should only use this option for guests which support SELinux.
-
=item B<--sm-attach> SELECTOR
Attach to a pool using C<subscription-manager>.
diff --git a/common/mlcustomize/customize-synopsis.pod b/common/mlcustomize/customize-synopsis.pod
index 5f185408..25208538 100644
--- a/common/mlcustomize/customize-synopsis.pod
+++ b/common/mlcustomize/customize-synopsis.pod
@@ -12,5 +12,5 @@
[--truncate-recursive PATH] [--timezone TIMEZONE] [--touch FILE]
[--uninstall PKG,PKG..] [--update] [--upload FILE:DEST]
[--write FILE:CONTENT] [--no-logfile]
- [--password-crypto md5|sha256|sha512] [--selinux-relabel]
+ [--password-crypto md5|sha256|sha512] [--no-selinux-relabel]
[--sm-credentials SELECTOR]
diff --git a/common/mlcustomize/customize_cmdline.ml b/common/mlcustomize/customize_cmdline.ml
index 9326baa0..5d404e84 100644
--- a/common/mlcustomize/customize_cmdline.ml
+++ b/common/mlcustomize/customize_cmdline.ml
@@ -109,8 +109,8 @@ and flags = {
(* --no-logfile *)
password_crypto : Password.password_crypto option;
(* --password-crypto md5|sha256|sha512 *)
- selinux_relabel : bool;
- (* --selinux-relabel *)
+ no_selinux_relabel : bool;
+ (* --no-selinux-relabel *)
sm_credentials : Subscription_manager.sm_credentials option;
(* --sm-credentials SELECTOR *)
}
@@ -121,7 +121,7 @@ let rec argspec () =
let ops = ref [] in
let scrub_logfile = ref false in
let password_crypto = ref None in
- let selinux_relabel = ref false in
+ let no_selinux_relabel = ref false in
let sm_credentials = ref None in
let rec get_ops () = {
@@ -131,7 +131,7 @@ let rec argspec () =
and get_flags () = {
scrub_logfile = !scrub_logfile;
password_crypto = !password_crypto;
- selinux_relabel = !selinux_relabel;
+ no_selinux_relabel = !no_selinux_relabel;
sm_credentials = !sm_credentials;
}
in
@@ -459,11 +459,11 @@ let rec argspec () =
),
Some "md5|sha256|sha512", "When the virt tools change or set a password in the guest, this\noption sets the password encryption of that password to\nC<md5>, C<sha256> or C<sha512>.\n\nC<sha256> and C<sha512> require glibc E<ge> 2.7 (check crypt(3) inside\nthe guest).\n\nC<md5> will work with relatively old Linux guests (eg. RHEL 3), but\nis not secure against modern attacks.\n\nThe default is C<sha512> unless libguestfs detects an old guest that\ndidn't have support for SHA-512, in which case it will use C<md5>.\nYou can override libguestfs by specifying this option.\n\nNote this does not change the default password encryption used\nby the guest when you create new user accounts inside the guest.\nIf you want to do that, then you should use the I<--edit> option\nto modify C</etc/sysconfig/authconfig> (Fedora, RHEL) or\nC</etc/pam.d/common-password> (Debian, Ubuntu).";
(
- [ L"selinux-relabel" ],
- Getopt.Set selinux_relabel,
- s_"Relabel files with correct SELinux labels"
+ [ L"no-selinux-relabel" ],
+ Getopt.Set no_selinux_relabel,
+ s_"Do not relabel files with correct SELinux labels"
),
- None, "Relabel files in the guest so that they have the correct SELinux label.\n\nThis will attempt to relabel files immediately, but if the operation fails\nthis will instead touch F</.autorelabel> on the image to schedule a\nrelabel operation for the next time the image boots.\n\nYou should only use this option for guests which support SELinux.";
+ None, "Do not attempt to correct the SELinux labels of files in the guest.\n\nIn such guests that support SELinux, customization automatically\nrelabels files so that they have the correct SELinux label. (The\nrelabeling is performed immediately, but if the operation fails,\ncustomization will instead touch F</.autorelabel> on the image to\nschedule a relabel operation for the next time the image boots.) This\noption disables the automatic relabeling.\n\nThe option is a no-op for guests that do not support SELinux.";
(
[ L"sm-credentials" ],
Getopt.String (
diff --git a/common/mlcustomize/customize_cmdline.mli b/common/mlcustomize/customize_cmdline.mli
index 14eda49e..7ee882a6 100644
--- a/common/mlcustomize/customize_cmdline.mli
+++ b/common/mlcustomize/customize_cmdline.mli
@@ -101,8 +101,8 @@ and flags = {
(* --no-logfile *)
password_crypto : Password.password_crypto option;
(* --password-crypto md5|sha256|sha512 *)
- selinux_relabel : bool;
- (* --selinux-relabel *)
+ no_selinux_relabel : bool;
+ (* --no-selinux-relabel *)
sm_credentials : Subscription_manager.sm_credentials option;
(* --sm-credentials SELECTOR *)
}
diff --git a/common/mlcustomize/test-firstboot.sh b/common/mlcustomize/test-firstboot.sh
index b9069975..24c67f3e 100755
--- a/common/mlcustomize/test-firstboot.sh
+++ b/common/mlcustomize/test-firstboot.sh
@@ -61,9 +61,6 @@ case "$guestname" in
extra[${#extra[*]}]='/etc/inittab:
s,^#([1-9].*respawn.*/sbin/getty.*),$1,'
;;
- fedora*|rhel*|centos*)
- extra[${#extra[*]}]='--selinux-relabel'
- ;;
*)
;;
esac
diff --git a/common/mlcustomize/test-selinuxrelabel.sh b/common/mlcustomize/test-selinuxrelabel.sh
index 86278c63..caf75211 100755
--- a/common/mlcustomize/test-selinuxrelabel.sh
+++ b/common/mlcustomize/test-selinuxrelabel.sh
@@ -41,13 +41,12 @@ virt-builder "$guestname" --quiet -o "$disk"
# Test #1: relabel with the default configuration works.
rm -f "$disk_overlay"
guestfish -- disk-create "$disk_overlay" qcow2 -1 backingfile:"$disk"
-virt-customize -a "$disk" --selinux-relabel
+virt-customize -a "$disk"
# Test #2: relabel with no SELINUXTYPE in the configuration.
rm -f "$disk_overlay"
guestfish -- disk-create "$disk_overlay" qcow2 -1 backingfile:"$disk"
virt-customize -a "$disk" \
- --edit /etc/selinux/config:"s,^SELINUXTYPE=,#&,g" \
- --selinux-relabel
+ --edit /etc/selinux/config:"s,^SELINUXTYPE=,#&,g"
rm "$disk" "$disk_overlay"
diff --git a/common/options/uri.c b/common/options/uri.c
index 6b696fc2..84d393c1 100644
--- a/common/options/uri.c
+++ b/common/options/uri.c
@@ -135,7 +135,7 @@ parse (const char *arg, char **path_ret, char **protocol_ret,
socket = query_get (uri, "socket");
if (uri->server && STRNEQ (uri->server, "") && socket) {
- fprintf (stderr, _("%s: %s: cannot both a server name and a socket query parameter\n"),
+ fprintf (stderr, _("%s: %s: cannot have both a server name and a socket query parameter\n"),
getprogname (), arg);
return -1;
}
@@ -347,6 +347,7 @@ make_server (xmlURIPtr uri, const char *socket, char ***ret)
*ret = malloc (sizeof (char *) * 2);
if (*ret == NULL) {
perror ("malloc");
+ free (server);
return -1;
}
(*ret)[0] = server;
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
--
2.31.1

View File

@ -1,2 +1,2 @@
SHA512 (virt-v2v-2.0.4.tar.gz) = 7afddad3385af3b0955c2e8c045a1c4dd548d0424ef53a2cb99c5cc97b33c1c0775e46c69b285a529348daf273b71742c49db5e41835543de112d10afbc8ca11
SHA512 (virt-v2v-2.0.4.tar.gz.sig) = 23cd37c4ac670528091bd8725cf58800c26dd1520192e1445382b9dec2f6d87bab94f7616813112b638b1a03561e1fc63088d591b9da22763b95fce665a5fc1c
SHA512 (virt-v2v-2.0.5.tar.gz) = 83de83060cd35210497c1751287d68ccb472b1dcbce0634fb96b1f9bfcd59b81f783578fd5799ab721d4e978e677b9a30349b34cc4a414b381e7ab98180b92de
SHA512 (virt-v2v-2.0.5.tar.gz.sig) = 55ca5774f3929605b528f2d4969eec6bf08278724494cbe169f352e45f5148842bbda7f7e586412a00a2cc3da50bc7f5f6306aeeee58cc550f78d4fb3e410279

View File

@ -15,7 +15,7 @@
Name: virt-v2v
Epoch: 1
Version: 2.0.4
Version: 2.0.5
Release: 1%{?dist}
Summary: Convert a virtual machine to run on KVM
@ -44,6 +44,7 @@ Patch0008: 0008-RHEL-Disable-o-glance.patch
Patch0009: 0009-RHEL-Remove-the-in-place-option.patch
Patch0010: 0010-output-Remove-o-json-mode.patch
Patch0011: 0011-output-Remove-unused-dummy.c.patch
Patch0012: 0012-adopt-inversion-of-SELinux-relabeling-in-virt-custom.patch
%if !0%{?rhel}
# libguestfs hasn't been built on i686 for a while since there is no
@ -317,8 +318,8 @@ rm $RPM_BUILD_ROOT%{_mandir}/man1/virt-v2v-in-place.1*
%changelog
* Tue Apr 12 2022 Richard W.M. Jones <rjones@redhat.com> - 1:2.0.4-1
- Rebase to stable branch version 2.0.4
* Thu May 12 2022 Richard W.M. Jones <rjones@redhat.com> - 1:2.0.5-1
- Rebase to stable branch version 2.0.5
resolves: rhbz#2059287, rhbz#1658126, rhbz#1788823, rhbz#1854275
- Fix openssh-clients dependency
resolves: rhbz#2064178
@ -347,6 +348,8 @@ rm $RPM_BUILD_ROOT%{_mandir}/man1/virt-v2v-in-place.1*
resolves: rhbz#1883802
- Fix booting of RHEL 9.1 guests after conversion
resolves: rhbz#2076013
- Fix -o qemu warning
resolves: rhbz#2082603
* Tue Feb 15 2022 Richard W.M. Jones <rjones@redhat.com> - 1:1.45.99-1
- Rebase to upstream 1.45.99.