Compare commits
No commits in common. 'c8-stream-rhel' and 'c9-beta' have entirely different histories.
c8-stream-
...
c9-beta
@ -1,2 +1,2 @@
|
||||
SOURCES/libguestfs-1.44.0.tar.gz
|
||||
SOURCES/libguestfs-1.50.1.tar.gz
|
||||
SOURCES/libguestfs.keyring
|
||||
|
@ -1,2 +1,2 @@
|
||||
99d241dc4a5ba0dc6111954ed7a872e0b0bb6944 SOURCES/libguestfs-1.44.0.tar.gz
|
||||
b2ccc62a61d43917d982bb380709cd283fda465a SOURCES/libguestfs-1.50.1.tar.gz
|
||||
1bbc40f501a7fef9eef2a39b701a71aee2fea7c4 SOURCES/libguestfs.keyring
|
||||
|
@ -1,56 +0,0 @@
|
||||
From 5b6d2b05fe0c4035b9791a751e3133d26c7baa2d Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 21 Dec 2012 15:50:11 +0000
|
||||
Subject: [PATCH] RHEL 8: Remove libguestfs live (RHBZ#798980).
|
||||
|
||||
This isn't supported in RHEL 8.
|
||||
|
||||
Disable daemon tests that require the 'unix' backend.
|
||||
---
|
||||
lib/launch-unix.c | 7 +++++++
|
||||
tests/daemon/Makefile.am | 4 +---
|
||||
2 files changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lib/launch-unix.c b/lib/launch-unix.c
|
||||
index 0d344f9df..74dd1bb4a 100644
|
||||
--- a/lib/launch-unix.c
|
||||
+++ b/lib/launch-unix.c
|
||||
@@ -37,6 +37,12 @@
|
||||
static int
|
||||
launch_unix (guestfs_h *g, void *datav, const char *sockpath)
|
||||
{
|
||||
+ error (g,
|
||||
+ "launch: In RHEL, only the 'libvirt' or 'direct' method is supported.\n"
|
||||
+ "In particular, \"libguestfs live\" is not supported.");
|
||||
+ return -1;
|
||||
+
|
||||
+#if 0
|
||||
int r, daemon_sock = -1;
|
||||
struct sockaddr_un addr;
|
||||
uint32_t size;
|
||||
@@ -106,6 +112,7 @@ launch_unix (guestfs_h *g, void *datav, const char *sockpath)
|
||||
g->conn = NULL;
|
||||
}
|
||||
return -1;
|
||||
+#endif
|
||||
}
|
||||
|
||||
static int
|
||||
diff --git a/tests/daemon/Makefile.am b/tests/daemon/Makefile.am
|
||||
index 921e6d1df..8b2887247 100644
|
||||
--- a/tests/daemon/Makefile.am
|
||||
+++ b/tests/daemon/Makefile.am
|
||||
@@ -23,9 +23,7 @@ include $(top_srcdir)/subdir-rules.mk
|
||||
|
||||
check_DATA = captive-daemon.pm
|
||||
|
||||
-TESTS = \
|
||||
- test-daemon-start.pl \
|
||||
- test-btrfs.pl
|
||||
+TESTS =
|
||||
|
||||
TESTS_ENVIRONMENT = $(top_builddir)/run --test
|
||||
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,330 +0,0 @@
|
||||
From 91b2a6e50211c58ea31a36351ec63c358f708bf9 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 18 Jul 2013 18:31:53 +0100
|
||||
Subject: [PATCH] RHEL 8: Remove 9p APIs from RHEL (RHBZ#921710).
|
||||
|
||||
---
|
||||
Makefile.am | 2 +-
|
||||
daemon/9p.c | 182 --------------------------------------
|
||||
daemon/Makefile.am | 1 -
|
||||
docs/C_SOURCE_FILES | 1 -
|
||||
generator/actions_core.ml | 21 -----
|
||||
generator/proc_nr.ml | 2 -
|
||||
gobject/Makefile.inc | 2 -
|
||||
po/POTFILES | 2 -
|
||||
8 files changed, 1 insertion(+), 212 deletions(-)
|
||||
delete mode 100644 daemon/9p.c
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 3df1b6a7a..36e44dfd5 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -78,7 +78,7 @@ SUBDIRS += tests/xfs
|
||||
SUBDIRS += tests/charsets
|
||||
SUBDIRS += tests/xml
|
||||
SUBDIRS += tests/mount-local
|
||||
-SUBDIRS += tests/9p
|
||||
+#SUBDIRS += tests/9p
|
||||
SUBDIRS += tests/rsync
|
||||
SUBDIRS += tests/bigdirs
|
||||
SUBDIRS += tests/disk-labels
|
||||
diff --git a/daemon/9p.c b/daemon/9p.c
|
||||
deleted file mode 100644
|
||||
index 743a96abd..000000000
|
||||
--- a/daemon/9p.c
|
||||
+++ /dev/null
|
||||
@@ -1,182 +0,0 @@
|
||||
-/* libguestfs - the guestfsd daemon
|
||||
- * Copyright (C) 2011 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.
|
||||
- */
|
||||
-
|
||||
-#include <config.h>
|
||||
-
|
||||
-#include <stdio.h>
|
||||
-#include <stdlib.h>
|
||||
-#include <string.h>
|
||||
-#include <unistd.h>
|
||||
-#include <limits.h>
|
||||
-#include <errno.h>
|
||||
-#include <sys/types.h>
|
||||
-#include <sys/stat.h>
|
||||
-#include <dirent.h>
|
||||
-#include <fcntl.h>
|
||||
-
|
||||
-#include "ignore-value.h"
|
||||
-
|
||||
-#include "daemon.h"
|
||||
-#include "actions.h"
|
||||
-
|
||||
-#define BUS_PATH "/sys/bus/virtio/drivers/9pnet_virtio"
|
||||
-
|
||||
-static void
|
||||
-modprobe_9pnet_virtio (void)
|
||||
-{
|
||||
- /* Required with Linux 5.6 and maybe earlier kernels. For unclear
|
||||
- * reasons the module is not an automatic dependency of the 9p
|
||||
- * module so doesn't get loaded automatically.
|
||||
- */
|
||||
- ignore_value (command (NULL, NULL, "modprobe", "9pnet_virtio", NULL));
|
||||
-}
|
||||
-
|
||||
-/* https://bugzilla.redhat.com/show_bug.cgi?id=714981#c1 */
|
||||
-char **
|
||||
-do_list_9p (void)
|
||||
-{
|
||||
- CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (r);
|
||||
- DIR *dir;
|
||||
-
|
||||
- modprobe_9pnet_virtio ();
|
||||
-
|
||||
- dir = opendir (BUS_PATH);
|
||||
- if (!dir) {
|
||||
- perror ("opendir: " BUS_PATH);
|
||||
- if (errno != ENOENT) {
|
||||
- reply_with_perror ("opendir: " BUS_PATH);
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- /* If this directory doesn't exist, it probably means that
|
||||
- * the virtio driver isn't loaded. Don't return an error
|
||||
- * in this case, but return an empty list.
|
||||
- */
|
||||
- if (end_stringsbuf (&r) == -1)
|
||||
- return NULL;
|
||||
-
|
||||
- return take_stringsbuf (&r);
|
||||
- }
|
||||
-
|
||||
- while (1) {
|
||||
- struct dirent *d;
|
||||
-
|
||||
- errno = 0;
|
||||
- d = readdir (dir);
|
||||
- if (d == NULL) break;
|
||||
-
|
||||
- if (STRPREFIX (d->d_name, "virtio")) {
|
||||
- CLEANUP_FREE char *mount_tag_path = NULL;
|
||||
- if (asprintf (&mount_tag_path, BUS_PATH "/%s/mount_tag",
|
||||
- d->d_name) == -1) {
|
||||
- reply_with_perror ("asprintf");
|
||||
- closedir (dir);
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- /* A bit unclear, but it looks like the virtio transport allows
|
||||
- * the mount tag length to be unlimited (or up to 65536 bytes).
|
||||
- * See: linux/include/linux/virtio_9p.h
|
||||
- */
|
||||
- CLEANUP_FREE char *mount_tag = read_whole_file (mount_tag_path, NULL);
|
||||
- if (mount_tag == 0)
|
||||
- continue;
|
||||
-
|
||||
- if (add_string (&r, mount_tag) == -1) {
|
||||
- closedir (dir);
|
||||
- return NULL;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- /* Check readdir didn't fail */
|
||||
- if (errno != 0) {
|
||||
- reply_with_perror ("readdir: /sys/block");
|
||||
- closedir (dir);
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- /* Close the directory handle */
|
||||
- if (closedir (dir) == -1) {
|
||||
- reply_with_perror ("closedir: /sys/block");
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- /* Sort the tags. */
|
||||
- if (r.size > 0)
|
||||
- sort_strings (r.argv, r.size);
|
||||
-
|
||||
- /* NULL terminate the list */
|
||||
- if (end_stringsbuf (&r) == -1)
|
||||
- return NULL;
|
||||
-
|
||||
- return take_stringsbuf (&r);
|
||||
-}
|
||||
-
|
||||
-/* Takes optional arguments, consult optargs_bitmask. */
|
||||
-int
|
||||
-do_mount_9p (const char *mount_tag, const char *mountpoint, const char *options)
|
||||
-{
|
||||
- CLEANUP_FREE char *mp = NULL, *opts = NULL, *err = NULL;
|
||||
- struct stat statbuf;
|
||||
- int r;
|
||||
-
|
||||
- ABS_PATH (mountpoint, 0, return -1);
|
||||
-
|
||||
- mp = sysroot_path (mountpoint);
|
||||
- if (!mp) {
|
||||
- reply_with_perror ("malloc");
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- /* Check the mountpoint exists and is a directory. */
|
||||
- if (stat (mp, &statbuf) == -1) {
|
||||
- reply_with_perror ("%s", mountpoint);
|
||||
- return -1;
|
||||
- }
|
||||
- if (!S_ISDIR (statbuf.st_mode)) {
|
||||
- reply_with_perror ("%s: mount point is not a directory", mountpoint);
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- /* Add trans=virtio to the options. */
|
||||
- if ((optargs_bitmask & GUESTFS_MOUNT_9P_OPTIONS_BITMASK) &&
|
||||
- STRNEQ (options, "")) {
|
||||
- if (asprintf (&opts, "trans=virtio,%s", options) == -1) {
|
||||
- reply_with_perror ("asprintf");
|
||||
- return -1;
|
||||
- }
|
||||
- }
|
||||
- else {
|
||||
- opts = strdup ("trans=virtio");
|
||||
- if (opts == NULL) {
|
||||
- reply_with_perror ("strdup");
|
||||
- return -1;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- modprobe_9pnet_virtio ();
|
||||
- r = command (NULL, &err,
|
||||
- "mount", "-o", opts, "-t", "9p", mount_tag, mp, NULL);
|
||||
- if (r == -1) {
|
||||
- reply_with_error ("%s on %s: %s", mount_tag, mountpoint, err);
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
|
||||
index 038be592c..df9dcc4ee 100644
|
||||
--- a/daemon/Makefile.am
|
||||
+++ b/daemon/Makefile.am
|
||||
@@ -82,7 +82,6 @@ guestfsd_SOURCES = \
|
||||
../common/protocol/guestfs_protocol.h \
|
||||
../common/utils/cleanups.h \
|
||||
../common/utils/guestfs-utils.h \
|
||||
- 9p.c \
|
||||
acl.c \
|
||||
actions.h \
|
||||
available.c \
|
||||
diff --git a/docs/C_SOURCE_FILES b/docs/C_SOURCE_FILES
|
||||
index cd5bd2924..831b7e25a 100644
|
||||
--- a/docs/C_SOURCE_FILES
|
||||
+++ b/docs/C_SOURCE_FILES
|
||||
@@ -63,7 +63,6 @@ common/windows/windows.c
|
||||
common/windows/windows.h
|
||||
customize/crypt-c.c
|
||||
customize/perl_edit-c.c
|
||||
-daemon/9p.c
|
||||
daemon/acl.c
|
||||
daemon/actions.h
|
||||
daemon/augeas.c
|
||||
diff --git a/generator/actions_core.ml b/generator/actions_core.ml
|
||||
index 806565b19..37476c93e 100644
|
||||
--- a/generator/actions_core.ml
|
||||
+++ b/generator/actions_core.ml
|
||||
@@ -6157,27 +6157,6 @@ This returns true iff the device exists and contains all zero bytes.
|
||||
|
||||
Note that for large devices this can take a long time to run." };
|
||||
|
||||
- { defaults with
|
||||
- name = "list_9p"; added = (1, 11, 12);
|
||||
- style = RStringList (RPlainString, "mounttags"), [], [];
|
||||
- shortdesc = "list 9p filesystems";
|
||||
- longdesc = "\
|
||||
-List all 9p filesystems attached to the guest. A list of
|
||||
-mount tags is returned." };
|
||||
-
|
||||
- { defaults with
|
||||
- name = "mount_9p"; added = (1, 11, 12);
|
||||
- style = RErr, [String (PlainString, "mounttag"); String (PlainString, "mountpoint")], [OString "options"];
|
||||
- camel_name = "Mount9P";
|
||||
- shortdesc = "mount 9p filesystem";
|
||||
- longdesc = "\
|
||||
-Mount the virtio-9p filesystem with the tag C<mounttag> on the
|
||||
-directory C<mountpoint>.
|
||||
-
|
||||
-If required, C<trans=virtio> will be automatically added to the options.
|
||||
-Any other options required can be passed in the optional C<options>
|
||||
-parameter." };
|
||||
-
|
||||
{ defaults with
|
||||
name = "list_dm_devices"; added = (1, 11, 15);
|
||||
style = RStringList (RDevice, "devices"), [], [];
|
||||
diff --git a/generator/proc_nr.ml b/generator/proc_nr.ml
|
||||
index 30e42864f..57976be36 100644
|
||||
--- a/generator/proc_nr.ml
|
||||
+++ b/generator/proc_nr.ml
|
||||
@@ -295,8 +295,6 @@ let proc_nr = [
|
||||
282, "internal_autosync";
|
||||
283, "is_zero";
|
||||
284, "is_zero_device";
|
||||
-285, "list_9p";
|
||||
-286, "mount_9p";
|
||||
287, "list_dm_devices";
|
||||
288, "ntfsresize";
|
||||
289, "btrfs_filesystem_resize";
|
||||
diff --git a/gobject/Makefile.inc b/gobject/Makefile.inc
|
||||
index 650f8ddac..c4e735967 100644
|
||||
--- a/gobject/Makefile.inc
|
||||
+++ b/gobject/Makefile.inc
|
||||
@@ -94,7 +94,6 @@ guestfs_gobject_headers= \
|
||||
include/guestfs-gobject/optargs-mksquashfs.h \
|
||||
include/guestfs-gobject/optargs-mkswap.h \
|
||||
include/guestfs-gobject/optargs-mktemp.h \
|
||||
- include/guestfs-gobject/optargs-mount_9p.h \
|
||||
include/guestfs-gobject/optargs-mount_local.h \
|
||||
include/guestfs-gobject/optargs-ntfsclone_out.h \
|
||||
include/guestfs-gobject/optargs-ntfsfix.h \
|
||||
@@ -188,7 +187,6 @@ guestfs_gobject_sources= \
|
||||
src/optargs-mksquashfs.c \
|
||||
src/optargs-mkswap.c \
|
||||
src/optargs-mktemp.c \
|
||||
- src/optargs-mount_9p.c \
|
||||
src/optargs-mount_local.c \
|
||||
src/optargs-ntfsclone_out.c \
|
||||
src/optargs-ntfsfix.c \
|
||||
diff --git a/po/POTFILES b/po/POTFILES
|
||||
index 69ea7134a..0782e8ceb 100644
|
||||
--- a/po/POTFILES
|
||||
+++ b/po/POTFILES
|
||||
@@ -47,7 +47,6 @@ common/visit/visit.c
|
||||
common/windows/windows.c
|
||||
customize/crypt-c.c
|
||||
customize/perl_edit-c.c
|
||||
-daemon/9p.c
|
||||
daemon/acl.c
|
||||
daemon/augeas.c
|
||||
daemon/available.c
|
||||
@@ -277,7 +276,6 @@ gobject/src/optargs-mkfs_btrfs.c
|
||||
gobject/src/optargs-mksquashfs.c
|
||||
gobject/src/optargs-mkswap.c
|
||||
gobject/src/optargs-mktemp.c
|
||||
-gobject/src/optargs-mount_9p.c
|
||||
gobject/src/optargs-mount_local.c
|
||||
gobject/src/optargs-ntfsclone_out.c
|
||||
gobject/src/optargs-ntfsfix.c
|
||||
--
|
||||
2.31.1
|
||||
|
@ -0,0 +1,37 @@
|
||||
From 89b6c8b458dcb00de83b543c47a6acb049f63f18 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Tue, 21 Mar 2023 16:55:15 +0100
|
||||
Subject: [PATCH] update common submodule
|
||||
|
||||
HATAYAMA Daisuke (1):
|
||||
progress: fix segmentation fault when TERM variable is "dumb"
|
||||
|
||||
Laszlo Ersek (2):
|
||||
detect_kernels: tighten "try" scope
|
||||
detect_kernels: deal with RHEL's kernel-core / kernel-modules-core split
|
||||
|
||||
rwmjones (1):
|
||||
Merge pull request #5 from d-hatayama/fix_segfault_progress_bar
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2175703
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
(cherry picked from commit be11d25b3e2770d86699e94c5087e6625477d5ec)
|
||||
---
|
||||
common | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Submodule common 360e037d..70c10a07:
|
||||
diff --git a/common/progress/progress.c b/common/progress/progress.c
|
||||
index 4d52b97e..e4b30663 100644
|
||||
--- a/common/progress/progress.c
|
||||
+++ b/common/progress/progress.c
|
||||
@@ -318,7 +318,8 @@ progress_bar_set (struct progress_bar *bar,
|
||||
* (b) it's just not possible to use tputs in a sane way here.
|
||||
*/
|
||||
/*tputs (UP, 2, putchar);*/
|
||||
- fprintf (fp, "%s", UP);
|
||||
+ if (UP)
|
||||
+ fprintf (fp, "%s", UP);
|
||||
}
|
||||
bar->count++;
|
||||
|
@ -0,0 +1,63 @@
|
||||
From e58cd8df467e342463d08e3d761c2e322287b13e Mon Sep 17 00:00:00 2001
|
||||
From: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
|
||||
Date: Wed, 26 Apr 2023 15:59:44 +0300
|
||||
Subject: [PATCH] daemon/selinux-relabel: don't exclude "/selinux" if it's
|
||||
non-existent
|
||||
|
||||
Since RHBZ#726528, filesystem.rpm doesn't include /selinux. setfiles
|
||||
then gives us the warning: "Can't stat exclude path "/sysroot/selinux",
|
||||
No such file or directory - ignoring."
|
||||
|
||||
Though the warning is harmless, let's get rid of it by checking the
|
||||
existence of /selinux directory.
|
||||
|
||||
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
|
||||
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit 9ced5fac8c1f0f8ff7ed2b5671c1c7f5f0bfa875)
|
||||
---
|
||||
daemon/selinux-relabel.c | 16 +++++++++++++++-
|
||||
1 file changed, 15 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/daemon/selinux-relabel.c b/daemon/selinux-relabel.c
|
||||
index 976cffe3..454486c1 100644
|
||||
--- a/daemon/selinux-relabel.c
|
||||
+++ b/daemon/selinux-relabel.c
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
+#include <sys/stat.h>
|
||||
|
||||
#include "guestfs_protocol.h"
|
||||
#include "daemon.h"
|
||||
@@ -37,6 +38,17 @@ optgroup_selinuxrelabel_available (void)
|
||||
return prog_exists ("setfiles");
|
||||
}
|
||||
|
||||
+static int
|
||||
+dir_exists (const char *dir)
|
||||
+{
|
||||
+ struct stat statbuf;
|
||||
+
|
||||
+ if (stat (dir, &statbuf) == 0 && S_ISDIR (statbuf.st_mode))
|
||||
+ return 1;
|
||||
+ else
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int
|
||||
setfiles_has_option (int *flag, char opt_char)
|
||||
{
|
||||
@@ -99,8 +111,10 @@ do_selinux_relabel (const char *specfile, const char *path,
|
||||
*/
|
||||
ADD_ARG (argv, i, "-e"); ADD_ARG (argv, i, s_dev);
|
||||
ADD_ARG (argv, i, "-e"); ADD_ARG (argv, i, s_proc);
|
||||
- ADD_ARG (argv, i, "-e"); ADD_ARG (argv, i, s_selinux);
|
||||
ADD_ARG (argv, i, "-e"); ADD_ARG (argv, i, s_sys);
|
||||
+ if (dir_exists (s_selinux)) {
|
||||
+ ADD_ARG (argv, i, "-e"); ADD_ARG (argv, i, s_selinux);
|
||||
+ }
|
||||
|
||||
/* You have to use the -m option (where available) otherwise
|
||||
* setfiles puts all the mountpoints on the excludes list for no
|
@ -1,72 +0,0 @@
|
||||
From 34f8c6a5eb0eabfba4ab1831b45e2baa73a4b501 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 19 Sep 2014 13:38:20 +0100
|
||||
Subject: [PATCH] RHEL 8: Remove User-Mode Linux (RHBZ#1144197).
|
||||
|
||||
This isn't supported in RHEL 8.
|
||||
---
|
||||
lib/launch-uml.c | 13 +++++++++++++
|
||||
1 file changed, 13 insertions(+)
|
||||
|
||||
diff --git a/lib/launch-uml.c b/lib/launch-uml.c
|
||||
index 5aec50a57..8b9fcd770 100644
|
||||
--- a/lib/launch-uml.c
|
||||
+++ b/lib/launch-uml.c
|
||||
@@ -44,7 +44,9 @@ struct backend_uml_data {
|
||||
char umid[UML_UMID_LEN+1]; /* umid=<...> unique ID. */
|
||||
};
|
||||
|
||||
+#if 0
|
||||
static void print_vmlinux_command_line (guestfs_h *g, char **argv);
|
||||
+#endif
|
||||
|
||||
/* Run uml_mkcow to create a COW overlay. */
|
||||
static char *
|
||||
@@ -81,6 +83,7 @@ create_cow_overlay_uml (guestfs_h *g, void *datav, struct drive *drv)
|
||||
return make_cow_overlay (g, drv->src.u.path);
|
||||
}
|
||||
|
||||
+#if 0
|
||||
/* Test for features which are not supported by the UML backend.
|
||||
* Possibly some of these should just be warnings, not errors.
|
||||
*/
|
||||
@@ -133,10 +136,17 @@ uml_supported (guestfs_h *g)
|
||||
|
||||
return true;
|
||||
}
|
||||
+#endif
|
||||
|
||||
static int
|
||||
launch_uml (guestfs_h *g, void *datav, const char *arg)
|
||||
{
|
||||
+ error (g,
|
||||
+ "launch: In RHEL, only the 'libvirt' or 'direct' method is supported.\n"
|
||||
+ "In particular, User-Mode Linux (UML) is not supported.");
|
||||
+ return -1;
|
||||
+
|
||||
+#if 0
|
||||
struct backend_uml_data *data = datav;
|
||||
CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (cmdline);
|
||||
int console_sock = -1, daemon_sock = -1;
|
||||
@@ -496,8 +506,10 @@ launch_uml (guestfs_h *g, void *datav, const char *arg)
|
||||
}
|
||||
g->state = CONFIG;
|
||||
return -1;
|
||||
+#endif
|
||||
}
|
||||
|
||||
+#if 0
|
||||
/* This is called from the forked subprocess just before vmlinux runs,
|
||||
* so it can just print the message straight to stderr, where it will
|
||||
* be picked up and funnelled through the usual appliance event API.
|
||||
@@ -527,6 +539,7 @@ print_vmlinux_command_line (guestfs_h *g, char **argv)
|
||||
|
||||
fputc ('\n', stderr);
|
||||
}
|
||||
+#endif
|
||||
|
||||
static int
|
||||
shutdown_uml (guestfs_h *g, void *datav, int check_for_errors)
|
||||
--
|
||||
2.31.1
|
||||
|
@ -0,0 +1,33 @@
|
||||
From c1829048c598e11950c9d355fdd5c177a99e046f Mon Sep 17 00:00:00 2001
|
||||
From: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
|
||||
Date: Wed, 26 Apr 2023 15:59:45 +0300
|
||||
Subject: [PATCH] daemon/selinux-relabel: search for "invalid option" in
|
||||
setfiles output
|
||||
|
||||
'X' in the setiles' stderr doesn't necessarily mean that option 'X'
|
||||
doesn't exist. For instance, when passing '-T' we get: "setfiles:
|
||||
option requires an argument -- 'T'".
|
||||
|
||||
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
|
||||
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit 152d6e4bdf2dac88856a4ff83cf73451f897d4d4)
|
||||
---
|
||||
daemon/selinux-relabel.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/daemon/selinux-relabel.c b/daemon/selinux-relabel.c
|
||||
index 454486c1..60a6f48a 100644
|
||||
--- a/daemon/selinux-relabel.c
|
||||
+++ b/daemon/selinux-relabel.c
|
||||
@@ -56,8 +56,9 @@ setfiles_has_option (int *flag, char opt_char)
|
||||
|
||||
if (*flag == -1) {
|
||||
char option[] = { '-', opt_char, '\0' }; /* "-X" */
|
||||
- char err_opt[] = { '\'', opt_char, '\'', '\0'}; /* "'X'" */
|
||||
+ char err_opt[32]; /* "invalid option -- 'X'" */
|
||||
|
||||
+ snprintf(err_opt, sizeof(err_opt), "invalid option -- '%c'", opt_char);
|
||||
ignore_value (command (NULL, &err, "setfiles", option, NULL));
|
||||
*flag = err && strstr (err, /* "invalid option -- " */ err_opt) == NULL;
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
From 3046af080baad9935627ebb671950448cfd0fa7b Mon Sep 17 00:00:00 2001
|
||||
From: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
|
||||
Date: Wed, 26 Apr 2023 15:59:46 +0300
|
||||
Subject: [PATCH] daemon/selinux-relabel: run setfiles with "-T 0", if
|
||||
supported
|
||||
|
||||
Since SELinux userspace v3.4 [1], setfiles command supports "-T nthreads"
|
||||
option, which allows parallel execution. "-T 0" allows using as many
|
||||
threads as there're available CPU cores. This might speed up the process
|
||||
of filesystem relabeling in case the appliance is being run with multiple
|
||||
vCPUs. The latter is true for at least v2v starting from d2b64ecc67
|
||||
("v2v: Set the number of vCPUs to same as host number of pCPUs.").
|
||||
|
||||
For instance, when running virt-v2v-in-place on my 12-core Xeon host
|
||||
with SSD, with appliance being run with 8 vCPUs (the upper limit specified
|
||||
in d2b64ecc67), and on the ~150GiB disk VM (physical size on the host),
|
||||
I get the following results:
|
||||
|
||||
./in-place/virt-v2v-in-place -i libvirt fedora37-vm -v -x
|
||||
|
||||
Without this patch:
|
||||
...
|
||||
commandrvf: setfiles -F -e /sysroot/dev -e /sysroot/proc -e /sysroot/sys -m -C -r /sysroot -v /sysroot/etc/selinux/targeted/contexts/files/file_contexts /sysroot/^M
|
||||
libguestfs: trace: v2v: selinux_relabel = 0
|
||||
libguestfs: trace: v2v: rm_f "/.autorelabel"
|
||||
guestfsd: => selinux_relabel (0x1d3) took 17.94 secs
|
||||
...
|
||||
|
||||
With this patch:
|
||||
...
|
||||
commandrvf: setfiles -F -e /sysroot/dev -e /sysroot/proc -e /sysroot/sys -m -C -T 0 -r /sysroot -v /sysroot/etc/selinux/targeted/contexts/files/file_contexts /sysroot/^M
|
||||
libguestfs: trace: v2v: selinux_relabel = 0
|
||||
libguestfs: trace: v2v: rm_f "/.autorelabel"
|
||||
guestfsd: => selinux_relabel (0x1d3) took 5.88 secs
|
||||
...
|
||||
|
||||
So in my scenario it's getting 3 times faster.
|
||||
|
||||
[1] https://github.com/SELinuxProject/selinux/releases/tag/3.4
|
||||
|
||||
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
|
||||
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit d0d8e6738477148a7b752348f9364a3b8faed67f)
|
||||
---
|
||||
daemon/selinux-relabel.c | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/daemon/selinux-relabel.c b/daemon/selinux-relabel.c
|
||||
index 60a6f48a..cfc5a31d 100644
|
||||
--- a/daemon/selinux-relabel.c
|
||||
+++ b/daemon/selinux-relabel.c
|
||||
@@ -73,6 +73,7 @@ do_selinux_relabel (const char *specfile, const char *path,
|
||||
{
|
||||
static int flag_m = -1;
|
||||
static int flag_C = -1;
|
||||
+ static int flag_T = -1;
|
||||
const char *argv[MAX_ARGS];
|
||||
CLEANUP_FREE char *s_dev = NULL, *s_proc = NULL, *s_selinux = NULL,
|
||||
*s_sys = NULL, *s_specfile = NULL, *s_path = NULL;
|
||||
@@ -131,6 +132,17 @@ do_selinux_relabel (const char *specfile, const char *path,
|
||||
if (setfiles_has_option (&flag_C, 'C'))
|
||||
ADD_ARG (argv, i, "-C");
|
||||
|
||||
+ /* If the appliance is being run with multiple vCPUs, running setfiles
|
||||
+ * in multithreading mode might speeds up the process. Option "-T" was
|
||||
+ * introduced in SELinux userspace v3.4, and we need to check whether it's
|
||||
+ * supported. Passing "-T 0" creates as many threads as there're available
|
||||
+ * vCPU cores.
|
||||
+ * https://github.com/SELinuxProject/selinux/releases/tag/3.4
|
||||
+ */
|
||||
+ if (setfiles_has_option (&flag_T, 'T')) {
|
||||
+ ADD_ARG (argv, i, "-T"); ADD_ARG (argv, i, "0");
|
||||
+ }
|
||||
+
|
||||
/* Relabelling in a chroot. */
|
||||
if (STRNEQ (sysroot, "/")) {
|
||||
ADD_ARG (argv, i, "-r");
|
@ -1,37 +0,0 @@
|
||||
From dbd1eaab6a478cf0c3ea093a56b3d04c29278615 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 12 Jan 2021 10:23:11 +0000
|
||||
Subject: [PATCH] build: Avoid warnings about unknown pragmas.
|
||||
|
||||
In commit 4bbbf03b8bc266ed2b63c461cd0945250bb134fe we started to
|
||||
ignore bogus GCC 11 warnings. Unfortunately earlier versions of GCC
|
||||
don't know about those pragmas so give warnings [hence errors in
|
||||
developer builds] like:
|
||||
|
||||
tsk.c:75:32: error: unknown option after '#pragma GCC diagnostic' kind [-Werror=pragmas]
|
||||
|
||||
Turn off these warnings.
|
||||
|
||||
Updates: commit 4bbbf03b8bc266ed2b63c461cd0945250bb134fe
|
||||
(cherry picked from commit 812f837c97f48ce0c26a0e02286fb9180c282923)
|
||||
---
|
||||
m4/guestfs-c.m4 | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/m4/guestfs-c.m4 b/m4/guestfs-c.m4
|
||||
index 25ffea0d9..bbb4db464 100644
|
||||
--- a/m4/guestfs-c.m4
|
||||
+++ b/m4/guestfs-c.m4
|
||||
@@ -108,6 +108,9 @@ gl_WARN_ADD([-Wformat-truncation=1])
|
||||
dnl GCC 9 at level 2 gives apparently bogus errors when %.*s is used.
|
||||
gl_WARN_ADD([-Wformat-overflow=1])
|
||||
|
||||
+dnl GCC < 11 gives warnings when disabling GCC 11 warnings.
|
||||
+gl_WARN_ADD([-Wno-pragmas])
|
||||
+
|
||||
AC_SUBST([WARN_CFLAGS])
|
||||
|
||||
NO_SNV_CFLAGS=
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,94 +0,0 @@
|
||||
From 22416a2329ec531b9608c21b11ff3d53275fe7a0 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 22 Feb 2021 10:18:45 +0000
|
||||
Subject: [PATCH] daemon: lvm: Use lvcreate --yes to avoid interactive prompts.
|
||||
|
||||
See https://bugzilla.redhat.com/show_bug.cgi?id=1930996#c1
|
||||
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1930996
|
||||
(cherry picked from commit 21cd97732c4973db835b8b6540c8ad582ebd2bda)
|
||||
---
|
||||
daemon/lvm.c | 2 +-
|
||||
tests/regressions/Makefile.am | 2 ++
|
||||
tests/regressions/rhbz1930996.sh | 36 ++++++++++++++++++++++++++++++++
|
||||
3 files changed, 39 insertions(+), 1 deletion(-)
|
||||
create mode 100755 tests/regressions/rhbz1930996.sh
|
||||
|
||||
diff --git a/daemon/lvm.c b/daemon/lvm.c
|
||||
index 841dc4b6b..72c59c3a1 100644
|
||||
--- a/daemon/lvm.c
|
||||
+++ b/daemon/lvm.c
|
||||
@@ -219,7 +219,7 @@ do_lvcreate (const char *logvol, const char *volgroup, int mbytes)
|
||||
snprintf (size, sizeof size, "%d", mbytes);
|
||||
|
||||
r = command (NULL, &err,
|
||||
- "lvm", "lvcreate",
|
||||
+ "lvm", "lvcreate", "--yes",
|
||||
"-L", size, "-n", logvol, volgroup, NULL);
|
||||
if (r == -1) {
|
||||
reply_with_error ("%s", err);
|
||||
diff --git a/tests/regressions/Makefile.am b/tests/regressions/Makefile.am
|
||||
index ecb0d68a7..c1e0ee8a9 100644
|
||||
--- a/tests/regressions/Makefile.am
|
||||
+++ b/tests/regressions/Makefile.am
|
||||
@@ -49,6 +49,7 @@ EXTRA_DIST = \
|
||||
rhbz1370424.sh \
|
||||
rhbz1370424.xml \
|
||||
rhbz1477623.sh \
|
||||
+ rhbz1930996.sh \
|
||||
test-noexec-stack.pl
|
||||
|
||||
TESTS = \
|
||||
@@ -79,6 +80,7 @@ TESTS = \
|
||||
rhbz1285847.sh \
|
||||
rhbz1370424.sh \
|
||||
rhbz1477623.sh \
|
||||
+ rhbz1930996.sh \
|
||||
test-big-heap \
|
||||
test-noexec-stack.pl \
|
||||
$(SLOW_TESTS)
|
||||
diff --git a/tests/regressions/rhbz1930996.sh b/tests/regressions/rhbz1930996.sh
|
||||
new file mode 100755
|
||||
index 000000000..27089beaa
|
||||
--- /dev/null
|
||||
+++ b/tests/regressions/rhbz1930996.sh
|
||||
@@ -0,0 +1,36 @@
|
||||
+#!/bin/bash -
|
||||
+# libguestfs
|
||||
+# Copyright (C) 2017-2021 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.
|
||||
+
|
||||
+# Regression test for:
|
||||
+# https://bugzilla.redhat.com/show_bug.cgi?id=1930996#c1
|
||||
+#
|
||||
+# Actually a bug/change in LVM, previously we failed to create an LV
|
||||
+# if the underlying disk contained a filesystem signature.
|
||||
+
|
||||
+set -e
|
||||
+
|
||||
+$TEST_FUNCTIONS
|
||||
+skip_if_skipped
|
||||
+skip_unless_phony_guest fedora.img
|
||||
+
|
||||
+f=rhbz1930996.img
|
||||
+rm -f $f
|
||||
+
|
||||
+guestfish -N $f=lvfs vgremove VG : vgcreate VG /dev/sda1 : lvcreate LV2 VG 100
|
||||
+
|
||||
+rm $f
|
||||
--
|
||||
2.31.1
|
||||
|
@ -0,0 +1,63 @@
|
||||
From e916ad54c31a725cbf08fb186756d9e968ff20b2 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 7 Feb 2023 13:20:36 +0000
|
||||
Subject: [PATCH] Remove virt-dib
|
||||
|
||||
The tool only supports an older version of the diskimage-builder
|
||||
metadata, and we do not have the time or inclination to update it to a
|
||||
newer version.
|
||||
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1910039
|
||||
(cherry picked from commit 7503eeebede688409b2adf616d71a94e04b7f0d2)
|
||||
---
|
||||
appliance/packagelist.in | 30 ------------------------------
|
||||
1 file changed, 30 deletions(-)
|
||||
|
||||
diff --git a/appliance/packagelist.in b/appliance/packagelist.in
|
||||
index 585d52ad..20b08c47 100644
|
||||
--- a/appliance/packagelist.in
|
||||
+++ b/appliance/packagelist.in
|
||||
@@ -110,7 +110,6 @@ ifelse(ARCHLINUX,1,
|
||||
dnl syslinux has mtools as optional dependency, but in reality it's
|
||||
dnl a hard one:
|
||||
mtools
|
||||
- multipath-tools dnl for kpartx
|
||||
nilfs-utils
|
||||
ntfs-3g
|
||||
ntfs-3g-system-compression
|
||||
@@ -266,35 +265,6 @@ util-linux-ng
|
||||
xfsprogs
|
||||
zerofree
|
||||
|
||||
-dnl tools needed by virt-dib
|
||||
-ifelse(REDHAT,1,
|
||||
- qemu-img
|
||||
- which
|
||||
-)
|
||||
-ifelse(DEBIAN,1,
|
||||
- qemu-utils
|
||||
-)
|
||||
-ifelse(ARCHLINUX,1,
|
||||
- qemu
|
||||
- which
|
||||
-)
|
||||
-ifelse(SUSE,1,
|
||||
- qemu-tools
|
||||
- which
|
||||
-)
|
||||
-ifelse(FRUGALWARE,1,
|
||||
- qemu
|
||||
- which
|
||||
-)
|
||||
-ifelse(MAGEIA,1,
|
||||
- qemu-img
|
||||
- which
|
||||
-)
|
||||
-curl
|
||||
-kpartx
|
||||
-dnl (virt-dib) tools optionally used for elements
|
||||
-debootstrap
|
||||
-
|
||||
dnl exFAT is not usually available in free software repos
|
||||
exfat-fuse
|
||||
exfat-utils
|
@ -1,113 +0,0 @@
|
||||
From e1b339688e5f8f2a14fe0c7e9d02ad68004e4655 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 15 Apr 2021 09:18:22 +0100
|
||||
Subject: [PATCH] inspection: More reliable detection of Linux split /usr
|
||||
configurations
|
||||
|
||||
In RHEL 8+, /usr/etc no longer exists. Since we were looking for this
|
||||
directory in order to detect a separate /usr partition, those were no
|
||||
longer detected, so the merging of /usr data into the root was not
|
||||
being done. The result was incomplete inspection data and failure of
|
||||
virt-v2v.
|
||||
|
||||
All Linux systems since forever have had /usr/src but not /src, so
|
||||
detect this instead.
|
||||
|
||||
Furthermore the merging code didn't work, because we expected that the
|
||||
root filesystem had a distro assigned, but in this configuration we
|
||||
may need to look for that information in /usr/lib/os-release (not on
|
||||
the root filesystem). This change makes the merging work even if we
|
||||
have incomplete information about the root filesystem, so long as we
|
||||
have an /etc/fstab entry pointing to the /usr mountpoint.
|
||||
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1949683
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1930133
|
||||
Fixes: commit 394d11be49121884295e61964ed47f5a8488c252
|
||||
(cherry picked from commit 26427b9ecc64e7e5e53a1d577cef9dc080d08877)
|
||||
---
|
||||
daemon/inspect.ml | 33 +++++++++++++++------------------
|
||||
daemon/inspect_fs.ml | 6 +++---
|
||||
2 files changed, 18 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/daemon/inspect.ml b/daemon/inspect.ml
|
||||
index 945a476f6..fb75b4a6c 100644
|
||||
--- a/daemon/inspect.ml
|
||||
+++ b/daemon/inspect.ml
|
||||
@@ -182,11 +182,9 @@ and check_for_duplicated_bsd_root fses =
|
||||
and collect_linux_inspection_info fses =
|
||||
List.map (
|
||||
function
|
||||
- | { role = RoleRoot { distro = Some d } } as root ->
|
||||
- if d <> DISTRO_COREOS then
|
||||
- collect_linux_inspection_info_for fses root
|
||||
- else
|
||||
- root
|
||||
+ | { role = RoleRoot { distro = Some DISTRO_COREOS } } as root -> root
|
||||
+ | { role = RoleRoot _ } as root ->
|
||||
+ collect_linux_inspection_info_for fses root
|
||||
| fs -> fs
|
||||
) fses
|
||||
|
||||
@@ -196,29 +194,28 @@ and collect_linux_inspection_info fses =
|
||||
* or other ways to identify the OS).
|
||||
*)
|
||||
and collect_linux_inspection_info_for fses root =
|
||||
- let root_distro, root_fstab =
|
||||
+ let root_fstab =
|
||||
match root with
|
||||
- | { role = RoleRoot { distro = Some d; fstab = f } } -> d, f
|
||||
+ | { role = RoleRoot { fstab = f } } -> f
|
||||
| _ -> assert false in
|
||||
|
||||
try
|
||||
let usr =
|
||||
List.find (
|
||||
function
|
||||
- | { role = RoleUsr { distro = d } }
|
||||
- when d = Some root_distro || d = None -> true
|
||||
+ | { role = RoleUsr _; fs_location = usr_mp } ->
|
||||
+ (* This checks that this usr is found in the fstab of
|
||||
+ * the root filesystem.
|
||||
+ *)
|
||||
+ List.exists (
|
||||
+ fun (mountable, _) ->
|
||||
+ usr_mp.mountable = mountable
|
||||
+ ) root_fstab
|
||||
| _ -> false
|
||||
) fses in
|
||||
|
||||
- let usr_mountable = usr.fs_location.mountable in
|
||||
-
|
||||
- (* This checks that [usr] is found in the fstab of the root
|
||||
- * filesystem. If not, [Not_found] is thrown.
|
||||
- *)
|
||||
- ignore (
|
||||
- List.find (fun (mountable, _) -> usr_mountable = mountable) root_fstab
|
||||
- );
|
||||
-
|
||||
+ eprintf "collect_linux_inspection_info_for: merging:\n%sinto:\n%s"
|
||||
+ (string_of_fs usr) (string_of_fs root);
|
||||
merge usr root;
|
||||
root
|
||||
with
|
||||
diff --git a/daemon/inspect_fs.ml b/daemon/inspect_fs.ml
|
||||
index 6e00c7083..02b5a0470 100644
|
||||
--- a/daemon/inspect_fs.ml
|
||||
+++ b/daemon/inspect_fs.ml
|
||||
@@ -164,10 +164,10 @@ and check_filesystem mountable =
|
||||
()
|
||||
)
|
||||
(* Linux /usr? *)
|
||||
- else if Is.is_dir "/etc" &&
|
||||
- Is.is_dir "/bin" &&
|
||||
- Is.is_dir "/share" &&
|
||||
+ else if Is.is_dir "/bin" &&
|
||||
Is.is_dir "/local" &&
|
||||
+ Is.is_dir "/share" &&
|
||||
+ Is.is_dir "/src" &&
|
||||
not (Is.is_file "/etc/fstab") then (
|
||||
debug_matching "Linux /usr";
|
||||
role := `Usr;
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,49 +0,0 @@
|
||||
From 791a16b049ea1ce2c450acd367fce774d9aab5b1 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 31 Aug 2021 08:27:15 +0100
|
||||
Subject: [PATCH] lib: Autodetect backing format for qemu-img create -b
|
||||
|
||||
qemu 6.1 has decided to change qemu-img create so that a backing
|
||||
format (-F) is required if a backing file (-b) is specified. Since we
|
||||
don't want to change the libguestfs API to force callers to specify
|
||||
this because that would be an API break, autodetect it.
|
||||
|
||||
This is similar to commit c8c181e8d9 ("launch: libvirt: Autodetect
|
||||
backing format for readonly drive overlays").
|
||||
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1998820
|
||||
(cherry picked from commit 45de287447bb18d59749fbfc1ec5072413090109)
|
||||
---
|
||||
lib/create.c | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/lib/create.c b/lib/create.c
|
||||
index 44a7df25f..75a4d3a28 100644
|
||||
--- a/lib/create.c
|
||||
+++ b/lib/create.c
|
||||
@@ -255,6 +255,7 @@ disk_create_qcow2 (guestfs_h *g, const char *filename, int64_t size,
|
||||
const struct guestfs_disk_create_argv *optargs)
|
||||
{
|
||||
const char *backingformat = NULL;
|
||||
+ CLEANUP_FREE char *backingformat_free = NULL;
|
||||
const char *preallocation = NULL;
|
||||
const char *compat = NULL;
|
||||
int clustersize = -1;
|
||||
@@ -270,6 +271,14 @@ disk_create_qcow2 (guestfs_h *g, const char *filename, int64_t size,
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
+ else if (backingfile) {
|
||||
+ /* Since qemu 6.1, qemu-img create has requires a backing format (-F)
|
||||
+ * parameter if backing file (-b) is used (RHBZ#1998820).
|
||||
+ */
|
||||
+ backingformat = backingformat_free = guestfs_disk_format (g, backingfile);
|
||||
+ if (!backingformat)
|
||||
+ return -1;
|
||||
+ }
|
||||
if (optargs->bitmask & GUESTFS_DISK_CREATE_PREALLOCATION_BITMASK) {
|
||||
if (STREQ (optargs->preallocation, "off") ||
|
||||
STREQ (optargs->preallocation, "sparse"))
|
||||
--
|
||||
2.31.1
|
||||
|
@ -0,0 +1,32 @@
|
||||
From e712c4b81cbd2cf0e990d01cb4d1f54734e62de6 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 9 Feb 2023 13:38:50 +0000
|
||||
Subject: [PATCH] lib: Choose q35 machine type for x86-64
|
||||
|
||||
This machine type is more modern than the older 'pc' type and as most
|
||||
qemu development is now focused there we expect it will perform and
|
||||
behave better. In almost all respects this change should make no
|
||||
difference.
|
||||
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2168578
|
||||
Acked-by: Laszlo Ersek <lersek@redhat.com>
|
||||
See-also: https://listman.redhat.com/archives/libguestfs/2023-February/030645.html
|
||||
(cherry picked from commit f0f8e6c5fe0c3f6d5d90534d263bded3a4dc7e8d)
|
||||
---
|
||||
lib/guestfs-internal.h | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h
|
||||
index 306f2a2e..fb55e026 100644
|
||||
--- a/lib/guestfs-internal.h
|
||||
+++ b/lib/guestfs-internal.h
|
||||
@@ -113,6 +113,9 @@ cleanup_mutex_unlock (pthread_mutex_t **ptr)
|
||||
#define MAX_WINDOWS_EXPLORER_SIZE (4 * 1000 * 1000)
|
||||
|
||||
/* Machine types. */
|
||||
+#if defined(__x86_64__)
|
||||
+#define MACHINE_TYPE "q35"
|
||||
+#endif
|
||||
#ifdef __arm__
|
||||
#define MACHINE_TYPE "virt"
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,160 @@
|
||||
From 194a48aef32367c45c555a4d93fb1a3375b0dead Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Fri, 19 May 2023 16:08:47 +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()
|
||||
|
||||
Richard W.M. Jones (1):
|
||||
mlcustomize/SELinux_relabel.ml: Use Array.mem
|
||||
|
||||
Roman Kagan (1):
|
||||
mlcustomize: skip SELinux relabeling if it's disabled
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168506
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20230519140849.310774-2-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit 83afd6d3d2c82ee3a8f22079ba12ef7eac38ac34)
|
||||
---
|
||||
common | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Submodule common 70c10a07..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,97 @@
|
||||
From c95b3086bdbdf840de8d3b24c3ae5e9b847bf588 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Fri, 19 May 2023 16:08:48 +0200
|
||||
Subject: [PATCH] LUKS-on-LVM inspection 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 inspection test.
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168506
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20230519140849.310774-3-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
< |