Compare commits

...
Sign in to create a new pull request.

35 commits

Author SHA1 Message Date
Richard W.M. Jones
faeb7c9b1e Kernel failed to boot on qemu with no messages
<quote>
libguestfs: responding to serial console Device Status Report
\x1b[1;256r\x1b[256;256H\x1b[6n
Google, Inc.
Serial Graphics Adapter 01/29/21
SGABIOS $Id$ (mockbuild@) Fri Jan 29 01:55:59 UTC 2021
Term: 80x24
4 0
\x1b[2J
SeaBIOS (version 1.14.0-4.fc34)
Machine UUID ed5fd44b-4d93-47ba-99d8-19f5c861b348
Booting from ROM...
\x1b[2Jlibguestfs: error: error reading console messages from the appliance: Connection reset by peer
</quote>
2022-02-09 14:06:44 +00:00
Richard W.M. Jones
488317994d Bump and rebuild for suspected dep problem
https://github.com/psss/tmt/issues/1042
2022-02-09 13:50:15 +00:00
Richard W.M. Jones
0c63156ee4 New upstream stable branch version 1.46.2
(cherry picked from commit 14d602dc88)
2021-12-24 10:35:05 +00:00
Richard W.M. Jones
f719d4f5ea New upstream stable branch version 1.46.1 2021-12-09 19:27:45 +00:00
Richard W.M. Jones
e67626d9c3 Disable tests on armv7
For Fedora 34:
Original error from libvirt: unsupported configuration: CPU mode 'host-model' for armv7l qemu domain on armv7l host is not supported by hypervisor [code=67 int1=-1]

(cherry picked from commit 9386c1d522)
2021-09-23 19:40:31 +01:00
Richard W.M. Jones
027e4dc34d Remove BUGS file, no longer provided upstream
(cherry picked from commit 1a2b1681de)
2021-09-23 16:11:08 +01:00
Richard W.M. Jones
dff2d2ff2f New upstream stable branch version 1.46.0
(cherry picked from commit 05680b55f6)
2021-09-23 16:11:04 +01:00
Richard W.M. Jones
34aa2141a0 Rebuild for updated ntfs-3g CVE (RHBZ#1999788) 2021-08-31 23:44:22 +01:00
Richard W.M. Jones
e597c5b31b Remove Patch line left by accident in previous commit.
(cherry picked from commit db62beac35)
2021-08-31 17:17:57 +01:00
Richard W.M. Jones
f45117738d New upstream development version 1.45.7.
Fix to work with qemu 6.1 (RHBZ#1998820)

(cherry picked from commit 58d553dcbd)
2021-08-31 17:12:48 +01:00
Richard W.M. Jones
80cccb97e6 Upstream patch to work with qemu 6.1 (RHBZ#1998820)
(cherry picked from commit 6c323aeaf2)
2021-08-31 08:39:31 +01:00
Richard W.M. Jones
dfed7d7522 Add --enable-appliance-format-auto (RHBZ#1967166)
(cherry picked from commit 0b4e08f0b4)
2021-06-03 14:32:03 +01:00
Richard W.M. Jones
ed326bbeff Remove bogus timestamp added by rpmdev-bumpspec
(cherry picked from commit c8896d32cb)
2021-06-03 14:31:19 +01:00
Richard W.M. Jones
46e1226c7f Add gating tests (for RHEL 9)
(cherry picked from commit af41447287)
2021-06-03 14:31:15 +01:00
Richard W.M. Jones
cc5d0a7465 Depend on rpm-libs >= 4.16.1.3 (RHBZ#1966541).
(cherry picked from commit 6b72a37644)
2021-06-03 14:31:09 +01:00
Richard W.M. Jones
9b405c9739 Fix date in changelog
(cherry picked from commit 85d3203b3a)
2021-05-27 18:27:27 +01:00
Richard W.M. Jones
abd4d4b3d6 New upstream development version 1.45.6.
(cherry picked from commit f1ab20704e)
2021-05-27 17:47:26 +01:00
Richard W.M. Jones
c7d6ee374d No qemu-kvm on POWER on RHEL
resolves: rhbz#1946532

(cherry picked from commit 575d24d6694f4460295af0be50ef49c7d0432884)
(cherry picked from commit d4725ab61b)
2021-05-27 17:46:47 +01:00
Richard W.M. Jones
6bcf52b151 libguestfs from 1.45.5 no longer bundles gnulib.
(cherry picked from commit 063aa237e0)
2021-05-27 17:46:43 +01:00
Richard W.M. Jones
4b154c96dc New upstream version 1.45.4.
(cherry picked from commit 6ab119c488)
2021-04-03 12:38:37 +01:00
Richard W.M. Jones
224ba1b52f Add workaround for broken "file" utility in Rawhide (RHBZ#1945122).
(cherry picked from commit a6a11a65c9)
2021-03-31 16:33:02 +01:00
Richard W.M. Jones
04639d5808 Fix date in changelog.
(cherry picked from commit 8f6ba6d789)
2021-03-31 16:32:56 +01:00
Richard W.M. Jones
7773064795 Don't require genisoimage or xorriso for the appliance.
(cherry picked from commit f331cc95d3)
2021-03-31 16:32:53 +01:00
Richard W.M. Jones
7496f55fd4 Switch from genisoimage to xorriso.
(cherry picked from commit 928729ea6e)
2021-03-31 16:32:48 +01:00
Richard W.M. Jones
ff3a3410b7 Add downstream (RHEL-only) patches (RHBZ#1931724).
(cherry picked from commit 9da4883de4)
2021-03-31 16:32:43 +01:00
Richard W.M. Jones
78729c6c7e BR rpm-devel to get header files.
(cherry picked from commit b091b5dde2)
2021-03-31 16:32:09 +01:00
Richard W.M. Jones
db1fafdee4 Add proper dependencies on librpm, remove BDB.
(cherry picked from commit cc9dde2cb7)
2021-03-31 16:32:04 +01:00
Richard W.M. Jones
109d13a094 New upstream release 1.45.3.
(cherry picked from commit 8c3b34551e)
2021-03-31 16:31:56 +01:00
Richard W.M. Jones
3ad6d7c006 Remove no longer needed requires on libguestfs-tools-c.
(cherry picked from commit 3c91923901)
2021-03-26 09:57:36 +00:00
Richard W.M. Jones
2d90b95845 Revert dependency on libvirt 7.1.
Non-upstream patch which reverts (temporarily) libvirt cpu maximum.
This feature requires libvirt 7.1 which is not currently available
in Fedora 34.
2021-03-25 19:47:21 +00:00
Richard W.M. Jones
c4ee04f298 Hand merge rawhide branch in F34. 2021-03-25 19:04:18 +00:00
Richard W.M. Jones
759e2fd7dd Make ocaml-ounit dependency conditional on !RHEL.
It's only needed by virt-builder to run some minor tests.

(cherry picked from commit 4a269d5cf9)
2021-03-18 13:07:53 +00:00
Richard W.M. Jones
f2e540811a Drop dependency on perl(Sys::Virt).
(cherry picked from commit e38829eec1)
2021-03-18 12:29:16 +00:00
Richard W.M. Jones
cc1d44fab4 Drop Requires: libvirt-daemon-kvm, pulls in the whole of qemu and subpkgs.
Cole Robinson writes:

> libguestfs spec looks like it has a bug (looking at fedora rawhide). It
> attempts to use Suggests/Recommends to limit what's pulled in of qemu
> modules, but then it has a dep on libvirt-daemon-kvm which conditionally
> pulls in qemu-kvm, which on fedora pulls in every qemu module. That
> explains SDL and gtk deps.
>
> libvirt-daemon-kvm is just a metapackage with deps on
> libvirt-daemon-driver-X subsystems, and qemu-kvm. The thing that
> actually puts the libvirt qemu driver on the host is
> libvirt-daemon-driver-qemu, which libguestfs already has an explicit dep on.
>
> So try dropping the libvirt-daemon-kvm dep and see if things break.

(cherry picked from commit 4fa48327db)
2021-03-10 18:02:48 +00:00
Richard W.M. Jones
4e13436381 Bump and rebuild for ocaml-gettext update. 2021-03-08 12:25:27 +00:00
10 changed files with 1384 additions and 454 deletions

View file

@ -0,0 +1,55 @@
From 802b515677d77936a2ae0d6e945a0364e4246002 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 1/5] RHEL: Remove libguestfs live (RHBZ#798980).
This isn't supported in RHEL.
Disable daemon tests that require the 'unix' backend.
---
lib/launch-unix.c | 7 +++++++
tests/Makefile.am | 3 ---
2 files changed, 7 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/Makefile.am b/tests/Makefile.am
index 690e09b5e..919e2f248 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -328,9 +328,6 @@ EXTRA_DIST += create/test-disk-create.sh
check_DATA = daemon/captive-daemon.pm
-TESTS += \
- daemon/test-daemon-start.pl \
- daemon/test-btrfs.pl
EXTRA_DIST += \
daemon/test-daemon-start.pl \
daemon/test-btrfs.pl
--
2.30.1

View file

@ -0,0 +1,34 @@
From 7af98c099c181f0b378a8390fb72f424d4bc7a4a Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 25 Mar 2021 19:44:34 +0000
Subject: [PATCH] Revert "appliance: Use <cpu mode="maximum"/> for -cpu max on
libvirt."
This reverts commit 13ceb6a87b2869909a6a0e3c8caa962b72e4cb0e.
---
lib/launch-libvirt.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
index 194530c49..2d995bee0 100644
--- a/lib/launch-libvirt.c
+++ b/lib/launch-libvirt.c
@@ -1183,8 +1183,13 @@ construct_libvirt_xml_cpu (guestfs_h *g,
} end_element ();
}
else if (STREQ (cpu_model, "max")) {
- /* https://bugzilla.redhat.com/show_bug.cgi?id=1935572#c11 */
- attribute ("mode", "maximum");
+ if (params->data->is_kvm)
+ attribute ("mode", "host-passthrough");
+ else
+ attribute ("mode", "host-model");
+ start_element ("model") {
+ attribute ("fallback", "allow");
+ } end_element ();
}
else
single_element ("model", cpu_model);
--
2.29.0.rc2

View file

@ -1,80 +0,0 @@
From 282e2f74cf1209ecf6bb18655018b2000a5b36a1 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 28 Jan 2021 12:20:49 +0000
Subject: [PATCH] appliance: Use -cpu max.
QEMU has a newish feature (from about 2017 / qemu 2.9) called -cpu max
which is supposed to select the best CPU, ideal for libguestfs.
After this change, on x86-64:
KVM TCG
Direct -cpu max -cpu max
(non-libvirt)
Libvirt <cpu mode="host-passthrough"> <cpu mode="host-model">
<model fallback="allow"/> <model fallback="allow"/>
</cpu> </cpu>
---
lib/appliance-cpu.c | 16 ++++++++--------
lib/launch-libvirt.c | 9 +++++++++
2 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/lib/appliance-cpu.c b/lib/appliance-cpu.c
index 5ef9f5c72..54ac6e2e3 100644
--- a/lib/appliance-cpu.c
+++ b/lib/appliance-cpu.c
@@ -38,6 +38,11 @@
*
* The literal string C<"host"> means use C<-cpu host>.
*
+ * =item C<"max">
+ *
+ * The literal string C<"max"> means use C<-cpu max> (the best
+ * possible). This requires awkward translation for libvirt.
+ *
* =item some string
*
* Some string such as C<"cortex-a57"> means use C<-cpu cortex-a57>.
@@ -80,14 +85,9 @@ guestfs_int_get_cpu_model (int kvm)
/* See discussion in https://bugzilla.redhat.com/show_bug.cgi?id=1605071 */
return NULL;
#else
- /* On most architectures, it is faster to pass the CPU host model to
- * the appliance, allowing maximum speed for things like checksums
- * and encryption. Only do this with KVM. It is broken in subtle
- * ways on TCG, and fairly pointless when you're emulating anyway.
+ /* On most architectures we can use "max" to get the best possible CPU.
+ * For recent qemu this should work even on TCG.
*/
- if (kvm)
- return "host";
- else
- return NULL;
+ return "max";
#endif
}
diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
index 026dc6b26..eff1c8f7e 100644
--- a/lib/launch-libvirt.c
+++ b/lib/launch-libvirt.c
@@ -1169,6 +1169,15 @@ construct_libvirt_xml_cpu (guestfs_h *g,
attribute ("fallback", "allow");
} end_element ();
}
+ else if (STREQ (cpu_model, "max")) {
+ if (params->data->is_kvm)
+ attribute ("mode", "host-passthrough");
+ else
+ attribute ("mode", "host-model");
+ start_element ("model") {
+ attribute ("fallback", "allow");
+ } end_element ();
+ }
else
single_element ("model", cpu_model);
} end_element ();
--
2.29.0.rc2

View file

@ -0,0 +1,329 @@
From c8770be96ddbebd7f1f726d97aa566fb1558ce2d 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 2/5] RHEL: Remove 9p APIs from RHEL (RHBZ#921710).
---
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 -
tests/Makefile.am | 1 -
8 files changed, 212 deletions(-)
delete mode 100644 daemon/9p.c
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 216029b7c..8bf601367 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -83,7 +83,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 060be051b..7a05f3b24 100644
--- a/docs/C_SOURCE_FILES
+++ b/docs/C_SOURCE_FILES
@@ -43,7 +43,6 @@ common/visit/visit.c
common/visit/visit.h
common/windows/windows.c
common/windows/windows.h
-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 bb92ef2ca..5f849bad1 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 74b95baf7..6b6cb7353 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 c5f4e6aa7..aeb701e32 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -26,7 +26,6 @@ common/utils/stringlists-utils.c
common/utils/utils.c
common/visit/visit.c
common/windows/windows.c
-daemon/9p.c
daemon/acl.c
daemon/augeas.c
daemon/available.c
@@ -251,7 +250,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
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 919e2f248..e3613fec4 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -43,7 +43,6 @@ check-slow:
check-valgrind:
$(MAKE) VG="@VG@" check
-TESTS += 9p/test-9p.sh
EXTRA_DIST += 9p/test-9p.sh
SLOW_TESTS += bigdirs/test-big-dirs.pl
--
2.30.1

View file

@ -0,0 +1,609 @@
From 41beea618d3da3b0351b3d8aa7eb7be40f369877 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 29 Jul 2013 14:47:56 +0100
Subject: [PATCH 3/5] RHEL: Disable unsupported remote drive protocols
(RHBZ#962113).
This disables support for unsupported remote drive protocols:
* ftp
* ftps
* http
* https
* tftp
* gluster
* iscsi
* sheepdog
* ssh
Note 'nbd' is not disabled, and of course 'file' works.
We hope to gradually add some of these back over the lifetime of RHEL.
---
docs/guestfs-testing.pod | 20 -----
fish/guestfish.pod | 66 ++--------------
fish/test-add-uri.sh | 32 --------
generator/actions_core.ml | 50 +------------
lib/drives.c | 8 ++
lib/guestfs.pod | 100 -------------------------
tests/disks/test-qemu-drive-libvirt.sh | 28 -------
tests/disks/test-qemu-drive.sh | 60 ---------------
8 files changed, 16 insertions(+), 348 deletions(-)
diff --git a/docs/guestfs-testing.pod b/docs/guestfs-testing.pod
index f558964bf..8f264ed17 100644
--- a/docs/guestfs-testing.pod
+++ b/docs/guestfs-testing.pod
@@ -109,26 +109,6 @@ image. To exit, type C<exit>.
If you get an error, try enabling debugging (add C<-v> to the command
line). Also make sure that L<libguestfs-test-tool(1)> succeeds.
-=head2 Try to open a remote guest image with guestfish.
-
-You may also have to disable libvirt by setting this:
-
- export LIBGUESTFS_BACKEND=direct
-
-If you have a disk image available over HTTP/FTP, try to open it.
-
- guestfish --ro -i --format=raw -a http://www.example.com/disk.img
-
-For SSH you will need to make sure that ssh-agent is set up so you
-don't need a password to log in to the remote machine. Then a command
-similar to this should work:
-
- guestfish --ro -i --format=raw \
- -a ssh://remote.example.com/path/to/disk.img
-
-If you get an error, try enabling debugging (add C<-v> to the command
-line). Also make sure that L<libguestfs-test-tool(1)> succeeds.
-
=head2 Run virt-alignment-scan on all your guests.
Run L<virt-alignment-scan(1)> on guests or disk images:
diff --git a/fish/guestfish.pod b/fish/guestfish.pod
index 9f086f110..bb4167b06 100644
--- a/fish/guestfish.pod
+++ b/fish/guestfish.pod
@@ -131,9 +131,9 @@ To list what is available do:
=head2 Remote drives
-Access a remote disk using ssh:
+Access a remote disk using NBD:
- guestfish -a ssh://example.com/path/to/disk.img
+ guestfish -a nbd://example.com
=head2 Remote control
@@ -1134,12 +1134,12 @@ L<guestfs(3)/REMOTE STORAGE>>.
On the command line, you can use the I<-a> option to add network
block devices using a URI-style format, for example:
- guestfish -a ssh://root@example.com/disk.img
+ guestfish -a nbd://example.com
URIs I<cannot> be used with the L</add> command. The equivalent
command using the API directly is:
- ><fs> add /disk.img protocol:ssh server:tcp:example.com username:root
+ ><fs> add /disk.img protocol:nbd server:tcp:example.com
The possible I<-a URI> formats are described below.
@@ -1149,40 +1149,6 @@ The possible I<-a URI> formats are described below.
Add the local disk image (or device) called F<disk.img>.
-=head2 B<-a ftp://[user@]example.com[:port]/disk.img>
-
-=head2 B<-a ftps://[user@]example.com[:port]/disk.img>
-
-=head2 B<-a http://[user@]example.com[:port]/disk.img>
-
-=head2 B<-a https://[user@]example.com[:port]/disk.img>
-
-=head2 B<-a tftp://[user@]example.com[:port]/disk.img>
-
-Add a disk located on a remote FTP, HTTP or TFTP server.
-
-The equivalent API command would be:
-
- ><fs> add /disk.img protocol:(ftp|...) server:tcp:example.com
-
-=head2 B<-a gluster://example.com[:port]/volname/image>
-
-Add a disk image located on GlusterFS storage.
-
-The server is the one running C<glusterd>, and may be C<localhost>.
-
-The equivalent API command would be:
-
- ><fs> add volname/image protocol:gluster server:tcp:example.com
-
-=head2 B<-a iscsi://example.com[:port]/target-iqn-name[/lun]>
-
-Add a disk located on an iSCSI server.
-
-The equivalent API command would be:
-
- ><fs> add target-iqn-name/lun protocol:iscsi server:tcp:example.com
-
=head2 B<-a nbd://example.com[:port]>
=head2 B<-a nbd://example.com[:port]/exportname>
@@ -1217,35 +1183,13 @@ The equivalent API command would be:
><fs> add pool/disk protocol:rbd server:tcp:example.com:port
-=head2 B<-a sheepdog://[example.com[:port]]/volume/image>
-
-Add a disk image located on a Sheepdog volume.
-
-The server name is optional. Although libguestfs and Sheepdog
-supports multiple servers, only at most one server can be specified
-when using this URI syntax.
-
-The equivalent API command would be:
-
- ><fs> add volume protocol:sheepdog [server:tcp:example.com]
-
-=head2 B<-a ssh://[user@]example.com[:port]/disk.img>
-
-Add a disk image located on a remote server, accessed using the Secure
-Shell (ssh) SFTP protocol. SFTP is supported out of the box by all
-major SSH servers.
-
-The equivalent API command would be:
-
- ><fs> add /disk protocol:ssh server:tcp:example.com [username:user]
-
Note that the URIs follow the syntax of
L<RFC 3986|https://tools.ietf.org/html/rfc3986>: in particular, there
are restrictions on the allowed characters for the various components
of the URI. Characters such as C<:>, C<@>, and C</> B<must> be
percent-encoded:
- $ guestfish -a ssh://user:pass%40word@example.com/disk.img
+ $ guestfish -a rbd://user:pass%40word@example.com[:port]/pool/disk
In this case, the password is C<pass@word>.
diff --git a/fish/test-add-uri.sh b/fish/test-add-uri.sh
index 21d424984..ddabeb639 100755
--- a/fish/test-add-uri.sh
+++ b/fish/test-add-uri.sh
@@ -40,14 +40,6 @@ function fail ()
$VG guestfish -x -a file://$abs_builddir/test-add-uri.img </dev/null >test-add-uri.out 2>&1
grep -sq 'add_drive ".*/test-add-uri.img"' test-add-uri.out || fail
-# curl
-$VG guestfish -x -a ftp://user@example.com/disk.img </dev/null >test-add-uri.out 2>&1
-grep -sq 'add_drive "/disk.img" "protocol:ftp" "server:tcp:example.com" "username:user"' test-add-uri.out || fail
-
-# gluster
-$VG guestfish -x -a gluster://example.com/disk </dev/null >test-add-uri.out 2>&1
-grep -sq 'add_drive "disk" "protocol:gluster" "server:tcp:example.com"' test-add-uri.out || fail
-
# NBD
$VG guestfish -x -a nbd://example.com </dev/null >test-add-uri.out 2>&1
grep -sq 'add_drive "" "protocol:nbd" "server:tcp:example.com"' test-add-uri.out || fail
@@ -67,29 +59,5 @@ grep -sq 'add_drive "pool/disk" "protocol:rbd" "server:tcp:example.com:6789"' te
$VG guestfish -x -a rbd:///pool/disk </dev/null >test-add-uri.out 2>&1
grep -sq 'add_drive "pool/disk" "protocol:rbd"' test-add-uri.out || fail
-# sheepdog
-$VG guestfish -x -a sheepdog:///volume/image </dev/null >test-add-uri.out 2>&1
-grep -sq 'add_drive "volume/image" "protocol:sheepdog"' test-add-uri.out || fail
-
-$VG guestfish -x -a sheepdog://example.com:3000/volume/image </dev/null >test-add-uri.out 2>&1
-grep -sq 'add_drive "volume/image" "protocol:sheepdog" "server:tcp:example.com:3000"' test-add-uri.out || fail
-
-# ssh
-$VG guestfish -x -a ssh://example.com/disk.img </dev/null >test-add-uri.out 2>&1
-grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com"' test-add-uri.out || fail
-
-$VG guestfish -x -a ssh://user@example.com/disk.img </dev/null >test-add-uri.out 2>&1
-grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com" "username:user"' test-add-uri.out || fail
-
-$VG guestfish -x -a ssh://user@example.com:2000/disk.img </dev/null >test-add-uri.out 2>&1
-grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com:2000" "username:user"' test-add-uri.out || fail
-
-# iSCSI
-$VG guestfish -x -a iscsi://example.com/iqn.2015-12.com.libguestfs:test1/0 </dev/null >test-add-uri.out 2>&1
-grep -sq 'add_drive "iqn.2015-12.com.libguestfs:test1/0" "protocol:iscsi" "server:tcp:example.com"' test-add-uri.out || fail
-
-$VG guestfish -x -a iscsi://user:password@example.com/iqn.2015-12.com.libguestfs:test2/0 </dev/null >test-add-uri.out 2>&1
-grep -sq 'add_drive "iqn.2015-12.com.libguestfs:test2/0" "protocol:iscsi" "server:tcp:example.com" "username:user" "secret:password"' test-add-uri.out || fail
-
rm test-add-uri.out
rm test-add-uri.img
diff --git a/generator/actions_core.ml b/generator/actions_core.ml
index 5f849bad1..f6f8844b8 100644
--- a/generator/actions_core.ml
+++ b/generator/actions_core.ml
@@ -297,29 +297,6 @@ F<filename> is interpreted as a local file or device.
This is the default if the optional protocol parameter
is omitted.
-=item C<protocol = \"ftp\"|\"ftps\"|\"http\"|\"https\"|\"tftp\">
-
-Connect to a remote FTP, HTTP or TFTP server.
-The C<server> parameter must also be supplied - see below.
-
-See also: L<guestfs(3)/FTP, HTTP AND TFTP>
-
-=item C<protocol = \"gluster\">
-
-Connect to the GlusterFS server.
-The C<server> parameter must also be supplied - see below.
-
-See also: L<guestfs(3)/GLUSTER>
-
-=item C<protocol = \"iscsi\">
-
-Connect to the iSCSI server.
-The C<server> parameter must also be supplied - see below.
-The C<username> parameter may be supplied. See below.
-The C<secret> parameter may be supplied. See below.
-
-See also: L<guestfs(3)/ISCSI>.
-
=item C<protocol = \"nbd\">
Connect to the Network Block Device server.
@@ -336,22 +313,6 @@ The C<secret> parameter may be supplied. See below.
See also: L<guestfs(3)/CEPH>.
-=item C<protocol = \"sheepdog\">
-
-Connect to the Sheepdog server.
-The C<server> parameter may also be supplied - see below.
-
-See also: L<guestfs(3)/SHEEPDOG>.
-
-=item C<protocol = \"ssh\">
-
-Connect to the Secure Shell (ssh) server.
-
-The C<server> parameter must be supplied.
-The C<username> parameter may be supplied. See below.
-
-See also: L<guestfs(3)/SSH>.
-
=back
=item C<server>
@@ -362,13 +323,8 @@ is a list of server(s).
Protocol Number of servers required
-------- --------------------------
file List must be empty or param not used at all
- ftp|ftps|http|https|tftp Exactly one
- gluster Exactly one
- iscsi Exactly one
nbd Exactly one
rbd Zero or more
- sheepdog Zero or more
- ssh Exactly one
Each list element is a string specifying a server. The string must be
in one of the following formats:
@@ -384,10 +340,10 @@ for the protocol is used (see F</etc/services>).
=item C<username>
-For the C<ftp>, C<ftps>, C<http>, C<https>, C<iscsi>, C<rbd>, C<ssh>
-and C<tftp> protocols, this specifies the remote username.
+For the C<rbd>
+protocol, this specifies the remote username.
-If not given, then the local username is used for C<ssh>, and no authentication
+If not given, then no authentication
is attempted for ceph. But note this sometimes may give unexpected results, for
example if using the libvirt backend and if the libvirt backend is configured to
start the qemu appliance as a special user such as C<qemu.qemu>. If in doubt,
diff --git a/lib/drives.c b/lib/drives.c
index 46af66db4..c81ded5d7 100644
--- a/lib/drives.c
+++ b/lib/drives.c
@@ -168,6 +168,7 @@ create_drive_non_file (guestfs_h *g,
return drv;
}
+#if 0 /* DISABLED IN RHEL 8 */
static struct drive *
create_drive_curl (guestfs_h *g,
const struct drive_create_data *data)
@@ -226,6 +227,7 @@ create_drive_gluster (guestfs_h *g,
return create_drive_non_file (g, data);
}
+#endif /* DISABLED IN RHEL 8 */
static int
nbd_port (void)
@@ -294,6 +296,7 @@ create_drive_rbd (guestfs_h *g,
return create_drive_non_file (g, data);
}
+#if 0 /* DISABLED IN RHEL 8 */
static struct drive *
create_drive_sheepdog (guestfs_h *g,
const struct drive_create_data *data)
@@ -394,6 +397,7 @@ create_drive_iscsi (guestfs_h *g,
return create_drive_non_file (g, data);
}
+#endif /* DISABLED IN RHEL 8 */
/**
* Create the special F</dev/null> drive.
@@ -856,6 +860,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
drv = create_drive_file (g, &data);
}
}
+#if 0 /* DISABLED IN RHEL 8 */
else if (STREQ (protocol, "ftp")) {
data.protocol = drive_protocol_ftp;
drv = create_drive_curl (g, &data);
@@ -880,6 +885,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
data.protocol = drive_protocol_iscsi;
drv = create_drive_iscsi (g, &data);
}
+#endif /* DISABLED IN RHEL 8 */
else if (STREQ (protocol, "nbd")) {
data.protocol = drive_protocol_nbd;
drv = create_drive_nbd (g, &data);
@@ -888,6 +894,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
data.protocol = drive_protocol_rbd;
drv = create_drive_rbd (g, &data);
}
+#if 0 /* DISABLED IN RHEL 8 */
else if (STREQ (protocol, "sheepdog")) {
data.protocol = drive_protocol_sheepdog;
drv = create_drive_sheepdog (g, &data);
@@ -900,6 +907,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
data.protocol = drive_protocol_tftp;
drv = create_drive_curl (g, &data);
}
+#endif /* DISABLED IN RHEL 8 */
else {
error (g, _("unknown protocol %s"), protocol);
drv = NULL; /*FALLTHROUGH*/
diff --git a/lib/guestfs.pod b/lib/guestfs.pod
index ff58aa0bb..1af00f1bb 100644
--- a/lib/guestfs.pod
+++ b/lib/guestfs.pod
@@ -715,70 +715,6 @@ servers. The server string is documented in
L</guestfs_add_drive_opts>. The C<username> and C<secret> parameters are
also optional, and if not given, then no authentication will be used.
-=head3 FTP, HTTP AND TFTP
-
-Libguestfs can access remote disks over FTP, FTPS, HTTP, HTTPS
-or TFTP protocols.
-
-To do this, set the optional C<protocol> and C<server> parameters of
-L</guestfs_add_drive_opts> like this:
-
- char **servers = { "www.example.org", NULL };
- guestfs_add_drive_opts (g, "/disk.img",
- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "http",
- GUESTFS_ADD_DRIVE_OPTS_SERVER, servers,
- -1);
-
-The C<protocol> can be one of C<"ftp">, C<"ftps">, C<"http">,
-C<"https"> or C<"tftp">.
-
-C<servers> (the C<server> parameter) is a list which must have a
-single element. The single element is a string defining the web,
-FTP or TFTP server. The format of this string is documented in
-L</guestfs_add_drive_opts>.
-
-=head3 GLUSTER
-
-Libguestfs can access Gluster disks.
-
-To do this, set the optional C<protocol> and C<server> parameters of
-L</guestfs_add_drive_opts> like this:
-
- char **servers = { "gluster.example.org:24007", NULL };
- guestfs_add_drive_opts (g, "volname/image",
- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "gluster",
- GUESTFS_ADD_DRIVE_OPTS_SERVER, servers,
- -1);
-
-C<servers> (the C<server> parameter) is a list which must have a
-single element. The single element is a string defining the Gluster
-server. The format of this string is documented in
-L</guestfs_add_drive_opts>.
-
-Note that gluster usually requires the client process (ie. libguestfs)
-to run as B<root> and will give unfathomable errors if it is not
-(eg. "No data available").
-
-=head3 ISCSI
-
-Libguestfs can access iSCSI disks remotely.
-
-To do this, set the optional C<protocol> and C<server> parameters like
-this:
-
- char **server = { "iscsi.example.org:3000", NULL };
- guestfs_add_drive_opts (g, "target-iqn-name/lun",
- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "iscsi",
- GUESTFS_ADD_DRIVE_OPTS_SERVER, server,
- -1);
-
-The C<server> parameter is a list which must have a single element.
-The single element is a string defining the iSCSI server. The format
-of this string is documented in L</guestfs_add_drive_opts>.
-
=head3 NETWORK BLOCK DEVICE
Libguestfs can access Network Block Device (NBD) disks remotely.
@@ -841,42 +777,6 @@ L<https://bugs.launchpad.net/qemu/+bug/1155677>
=back
-=head3 SHEEPDOG
-
-Libguestfs can access Sheepdog disks.
-
-To do this, set the optional C<protocol> and C<server> parameters of
-L</guestfs_add_drive_opts> like this:
-
- char **servers = { /* optional servers ... */ NULL };
- guestfs_add_drive_opts (g, "volume",
- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "sheepdog",
- GUESTFS_ADD_DRIVE_OPTS_SERVER, servers,
- -1);
-
-The optional list of C<servers> may be zero or more server addresses
-(C<"hostname:port">). The format of the server strings is documented
-in L</guestfs_add_drive_opts>.
-
-=head3 SSH
-
-Libguestfs can access disks over a Secure Shell (SSH) connection.
-
-To do this, set the C<protocol> and C<server> and (optionally)
-C<username> parameters of L</guestfs_add_drive_opts> like this:
-
- char **server = { "remote.example.com", NULL };
- guestfs_add_drive_opts (g, "/path/to/disk.img",
- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "ssh",
- GUESTFS_ADD_DRIVE_OPTS_SERVER, server,
- GUESTFS_ADD_DRIVE_OPTS_USERNAME, "remoteuser",
- -1);
-
-The format of the server string is documented in
-L</guestfs_add_drive_opts>.
-
=head2 INSPECTION
Libguestfs has APIs for inspecting an unknown disk image to find out
diff --git a/tests/disks/test-qemu-drive-libvirt.sh b/tests/disks/test-qemu-drive-libvirt.sh
index 595a95a5e..b49534c94 100755
--- a/tests/disks/test-qemu-drive-libvirt.sh
+++ b/tests/disks/test-qemu-drive-libvirt.sh
@@ -65,34 +65,6 @@ check_output
grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail ceph2
rm "$DEBUG_QEMU_FILE"
-# Gluster.
-
-$guestfish -d gluster run ||:
-check_output
-grep -sq -- '-drive file=gluster://1.2.3.4:1234/volname/image,' "$DEBUG_QEMU_FILE" || fail gluster
-rm "$DEBUG_QEMU_FILE"
-
-# iSCSI.
-
-$guestfish -d iscsi run ||:
-check_output
-grep -sq -- '-drive file=iscsi://1.2.3.4:1234/iqn.2003-01.org.linux-iscsi.fedora' "$DEBUG_QEMU_FILE" || fail iscsi
-rm "$DEBUG_QEMU_FILE"
-
-# NBD.
-
-$guestfish -d nbd run ||:
-check_output
-grep -sq -- '-drive file=nbd:1.2.3.4:1234,' "$DEBUG_QEMU_FILE" || fail nbd
-rm "$DEBUG_QEMU_FILE"
-
-# Sheepdog.
-
-$guestfish -d sheepdog run ||:
-check_output
-grep -sq -- '-drive file=sheepdog:volume,' "$DEBUG_QEMU_FILE" || fail sheepdog
-rm "$DEBUG_QEMU_FILE"
-
# Local, stored in a pool.
$guestfish -d pool1 run ||:
diff --git a/tests/disks/test-qemu-drive.sh b/tests/disks/test-qemu-drive.sh
index 12937fb30..b3e4f9903 100755
--- a/tests/disks/test-qemu-drive.sh
+++ b/tests/disks/test-qemu-drive.sh
@@ -62,45 +62,6 @@ check_output
grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail
rm "$DEBUG_QEMU_FILE"
-# HTTP.
-
-guestfish <<EOF ||:
- add "/disk.img" "format:raw" "protocol:http" "server:www.example.com"
- run
-EOF
-check_output
-grep -sq -- '-drive file=http://www.example.com/disk.img,' "$DEBUG_QEMU_FILE" || fail
-rm "$DEBUG_QEMU_FILE"
-
-# Gluster.
-
-guestfish <<EOF ||:
- add "volname/image" "format:raw" "protocol:gluster" "server:www.example.com:24007"
- run
-EOF
-check_output
-grep -sq -- '-drive file=gluster://www.example.com:24007/volname/image,' "$DEBUG_QEMU_FILE" || fail
-rm "$DEBUG_QEMU_FILE"
-
-# iSCSI.
-
-guestfish <<EOF ||:
- add "target-iqn-name/lun" "format:raw" "protocol:iscsi" "server:www.example.com:3000"
- run
-EOF
-check_output
-grep -sq -- '-drive file=iscsi://www.example.com:3000/target-iqn-name/lun,' "$DEBUG_QEMU_FILE" || fail
-rm "$DEBUG_QEMU_FILE"
-
-guestfish <<EOF ||:
- add "target-iqn-name/lun" "format:raw" "protocol:iscsi" "server:www.example.com:3000" \
- "username:user" "secret:pass"
- run
-EOF
-check_output
-grep -sq -- '-drive file=iscsi://user%pass@www.example.com:3000/target-iqn-name/lun,' "$DEBUG_QEMU_FILE" || fail
-rm "$DEBUG_QEMU_FILE"
-
# NBD.
guestfish <<EOF ||:
@@ -118,24 +79,3 @@ EOF
check_output
grep -sq -- '-drive file=nbd:unix:/socket,' "$DEBUG_QEMU_FILE" || fail
rm "$DEBUG_QEMU_FILE"
-
-# Sheepdog.
-
-guestfish <<EOF ||:
- add "volume" "format:raw" "protocol:sheepdog"
- run
-EOF
-check_output
-grep -sq -- '-drive file=sheepdog:volume,' "$DEBUG_QEMU_FILE" || fail
-rm "$DEBUG_QEMU_FILE"
-
-# SSH.
-
-guestfish <<EOF ||:
- add "/disk.img" "format:raw" "protocol:ssh" "server:example.com" \
- "username:rich"
- run
-EOF
-check_output
-grep -sq -- '-drive file=ssh://rich@example.com/disk.img,' "$DEBUG_QEMU_FILE" || fail
-rm "$DEBUG_QEMU_FILE"
--
2.30.1

View file

@ -0,0 +1,72 @@
From 2cad9372eb4f3a1c37f254eb2e9af797693fa7d4 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 4/5] RHEL: Remove User-Mode Linux (RHBZ#1144197).
This isn't supported in RHEL.
---
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.30.1

View file

@ -0,0 +1,69 @@
From f3fde497b6e0b079ff86360f6c0b6ef8d433c39b Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 7 Jul 2015 09:28:03 -0400
Subject: [PATCH 5/5] RHEL: Reject use of libguestfs-winsupport features except
for virt-* tools (RHBZ#1240276).
Fix the tests: it doesn't let us use guestfish for arbitrary Windows
edits.
---
generator/c.ml | 16 ++++++++++++++++
test-data/phony-guests/make-windows-img.sh | 1 +
tests/charsets/test-charset-fidelity.c | 2 ++
3 files changed, 19 insertions(+)
diff --git a/generator/c.ml b/generator/c.ml
index 86d3b26f8..a625361a9 100644
--- a/generator/c.ml
+++ b/generator/c.ml
@@ -1846,6 +1846,22 @@ and generate_client_actions actions () =
check_args_validity c_name style;
trace_call name c_name style;
+ (* RHEL 8 *)
+ if name = "mount" || name = "mount_ro" || name = "mount_options" ||
+ name = "mount_vfs" then (
+ pr " if (g->program && !STRPREFIX (g->program, \"virt-\")) {\n";
+ pr " CLEANUP_FREE char *vfs_type = guestfs_vfs_type (g, mountable);\n";
+ pr " if (vfs_type && STREQ (vfs_type, \"ntfs\")) {\n";
+ pr " error (g, \"mount: unsupported filesystem type\");\n";
+ pr " if (trace_flag)\n";
+ pr " guestfs_int_trace (g, \"%%s = %%s (error)\",\n";
+ pr " \"%s\", \"-1\");\n" name;
+ pr " return %s;\n" (string_of_errcode errcode);
+ pr " }\n";
+ pr " }\n";
+ pr "\n";
+ );
+
(* Calculate the total size of all FileIn arguments to pass
* as a progress bar hint.
*)
diff --git a/test-data/phony-guests/make-windows-img.sh b/test-data/phony-guests/make-windows-img.sh
index 30908a918..73cf5144e 100755
--- a/test-data/phony-guests/make-windows-img.sh
+++ b/test-data/phony-guests/make-windows-img.sh
@@ -37,6 +37,7 @@ fi
# Create a disk image.
guestfish <<EOF
+set-program virt-testing
sparse windows.img-t 512M
run
diff --git a/tests/charsets/test-charset-fidelity.c b/tests/charsets/test-charset-fidelity.c
index 105291dc3..5ca4f3b6d 100644
--- a/tests/charsets/test-charset-fidelity.c
+++ b/tests/charsets/test-charset-fidelity.c
@@ -96,6 +96,8 @@ main (int argc, char *argv[])
if (g == NULL)
error (EXIT_FAILURE, 0, "failed to create handle");
+ guestfs_set_program (g, "virt-testing");
+
if (guestfs_add_drive_scratch (g, 1024*1024*1024, -1) == -1)
exit (EXIT_FAILURE);
--
2.30.1

6
gating.yaml Executable file
View file

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: xen-ci.brew-build.tier1.functional}

View file

@ -17,15 +17,16 @@
#
# Currently the basic sanity check is *broken* on:
#
# arm: times out when running the test
# arm: cannot see virtio devices (similar to RHBZ#2006709 ?)
# aarch64: "MSI is not supported by interrupt controller" (RHBZ#1414081)
# ppc64: qemu doesn't work with TCG (RHBZ#1614948)
# ppc64le: kernel doesn't boot on qemu (RHBZ#1435873)
# s390x: qemu TCG cannot emulate enough to boot the kernel
# (however KVM would work if it was available in Koji, so this
# is not a bug)
# x86_64: kernel fails to boot (with no output)
%if !0%{?rhel}
%global test_arches x86_64
%global test_arches NONE
%else
# RHEL 9 only:
# x86-64: "/lib64/libc.so.6: CPU ISA level is lower than required"
@ -41,10 +42,15 @@
%global verify_tarball_signature 1
# If there are patches which touch autotools files, set this to 1.
%if !0%{?rhel}
%global patches_touch_autotools %{nil}
%else
# On RHEL the downstream patches always touch autotools files.
%global patches_touch_autotools 1
%endif
# The source directory.
%global source_directory 1.44-stable
%global source_directory 1.46-stable
# Filter perl provides.
%{?perl_default_filter}
@ -55,12 +61,16 @@
Summary: Access and modify virtual machine disk images
Name: libguestfs
Epoch: 1
Version: 1.44.0
Release: 5%{?dist}
Version: 1.46.2
Release: 1%{?dist}.1
License: LGPLv2+
# Build only for architectures that have a kernel
ExclusiveArch: %{kernel_arches}
%if 0%{?rhel}
# No qemu-kvm on POWER (RHBZ#1946532).
ExcludeArch: %{power64}
%endif
# Source and patches.
URL: http://libguestfs.org/
@ -86,14 +96,25 @@ Source7: libguestfs.keyring
# Maintainer script which helps with handling patches.
Source8: copy-patches.sh
# Upstream patch to use -cpu max.
Patch1: 0001-appliance-Use-cpu-max.patch
# Downstream (RHEL-only) patches.
%if 0%{?rhel}
Patch9001: 0001-RHEL-Remove-libguestfs-live-RHBZ-798980.patch
Patch9002: 0002-RHEL-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch
Patch9003: 0003-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch
Patch9004: 0004-RHEL-Remove-User-Mode-Linux-RHBZ-1144197.patch
Patch9005: 0005-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch
%endif
# Non-upstream patch which reverts (temporarily) libvirt cpu maximum.
# This feature requires libvirt 7.1 which is not currently available
# in Fedora 34.
Patch9999: 0001-Revert-appliance-Use-cpu-mode-maximum-for-cpu-max-on.patch
%if 0%{patches_touch_autotools}
BuildRequires: autoconf, automake, libtool, gettext-devel
%endif
# Basic build requirements for the library and virt tools.
# Basic build requirements.
BuildRequires: gcc, gcc-c++
BuildRequires: make
BuildRequires: rpcgen
@ -107,20 +128,20 @@ BuildRequires: /usr/bin/pod2text
BuildRequires: po4a
BuildRequires: augeas-devel >= 1.7.0
BuildRequires: readline-devel
BuildRequires: genisoimage
BuildRequires: xorriso
BuildRequires: libxml2-devel
BuildRequires: createrepo_c
BuildRequires: glibc-static
BuildRequires: libselinux-utils
BuildRequires: libselinux-devel
BuildRequires: fuse, fuse-devel
BuildRequires: pcre-devel
BuildRequires: pcre2-devel
BuildRequires: file-devel
BuildRequires: libvirt-devel
BuildRequires: gperf
BuildRequires: flex
BuildRequires: bison
BuildRequires: libdb-utils
BuildRequires: rpm-devel
BuildRequires: cpio
BuildRequires: libconfig-devel
BuildRequires: xz-devel
@ -131,7 +152,8 @@ BuildRequires: unzip
BuildRequires: systemd-units
BuildRequires: netpbm-progs
BuildRequires: icoutils
BuildRequires: libvirt-daemon-kvm >= 5.3.0
#BuildRequires: libvirt-daemon-kvm >= 7.1.0
BuildRequires: libvirt-daemon-kvm
%if !0%{?rhel}
BuildRequires: perl(Expect)
%endif
@ -145,11 +167,8 @@ BuildRequires: systemd-devel
BuildRequires: bash-completion
BuildRequires: /usr/bin/ping
BuildRequires: /usr/bin/wget
BuildRequires: curl
BuildRequires: xz
BuildRequires: /usr/bin/qemu-img
BuildRequires: perl(Win::Hivex)
BuildRequires: perl(Win::Hivex::Regedit)
%if 0%{verify_tarball_signature}
BuildRequires: gnupg2
@ -160,13 +179,14 @@ BuildRequires: ocaml
BuildRequires: ocaml-ocamldoc
BuildRequires: ocaml-findlib-devel
BuildRequires: ocaml-gettext-devel
%if !0%{?rhel}
BuildRequires: ocaml-ounit-devel
%endif
BuildRequires: lua
BuildRequires: lua-devel
BuildRequires: perl-devel
BuildRequires: perl-generators
BuildRequires: perl-macros
BuildRequires: perl(Sys::Virt)
BuildRequires: perl(Test::More)
BuildRequires: perl(Test::Pod) >= 1.00
BuildRequires: perl(Test::Pod::Coverage) >= 1.00
@ -213,8 +233,8 @@ BuildRequires: bzip2
BuildRequires: coreutils
BuildRequires: cpio
BuildRequires: cryptsetup
BuildRequires: curl
%if !0%{?rhel}
BuildRequires: curl
BuildRequires: debootstrap
%endif
BuildRequires: dhclient
@ -225,7 +245,6 @@ BuildRequires: file
BuildRequires: findutils
BuildRequires: gawk
BuildRequires: gdisk
BuildRequires: genisoimage
%if !0%{?rhel}
BuildRequires: gfs2-utils
%endif
@ -239,12 +258,11 @@ BuildRequires: hfsplus-tools
BuildRequires: hivex
BuildRequires: iproute
BuildRequires: iputils
%if !0%{?rhel}
BuildRequires: jfsutils
%endif
BuildRequires: kernel
BuildRequires: kmod
%if !0%{?rhel}
BuildRequires: kpartx
%endif
BuildRequires: less
BuildRequires: libcap
%if !0%{?rhel}
@ -258,22 +276,17 @@ BuildRequires: lvm2
BuildRequires: lzop
BuildRequires: mdadm
%if !0%{?rhel}
BuildRequires: nilfs-utils
%endif
%if !0%{?rhel}
BuildRequires: ntfs-3g ntfsprogs ntfs-3g-system-compression
%endif
BuildRequires: openssh-clients
BuildRequires: parted
BuildRequires: pciutils
BuildRequires: pcre
BuildRequires: pcre2
BuildRequires: policycoreutils
BuildRequires: procps
BuildRequires: psmisc
BuildRequires: qemu-img
%if !0%{?rhel}
BuildRequires: reiserfs-utils
%endif
BuildRequires: rpm-libs
BuildRequires: rsync
BuildRequires: scrub
BuildRequires: sed
@ -290,7 +303,9 @@ BuildRequires: tar
BuildRequires: udev
BuildRequires: util-linux
BuildRequires: vim-minimal
%if !0%{?rhel}
BuildRequires: which
%endif
BuildRequires: xfsprogs
BuildRequires: xz
BuildRequires: yajl
@ -312,15 +327,13 @@ Requires: supermin >= 5.1.18
Requires: augeas-libs%{?_isa} >= 1.7.0
Requires: libacl%{?_isa}
Requires: libcap%{?_isa}
Requires: hivex%{?_isa} >= 1.3.10
Requires: pcre%{?_isa}
Requires: libselinux%{?_isa}
Requires: hivex%{?_isa} >= 1.3.10
Requires: pcre2%{?_isa}
Requires: rpm-libs%{?_isa} >= 4.16.1.3
Requires: systemd-libs%{?_isa}
Requires: yajl%{?_isa}
# For core inspection API.
Requires: libdb-utils
# For core mount-local (FUSE) API.
Requires: fuse
@ -335,25 +348,22 @@ Suggests: qemu-block-iscsi
Suggests: qemu-block-rbd
Suggests: qemu-block-ssh
Recommends: libvirt-daemon-config-network
#Requires: libvirt-daemon-driver-qemu >= 7.1.0
Requires: libvirt-daemon-driver-qemu
Requires: libvirt-daemon-driver-secret
Recommends: libvirt-daemon-driver-storage-core
Requires: libvirt-daemon-kvm >= 5.3.0
Requires: selinux-policy >= 3.11.1-63
%ifarch aarch64
Requires: edk2-aarch64
%endif
# For UML backend (this backend only works on x86).
# UML has been broken upstream (in the kernel) for a while, so don't
# include this. Note that uml_utilities also depends on Perl.
#% ifarch % {ix86} x86_64
#Requires: uml_utilities
#% endif
# https://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries#Packages_granted_exceptions
Provides: bundled(gnulib)
# For guestfish.
#Requires: /usr/bin/emacs #theoretically, but too large
Requires: /usr/bin/hexedit
Requires: /usr/bin/less
Requires: /usr/bin/man
Requires: /usr/bin/vi
%if !0%{?rhel}
# Someone managed to install libguestfs-winsupport (from RHEL!) on
@ -364,29 +374,15 @@ Conflicts: libguestfs-winsupport < 7.2
%endif
%description
Libguestfs is a library for accessing and modifying virtual machine
disk images. http://libguestfs.org
It can be used to make batch configuration changes to guests, get disk
used/free statistics (virt-df), perform backups and guest clones,
change registry/UUID/hostname info, build guests from scratch
(virt-builder) and much more.
Libguestfs uses Linux kernel and qemu code, and can access any type of
guest filesystem that Linux and qemu can, including but not limited
to: ext2/3/4, btrfs, FAT and NTFS, LVM, many different disk partition
schemes, qcow, qcow2, vmdk.
Libguestfs is split into several subpackages. The basic subpackages are:
libguestfs C library
libguestfs-tools virt-* tools, guestfish and guestmount (FUSE)
libguestfs-tools-c only the subset of virt tools written in C
(for reduced dependencies)
virt-dib safe and secure diskimage-builder replacement
For enhanced features, install:
%if !0%{?rhel}
@ -395,11 +391,6 @@ For enhanced features, install:
libguestfs-hfsplus adds HFS+ (Mac filesystem) support
%endif
libguestfs-inspect-icons adds support for inspecting guest icons
%if !0%{?rhel}
libguestfs-jfs adds JFS support
libguestfs-nilfs adds NILFS v2 support
libguestfs-reiserfs adds ReiserFS support
%endif
libguestfs-rescue enhances virt-rescue shell with more tools
libguestfs-rsync rsync to/from guest filesystems
%if !0%{?rhel}
@ -438,9 +429,9 @@ Summary: Development tools and libraries for %{name}
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
Requires: pkgconfig
# For libguestfs-make-fixed-appliance.
# libguestfs-make-fixed-appliance requires guestfish.
Requires: xz
Requires: %{name}-tools-c = %{epoch}:%{version}-%{release}
Requires: %{name} = %{epoch}:%{version}-%{release}
%description devel
@ -448,6 +439,17 @@ Requires: %{name}-tools-c = %{epoch}:%{version}-%{release}
for %{name}.
%if !0%{?rhel}
%package dib
Summary: Additional tools for virt-dib
License: LGPLv2+
%description dib
This adds extra packages needed by virt-dib to %{name}. You should
normally install the virt-dib package which depends on this one.
%endif
%if !0%{?rhel}
%package forensics
Summary: Filesystem forensics support for %{name}
@ -486,50 +488,14 @@ disk images containing HFS+ / Mac OS Extended filesystems.
%endif
%if !0%{?rhel}
%package jfs
Summary: JFS support for %{name}
License: LGPLv2+
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
%description jfs
This adds JFS support to %{name}. Install it if you want to process
disk images containing JFS.
%endif
%if !0%{?rhel}
%package nilfs
Summary: NILFS support for %{name}
License: LGPLv2+
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
%description nilfs
This adds NILFS v2 support to %{name}. Install it if you want to process
disk images containing NILFS v2.
%endif
%if !0%{?rhel}
%package reiserfs
Summary: ReiserFS support for %{name}
License: LGPLv2+
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
%description reiserfs
This adds ReiserFS support to %{name}. Install it if you want to process
disk images containing ReiserFS.
%endif
%package rescue
Summary: Additional tools for virt-rescue
Summary: virt-rescue shell
License: LGPLv2+
Requires: %{name}-tools-c = %{epoch}:%{version}-%{release}
%description rescue
This adds additional tools to use inside the virt-rescue shell,
such as ssh, network utilities, editors and debugging utilities.
This adds the virt-rescue shell which is a "rescue disk" for virtual
machines, and additional tools to use inside the shell such as ssh,
network utilities, editors and debugging utilities.
%package rsync
@ -598,149 +564,10 @@ The only reason this is a separate package is to avoid core libguestfs
having to depend on Perl. See https://bugzilla.redhat.com/1194158
%package tools-c
Summary: System administration tools for virtual machines
License: GPLv2+
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
# For guestfish:
#Requires: /usr/bin/emacs #theoretically, but too large
Requires: /usr/bin/hexedit
Requires: /usr/bin/less
Requires: /usr/bin/man
Requires: /usr/bin/vi
# For virt-builder:
Requires: gnupg2
Requires: xz
#Requires: nbdkit, nbdkit-plugin-xz
Requires: curl
# For virt-builder-repository:
Suggests: osinfo-db
# Some Fedora, and all RHEL 7, use XFS:
Recommends: libguestfs-xfs
# For virt-edit and virt-customize:
Suggests: perl
%description tools-c
This package contains miscellaneous system administrator command line
tools for virtual machines.
Note that you should install %{name}-tools (which pulls in
this package). This package is only used directly when you want
to avoid dependencies on Perl.
%package tools
Summary: System administration tools for virtual machines
License: GPLv2+
BuildArch: noarch
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: %{name}-tools-c = %{epoch}:%{version}-%{release}
%description tools
This package contains miscellaneous system administrator command line
tools for virtual machines.
Guestfish is the Filesystem Interactive SHell, for accessing and
modifying virtual machine disk images from the command line and shell
scripts.
The guestmount command lets you mount guest filesystems on the host
using FUSE and %{name}.
Virt-alignment-scan scans virtual machines looking for partition
alignment problems.
Virt-builder is a command line tool for rapidly making disk images
of popular free operating systems.
Virt-cat is a command line tool to display the contents of a file in a
virtual machine.
Virt-copy-in and virt-copy-out are command line tools for uploading
and downloading files and directories to and from virtual machines.
Virt-customize is a command line tool for customizing virtual machine
disk images.
Virt-df is a command line tool to display free space on virtual
machine filesystems. Unlike other tools, it doesnt just display the
amount of space allocated to a virtual machine, but can look inside
the virtual machine to see how much space is really being used. It is
like the df(1) command, but for virtual machines, except that it also
works for Windows virtual machines.
Virt-diff shows the differences between virtual machines.
Virt-edit is a command line tool to edit the contents of a file in a
virtual machine.
Virt-filesystems is a command line tool to display the filesystems,
partitions, block devices, LVs, VGs and PVs found in a disk image
or virtual machine. It replaces the deprecated programs
virt-list-filesystems and virt-list-partitions with a much more
capable tool.
Virt-format is a command line tool to erase and make blank disks.
Virt-get-kernel extracts a kernel/initrd from a disk image.
Virt-inspector examines a virtual machine and tries to determine the
version of the OS, the kernel version, what drivers are installed,
whether the virtual machine is fully virtualized (FV) or
para-virtualized (PV), what applications are installed and more.
Virt-log is a command line tool to display the log files from a
virtual machine.
Virt-ls is a command line tool to list out files in a virtual machine.
Virt-make-fs is a command line tool to build a filesystem out of
a collection of files or a tarball.
Virt-rescue provides a rescue shell for making interactive,
unstructured fixes to virtual machines.
Virt-resize can resize existing virtual machine disk images.
Virt-sparsify makes virtual machine disk images sparse (thin-provisioned).
Virt-sysprep lets you reset or unconfigure virtual machines in
preparation for cloning them.
Virt-tail follows (tails) a log file within a guest, like 'tail -f'.
Virt-tar-in and virt-tar-out are archive, backup and upload tools
for virtual machines. These replace the deprecated program virt-tar.
Virt-win-reg lets you look at and modify the Windows Registry of
Windows virtual machines.
%package -n virt-dib
Summary: Safe and secure diskimage-builder replacement
License: GPLv2+
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
%description -n virt-dib
Virt-dib is a safe and secure alternative to the OpenStack
diskimage-builder command. It is compatible with most
diskimage-builder elements.
%package bash-completion
Summary: Bash tab-completion scripts for %{name} tools
BuildArch: noarch
Requires: bash-completion >= 2.0
Requires: %{name}-tools-c = %{epoch}:%{version}-%{release}
%description bash-completion
@ -938,6 +765,7 @@ fi
%endif
PYTHON=%{__python3} \
--with-default-backend=libvirt \
--enable-appliance-format-auto \
%if !0%{?rhel}
--with-extra="fedora=%{fedora},release=%{release},libvirt" \
%else
@ -954,13 +782,8 @@ fi
--disable-erlang \
$extra
# Building index-parse.c by hand works around a race condition in the
# autotools cruft, where two or more copies of yacc race with each
# other, resulting in a corrupted file.
#
# 'INSTALLDIRS' ensures that Perl and Ruby libs are installed in the
# vendor dir not the site dir.
make -j1 -C builder index-parse.c
make V=1 INSTALLDIRS=vendor %{?_smp_mflags}
@ -979,11 +802,6 @@ fi
%install
# This file is creeping over 1 MB uncompressed, and since it is
# included in the -devel subpackage, compress it to reduce
# installation size.
gzip -9 ChangeLog
# 'INSTALLDIRS' ensures that Perl and Ruby libs are installed in the
# vendor dir not the site dir.
make DESTDIR=$RPM_BUILD_ROOT INSTALLDIRS=vendor install
@ -1000,14 +818,6 @@ find $RPM_BUILD_ROOT -name .packlist -delete
find $RPM_BUILD_ROOT -name '*.bs' -delete
find $RPM_BUILD_ROOT -name 'bindtests.pl' -delete
# Remove obsolete binaries (RHBZ#1213298).
rm $RPM_BUILD_ROOT%{_bindir}/virt-list-filesystems
rm $RPM_BUILD_ROOT%{_bindir}/virt-list-partitions
rm $RPM_BUILD_ROOT%{_bindir}/virt-tar
rm $RPM_BUILD_ROOT%{_mandir}/man1/virt-list-filesystems.1*
rm $RPM_BUILD_ROOT%{_mandir}/man1/virt-list-partitions.1*
rm $RPM_BUILD_ROOT%{_mandir}/man1/virt-tar.1*
# golang: Ignore what libguestfs upstream installs, and just copy the
# source files to %%{_datadir}/gocode/src.
%ifarch %{golang_arches}
@ -1016,40 +826,47 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/gocode/src
cp -a golang/src/libguestfs.org $RPM_BUILD_ROOT%{_datadir}/gocode/src
%endif
# Move installed documentation back to the source directory so
# we can install it using a %%doc rule.
mv $RPM_BUILD_ROOT%{_docdir}/libguestfs installed-docs
gzip --best installed-docs/*.xml
# Split up the monolithic packages file in the supermin appliance so
# we can install dependencies in subpackages.
pushd $RPM_BUILD_ROOT%{_libdir}/guestfs/supermin.d
function remove
{
grep -Ev "^$1$" < packages > packages-t
mv packages-t packages
}
function move_to
{
if ! grep -Esq "^$1$" packages; then
echo "move_to $1: package name not found in packages file"
exit 1
fi
grep -Ev "^$1$" < packages > packages-t
mv packages-t packages
remove "$1"
echo "$1" >> "$2"
}
move_to curl zz-packages-dib
%if !0%{?rhel}
move_to curl zz-packages-dib
move_to debootstrap zz-packages-dib
%endif
move_to kpartx zz-packages-dib
move_to qemu-img zz-packages-dib
move_to which zz-packages-dib
%else
remove curl
remove debootstrap
remove kpartx
remove qemu-img
remove which
%endif
%if !0%{?rhel}
move_to sleuthkit zz-packages-forensics
move_to gfs2-utils zz-packages-gfs2
move_to hfsplus-tools zz-packages-hfsplus
move_to jfsutils zz-packages-jfs
move_to nilfs-utils zz-packages-nilfs
move_to reiserfs-utils zz-packages-reiserfs
%else
remove sleuthkit
remove gfs2-utils
remove hfsplus-tools
%endif
move_to iputils zz-packages-rescue
move_to lsof zz-packages-rescue
@ -1063,6 +880,8 @@ move_to xfsprogs zz-packages-xfs
%ifnarch %{arm} aarch64 s390 s390x riscv64
move_to zfs-fuse zz-packages-zfs
%endif
%else
remove zfs-fuse
%endif
%if !0%{?rhel}
@ -1097,23 +916,39 @@ rm ocaml/html/.gitignore
%files -f %{name}.lang
%doc COPYING README
%{_bindir}/guestfish
%{_bindir}/guestmount
%{_bindir}/guestunmount
%{_bindir}/libguestfs-test-tool
%{_bindir}/virt-copy-in
%{_bindir}/virt-copy-out
%{_bindir}/virt-tar-in
%{_bindir}/virt-tar-out
%{_libdir}/guestfs/
%exclude %{_libdir}/guestfs/supermin.d/zz-packages-*
%{_libdir}/libguestfs.so.*
%{_mandir}/man1/guestfish.1*
%{_mandir}/man1/guestfs-faq.1*
%{_mandir}/man1/guestfs-performance.1*
%{_mandir}/man1/guestfs-recipes.1*
%{_mandir}/man1/guestfs-release-notes-1*.1*
%{_mandir}/man1/guestfs-release-notes-historical.1*
%{_mandir}/man1/guestfs-security.1*
%{_mandir}/man1/guestmount.1*
%{_mandir}/man1/guestunmount.1*
%{_mandir}/man1/libguestfs-test-tool.1*
%{_mandir}/man1/virt-copy-in.1*
%{_mandir}/man1/virt-copy-out.1*
%{_mandir}/man1/virt-tar-in.1*
%{_mandir}/man1/virt-tar-out.1*
%{_mandir}/man5/libguestfs-tools.conf.5*
%config %{_sysconfdir}/profile.d/guestfish.sh
%config(noreplace) %{_sysconfdir}/libguestfs-tools.conf
%files devel
%doc AUTHORS BUGS ChangeLog.gz HACKING TODO README
%doc AUTHORS HACKING TODO README
%doc examples/*.c
%doc installed-docs/*
%{_libdir}/libguestfs.so
%{_sbindir}/libguestfs-make-fixed-appliance
%{_mandir}/man1/guestfs-building.1*
@ -1128,6 +963,11 @@ rm ocaml/html/.gitignore
%{_libdir}/pkgconfig/libguestfs.pc
%if !0%{?rhel}
%files dib
%{_libdir}/guestfs/supermin.d/zz-packages-dib
%endif
%if !0%{?rhel}
%files forensics
%{_libdir}/guestfs/supermin.d/zz-packages-forensics
@ -1145,26 +985,13 @@ rm ocaml/html/.gitignore
%endif
%endif
%if !0%{?rhel}
%files jfs
%{_libdir}/guestfs/supermin.d/zz-packages-jfs
%endif
%if !0%{?rhel}
%files nilfs
%{_libdir}/guestfs/supermin.d/zz-packages-nilfs
%endif
%if !0%{?rhel}
%files reiserfs
%{_libdir}/guestfs/supermin.d/zz-packages-reiserfs
%endif
%files rsync
%{_libdir}/guestfs/supermin.d/zz-packages-rsync
%files rescue
%{_libdir}/guestfs/supermin.d/zz-packages-rescue
%{_bindir}/virt-rescue
%{_mandir}/man1/virt-rescue.1*
%if !0%{?rhel}
%files ufs
@ -1186,93 +1013,17 @@ rm ocaml/html/.gitignore
# no files
%files tools-c
%doc README
%config(noreplace) %{_sysconfdir}/libguestfs-tools.conf
%{_sysconfdir}/virt-builder
%dir %{_sysconfdir}/xdg/virt-builder
%dir %{_sysconfdir}/xdg/virt-builder/repos.d
%config %{_sysconfdir}/xdg/virt-builder/repos.d/*
%config %{_sysconfdir}/profile.d/guestfish.sh
%{_mandir}/man5/libguestfs-tools.conf.5*
%{_bindir}/guestfish
%{_mandir}/man1/guestfish.1*
%{_bindir}/guestmount
%{_mandir}/man1/guestmount.1*
%{_bindir}/guestunmount
%{_mandir}/man1/guestunmount.1*
%{_bindir}/virt-alignment-scan
%{_mandir}/man1/virt-alignment-scan.1*
%{_bindir}/virt-builder
%{_mandir}/man1/virt-builder.1*
%{_bindir}/virt-builder-repository
%{_mandir}/man1/virt-builder-repository.1*
%{_bindir}/virt-cat
%{_mandir}/man1/virt-cat.1*
%{_bindir}/virt-copy-in
%{_mandir}/man1/virt-copy-in.1*
%{_bindir}/virt-copy-out
%{_mandir}/man1/virt-copy-out.1*
%{_bindir}/virt-customize
%{_mandir}/man1/virt-customize.1*
%{_bindir}/virt-df
%{_mandir}/man1/virt-df.1*
%{_bindir}/virt-diff
%{_mandir}/man1/virt-diff.1*
%{_bindir}/virt-edit
%{_mandir}/man1/virt-edit.1*
%{_bindir}/virt-filesystems
%{_mandir}/man1/virt-filesystems.1*
%{_bindir}/virt-format
%{_mandir}/man1/virt-format.1*
%{_bindir}/virt-get-kernel
%{_mandir}/man1/virt-get-kernel.1*
%{_bindir}/virt-index-validate
%{_mandir}/man1/virt-index-validate.1*
%{_bindir}/virt-inspector
%{_mandir}/man1/virt-inspector.1*
%{_bindir}/virt-log
%{_mandir}/man1/virt-log.1*
%{_bindir}/virt-ls
%{_mandir}/man1/virt-ls.1*
%{_bindir}/virt-make-fs
%{_mandir}/man1/virt-make-fs.1*
%{_bindir}/virt-rescue
%{_mandir}/man1/virt-rescue.1*
%{_bindir}/virt-resize
%{_mandir}/man1/virt-resize.1*
%{_bindir}/virt-sparsify
%{_mandir}/man1/virt-sparsify.1*
%{_bindir}/virt-sysprep
%{_mandir}/man1/virt-sysprep.1*
%{_bindir}/virt-tail
%{_mandir}/man1/virt-tail.1*
%{_bindir}/virt-tar-in
%{_mandir}/man1/virt-tar-in.1*
%{_bindir}/virt-tar-out
%{_mandir}/man1/virt-tar-out.1*
%files tools
%doc README
%{_bindir}/virt-win-reg
%{_mandir}/man1/virt-win-reg.1*
%files -n virt-dib
%doc COPYING README
%{_bindir}/virt-dib
%{_mandir}/man1/virt-dib.1*
%{_libdir}/guestfs/supermin.d/zz-packages-dib
%files bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/guestfish
%{_datadir}/bash-completion/completions/guestmount
%{_datadir}/bash-completion/completions/guestunmount
%{_datadir}/bash-completion/completions/libguestfs-test-tool
%{_datadir}/bash-completion/completions/virt-*
%{_datadir}/bash-completion/completions/virt-copy-in
%{_datadir}/bash-completion/completions/virt-copy-out
%{_datadir}/bash-completion/completions/virt-rescue
%{_datadir}/bash-completion/completions/virt-tar-in
%{_datadir}/bash-completion/completions/virt-tar-out
%files -n ocaml-%{name}
@ -1377,6 +1128,92 @@ rm ocaml/html/.gitignore
%changelog
* Wed Feb 09 2022 Richard W.M. Jones <rjones@redhat.com> - 1:1.46.2-1.1
- Bump and rebuild for suspected dep problem
https://github.com/psss/tmt/issues/1042
* Fri Dec 24 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.46.2-1
- New upstream stable branch version 1.46.2
* Thu Dec 09 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.46.1-1
- New upstream stable branch version 1.46.1
* Thu Sep 23 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.46.0-1
- New upstream stable branch version 1.46.0
- Remove BUGS file, no longer provided upstream
* Tue Aug 31 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.45.7-2
- Rebuild for updated ntfs-3g CVE (RHBZ#1999788)
* Tue Aug 31 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.45.7-1
- New upstream development version 1.45.7.
- Fix to work with qemu 6.1 (RHBZ#1998820)
* Thu Jun 3 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.45.6-4
- Add --enable-appliance-format-auto (RHBZ#1967166)
* Wed Jun 2 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.45.6-3
- Add gating tests (for RHEL 9)
* Tue Jun 01 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.45.6-2
- Depend on rpm-libs >= 4.16.1.3 (RHBZ#1966541).
* Thu May 27 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.45.6-1
- New upstream development version 1.45.6.
* Sat Apr 03 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.45.4-1
- New upstream version 1.45.4.
* Wed Mar 31 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.45.3-6
- Don't require genisoimage or xorriso for the appliance.
- Add workaround for broken "file" utility in Rawhide (RHBZ#1945122).
* Tue Mar 30 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.45.3-4
- Add downstream (RHEL-only) patches (RHBZ#1931724).
- Switch from genisoimage to xorriso.
* Mon Mar 29 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.45.3-2
- New upstream release 1.45.3.
- Add proper dependencies on librpm, remove BDB.
* Fri Mar 26 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.45.2-2
- Remove no longer needed requires on libguestfs-tools-c.
* Tue Mar 23 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.45.2-1
- New upstream version 1.45.2.
- This drops the tools. Now packaged as guestfs-tools.
- guestfish, guestmount, guestunmount now packaged with libguestfs.
- virt-rescue now packaged in libguestfs-rescue.
- Drop ChangeLog file.
- Remove virt-dib in RHEL 9.
- Depend on PCRE2 instead of PCRE.
* Thu Mar 18 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.45.1-6
- Drop dependency on perl(Sys::Virt).
- Fix -cpu max and require libvirt >= 7.1.0.
* Wed Mar 10 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.45.1-4
- Drop Requires: libvirt-daemon-kvm, pulls in the whole of qemu and subpkgs.
* Mon Mar 8 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.45.1-3
- Bump and rebuild for ocaml-gettext update.
* Fri Mar 5 2021 Remi Collet <remi@fedoraproject.org> - 1:1.45.1-2
- rebuild for https://fedoraproject.org/wiki/Changes/php80
- add trivial patch to fix build with PHP 8
* Wed Mar 3 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.45.1-1
- New upstream version 1.45.1.
* Tue Mar 2 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.44.0-8
- OCaml 4.12.0 build
- Fixes for OCaml 4.12.
* Wed Feb 17 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.44.0-6
- Remove jfsutils (dead upstream since 2011).
- Remove nilfs (dead upstream since 2015).
- Remove reiserfs (dead upstream since 2006).
* Tue Feb 09 2021 Richard W.M. Jones <rjones@redhat.com> - 1:1.44.0-5
- Remove gfs2-utils dependency in RHEL 9.
@ -2166,7 +2003,6 @@ rm ocaml/html/.gitignore
* Thu Jul 09 2015 Richard W.M. Jones <rjones@redhat.com> - 1:1.29.50-1
- New upstream version 1.29.50.
- Add virt-dib.
* Thu Jul 02 2015 Richard W.M. Jones <rjones@redhat.com> - 1:1.29.49-1

View file

@ -1,2 +1,2 @@
SHA512 (libguestfs-1.44.0.tar.gz) = e5052d6deb130f9bceea06d2d6626162991cb83ffaf0ed9923ff5d8bb67137e565053104d8854d37ea8c871dce2a5ca29507d17357de813a8ac49896f00be103
SHA512 (libguestfs-1.44.0.tar.gz.sig) = 26cb5b97dbc0d649466668964080220acc28c3fabc565563df0da5472420e61893907b4bedcb9f8977d7df9e867855d7178e4ad097df41dcbcaa98d0c07feac3
SHA512 (libguestfs-1.46.2.tar.gz) = 6a7a77c72dc3120e40d6719e1d652d8d803df44355e1f1c22e7d787d051f4922b8a80be7a9f4a389f6c078c22f2c8349607695f67fa642c08c38aad6bf3416bc
SHA512 (libguestfs-1.46.2.tar.gz.sig) = 30a335aee7fb024a8f9a28d5995ef42f64a895338f2ac0ece917c3bbdf79b20c11ce582e9341e31bbed6a9db11c082d3de4a1b8ada742efa87467d9a2223c350