diff --git a/0001-generator-Deprecate-direct-mode-guestfs_set_direct-g.patch b/0001-generator-Deprecate-direct-mode-guestfs_set_direct-g.patch deleted file mode 100644 index 4cd5a09..0000000 --- a/0001-generator-Deprecate-direct-mode-guestfs_set_direct-g.patch +++ /dev/null @@ -1,126 +0,0 @@ -From 2e70ca8b362e53976717a7519052faeffc31d4f2 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 2 Mar 2017 12:42:46 +0000 -Subject: [PATCH 01/10] generator: Deprecate direct mode (guestfs_set_direct, - guestfs_get_direct). - -(cherry picked from commit 26948d5cb17391a32856b18b8a5d6ae58a179507) ---- - generator/actions_properties.ml | 28 ---------------------------- - generator/actions_properties_deprecated.ml | 30 ++++++++++++++++++++++++++++++ - rescue/rescue.c | 3 +++ - test-tool/test-tool.c | 1 - - 4 files changed, 33 insertions(+), 29 deletions(-) - -diff --git a/generator/actions_properties.ml b/generator/actions_properties.ml -index 8f6455b81..87144b14f 100644 ---- a/generator/actions_properties.ml -+++ b/generator/actions_properties.ml -@@ -260,34 +260,6 @@ C)." }; - Return the command trace flag." }; - - { defaults with -- name = "set_direct"; added = (1, 0, 72); -- style = RErr, [Bool "direct"], []; -- fish_alias = ["direct"]; config_only = true; -- blocking = false; -- shortdesc = "enable or disable direct appliance mode"; -- longdesc = "\ --If the direct appliance mode flag is enabled, then stdin and --stdout are passed directly through to the appliance once it --is launched. -- --One consequence of this is that log messages aren't caught --by the library and handled by C, --but go straight to stdout. -- --You probably don't want to use this unless you know what you --are doing. -- --The default is disabled." }; -- -- { defaults with -- name = "get_direct"; added = (1, 0, 72); -- style = RBool "direct", [], []; -- blocking = false; -- shortdesc = "get direct appliance mode flag"; -- longdesc = "\ --Return the direct appliance mode flag." }; -- -- { defaults with - name = "set_recovery_proc"; added = (1, 0, 77); - style = RErr, [Bool "recoveryproc"], []; - fish_alias = ["recovery-proc"]; config_only = true; -diff --git a/generator/actions_properties_deprecated.ml b/generator/actions_properties_deprecated.ml -index def17b926..53277822e 100644 ---- a/generator/actions_properties_deprecated.ml -+++ b/generator/actions_properties_deprecated.ml -@@ -125,6 +125,36 @@ Return the current backend. - - See C and L." }; - -+ { defaults with -+ name = "set_direct"; added = (1, 0, 72); -+ style = RErr, [Bool "direct"], []; -+ deprecated_by = Deprecated_no_replacement; -+ fish_alias = ["direct"]; config_only = true; -+ blocking = false; -+ shortdesc = "enable or disable direct appliance mode"; -+ longdesc = "\ -+If the direct appliance mode flag is enabled, then stdin and -+stdout are passed directly through to the appliance once it -+is launched. -+ -+One consequence of this is that log messages aren't caught -+by the library and handled by C, -+but go straight to stdout. -+ -+You probably don't want to use this unless you know what you -+are doing. -+ -+The default is disabled." }; -+ -+ { defaults with -+ name = "get_direct"; added = (1, 0, 72); -+ style = RBool "direct", [], []; -+ deprecated_by = Deprecated_no_replacement; -+ blocking = false; -+ shortdesc = "get direct appliance mode flag"; -+ longdesc = "\ -+Return the direct appliance mode flag." }; -+ - ] - - let daemon_functions = [ -diff --git a/rescue/rescue.c b/rescue/rescue.c -index 45967b2ad..b692e5a07 100644 ---- a/rescue/rescue.c -+++ b/rescue/rescue.c -@@ -295,9 +295,12 @@ main (int argc, char *argv[]) - usage (EXIT_FAILURE); - } - -+#pragma GCC diagnostic push -+#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - /* Setting "direct mode" is required for the rescue appliance. */ - if (guestfs_set_direct (g, 1) == -1) - exit (EXIT_FAILURE); -+#pragma GCC diagnostic pop - - { - /* The libvirt backend doesn't support direct mode. As a temporary -diff --git a/test-tool/test-tool.c b/test-tool/test-tool.c -index 20e2a32fa..2ae266d7d 100644 ---- a/test-tool/test-tool.c -+++ b/test-tool/test-tool.c -@@ -224,7 +224,6 @@ main (int argc, char *argv[]) - p = guestfs_get_cachedir (g); - printf ("guestfs_get_cachedir: %s\n", p ? : "(null)"); - free (p); -- printf ("guestfs_get_direct: %d\n", guestfs_get_direct (g)); - p = guestfs_get_hv (g); - printf ("guestfs_get_hv: %s\n", p); - free (p); --- -2.13.2 - diff --git a/0002-New-API-internal-get-console-socket-to-support-virt-.patch b/0002-New-API-internal-get-console-socket-to-support-virt-.patch deleted file mode 100644 index 86d8f20..0000000 --- a/0002-New-API-internal-get-console-socket-to-support-virt-.patch +++ /dev/null @@ -1,185 +0,0 @@ -From 0fb454a7887727f7319fecc0caf2d55af3390062 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 2 Mar 2017 11:06:27 +0000 -Subject: [PATCH 02/10] New API: internal-get-console-socket to support - virt-rescue. - -This API intended for use by virt-rescue only gets the file descriptor -of the console socket. - -(cherry picked from commit 84c9f98c2e09a459ced3c7e85191f2e47d149a52) ---- - generator/actions_core.ml | 11 +++++++ - generator/actions_properties_deprecated.ml | 4 +-- - lib/Makefile.am | 1 + - lib/conn-socket.c | 16 +++++++++- - lib/guestfs-internal.h | 3 ++ - lib/rescue.c | 47 ++++++++++++++++++++++++++++++ - 6 files changed, 79 insertions(+), 3 deletions(-) - create mode 100644 lib/rescue.c - -diff --git a/generator/actions_core.ml b/generator/actions_core.ml -index 5e487df02..259ca9051 100644 ---- a/generator/actions_core.ml -+++ b/generator/actions_core.ml -@@ -1722,6 +1722,17 @@ call it returns a simple true/false boolean result, instead - of throwing an exception if a feature is not found. For - other documentation see C." }; - -+ { defaults with -+ name = "internal_get_console_socket"; added = (1, 37, 1); -+ style = RInt "fd", [], []; -+ visibility = VInternal; -+ test_excuse = "writing to the socket may block"; -+ shortdesc = "get the appliance console socket"; -+ longdesc = "\ -+This call is used by L to write directly to -+appliance console (for passing through keystrokes). It should -+not normally be used by other libguestfs users." }; -+ - ] - - let daemon_functions = [ -diff --git a/generator/actions_properties_deprecated.ml b/generator/actions_properties_deprecated.ml -index 53277822e..f36509e75 100644 ---- a/generator/actions_properties_deprecated.ml -+++ b/generator/actions_properties_deprecated.ml -@@ -128,7 +128,7 @@ See C and L." }; - { defaults with - name = "set_direct"; added = (1, 0, 72); - style = RErr, [Bool "direct"], []; -- deprecated_by = Deprecated_no_replacement; -+ deprecated_by = Replaced_by "internal_get_console_socket"; - fish_alias = ["direct"]; config_only = true; - blocking = false; - shortdesc = "enable or disable direct appliance mode"; -@@ -149,7 +149,7 @@ The default is disabled." }; - { defaults with - name = "get_direct"; added = (1, 0, 72); - style = RBool "direct", [], []; -- deprecated_by = Deprecated_no_replacement; -+ deprecated_by = Replaced_by "internal_get_console_socket"; - blocking = false; - shortdesc = "get direct appliance mode flag"; - longdesc = "\ -diff --git a/lib/Makefile.am b/lib/Makefile.am -index 22974187f..c3e013a52 100644 ---- a/lib/Makefile.am -+++ b/lib/Makefile.am -@@ -117,6 +117,7 @@ libguestfs_la_SOURCES = \ - private-data.c \ - proto.c \ - qemu.c \ -+ rescue.c \ - stringsbuf.c \ - structs-compare.c \ - structs-copy.c \ -diff --git a/lib/conn-socket.c b/lib/conn-socket.c -index 2cd261a2b..8ecfed856 100644 ---- a/lib/conn-socket.c -+++ b/lib/conn-socket.c -@@ -1,5 +1,5 @@ - /* libguestfs -- * Copyright (C) 2013 Red Hat Inc. -+ * Copyright (C) 2013-2017 Red Hat Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -397,6 +397,19 @@ handle_log_message (guestfs_h *g, - return 1; - } - -+static int -+get_console_sock (guestfs_h *g, struct connection *connv) -+{ -+ struct connection_socket *conn = (struct connection_socket *) connv; -+ -+ if (conn->console_sock == -1) { -+ error (g, _("console socket not connected")); -+ return -1; -+ } -+ -+ return conn->console_sock; -+} -+ - static void - free_conn_socket (guestfs_h *g, struct connection *connv) - { -@@ -418,6 +431,7 @@ static struct connection_ops ops = { - .read_data = read_data, - .write_data = write_data, - .can_read_data = can_read_data, -+ .get_console_sock = get_console_sock, - }; - - /** -diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h -index 949cacfef..51f532a1b 100644 ---- a/lib/guestfs-internal.h -+++ b/lib/guestfs-internal.h -@@ -373,6 +373,9 @@ struct connection_ops { - * Returns: 1 = yes, 0 = no, -1 = error - */ - int (*can_read_data) (guestfs_h *g, struct connection *); -+ -+ /* Get the console socket (to support virt-rescue). */ -+ int (*get_console_sock) (guestfs_h *g, struct connection *); - }; - - /** -diff --git a/lib/rescue.c b/lib/rescue.c -new file mode 100644 -index 000000000..ae7811a31 ---- /dev/null -+++ b/lib/rescue.c -@@ -0,0 +1,47 @@ -+/* libguestfs -+ * Copyright (C) 2017 Red Hat Inc. -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2 of the License, or (at your option) any later version. -+ * -+ * This library 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 -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+/** -+ * Support for virt-rescue(1). -+ */ -+ -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include "guestfs.h" -+#include "guestfs-internal.h" -+#include "guestfs-internal-actions.h" -+ -+int -+guestfs_impl_internal_get_console_socket (guestfs_h *g) -+{ -+ if (!g->conn) { -+ error (g, _("no console socket, the handle must be launched")); -+ return -1; -+ } -+ -+ if (!g->conn->ops->get_console_sock) -+ NOT_SUPPORTED (g, -1, -+ _("connection class does not support getting the console socket")); -+ -+ return g->conn->ops->get_console_sock (g, g->conn); -+} --- -2.13.2 - diff --git a/0003-lib-Return-EPIPE-for-appliance-closed-the-connection.patch b/0003-lib-Return-EPIPE-for-appliance-closed-the-connection.patch deleted file mode 100644 index 034ace1..0000000 --- a/0003-lib-Return-EPIPE-for-appliance-closed-the-connection.patch +++ /dev/null @@ -1,39 +0,0 @@ -From e1f952372e3df410295c60ddbad24d45b93551af Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 3 Mar 2017 10:14:20 +0000 -Subject: [PATCH 03/10] lib: Return EPIPE for "appliance closed the connection - unexpectedly". - -(cherry picked from commit 8af9acd4e31e9880e14735b2242c496ee017c0d9) ---- - lib/errors.c | 13 ++++++++----- - 1 file changed, 8 insertions(+), 5 deletions(-) - -diff --git a/lib/errors.c b/lib/errors.c -index c2af611ee..ace6a89cf 100644 ---- a/lib/errors.c -+++ b/lib/errors.c -@@ -358,12 +358,15 @@ void - guestfs_int_unexpected_close_error (guestfs_h *g) - { - if (g->verbose) -- error (g, _("appliance closed the connection unexpectedly, see earlier error messages")); -+ guestfs_int_error_errno (g, EPIPE, -+ _("appliance closed the connection unexpectedly, " -+ "see earlier error messages")); - else -- error (g, _( -- "appliance closed the connection unexpectedly.\n" -- "This usually means the libguestfs appliance crashed.\n" -- DEBUG_ADVICE)); -+ guestfs_int_error_errno (g, EPIPE, -+ _("appliance closed the connection unexpectedly.\n" -+ "This usually means the libguestfs appliance " -+ "crashed.\n" -+ DEBUG_ADVICE)); - } - - /** --- -2.13.2 - diff --git a/0004-rescue-Modify-virt-rescue-so-it-doesn-t-use-direct-m.patch b/0004-rescue-Modify-virt-rescue-so-it-doesn-t-use-direct-m.patch deleted file mode 100644 index 45a8be4..0000000 --- a/0004-rescue-Modify-virt-rescue-so-it-doesn-t-use-direct-m.patch +++ /dev/null @@ -1,533 +0,0 @@ -From 20acc6cf3ebf873497e0be95bd5d3daad56cecd5 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 2 Mar 2017 13:46:48 +0000 -Subject: [PATCH 04/10] rescue: Modify virt-rescue so it doesn't use direct - mode (RHBZ#1152819, RHBZ#1171654). - -Instead of using "direct mode" (which was basically a quick hack), -virt-rescue now launches the appliance with a running daemon. - -The daemon doesn't do much -- there is still a bash shell which the -user interacts with. The daemon is there simply to provide the -initial GUESTFS_LAUNCH_FLAG message and to handle shutdown a bit more -gracefully. - -To interact with the shell, and replacing direct mode, virt-rescue now -prints out log messages (the output of the shell), and sends input -typed by the user directly to the console socket. This uses the -guestfs_internal_get_console_socket API added previously. Most of the -complexity behind this is hidden in virt-rescue. - -This fully fixes the handling of ^C (RHBZ#1152819). Also there were -earlier reports that full screen commands like 'vim' didn't work well, -(RHBZ#1171654), but in this version vim appears to work fine, albeit -only using 80x24 of the screen because of the serial console. - -(cherry picked from commit 32d60801443647b3523b9374c431fefdbf054e3c) ---- - appliance/init | 91 ++++++++-------- - rescue/Makefile.am | 1 + - rescue/rescue.c | 306 +++++++++++++++++++++++++++++++++++++++++++++-------- - 3 files changed, 312 insertions(+), 86 deletions(-) - -diff --git a/appliance/init b/appliance/init -index 8a26e1a02..810f84d22 100755 ---- a/appliance/init -+++ b/appliance/init -@@ -159,59 +159,62 @@ if test "$guestfs_verbose" = 1 && test "$guestfs_boot_analysis" != 1; then - echo -n "uptime: "; cat /proc/uptime - fi - --if ! test "$guestfs_rescue" = 1; then -- # Run the daemon. -- cmd="guestfsd" -- eval `grep -Eo 'guestfs_channel=[^[:space:]]+' /proc/cmdline` -- if test "x$guestfs_channel" != "x"; then -+# Run the daemon. -+cmd="guestfsd" -+eval `grep -Eo 'guestfs_channel=[^[:space:]]+' /proc/cmdline` -+if test "x$guestfs_channel" != "x"; then - cmd="$cmd --channel $guestfs_channel" -- fi -- if test "$guestfs_verbose" = 1; then -+fi -+if test "$guestfs_verbose" = 1; then - cmd="$cmd --verbose" -- fi -- if test "$guestfs_network" = 1; then -+fi -+if test "$guestfs_network" = 1; then - cmd="$cmd --network" -- fi -- echo $cmd -- $cmd -+fi -+if ! test "$guestfs_rescue" = 1; then -+ echo $cmd -+ $cmd - else -- # Run virt-rescue shell. -+ # Run virt-rescue shell. - -- # Get name of the serial port, from console= passed by libguestfs. -- guestfs_serial=$(grep -Eo 'console=[^[:space:]]+' /proc/cmdline | -- sed s/console=//) -+ # We need a daemon, even in virt-rescue. -+ $cmd & - -- # Remove LD_PRELOAD=libSegFault set above. -- unset LD_PRELOAD -+ # Get name of the serial port, from console= passed by libguestfs. -+ guestfs_serial=$(grep -Eo 'console=[^[:space:]]+' /proc/cmdline | -+ sed s/console=//) - -- :> $HOME/.bashrc -- grep -Eo 'TERM=[^[:space:]]+' /proc/cmdline >> $HOME/.bashrc -- echo "PS1='> '" >> $HOME/.bashrc -- echo "export TERM PS1" >> $HOME/.bashrc -+ # Remove LD_PRELOAD=libSegFault set above. -+ unset LD_PRELOAD - -- # The shell is opened by default on /dev/console, which (on Linux) -- # is not a controlling terminal, causing job control to fail. For -- # how we work around this, see: -- # https://busybox.net/FAQ.html#job_control -- run_bash_with_ctty () -- { -- setsid bash -c \ -- "exec bash /dev/$guestfs_serial 2>&1" -- } -+ :> $HOME/.bashrc -+ grep -Eo 'TERM=[^[:space:]]+' /proc/cmdline >> $HOME/.bashrc -+ echo "PS1='> '" >> $HOME/.bashrc -+ echo "export TERM PS1" >> $HOME/.bashrc - -- echo -- echo "------------------------------------------------------------" -- echo -- echo "Welcome to virt-rescue, the libguestfs rescue shell." -- echo -- echo "Note: The contents of / are the rescue appliance." -- echo "You have to mount the guest's partitions under /sysroot" -- echo "before you can examine them." -- echo -- run_bash_with_ctty -- echo -- echo "virt-rescue: Syncing the disk now before exiting ..." -- echo -+ # The shell is opened by default on /dev/console, which (on Linux) -+ # is not a controlling terminal, causing job control to fail. For -+ # how we work around this, see: -+ # https://busybox.net/FAQ.html#job_control -+ run_bash_with_ctty () -+ { -+ setsid bash -c \ -+ "exec bash /dev/$guestfs_serial 2>&1" -+ } -+ -+ echo -+ echo "------------------------------------------------------------" -+ echo -+ echo "Welcome to virt-rescue, the libguestfs rescue shell." -+ echo -+ echo "Note: The contents of / (root) are the rescue appliance." -+ echo "You have to mount the guest's partitions under /sysroot" -+ echo "before you can examine them." -+ echo -+ run_bash_with_ctty -+ echo -+ echo "virt-rescue: Syncing the disk now before exiting ..." -+ echo - fi - - sync -diff --git a/rescue/Makefile.am b/rescue/Makefile.am -index 7919aafd5..99d4b79ae 100644 ---- a/rescue/Makefile.am -+++ b/rescue/Makefile.am -@@ -30,6 +30,7 @@ virt_rescue_SOURCES = \ - - virt_rescue_CPPFLAGS = \ - -DGUESTFS_WARN_DEPRECATED=1 \ -+ -DGUESTFS_PRIVATE=1 \ - -DLOCALEBASEDIR=\""$(datadir)/locale"\" \ - -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \ - -I$(top_srcdir)/lib -I$(top_builddir)/lib \ -diff --git a/rescue/rescue.c b/rescue/rescue.c -index b692e5a07..b145dcd40 100644 ---- a/rescue/rescue.c -+++ b/rescue/rescue.c -@@ -23,21 +23,32 @@ - #include - #include - #include -+#include - #include - #include - #include -+#include -+#include -+#include - #include - #include - #include - -+#include "full-write.h" -+#include "getprogname.h" - #include "ignore-value.h" - #include "xvasprintf.h" --#include "getprogname.h" - - #include "guestfs.h" - #include "options.h" - #include "display-options.h" - -+static void log_message_callback (guestfs_h *g, void *opaque, uint64_t event, int event_handle, int flags, const char *buf, size_t buf_len, const uint64_t *array, size_t array_len); -+static void do_rescue (int sock); -+static void raw_tty (void); -+static void restore_tty (void); -+static void tstp_handler (int sig); -+static void cont_handler (int sig); - static void add_scratch_disks (int n, struct drv **drvs); - static void do_suggestion (struct drv *drvs); - -@@ -54,6 +65,9 @@ int inspector = 0; - int in_guestfish = 0; - int in_virt_rescue = 1; - -+/* Old terminal settings. */ -+static struct termios old_termios; -+ - static void __attribute__((noreturn)) - usage (int status) - { -@@ -135,6 +149,8 @@ main (int argc, char *argv[]) - int memsize = 0; - int smp = 0; - int suggest = 0; -+ char *append_full; -+ int sock; - - g = guestfs_create (); - if (g == NULL) -@@ -295,30 +311,6 @@ main (int argc, char *argv[]) - usage (EXIT_FAILURE); - } - --#pragma GCC diagnostic push --#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -- /* Setting "direct mode" is required for the rescue appliance. */ -- if (guestfs_set_direct (g, 1) == -1) -- exit (EXIT_FAILURE); --#pragma GCC diagnostic pop -- -- { -- /* The libvirt backend doesn't support direct mode. As a temporary -- * workaround, force the appliance backend, but warn about it. -- */ -- CLEANUP_FREE char *backend = guestfs_get_backend (g); -- if (backend) { -- if (STREQ (backend, "libvirt") || -- STRPREFIX (backend, "libvirt:")) { -- fprintf (stderr, _("%s: warning: virt-rescue doesn't work with the libvirt backend\n" -- "at the moment. As a workaround, forcing backend = 'direct'.\n"), -- getprogname ()); -- if (guestfs_set_backend (g, "direct") == -1) -- exit (EXIT_FAILURE); -- } -- } -- } -- - /* Set other features. */ - if (memsize > 0) - if (guestfs_set_memsize (g, memsize) == -1) -@@ -330,16 +322,15 @@ main (int argc, char *argv[]) - if (guestfs_set_smp (g, smp) == -1) - exit (EXIT_FAILURE); - -- { -- /* Kernel command line must include guestfs_rescue=1 (see -- * appliance/init) as well as other options. -- */ -- CLEANUP_FREE char *append_full = xasprintf ("guestfs_rescue=1%s%s", -- append ? " " : "", -- append ? append : ""); -- if (guestfs_set_append (g, append_full) == -1) -- exit (EXIT_FAILURE); -- } -+ /* Kernel command line must include guestfs_rescue=1 (see -+ * appliance/init) as well as other options. -+ */ -+ append_full = xasprintf ("guestfs_rescue=1%s%s", -+ append ? " " : "", -+ append ? append : ""); -+ if (guestfs_set_append (g, append_full) == -1) -+ exit (EXIT_FAILURE); -+ free (append_full); - - /* Add drives. */ - add_drives (drvs); -@@ -347,22 +338,253 @@ main (int argc, char *argv[]) - /* Free up data structures, no longer needed after this point. */ - free_drives (drvs); - -- /* Run the appliance. This won't return until the user quits the -- * appliance. -+ /* Add an event handler to print "log messages". These will be the -+ * output of the appliance console during launch and shutdown. -+ * After launch, we will read the console messages directly from the -+ * socket and they won't be passed through the event callback. - */ -- if (!verbose) -- guestfs_set_error_handler (g, NULL, NULL); -+ if (guestfs_set_event_callback (g, log_message_callback, -+ GUESTFS_EVENT_APPLIANCE, 0, NULL) == -1) -+ exit (EXIT_FAILURE); - -- /* We expect launch to fail, so ignore the return value, and don't -- * bother with explicit guestfs_shutdown either. -+ /* Run the appliance. */ -+ if (guestfs_launch (g) == -1) -+ exit (EXIT_FAILURE); -+ -+ sock = guestfs_internal_get_console_socket (g); -+ if (sock == -1) -+ exit (EXIT_FAILURE); -+ -+ /* Try to set all sockets to non-blocking. */ -+ if (fcntl (STDIN_FILENO, F_SETFL, O_NONBLOCK) == -1) -+ perror ("could not set stdin to non-blocking"); -+ if (fcntl (STDOUT_FILENO, F_SETFL, O_NONBLOCK) == -1) -+ perror ("could not set stdout to non-blocking"); -+ if (fcntl (sock, F_SETFL, O_NONBLOCK) == -1) -+ perror ("could not set console socket to non-blocking"); -+ -+ /* Save the initial state of the tty so we always have the original -+ * state to go back to. -+ */ -+ if (tcgetattr (STDIN_FILENO, &old_termios) == -1) { -+ perror ("tcgetattr: stdin"); -+ exit (EXIT_FAILURE); -+ } -+ -+ /* Put stdin in raw mode so that we can receive ^C and other -+ * special keys. -+ */ -+ raw_tty (); -+ -+ /* Restore the tty settings when the process exits. */ -+ atexit (restore_tty); -+ -+ /* Catch tty stop and cont signals so we can cleanup. -+ * See https://www.gnu.org/software/libc/manual/html_node/Signaling-Yourself.html - */ -- ignore_value (guestfs_launch (g)); -+ signal (SIGTSTP, tstp_handler); -+ signal (SIGCONT, cont_handler); -+ -+ do_rescue (sock); -+ -+ restore_tty (); -+ -+ /* Shut down the appliance. */ -+ guestfs_push_error_handler (g, NULL, NULL); -+ if (guestfs_shutdown (g) == -1) { -+ const char *err; -+ -+ /* Ignore "appliance closed the connection unexpectedly" since -+ * this can happen if the user reboots the appliance. -+ */ -+ if (guestfs_last_errno (g) == EPIPE) -+ goto next; - -+ /* Otherwise it's a real error. */ -+ err = guestfs_last_error (g); -+ fprintf (stderr, "libguestfs: error: %s\n", err); -+ exit (EXIT_FAILURE); -+ } -+ next: -+ guestfs_pop_error_handler (g); - guestfs_close (g); - - exit (EXIT_SUCCESS); - } - -+static void -+log_message_callback (guestfs_h *g, void *opaque, uint64_t event, -+ int event_handle, int flags, -+ const char *buf, size_t buf_len, -+ const uint64_t *array, size_t array_len) -+{ -+ if (buf_len > 0) { -+ ignore_value (full_write (STDOUT_FILENO, buf, buf_len)); -+ } -+} -+ -+/* This is the main loop for virt-rescue. We read and write -+ * directly to the console socket. -+ */ -+#define BUFSIZE 4096 -+static char rbuf[BUFSIZE]; /* appliance -> local tty */ -+static char wbuf[BUFSIZE]; /* local tty -> appliance */ -+ -+static void -+do_rescue (int sock) -+{ -+ size_t rlen = 0; -+ size_t wlen = 0; -+ -+ while (sock >= 0 || rlen > 0) { -+ struct pollfd fds[3]; -+ nfds_t nfds = 2; -+ int r; -+ ssize_t n; -+ -+ fds[0].fd = STDIN_FILENO; -+ fds[0].events = 0; -+ if (BUFSIZE-wlen > 0) -+ fds[0].events = POLLIN; -+ fds[0].revents = 0; -+ -+ fds[1].fd = STDOUT_FILENO; -+ fds[1].events = 0; -+ if (rlen > 0) -+ fds[1].events |= POLLOUT; -+ fds[1].revents = 0; -+ -+ if (sock >= 0) { -+ fds[2].fd = sock; -+ fds[2].events = 0; -+ if (BUFSIZE-rlen > 0) -+ fds[2].events |= POLLIN; -+ if (wlen > 0) -+ fds[2].events |= POLLOUT; -+ fds[2].revents = 0; -+ nfds++; -+ } -+ -+ r = poll (fds, nfds, -1); -+ if (r == -1) { -+ if (errno == EINTR || errno == EAGAIN) -+ continue; -+ perror ("poll"); -+ return; -+ } -+ -+ /* Input from local tty. */ -+ if ((fds[0].revents & POLLIN) != 0) { -+ assert (BUFSIZE-wlen > 0); -+ n = read (STDIN_FILENO, wbuf+wlen, BUFSIZE-wlen); -+ if (n == -1) { -+ if (errno == EINTR || errno == EAGAIN) -+ continue; -+ perror ("read"); -+ return; -+ } -+ if (n == 0) { -+ /* We don't expect this to happen. Maybe the whole tty went away? -+ * Anyway, we should exit as soon as possible. -+ */ -+ return; -+ } -+ if (n > 0) -+ wlen += n; -+ } -+ -+ /* Log message from appliance. */ -+ if (nfds > 2 && (fds[2].revents & POLLIN) != 0) { -+ assert (BUFSIZE-rlen > 0); -+ n = read (sock, rbuf+rlen, BUFSIZE-rlen); -+ if (n == -1) { -+ if (errno == EINTR || errno == EAGAIN) -+ continue; -+ if (errno == ECONNRESET) -+ goto appliance_closed; -+ perror ("read"); -+ return; -+ } -+ if (n == 0) { -+ appliance_closed: -+ sock = -1; -+ /* Don't actually close the socket, because it's owned by -+ * the guestfs handle. -+ */ -+ continue; -+ } -+ if (n > 0) -+ rlen += n; -+ } -+ -+ /* Write log messages to local tty. */ -+ if ((fds[1].revents & POLLOUT) != 0) { -+ assert (rlen > 0); -+ n = write (STDOUT_FILENO, rbuf, rlen); -+ if (n == -1) { -+ perror ("write"); -+ continue; -+ } -+ rlen -= n; -+ memmove (rbuf, rbuf+n, rlen); -+ } -+ -+ /* Write commands to the appliance. */ -+ if (nfds > 2 && (fds[2].revents & POLLOUT) != 0) { -+ assert (wlen > 0); -+ n = write (sock, wbuf, wlen); -+ if (n == -1) { -+ perror ("write"); -+ continue; -+ } -+ wlen -= n; -+ memmove (wbuf, wbuf+n, wlen); -+ } -+ } -+} -+ -+/* Put the tty in raw mode. */ -+static void -+raw_tty (void) -+{ -+ struct termios termios; -+ -+ if (tcgetattr (STDIN_FILENO, &termios) == -1) { -+ perror ("tcgetattr: stdin"); -+ exit (EXIT_FAILURE); -+ } -+ cfmakeraw (&termios); -+ if (tcsetattr (STDIN_FILENO, TCSANOW, &termios) == -1) { -+ perror ("tcsetattr: stdin"); -+ exit (EXIT_FAILURE); -+ } -+} -+ -+/* Restore the tty to (presumably) cooked mode as it was when -+ * the program was started. -+ */ -+static void -+restore_tty (void) -+{ -+ tcsetattr (STDIN_FILENO, TCSANOW, &old_termios); -+} -+ -+/* When we get SIGTSTP, switch back to cooked mode. */ -+static void -+tstp_handler (int sig) -+{ -+ restore_tty (); -+ signal (SIGTSTP, SIG_DFL); -+ raise (SIGTSTP); -+} -+ -+/* When we get SIGCONF, switch to raw mode. */ -+static void -+cont_handler (int sig) -+{ -+ raw_tty (); -+} -+ - static void suggest_filesystems (void); - - static int --- -2.13.2 - diff --git a/0005-rescue-Implement-m-and-i-options.patch b/0005-rescue-Implement-m-and-i-options.patch deleted file mode 100644 index fa0b54e..0000000 --- a/0005-rescue-Implement-m-and-i-options.patch +++ /dev/null @@ -1,400 +0,0 @@ -From b308fb2a8d31f5439793b908bbf2e8414ee97897 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 3 Mar 2017 13:52:31 +0000 -Subject: [PATCH 05/10] rescue: Implement -m and -i options. - -`virt-rescue -a disk -i' does the right thing. - -`-m' was previously an alternate form of `--memsize'. By sniffing the -parameter we can make `-m MB' continue to work, while also allowing -`-m' to be used as a short form for the `--mount' option. - -This also removes most of the description of `--suggest' from the man -page, since it is no longer needed. - -(cherry picked from commit 33d2ae796119ae5dd38e2afcbf1ba4216bd99846) ---- - appliance/init | 12 +++++-- - rescue/Makefile.am | 3 +- - rescue/rescue.c | 87 +++++++++++++++++++++++++++++++++++++------------- - rescue/virt-rescue.pod | 80 ++++++++++++++++++++++++++++------------------ - 4 files changed, 126 insertions(+), 56 deletions(-) - -diff --git a/appliance/init b/appliance/init -index 810f84d22..968429c4b 100755 ---- a/appliance/init -+++ b/appliance/init -@@ -180,6 +180,10 @@ else - # We need a daemon, even in virt-rescue. - $cmd & - -+ # XXX This gives a bit of time for virt-rescue to connect to the -+ # daemon and mount any filesystems. -+ sleep 2 -+ - # Get name of the serial port, from console= passed by libguestfs. - guestfs_serial=$(grep -Eo 'console=[^[:space:]]+' /proc/cmdline | - sed s/console=//) -@@ -208,8 +212,12 @@ else - echo "Welcome to virt-rescue, the libguestfs rescue shell." - echo - echo "Note: The contents of / (root) are the rescue appliance." -- echo "You have to mount the guest's partitions under /sysroot" -- echo "before you can examine them." -+ if ! test -d "/sysroot/dev"; then -+ echo "You have to mount the guest's partitions under /sysroot" -+ echo "before you can examine them." -+ else -+ echo "Use 'cd /sysroot' or 'chroot /sysroot' to see guest filesystems." -+ fi - echo - run_bash_with_ctty - echo -diff --git a/rescue/Makefile.am b/rescue/Makefile.am -index 99d4b79ae..c83c43458 100644 ---- a/rescue/Makefile.am -+++ b/rescue/Makefile.am -@@ -35,7 +35,7 @@ virt_rescue_CPPFLAGS = \ - -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \ - -I$(top_srcdir)/lib -I$(top_builddir)/lib \ - -I$(top_srcdir)/common/options -I$(top_builddir)/common/options \ -- -I$(top_srcdir)/fish \ -+ -I$(top_srcdir)/common/windows -I$(top_builddir)/common/windows \ - -I$(srcdir)/../gnulib/lib -I../gnulib/lib - - virt_rescue_CFLAGS = \ -@@ -43,6 +43,7 @@ virt_rescue_CFLAGS = \ - $(LIBXML2_CFLAGS) - - virt_rescue_LDADD = \ -+ $(top_builddir)/common/windows/libwindows.la \ - $(top_builddir)/common/options/liboptions.la \ - $(top_builddir)/common/utils/libutils.la \ - $(top_builddir)/lib/libguestfs.la \ -diff --git a/rescue/rescue.c b/rescue/rescue.c -index b145dcd40..2b461378d 100644 ---- a/rescue/rescue.c -+++ b/rescue/rescue.c -@@ -23,7 +23,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -37,9 +36,11 @@ - #include "full-write.h" - #include "getprogname.h" - #include "ignore-value.h" -+#include "nonblocking.h" - #include "xvasprintf.h" - - #include "guestfs.h" -+#include "windows.h" - #include "options.h" - #include "display-options.h" - -@@ -87,7 +88,9 @@ usage (int status) - " -d|--domain guest Add disks from libvirt guest\n" - " --format[=raw|..] Force disk format for -a option\n" - " --help Display brief help\n" -- " -m|--memsize MB Set memory size in megabytes\n" -+ " -i|--inspector Automatically mount filesystems\n" -+ " -m|--mount dev[:mnt[:opts[:fstype]] Mount dev on mnt (if omitted, /)\n" -+ " --memsize MB Set memory size in megabytes\n" - " --network Enable network\n" - " -r|--ro Access read-only\n" - " --scratch[=N] Add scratch disk(s)\n" -@@ -116,7 +119,7 @@ main (int argc, char *argv[]) - - enum { HELP_OPTION = CHAR_MAX + 1 }; - -- static const char options[] = "a:c:d:m:rvVwx"; -+ static const char options[] = "a:c:d:im:rvVwx"; - static const struct option long_options[] = { - { "add", 1, 0, 'a' }, - { "append", 1, 0, 0 }, -@@ -124,8 +127,10 @@ main (int argc, char *argv[]) - { "domain", 1, 0, 'd' }, - { "format", 2, 0, 0 }, - { "help", 0, 0, HELP_OPTION }, -+ { "inspector", 0, 0, 'i' }, - { "long-options", 0, 0, 0 }, -- { "memsize", 1, 0, 'm' }, -+ { "mount", 1, 0, 'm' }, -+ { "memsize", 1, 0, 0 }, - { "network", 0, 0, 0 }, - { "ro", 0, 0, 'r' }, - { "rw", 0, 0, 'w' }, -@@ -140,13 +145,16 @@ main (int argc, char *argv[]) - }; - struct drv *drvs = NULL; - struct drv *drv; -+ struct mp *mps = NULL; -+ struct mp *mp; -+ char *p; - const char *format = NULL; - bool format_consumed = true; - int c; - int option_index; - int network = 0; - const char *append = NULL; -- int memsize = 0; -+ int memsize = 0, m; - int smp = 0; - int suggest = 0; - char *append_full; -@@ -196,6 +204,10 @@ main (int argc, char *argv[]) - _("--scratch parameter '%s' should be >= 1"), optarg); - add_scratch_disks (n, &drvs); - } -+ } else if (STREQ (long_options[option_index].name, "memsize")) { -+ if (sscanf (optarg, "%d", &memsize) != 1) -+ error (EXIT_FAILURE, 0, -+ _("could not parse memory size '%s'"), optarg); - } else - error (EXIT_FAILURE, 0, - _("unknown long option: %s (%d)"), -@@ -214,10 +226,19 @@ main (int argc, char *argv[]) - OPTION_d; - break; - -+ case 'i': -+ OPTION_i; -+ break; -+ - case 'm': -- if (sscanf (optarg, "%d", &memsize) != 1) -- error (EXIT_FAILURE, 0, -- _("could not parse memory size '%s'"), optarg); -+ /* For backwards compatibility with virt-rescue <= 1.36, we -+ * must handle -m as a synonym for --memsize. -+ */ -+ if (sscanf (optarg, "%d", &m) == 1) -+ memsize = m; -+ else { -+ OPTION_m; -+ } - break; - - case 'r': -@@ -288,7 +309,6 @@ main (int argc, char *argv[]) - * options parsing code. Assert here that they have known-good - * values. - */ -- assert (inspector == 0); - assert (keys_from_stdin == 0); - assert (echo_keys == 0); - assert (live == 0); -@@ -332,12 +352,6 @@ main (int argc, char *argv[]) - exit (EXIT_FAILURE); - free (append_full); - -- /* Add drives. */ -- add_drives (drvs); -- -- /* Free up data structures, no longer needed after this point. */ -- free_drives (drvs); -- - /* Add an event handler to print "log messages". These will be the - * output of the appliance console during launch and shutdown. - * After launch, we will read the console messages directly from the -@@ -347,21 +361,50 @@ main (int argc, char *argv[]) - GUESTFS_EVENT_APPLIANCE, 0, NULL) == -1) - exit (EXIT_FAILURE); - -- /* Run the appliance. */ -+ /* Do the guest drives and mountpoints. */ -+ add_drives (drvs); - if (guestfs_launch (g) == -1) - exit (EXIT_FAILURE); -+ if (inspector) -+ inspect_mount (); -+ mount_mps (mps); -+ -+ free_drives (drvs); -+ free_mps (mps); -+ -+ /* Also bind-mount /dev etc under /sysroot, if -i was given. */ -+ if (inspector) { -+ CLEANUP_FREE_STRING_LIST char **roots; -+ int windows; -+ -+ roots = guestfs_inspect_get_roots (g); -+ windows = roots && roots[0] && is_windows (g, roots[0]); -+ if (!windows) { -+ const char *cmd[5] = { "mount", "--rbind", NULL, NULL, NULL }; -+ char *r; -+ -+ cmd[2] = "/dev"; cmd[3] = "/sysroot/dev"; -+ r = guestfs_debug (g, "sh", (char **) cmd); -+ free (r); -+ -+ cmd[2] = "/proc"; cmd[3] = "/sysroot/proc"; -+ r = guestfs_debug (g, "sh", (char **) cmd); -+ free (r); -+ -+ cmd[2] = "/sys"; cmd[3] = "/sysroot/sys"; -+ r = guestfs_debug (g, "sh", (char **) cmd); -+ free (r); -+ } -+ } - - sock = guestfs_internal_get_console_socket (g); - if (sock == -1) - exit (EXIT_FAILURE); - - /* Try to set all sockets to non-blocking. */ -- if (fcntl (STDIN_FILENO, F_SETFL, O_NONBLOCK) == -1) -- perror ("could not set stdin to non-blocking"); -- if (fcntl (STDOUT_FILENO, F_SETFL, O_NONBLOCK) == -1) -- perror ("could not set stdout to non-blocking"); -- if (fcntl (sock, F_SETFL, O_NONBLOCK) == -1) -- perror ("could not set console socket to non-blocking"); -+ ignore_value (set_nonblocking_flag (STDIN_FILENO, 1)); -+ ignore_value (set_nonblocking_flag (STDOUT_FILENO, 1)); -+ ignore_value (set_nonblocking_flag (sock, 1)); - - /* Save the initial state of the tty so we always have the original - * state to go back to. -diff --git a/rescue/virt-rescue.pod b/rescue/virt-rescue.pod -index b8aa32637..b651f84e7 100644 ---- a/rescue/virt-rescue.pod -+++ b/rescue/virt-rescue.pod -@@ -6,9 +6,7 @@ virt-rescue - Run a rescue shell on a virtual machine - - virt-rescue [--options] -d domname - -- virt-rescue [--options] -a disk.img [-a disk.img ...] -- -- virt-rescue --suggest (-d domname | -a disk.img ...) -+ virt-rescue [--options] -a disk.img [-a disk.img ...] [-i] - - Old style: - -@@ -26,13 +24,13 @@ machine or disk image. - You can run virt-rescue on any virtual machine known to libvirt, or - directly on disk image(s): - -- virt-rescue -d GuestName -+ virt-rescue -d GuestName -i - -- virt-rescue --ro -a /path/to/disk.img -+ virt-rescue --ro -a /path/to/disk.img -i - - virt-rescue -a /dev/sdc - --For live VMs you I use the --ro option. -+For live VMs you I use the I<--ro> option. - - When you run virt-rescue on a virtual machine or disk image, you are - placed in an interactive bash shell where you can use many ordinary -@@ -41,26 +39,10 @@ rescue appliance. You must mount the virtual machine's filesystems by - hand. There is an empty directory called F where you can - mount filesystems. - --You can get virt-rescue to suggest mount commands for you by using the --I<--suggest> option (in another terminal): -- -- $ virt-rescue --suggest -d Fedora15 -- Inspecting the virtual machine or disk image ... -- -- This disk contains one or more operating systems. You can use these -- mount commands in virt-rescue (at the > prompt) to mount the -- filesystems. -- -- # /dev/vg_f15x32/lv_root is the root of a linux operating system -- # type: linux, distro: fedora, version: 15.0 -- # Fedora release 15 (Lovelock) -- -- mount /dev/vg_f15x32/lv_root /sysroot/ -- mount /dev/vda1 /sysroot/boot -- mount --bind /dev /sysroot/dev -- mount --bind /dev/pts /sysroot/dev/pts -- mount --bind /proc /sysroot/proc -- mount --bind /sys /sysroot/sys -+To automatically mount the virtual machine's filesystems under -+F use the I<-i> option. This uses libguestfs inspection to -+find the filesystems and mount them in the right place. You can also -+mount filesystems individually using the I<-m> option. - - Another way is to list the logical volumes (with L) and - partitions (with L) and mount them by hand: -@@ -170,7 +152,15 @@ If you have untrusted raw-format guest disk images, you should use - this option to specify the disk format. This avoids a possible - security problem with malicious guests (CVE-2010-3851). - --=item B<-m> MB -+=item B<-i> -+ -+=item B<--inspector> -+ -+Using L code, inspect the disks looking for -+an operating system and mount filesystems as they would be -+mounted on the real virtual machine. -+ -+The filesystems are mounted on F in the rescue environment. - - =item B<--memsize> MB - -@@ -179,6 +169,33 @@ default is set by libguestfs and is small but adequate for running - system tools. The occasional program might need more memory. The - parameter is specified in megabytes. - -+=item B<-m> dev[:mountpoint[:options[:fstype]]] -+ -+=item B<--mount> dev[:mountpoint[:options[:fstype]]] -+ -+Mount the named partition or logical volume on the given mountpoint -+B (this has nothing to do with mountpoints in the host). -+ -+If the mountpoint is omitted, it defaults to F. You have to mount -+something on F. -+ -+The filesystems are mounted under F in the rescue environment. -+ -+The third (and rarely used) part of the mount parameter is the list of -+mount options used to mount the underlying filesystem. If this is not -+given, then the mount options are either the empty string or C -+(the latter if the I<--ro> flag is used). By specifying the mount -+options, you override this default choice. Probably the only time you -+would use this is to enable ACLs and/or extended attributes if the -+filesystem can support them: -+ -+ -m /dev/sda1:/:acl,user_xattr -+ -+The fourth part of the parameter is the filesystem driver to use, such -+as C or C. This is rarely needed, but can be useful if -+multiple drivers are valid for a filesystem (eg: C and C), -+or if libguestfs misidentifies a filesystem. -+ - =item B<--network> - - Enable QEMU user networking in the guest. See L. -@@ -217,9 +234,10 @@ Enable N E 2 virtual CPUs in the rescue appliance. - - =item B<--suggest> - --Inspect the disk image and suggest what mount commands should be used --to mount the disks. You should use the I<--suggest> option in a --second terminal, then paste the commands into another virt-rescue. -+This option was used in older versions of virt-rescue to suggest what -+commands you could use to mount filesystems under F. For -+the current version of virt-rescue, it is easier to use the I<-i> -+option instead. - - This option implies I<--ro> and is safe to use even if the guest is up - or if another virt-rescue is running. -@@ -240,7 +258,7 @@ Display version number and exit. - - =item B<--rw> - --This changes the I<-a> and I<-d> options so that disks are -+This changes the I<-a>, I<-d> and I<-m> options so that disks are - added and mounts are done read-write. - - See L. --- -2.13.2 - diff --git a/0006-rescue-Implement-escape-sequences.patch b/0006-rescue-Implement-escape-sequences.patch deleted file mode 100644 index 4a934aa..0000000 --- a/0006-rescue-Implement-escape-sequences.patch +++ /dev/null @@ -1,615 +0,0 @@ -From 323350c82b49ac4d3519fe7ef9959c79dd9a83db Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Sat, 4 Mar 2017 11:47:59 +0000 -Subject: [PATCH 06/10] rescue: Implement escape sequences. - -This implements a few useful escape sequences: - -> ^]? -virt-rescue escape sequences: - ^] ? - print this message - ^] h - print this message - ^] q - quit virt-rescue - ^] s - sync the filesystems - ^] u - unmount filesystems - ^] x - quit virt-rescue - ^] z - suspend virt-rescue -to pass the escape key through to the rescue shell, type it twice - -^]i - -root device: /dev/sda3 - product name: Fedora 25 (Twenty Five) - type: linux - distro: fedora - -^]z -[3]+ Stopped ./run virt-rescue --scratch -$ fg - -> ^]u - -unmounting filesystems ... -[ 21.158558] XFS (sda3): Unmounting Filesystem - -(cherry picked from commit 3637c42f4e521eb647d7dfae7f48eb1689d0af54) ---- - rescue/Makefile.am | 4 +- - rescue/escape.c | 302 +++++++++++++++++++++++++++++++++++++++++++++++++ - rescue/rescue.c | 30 ++++- - rescue/rescue.h | 47 ++++++++ - rescue/virt-rescue.pod | 74 ++++++++++++ - 5 files changed, 454 insertions(+), 3 deletions(-) - create mode 100644 rescue/escape.c - create mode 100644 rescue/rescue.h - -diff --git a/rescue/Makefile.am b/rescue/Makefile.am -index c83c43458..eb60bafa4 100644 ---- a/rescue/Makefile.am -+++ b/rescue/Makefile.am -@@ -26,7 +26,9 @@ EXTRA_DIST = \ - bin_PROGRAMS = virt-rescue - - virt_rescue_SOURCES = \ -- rescue.c -+ escape.c \ -+ rescue.c \ -+ rescue.h - - virt_rescue_CPPFLAGS = \ - -DGUESTFS_WARN_DEPRECATED=1 \ -diff --git a/rescue/escape.c b/rescue/escape.c -new file mode 100644 -index 000000000..f7f7d84c4 ---- /dev/null -+++ b/rescue/escape.c -@@ -0,0 +1,302 @@ -+/* virt-rescue -+ * Copyright (C) 2010-2017 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 -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "c-ctype.h" -+ -+#include "guestfs.h" -+#include "guestfs-internal-frontend.h" -+ -+#include "rescue.h" -+ -+static void print_help (void); -+static void print_inspector (void); -+static void crlf (void); -+static void print_escape_key (void); -+ -+/* Parse the -e parameter from the command line. */ -+int -+parse_escape_key (const char *arg) -+{ -+ size_t len; -+ -+ if (STREQ (arg, "none")) -+ return 0; -+ -+ len = strlen (arg); -+ if (arg == 0) -+ return -1; -+ -+ switch (arg[0]) { -+ case '^': -+ if (len == 2 && -+ ((arg[1] >= 'a' && arg[1] <= 'z') || -+ (arg[1] >= 'A' && arg[1] <= '_'))) { -+ return c_toupper (arg[1]) - '@'; -+ } -+ else -+ return -1; -+ break; -+ } -+ -+ return -1; -+} -+ -+/* Print one-line end user description of the escape key. -+ * -+ * This is printed when virt-rescue starts. -+ */ -+void -+print_escape_key_help (void) -+{ -+ crlf (); -+ /* Difficult to translate this string. XXX */ -+ printf ("The virt-rescue escape key is ‘"); -+ print_escape_key (); -+ printf ("’. Type ‘"); -+ print_escape_key (); -+ printf (" h’ for help."); -+ crlf (); -+} -+ -+void -+init_escape_state (struct escape_state *state) -+{ -+ state->in_escape = false; -+} -+ -+/* Process escapes in the tty input buffer. -+ * -+ * This function has a state parameter so that we can handle an escape -+ * sequence split over the end of the buffer. -+ * -+ * Escape sequences are removed from the buffer. -+ * -+ * Returns true iff virt-rescue should exit. -+ */ -+bool -+process_escapes (struct escape_state *state, char *buf, size_t *len) -+{ -+ size_t i; -+ -+ for (i = 0; i < *len; ++i) { -+#define DROP_CURRENT_CHAR() \ -+ memmove (&buf[i], &buf[i+1], --(*len)) -+#define PRINT_ESC() \ -+ do { print_escape_key (); putchar (buf[i]); crlf (); } while (0) -+ -+ if (!state->in_escape) { -+ if (buf[i] == escape_key) { -+ /* Drop the escape key from the buffer and go to escape mode. */ -+ DROP_CURRENT_CHAR (); -+ state->in_escape = true; -+ } -+ } -+ else /* in escape sequence */ { -+ if (buf[i] == escape_key) /* ^] ^] means send ^] to rescue shell */ -+ state->in_escape = false; -+ else { -+ switch (buf[i]) { -+ case '?': case 'h': -+ PRINT_ESC (); -+ print_help (); -+ break; -+ -+ case 'i': -+ PRINT_ESC (); -+ print_inspector (); -+ break; -+ -+ case 'q': case 'x': -+ PRINT_ESC (); -+ return true /* exit virt-rescue at once */; -+ -+ case 's': -+ PRINT_ESC (); -+ printf (_("attempting to sync filesystems ...")); -+ crlf (); -+ guestfs_sync (g); -+ break; -+ -+ case 'u': -+ PRINT_ESC (); -+ printf (_("unmounting filesystems ...")); -+ crlf (); -+ guestfs_umount_all (g); -+ break; -+ -+ case 'z': -+ PRINT_ESC (); -+ raise (SIGTSTP); -+ break; -+ -+ default: -+ /* Any unrecognized escape sequence will be dropped. We -+ * could be obnoxious and ring the bell, but I hate it when -+ * programs do that. -+ */ -+ break; -+ } -+ -+ /* Drop the escape key and return to non-escape mode. */ -+ DROP_CURRENT_CHAR (); -+ state->in_escape = false; -+ -+ /* The output is line buffered, this is just to make sure -+ * everything gets written to stdout before we continue -+ * writing to STDOUT_FILENO. -+ */ -+ fflush (stdout); -+ } -+ } /* in escape sequence */ -+ } /* for */ -+ -+ return false /* don't exit */; -+} -+ -+/* This is called when the user types ^] h */ -+static void -+print_help (void) -+{ -+ printf (_("virt-rescue escape sequences:")); -+ crlf (); -+ -+ putchar (' '); -+ print_escape_key (); -+ printf (_(" ? - print this message")); -+ crlf (); -+ -+ putchar (' '); -+ print_escape_key (); -+ printf (_(" h - print this message")); -+ crlf (); -+ -+ if (inspector) { -+ putchar (' '); -+ print_escape_key (); -+ printf (_(" i - print inspection data")); -+ crlf (); -+ } -+ -+ putchar (' '); -+ print_escape_key (); -+ printf (_(" q - quit virt-rescue")); -+ crlf (); -+ -+ putchar (' '); -+ print_escape_key (); -+ printf (_(" s - sync the filesystems")); -+ crlf (); -+ -+ putchar (' '); -+ print_escape_key (); -+ printf (_(" u - unmount filesystems")); -+ crlf (); -+ -+ putchar (' '); -+ print_escape_key (); -+ printf (_(" x - quit virt-rescue")); -+ crlf (); -+ -+ putchar (' '); -+ print_escape_key (); -+ printf (_(" z - suspend virt-rescue")); -+ crlf (); -+ -+ printf (_("to pass the escape key through to the rescue shell, type it twice")); -+ crlf (); -+} -+ -+/* This is called when the user types ^] i */ -+static void -+print_inspector (void) -+{ -+ CLEANUP_FREE_STRING_LIST char **roots; -+ size_t i; -+ const char *root; -+ char *str; -+ -+ if (inspector) { -+ roots = guestfs_inspect_get_roots (g); -+ if (roots) { -+ crlf (); -+ for (i = 0; roots[i] != NULL; ++i) { -+ root = roots[i]; -+ printf (_("root device: %s"), root); -+ crlf (); -+ -+ str = guestfs_inspect_get_product_name (g, root); -+ if (str) { -+ printf (_(" product name: %s"), str); -+ crlf (); -+ } -+ free (str); -+ -+ str = guestfs_inspect_get_type (g, root); -+ if (str) { -+ printf (_(" type: %s"), str); -+ crlf (); -+ } -+ free (str); -+ -+ str = guestfs_inspect_get_distro (g, root); -+ if (str) { -+ printf (_(" distro: %s"), str); -+ crlf (); -+ } -+ free (str); -+ } -+ } -+ } -+} -+ -+/* Because the terminal is in raw mode, we have to send CR LF instead -+ * of printing just \n. -+ */ -+static void -+crlf (void) -+{ -+ putchar ('\r'); -+ putchar ('\n'); -+} -+ -+static void -+print_escape_key (void) -+{ -+ switch (escape_key) { -+ case 0: -+ printf ("none"); -+ break; -+ case '\x1'...'\x1f': -+ putchar ('^'); -+ putchar (escape_key + '@'); -+ break; -+ default: -+ abort (); -+ } -+} -diff --git a/rescue/rescue.c b/rescue/rescue.c -index 2b461378d..5281b1161 100644 ---- a/rescue/rescue.c -+++ b/rescue/rescue.c -@@ -1,5 +1,5 @@ - /* virt-rescue -- * Copyright (C) 2010-2012 Red Hat Inc. -+ * Copyright (C) 2010-2017 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 -@@ -40,10 +40,14 @@ - #include "xvasprintf.h" - - #include "guestfs.h" -+#include "guestfs-internal-frontend.h" -+ - #include "windows.h" - #include "options.h" - #include "display-options.h" - -+#include "rescue.h" -+ - static void log_message_callback (guestfs_h *g, void *opaque, uint64_t event, int event_handle, int flags, const char *buf, size_t buf_len, const uint64_t *array, size_t array_len); - static void do_rescue (int sock); - static void raw_tty (void); -@@ -65,6 +69,7 @@ const char *libvirt_uri = NULL; - int inspector = 0; - int in_guestfish = 0; - int in_virt_rescue = 1; -+int escape_key = '\x1d'; /* ^] */ - - /* Old terminal settings. */ - static struct termios old_termios; -@@ -86,6 +91,7 @@ usage (int status) - " --append kernelopts Append kernel options\n" - " -c|--connect uri Specify libvirt URI for -d option\n" - " -d|--domain guest Add disks from libvirt guest\n" -+ " -e ^x|none Set or disable escape key (default ^])\n" - " --format[=raw|..] Force disk format for -a option\n" - " --help Display brief help\n" - " -i|--inspector Automatically mount filesystems\n" -@@ -119,7 +125,7 @@ main (int argc, char *argv[]) - - enum { HELP_OPTION = CHAR_MAX + 1 }; - -- static const char options[] = "a:c:d:im:rvVwx"; -+ static const char options[] = "a:c:d:e:im:rvVwx"; - static const struct option long_options[] = { - { "add", 1, 0, 'a' }, - { "append", 1, 0, 0 }, -@@ -226,6 +232,12 @@ main (int argc, char *argv[]) - OPTION_d; - break; - -+ case 'e': -+ escape_key = parse_escape_key (optarg); -+ if (escape_key == -1) -+ error (EXIT_FAILURE, 0, _("unrecognized escape key: %s"), optarg); -+ break; -+ - case 'i': - OPTION_i; - break; -@@ -428,6 +440,10 @@ main (int argc, char *argv[]) - signal (SIGTSTP, tstp_handler); - signal (SIGCONT, cont_handler); - -+ /* Print the escape key if set. */ -+ if (escape_key > 0) -+ print_escape_key_help (); -+ - do_rescue (sock); - - restore_tty (); -@@ -478,6 +494,9 @@ do_rescue (int sock) - { - size_t rlen = 0; - size_t wlen = 0; -+ struct escape_state escape_state; -+ -+ init_escape_state (&escape_state); - - while (sock >= 0 || rlen > 0) { - struct pollfd fds[3]; -@@ -534,6 +553,13 @@ do_rescue (int sock) - } - if (n > 0) - wlen += n; -+ -+ /* Process escape sequences in the tty input. If the function -+ * returns true, then we exit the loop causing virt-rescue to -+ * exit. -+ */ -+ if (escape_key > 0 && process_escapes (&escape_state, wbuf, &wlen)) -+ return; - } - - /* Log message from appliance. */ -diff --git a/rescue/rescue.h b/rescue/rescue.h -new file mode 100644 -index 000000000..ccffb5eb3 ---- /dev/null -+++ b/rescue/rescue.h -@@ -0,0 +1,47 @@ -+/* virt-rescue -+ * Copyright (C) 2010-2017 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. -+ */ -+ -+#ifndef RESCUE_H -+#define RESCUE_H -+ -+#include -+ -+#include "guestfs.h" -+ -+extern guestfs_h *g; -+extern int read_only; -+extern int live; -+extern int verbose; -+extern int keys_from_stdin; -+extern int echo_keys; -+extern const char *libvirt_uri; -+extern int inspector; -+extern int in_guestfish; -+extern int in_virt_rescue; -+extern int escape_key; -+ -+/* escape.c */ -+struct escape_state { -+ bool in_escape; -+}; -+extern void init_escape_state (struct escape_state *state); -+extern bool process_escapes (struct escape_state *state, char *buf, size_t *len); -+extern int parse_escape_key (const char *); -+extern void print_escape_key_help (void); -+ -+#endif /* RESCUE_H */ -diff --git a/rescue/virt-rescue.pod b/rescue/virt-rescue.pod -index b651f84e7..bd6f954e9 100644 ---- a/rescue/virt-rescue.pod -+++ b/rescue/virt-rescue.pod -@@ -128,6 +128,29 @@ not used at all. - Add all the disks from the named libvirt guest. Domain UUIDs can be - used instead of names. - -+=item B<-e none> -+ -+Disable the escape key. -+ -+=item B<-e> KEY -+ -+Set the escape key to the given key sequence. The default is C<^]>. -+To specify the escape key you can use: -+ -+=over 4 -+ -+=item C<^x> -+ -+Control key + C key. -+ -+=item C -+ -+I<-e none> means there is no escape key, escapes are disabled. -+ -+=back -+ -+See L below for further information. -+ - =item B<--format=raw|qcow2|..> - - =item B<--format> -@@ -321,6 +344,57 @@ See L for more details. - - =back - -+=head1 ESCAPE KEY -+ -+Virt-rescue supports various keyboard escape sequences which are -+entered by pressing C<^]> (Control key + C<]> key). -+ -+You can change the escape key using the I<-e> option on the command -+line (see above), and you can disable escapes completely using -+I<-e none>. The rest of this section assumes the default escape key. -+ -+The following escapes can be used: -+ -+=over 4 -+ -+=item C<^] ?> -+ -+=item C<^] h> -+ -+Prints a brief help text about escape sequences. -+ -+=item C<^] i> -+ -+Prints brief libguestfs inspection information for the guest. This -+only works if you used I<-i> on the virt-rescue command line. -+ -+=item C<^] q> -+ -+=item C<^] x> -+ -+Quits virt-rescue immediately. -+ -+=item C<^] s> -+ -+Synchronize the filesystems (sync). -+ -+=item C<^] u> -+ -+Unmounts all the filesystems, except for the root (appliance) -+filesystems. -+ -+=item C<^] z> -+ -+Suspend virt-rescue (like pressing C<^Z> except that it affects -+virt-rescue rather than the program inside the rescue shell). -+ -+=item C<^] ^]> -+ -+Sends the literal character C<^]> (ASCII 0x1d) through to the rescue -+shell. -+ -+=back -+ - =head1 CAPTURING CORE DUMPS - - If you are testing a tool inside virt-rescue and the tool (B --- -2.13.2 - diff --git a/0007-rescue-Move-suggest-code-to-separate-file.patch b/0007-rescue-Move-suggest-code-to-separate-file.patch deleted file mode 100644 index 328f5db..0000000 --- a/0007-rescue-Move-suggest-code-to-separate-file.patch +++ /dev/null @@ -1,397 +0,0 @@ -From 00adeb472c65e30fd2e55599b14d9b2eec2a873d Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Sat, 4 Mar 2017 15:35:09 +0000 -Subject: [PATCH 07/10] rescue: Move --suggest code to separate file. - -Just code motion. - -(cherry picked from commit 5ea17e97e4413c3db4449ded72b9677cce09444f) ---- - rescue/Makefile.am | 3 +- - rescue/rescue.c | 144 ------------------------------------------- - rescue/rescue.h | 5 ++ - rescue/suggest.c | 175 +++++++++++++++++++++++++++++++++++++++++++++++++++++ - 4 files changed, 182 insertions(+), 145 deletions(-) - create mode 100644 rescue/suggest.c - -diff --git a/rescue/Makefile.am b/rescue/Makefile.am -index eb60bafa4..d478c8e3d 100644 ---- a/rescue/Makefile.am -+++ b/rescue/Makefile.am -@@ -28,7 +28,8 @@ bin_PROGRAMS = virt-rescue - virt_rescue_SOURCES = \ - escape.c \ - rescue.c \ -- rescue.h -+ rescue.h \ -+ suggest.c - - virt_rescue_CPPFLAGS = \ - -DGUESTFS_WARN_DEPRECATED=1 \ -diff --git a/rescue/rescue.c b/rescue/rescue.c -index 5281b1161..a1aac53e4 100644 ---- a/rescue/rescue.c -+++ b/rescue/rescue.c -@@ -55,7 +55,6 @@ static void restore_tty (void); - static void tstp_handler (int sig); - static void cont_handler (int sig); - static void add_scratch_disks (int n, struct drv **drvs); --static void do_suggestion (struct drv *drvs); - - /* Currently open libguestfs handle. */ - guestfs_h *g; -@@ -654,149 +653,6 @@ cont_handler (int sig) - raw_tty (); - } - --static void suggest_filesystems (void); -- --static int --compare_keys_len (const void *p1, const void *p2) --{ -- const char *key1 = * (char * const *) p1; -- const char *key2 = * (char * const *) p2; -- return strlen (key1) - strlen (key2); --} -- --/* virt-rescue --suggest flag does a kind of inspection on the -- * drives and suggests mount commands that you should use. -- */ --static void --do_suggestion (struct drv *drvs) --{ -- CLEANUP_FREE_STRING_LIST char **roots = NULL; -- size_t i; -- -- /* For inspection, force add_drives to add the drives read-only. */ -- read_only = 1; -- -- /* Add drives. */ -- add_drives (drvs); -- -- /* Free up data structures, no longer needed after this point. */ -- free_drives (drvs); -- -- printf (_("Inspecting the virtual machine or disk image ...\n\n")); -- fflush (stdout); -- -- if (guestfs_launch (g) == -1) -- exit (EXIT_FAILURE); -- -- /* Don't use inspect_mount, since for virt-rescue we should allow -- * arbitrary disks and disks with more than one OS on them. Let's -- * do this using the basic API instead. -- */ -- roots = guestfs_inspect_os (g); -- if (roots == NULL) -- exit (EXIT_FAILURE); -- -- if (roots[0] == NULL) { -- suggest_filesystems (); -- return; -- } -- -- printf (_("This disk contains one or more operating systems. You can use these mount\n" -- "commands in virt-rescue (at the > prompt) to mount the filesystems.\n\n")); -- -- for (i = 0; roots[i] != NULL; ++i) { -- CLEANUP_FREE_STRING_LIST char **mps = NULL; -- CLEANUP_FREE char *type = NULL, *distro = NULL, *product_name = NULL; -- int major, minor; -- size_t j; -- -- type = guestfs_inspect_get_type (g, roots[i]); -- distro = guestfs_inspect_get_distro (g, roots[i]); -- product_name = guestfs_inspect_get_product_name (g, roots[i]); -- major = guestfs_inspect_get_major_version (g, roots[i]); -- minor = guestfs_inspect_get_minor_version (g, roots[i]); -- -- printf (_("# %s is the root of a %s operating system\n" -- "# type: %s, distro: %s, version: %d.%d\n" -- "# %s\n\n"), -- roots[i], type ? : "unknown", -- type ? : "unknown", distro ? : "unknown", major, minor, -- product_name ? : ""); -- -- mps = guestfs_inspect_get_mountpoints (g, roots[i]); -- if (mps == NULL) -- exit (EXIT_FAILURE); -- -- /* Sort by key length, shortest key first, so that we end up -- * mounting the filesystems in the correct order. -- */ -- qsort (mps, guestfs_int_count_strings (mps) / 2, 2 * sizeof (char *), -- compare_keys_len); -- -- for (j = 0; mps[j] != NULL; j += 2) -- printf ("mount %s /sysroot%s\n", mps[j+1], mps[j]); -- -- /* If it's Linux, print the bind-mounts and a chroot command. */ -- if (type && STREQ (type, "linux")) { -- printf ("mount --rbind /dev /sysroot/dev\n"); -- printf ("mount --rbind /proc /sysroot/proc\n"); -- printf ("mount --rbind /sys /sysroot/sys\n"); -- printf ("\n"); -- printf ("cd /sysroot\n"); -- printf ("chroot /sysroot\n"); -- } -- -- printf ("\n"); -- } --} -- --/* Inspection failed, so it doesn't contain any OS that we recognise. -- * However there might still be filesystems so print some suggestions -- * for those. -- */ --static void --suggest_filesystems (void) --{ -- size_t i, count; -- -- CLEANUP_FREE_STRING_LIST char **fses = guestfs_list_filesystems (g); -- if (fses == NULL) -- exit (EXIT_FAILURE); -- -- /* Count how many are not swap or unknown. Possibly we should try -- * mounting to see which are mountable, but that has a high -- * probability of breaking. -- */ --#define TEST_MOUNTABLE(fs) STRNEQ ((fs), "swap") && STRNEQ ((fs), "unknown") -- count = 0; -- for (i = 0; fses[i] != NULL; i += 2) { -- if (TEST_MOUNTABLE (fses[i+1])) -- count++; -- } -- -- if (count == 0) { -- printf (_("This disk contains no mountable filesystems that we recognize.\n\n" -- "However you can still use virt-rescue on the disk image, to try to mount\n" -- "filesystems that are not recognized by libguestfs, or to create partitions,\n" -- "logical volumes and filesystems on a blank disk.\n")); -- return; -- } -- -- printf (_("This disk contains one or more filesystems, but we don't recognize any\n" -- "operating system. You can use these mount commands in virt-rescue (at the\n" -- "> prompt) to mount these filesystems.\n\n")); -- -- for (i = 0; fses[i] != NULL; i += 2) { -- printf (_("# %s has type '%s'\n"), fses[i], fses[i+1]); -- -- if (TEST_MOUNTABLE (fses[i+1])) -- printf ("mount %s /sysroot\n", fses[i]); -- -- printf ("\n"); -- } --#undef TEST_MOUNTABLE --} -- - static void add_scratch_disk (struct drv **drvs); - - static void -diff --git a/rescue/rescue.h b/rescue/rescue.h -index ccffb5eb3..4f5a04a71 100644 ---- a/rescue/rescue.h -+++ b/rescue/rescue.h -@@ -23,6 +23,8 @@ - - #include "guestfs.h" - -+#include "options.h" -+ - extern guestfs_h *g; - extern int read_only; - extern int live; -@@ -44,4 +46,7 @@ extern bool process_escapes (struct escape_state *state, char *buf, size_t *len) - extern int parse_escape_key (const char *); - extern void print_escape_key_help (void); - -+/* suggest.c */ -+extern void do_suggestion (struct drv *drvs); -+ - #endif /* RESCUE_H */ -diff --git a/rescue/suggest.c b/rescue/suggest.c -new file mode 100644 -index 000000000..13141ccc2 ---- /dev/null -+++ b/rescue/suggest.c -@@ -0,0 +1,175 @@ -+/* virt-rescue -+ * Copyright (C) 2010-2017 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 -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include "guestfs.h" -+#include "guestfs-internal-frontend.h" -+ -+#include "options.h" -+ -+#include "rescue.h" -+ -+static void suggest_filesystems (void); -+ -+static int -+compare_keys_len (const void *p1, const void *p2) -+{ -+ const char *key1 = * (char * const *) p1; -+ const char *key2 = * (char * const *) p2; -+ return strlen (key1) - strlen (key2); -+} -+ -+/* virt-rescue --suggest flag does a kind of inspection on the -+ * drives and suggests mount commands that you should use. -+ */ -+void -+do_suggestion (struct drv *drvs) -+{ -+ CLEANUP_FREE_STRING_LIST char **roots = NULL; -+ size_t i; -+ -+ /* For inspection, force add_drives to add the drives read-only. */ -+ read_only = 1; -+ -+ /* Add drives. */ -+ add_drives (drvs); -+ -+ /* Free up data structures, no longer needed after this point. */ -+ free_drives (drvs); -+ -+ printf (_("Inspecting the virtual machine or disk image ...\n\n")); -+ fflush (stdout); -+ -+ if (guestfs_launch (g) == -1) -+ exit (EXIT_FAILURE); -+ -+ /* Don't use inspect_mount, since for virt-rescue we should allow -+ * arbitrary disks and disks with more than one OS on them. Let's -+ * do this using the basic API instead. -+ */ -+ roots = guestfs_inspect_os (g); -+ if (roots == NULL) -+ exit (EXIT_FAILURE); -+ -+ if (roots[0] == NULL) { -+ suggest_filesystems (); -+ return; -+ } -+ -+ printf (_("This disk contains one or more operating systems. You can use these mount\n" -+ "commands in virt-rescue (at the > prompt) to mount the filesystems.\n\n")); -+ -+ for (i = 0; roots[i] != NULL; ++i) { -+ CLEANUP_FREE_STRING_LIST char **mps = NULL; -+ CLEANUP_FREE char *type = NULL, *distro = NULL, *product_name = NULL; -+ int major, minor; -+ size_t j; -+ -+ type = guestfs_inspect_get_type (g, roots[i]); -+ distro = guestfs_inspect_get_distro (g, roots[i]); -+ product_name = guestfs_inspect_get_product_name (g, roots[i]); -+ major = guestfs_inspect_get_major_version (g, roots[i]); -+ minor = guestfs_inspect_get_minor_version (g, roots[i]); -+ -+ printf (_("# %s is the root of a %s operating system\n" -+ "# type: %s, distro: %s, version: %d.%d\n" -+ "# %s\n\n"), -+ roots[i], type ? : "unknown", -+ type ? : "unknown", distro ? : "unknown", major, minor, -+ product_name ? : ""); -+ -+ mps = guestfs_inspect_get_mountpoints (g, roots[i]); -+ if (mps == NULL) -+ exit (EXIT_FAILURE); -+ -+ /* Sort by key length, shortest key first, so that we end up -+ * mounting the filesystems in the correct order. -+ */ -+ qsort (mps, guestfs_int_count_strings (mps) / 2, 2 * sizeof (char *), -+ compare_keys_len); -+ -+ for (j = 0; mps[j] != NULL; j += 2) -+ printf ("mount %s /sysroot%s\n", mps[j+1], mps[j]); -+ -+ /* If it's Linux, print the bind-mounts and a chroot command. */ -+ if (type && STREQ (type, "linux")) { -+ printf ("mount --rbind /dev /sysroot/dev\n"); -+ printf ("mount --rbind /proc /sysroot/proc\n"); -+ printf ("mount --rbind /sys /sysroot/sys\n"); -+ printf ("\n"); -+ printf ("cd /sysroot\n"); -+ printf ("chroot /sysroot\n"); -+ } -+ -+ printf ("\n"); -+ } -+} -+ -+/* Inspection failed, so it doesn't contain any OS that we recognise. -+ * However there might still be filesystems so print some suggestions -+ * for those. -+ */ -+static void -+suggest_filesystems (void) -+{ -+ size_t i, count; -+ -+ CLEANUP_FREE_STRING_LIST char **fses = guestfs_list_filesystems (g); -+ if (fses == NULL) -+ exit (EXIT_FAILURE); -+ -+ /* Count how many are not swap or unknown. Possibly we should try -+ * mounting to see which are mountable, but that has a high -+ * probability of breaking. -+ */ -+#define TEST_MOUNTABLE(fs) STRNEQ ((fs), "swap") && STRNEQ ((fs), "unknown") -+ count = 0; -+ for (i = 0; fses[i] != NULL; i += 2) { -+ if (TEST_MOUNTABLE (fses[i+1])) -+ count++; -+ } -+ -+ if (count == 0) { -+ printf (_("This disk contains no mountable filesystems that we recognize.\n\n" -+ "However you can still use virt-rescue on the disk image, to try to mount\n" -+ "filesystems that are not recognized by libguestfs, or to create partitions,\n" -+ "logical volumes and filesystems on a blank disk.\n")); -+ return; -+ } -+ -+ printf (_("This disk contains one or more filesystems, but we don't recognize any\n" -+ "operating system. You can use these mount commands in virt-rescue (at the\n" -+ "> prompt) to mount these filesystems.\n\n")); -+ -+ for (i = 0; fses[i] != NULL; i += 2) { -+ printf (_("# %s has type '%s'\n"), fses[i], fses[i+1]); -+ -+ if (TEST_MOUNTABLE (fses[i+1])) -+ printf ("mount %s /sysroot\n", fses[i]); -+ -+ printf ("\n"); -+ } -+#undef TEST_MOUNTABLE -+} --- -2.13.2 - diff --git a/0008-rescue-docs-It-is-no-longer-necessary-to-mount-files.patch b/0008-rescue-docs-It-is-no-longer-necessary-to-mount-files.patch deleted file mode 100644 index f4b0338..0000000 --- a/0008-rescue-docs-It-is-no-longer-necessary-to-mount-files.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 35f96f0b0c9a3f05b16160338b1a118e2e7862ea Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 24 Mar 2017 22:51:06 +0000 -Subject: [PATCH 08/10] rescue: docs: It is no longer necessary to mount - filesystems by hand. - -Fix the manual page to reflect the new -i option. - -Fixes commit 33d2ae796119ae5dd38e2afcbf1ba4216bd99846. - -(cherry picked from commit c38b48409e067ba973d02bb10273350aa31b558e) ---- - rescue/virt-rescue.pod | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/rescue/virt-rescue.pod b/rescue/virt-rescue.pod -index bd6f954e9..dfa74e204 100644 ---- a/rescue/virt-rescue.pod -+++ b/rescue/virt-rescue.pod -@@ -35,9 +35,9 @@ For live VMs you I use the I<--ro> option. - When you run virt-rescue on a virtual machine or disk image, you are - placed in an interactive bash shell where you can use many ordinary - Linux commands. What you see in F (F, F etc) is the --rescue appliance. You must mount the virtual machine's filesystems by --hand. There is an empty directory called F where you can --mount filesystems. -+rescue appliance. You must mount the virtual machine's filesystems. -+There is an empty directory called F where you can mount -+filesystems. - - To automatically mount the virtual machine's filesystems under - F use the I<-i> option. This uses libguestfs inspection to --- -2.13.2 - diff --git a/0009-rescue-docs-Note-that-you-can-run-virt-rescue-on-dis.patch b/0009-rescue-docs-Note-that-you-can-run-virt-rescue-on-dis.patch deleted file mode 100644 index 1c3328b..0000000 --- a/0009-rescue-docs-Note-that-you-can-run-virt-rescue-on-dis.patch +++ /dev/null @@ -1,28 +0,0 @@ -From bcbb71f280a1c8b9dee6d63ddd75d727d3c73d69 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 24 Mar 2017 22:52:02 +0000 -Subject: [PATCH 09/10] rescue: docs: Note that you can run virt-rescue on - disks too. - -(cherry picked from commit 267569f7ad22ad14d9ef4fa27b038469ae115c45) ---- - rescue/virt-rescue.pod | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/rescue/virt-rescue.pod b/rescue/virt-rescue.pod -index dfa74e204..5cfbd6e1c 100644 ---- a/rescue/virt-rescue.pod -+++ b/rescue/virt-rescue.pod -@@ -69,7 +69,8 @@ Virt-rescue can be used on I disk image file or device, not just - a virtual machine. For example you can use it on a blank file if you - want to partition that file (although we would recommend using - L instead as it is more suitable for this purpose). You --can even use virt-rescue on things like SD cards. -+can even use virt-rescue on things like USB drives, SD cards and hard -+disks. - - You can get virt-rescue to give you scratch disk(s) to play with. - This is useful for testing out Linux utilities (see I<--scratch>). --- -2.13.2 - diff --git a/0010-rescue-Don-t-document-suggest-option-in-help-output.patch b/0010-rescue-Don-t-document-suggest-option-in-help-output.patch deleted file mode 100644 index d5dde78..0000000 --- a/0010-rescue-Don-t-document-suggest-option-in-help-output.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 495ac58e2af309443f59819403e4cb5780ae721c Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Sat, 25 Mar 2017 23:34:09 +0000 -Subject: [PATCH 10/10] rescue: Don't document --suggest option in --help - output. - -Also fix the docs test to ignore it. - -Updates/fixes commit 33d2ae796119ae5dd38e2afcbf1ba4216bd99846. - -(cherry picked from commit aa7b7e26c3aa434f2b299055df63c52fb3a2f93f) ---- - rescue/rescue.c | 1 - - rescue/test-virt-rescue-docs.sh | 3 ++- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/rescue/rescue.c b/rescue/rescue.c -index a1aac53e4..6f9dcd733 100644 ---- a/rescue/rescue.c -+++ b/rescue/rescue.c -@@ -101,7 +101,6 @@ usage (int status) - " --scratch[=N] Add scratch disk(s)\n" - " --selinux For backwards compat only, does nothing\n" - " --smp N Enable SMP with N >= 2 virtual CPUs\n" -- " --suggest Suggest mount commands for this guest\n" - " -v|--verbose Verbose messages\n" - " -V|--version Display version and exit\n" - " -w|--rw Mount read-write\n" -diff --git a/rescue/test-virt-rescue-docs.sh b/rescue/test-virt-rescue-docs.sh -index 25f8f6095..e5fbf26f4 100755 ---- a/rescue/test-virt-rescue-docs.sh -+++ b/rescue/test-virt-rescue-docs.sh -@@ -21,4 +21,5 @@ set -e - $TEST_FUNCTIONS - skip_if_skipped - --$top_srcdir/podcheck.pl virt-rescue.pod virt-rescue -+$top_srcdir/podcheck.pl virt-rescue.pod virt-rescue \ -+ --ignore=--suggest --- -2.13.2 - diff --git a/README-replacement.in b/README-replacement.in index 6392cb4..388dc34 100644 --- a/README-replacement.in +++ b/README-replacement.in @@ -8,8 +8,7 @@ list: http://www.redhat.com/mailman/listinfo/libguestfs -This Fedora package comes with a lot of help and examples to get you -started. +This package comes with a lot of help and examples to get you started. The first place to start are the manual pages. Type: @@ -20,19 +19,19 @@ The first place to start are the manual pages. Type: man virt-cat # and other virt-* tools If you install the libguestfs-devel package, then in the -/usr/share/doc/libguestfs-devel/ directory you will also -find: +/usr/share/doc/libguestfs-devel/ directory you will find other +documentation including: - BUGS: list of open bugs in this version - - ChangeLog: the detailed list of changes in this version + - ChangeLog.gz: the detailed list of changes in this version - - ROADMAP: the roadmap for future versions + - HACKING: how to extend libguestfs - TODO: ideas for extending libguestfs - *.c: example C programs using the API - - *.xml: example virt-inspector output + - *.xml.gz: example virt-inspector output (compressed) - - *.rng: virt-inspector RelaxNG schema + - virt-inspector.rng: virt-inspector RelaxNG schema diff --git a/bump-and-build.sh b/bump-and-build.sh deleted file mode 100755 index 975db37..0000000 --- a/bump-and-build.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - - -set -e - -rpmdev-bumpspec -c "- Bump and rebuild." libguestfs.spec -git diff ||: -echo "Press ENTER to commit, push and rebuild." -read line -fedpkg commit -m "Bump and rebuild." -p -fedpkg build diff --git a/copy-patches.sh b/copy-patches.sh new file mode 100755 index 0000000..46b1f33 --- /dev/null +++ b/copy-patches.sh @@ -0,0 +1,56 @@ +#!/bin/bash - + +set -e + +# Maintainer script to copy patches from the git repo to the current +# directory. It's normally only used downstream (ie. in RHEL). Use +# it like this: +# ./copy-patches.sh + +rhel_version=9.0.0 + +# Check we're in the right directory. +if [ ! -f libguestfs.spec ]; then + echo "$0: run this from the directory containing 'libguestfs.spec'" + exit 1 +fi + +git_checkout=$HOME/d/libguestfs-rhel-$rhel_version +if [ ! -d $git_checkout ]; then + echo "$0: $git_checkout does not exist" + echo "This script is only for use by the maintainer when preparing a" + echo "libguestfs release on RHEL." + exit 1 +fi + +# Get the base version of libguestfs. +version=`grep '^Version:' libguestfs.spec | awk '{print $2}'` +tag="v$version" + +# Remove any existing patches. +git rm -f [0-9]*.patch ||: +rm -f [0-9]*.patch + +# Get the patches. +(cd $git_checkout; rm -f [0-9]*.patch; git format-patch -N --submodule=diff $tag) +mv $git_checkout/[0-9]*.patch . + +# Remove any not to be applied. +rm -f *NOT-FOR-RPM*.patch + +# Add the patches. +git add [0-9]*.patch + +# Print out the patch lines. +echo +echo "--- Copy the following text into libguestfs.spec file" +echo + +echo "# Patches." +for f in [0-9]*.patch; do + n=`echo $f | awk -F- '{print $1}'` + echo "Patch$n: $f" +done + +echo +echo "--- End of text" diff --git a/gating.yaml b/gating.yaml new file mode 100755 index 0000000..309384e --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-* +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: xen-ci.brew-build.tier1.functional} diff --git a/libguestfs.spec b/libguestfs.spec index fe9d4ea..66ef8e2 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -1,3 +1,6 @@ +# OCaml packages not built on i686 since OCaml 5 / Fedora 39. +ExcludeArch: %{ix86} + # Architectures on which golang works. #% global golang_arches aarch64 % {arm} % {ix86} x86_64 # In theory the above, in practice golang is so often broken that @@ -10,55 +13,46 @@ # we only do a sanity check that kernel/qemu/libvirt/appliance is not # broken. To perform the full test suite, see instructions here: # https://www.redhat.com/archives/libguestfs/2015-September/msg00078.html -# -# Currently the basic sanity check is *broken* on: -# -# arm: times out when running the test -# aarch64: "MSI is not supported by interrupt controller" (RHBZ#1414081) -# i686: constantly broken, so I have disabled it, probably forever -# power64: kernel regression (RHBZ#1426796) -# x86_64: kernel crashes on qemu (RHBZ#1430297) -%global test_arches NONE +%global test_arches aarch64 %{power64} s390x x86_64 # Trim older changelog entries. # https://lists.fedoraproject.org/pipermail/devel/2013-April/thread.html#181627 %global _changelog_trimtime %(date +%s -d "2 years ago") -# Verify tarball signature with GPGv2 (only possible for stable branches). +# Verify tarball signature with GPGv2. %global verify_tarball_signature 1 -# Filter perl provides +# The source directory. +%global source_directory 1.58-stable + +# Filter perl provides. %{?perl_default_filter} +# Unbreak the linker. +%undefine _strict_symbol_defs_build + Summary: Access and modify virtual machine disk images Name: libguestfs Epoch: 1 -Version: 1.36.13 -Release: 1%{?dist} -License: LGPLv2+ +Version: 1.58.0 +Release: 2%{?dist} +License: LGPL-2.1-or-later + +# 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/ -Source0: http://libguestfs.org/download/1.36-stable/%{name}-%{version}.tar.gz +Source0: http://libguestfs.org/download/%{source_directory}/%{name}-%{version}.tar.gz %if 0%{verify_tarball_signature} -Source1: http://libguestfs.org/download/1.36-stable/%{name}-%{version}.tar.gz.sig +Source1: http://libguestfs.org/download/%{source_directory}/%{name}-%{version}.tar.gz.sig %endif -# Include rewritten and greatly improved virt-rescue from upstream. -# Patches can be found on the 'fedora-26' branch upstream: -# https://github.com/libguestfs/libguestfs/tree/fedora-26 -Patch0001: 0001-generator-Deprecate-direct-mode-guestfs_set_direct-g.patch -Patch0002: 0002-New-API-internal-get-console-socket-to-support-virt-.patch -Patch0003: 0003-lib-Return-EPIPE-for-appliance-closed-the-connection.patch -Patch0004: 0004-rescue-Modify-virt-rescue-so-it-doesn-t-use-direct-m.patch -Patch0005: 0005-rescue-Implement-m-and-i-options.patch -Patch0006: 0006-rescue-Implement-escape-sequences.patch -Patch0007: 0007-rescue-Move-suggest-code-to-separate-file.patch -Patch0008: 0008-rescue-docs-It-is-no-longer-necessary-to-mount-files.patch -Patch0009: 0009-rescue-docs-Note-that-you-can-run-virt-rescue-on-dis.patch -Patch0010: 0010-rescue-Don-t-document-suggest-option-in-help-output.patch - -# Replacement README file for Fedora users. +# Replacement README file. Source4: README-replacement.in # Guestfish colour prompts. @@ -72,107 +66,107 @@ Source6: yum.conf.in Source7: libguestfs.keyring %endif -# Basic build requirements for the library and virt tools. -BuildRequires: gcc -BuildRequires: supermin-devel >= 5.1.12-4 -BuildRequires: hivex-devel >= 1.2.7-7 +# Maintainer script which helps with handling patches. +Source8: copy-patches.sh + +BuildRequires: autoconf, automake, libtool, gettext-devel + +# Basic build requirements. +BuildRequires: gcc, gcc-c++ +BuildRequires: make +BuildRequires: rpcgen +BuildRequires: libtirpc-devel +BuildRequires: supermin-devel >= 5.1.18 +BuildRequires: hivex-devel >= 1.3.10 +BuildRequires: ocaml-hivex-devel BuildRequires: perl(Pod::Simple) BuildRequires: perl(Pod::Man) BuildRequires: /usr/bin/pod2text BuildRequires: po4a BuildRequires: augeas-devel >= 1.7.0 +BuildRequires: ocaml-augeas-devel >= 0.6 BuildRequires: readline-devel -BuildRequires: genisoimage +BuildRequires: xorriso BuildRequires: libxml2-devel -BuildRequires: createrepo +BuildRequires: createrepo_c BuildRequires: glibc-static BuildRequires: libselinux-utils BuildRequires: libselinux-devel BuildRequires: fuse, fuse-devel -BuildRequires: pcre-devel -BuildRequires: file-devel -BuildRequires: libvirt-devel +BuildRequires: pcre2-devel +BuildRequires: libvirt-devel >= 11.10.0 BuildRequires: gperf -BuildRequires: flex -BuildRequires: bison -BuildRequires: libdb-utils +BuildRequires: rpm-devel BuildRequires: cpio BuildRequires: libconfig-devel -BuildRequires: xz-devel +%if !0%{?rhel} BuildRequires: zip BuildRequires: unzip +%endif BuildRequires: systemd-units BuildRequires: netpbm-progs BuildRequires: icoutils -BuildRequires: libvirt-daemon-qemu +BuildRequires: libvirt-daemon-kvm +%if !0%{?rhel} BuildRequires: perl(Expect) +%endif BuildRequires: libacl-devel BuildRequires: libcap-devel +%if !0%{?rhel} BuildRequires: libldm-devel -BuildRequires: yajl-devel +%endif +BuildRequires: json-c-devel BuildRequires: systemd-devel BuildRequires: bash-completion +%if 0%{?fedora} || 0%{?rhel} >= 11 +BuildRequires: bash-completion-devel +%endif BuildRequires: /usr/bin/ping -BuildRequires: /usr/bin/wget BuildRequires: curl BuildRequires: xz -BuildRequires: gtk3-devel -BuildRequires: dbus-devel -BuildRequires: /usr/bin/qemu-img -BuildRequires: perl(Win::Hivex) -BuildRequires: perl(Win::Hivex::Regedit) +BuildRequires: zstd +BuildRequires: libzstd-devel +BuildRequires: qemu-img >= 7.2.0 + %if 0%{verify_tarball_signature} BuildRequires: gnupg2 %endif # For language bindings. -BuildRequires: ocaml +BuildRequires: ocaml >= 4.08 BuildRequires: ocaml-ocamldoc BuildRequires: ocaml-findlib-devel -BuildRequires: ocaml-gettext-devel -BuildRequires: ocaml-ounit-devel -BuildRequires: ocaml-libvirt-devel >= 0.6.1.4-5 +%if !0%{?rhel} BuildRequires: lua BuildRequires: lua-devel +%endif 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 BuildRequires: perl(Module::Build) BuildRequires: perl(ExtUtils::CBuilder) BuildRequires: perl(Locale::TextDomain) -BuildRequires: python2-devel -BuildRequires: libvirt-python BuildRequires: python3-devel -BuildRequires: libvirt-python3 +BuildRequires: python3-libvirt +%if !0%{?rhel} BuildRequires: ruby-devel BuildRequires: rubygem-rake # json is not pulled in automatically, see RHBZ#1325022 BuildRequires: rubygem(json) BuildRequires: rubygem(rdoc) BuildRequires: rubygem(test-unit) -BuildRequires: ruby-irb -BuildRequires: java-1.8.0-openjdk -BuildRequires: java-1.8.0-openjdk-devel -BuildRequires: jpackage-utils +BuildRequires: rubygem(irb) BuildRequires: php-devel -BuildRequires: erlang-erts -BuildRequires: erlang-erl_interface BuildRequires: gobject-introspection-devel BuildRequires: gjs +BuildRequires: vala +%endif %ifarch %{golang_arches} BuildRequires: golang -# This version is required for aarch64 to be supported by gcc-go. -%ifarch aarch64 -BuildRequires: gcc >= 5.0.0-0.19.fc23 %endif -%endif - -# Required after patching Makefile.am etc. -BuildRequires: autoconf automake libtool gettext-devel # Build requirements for the appliance. # @@ -180,149 +174,219 @@ BuildRequires: autoconf automake libtool gettext-devel # for f in `cat appliance/packagelist`; do echo $f; done | sort -u # However you have to edit the list down to packages which exist in # current Fedora, since supermin ignores non-existent packages. -BuildRequires: acl attr augeas-libs bash binutils btrfs-progs bzip2 coreutils cpio cryptsetup curl debootstrap dhclient diffutils dosfstools e2fsprogs file findutils gawk gdisk genisoimage gfs2-utils grep gzip hivex iproute iputils jfsutils kernel kmod kpartx less libcap libldm libselinux libxml2 lsof lsscsi lvm2 lzop mdadm nilfs-utils openssh-clients parted pciutils pcre policycoreutils procps psmisc qemu-img reiserfs-utils rsync scrub sed sleuthkit strace systemd tar udev util-linux vim-minimal which xfsprogs xz yajl zerofree + +BuildRequires: acl +BuildRequires: attr +BuildRequires: augeas-libs +BuildRequires: bash +BuildRequires: binutils +%if !0%{?rhel} +BuildRequires: btrfs-progs +%endif +BuildRequires: bzip2 +BuildRequires: clevis-luks +BuildRequires: coreutils +BuildRequires: cpio +BuildRequires: cryptsetup +BuildRequires: dhcpcd +BuildRequires: diffutils +BuildRequires: dosfstools +BuildRequires: e2fsprogs +BuildRequires: file +BuildRequires: findutils +BuildRequires: gawk +%if !0%{?rhel} +BuildRequires: gdisk +BuildRequires: gfs2-utils +%endif +BuildRequires: grep +BuildRequires: gzip +%if !0%{?rhel} %ifnarch ppc BuildRequires: hfsplus-tools %endif -%ifnarch s390 s390x %{arm} aarch64 -# http://zfs-fuse.net/issues/94 -BuildRequires: zfs-fuse %endif -BuildRequires: ntfs-3g ntfsprogs +BuildRequires: hivex-libs +BuildRequires: iproute +BuildRequires: iputils +BuildRequires: kernel +BuildRequires: kmod +BuildRequires: less +BuildRequires: libcap +%if !0%{?rhel} +BuildRequires: libldm +%endif +BuildRequires: libselinux +BuildRequires: libxml2 +BuildRequires: lsof +BuildRequires: lsscsi +BuildRequires: lvm2 +BuildRequires: lzop +BuildRequires: mdadm +%if !0%{?rhel} +BuildRequires: ntfs-3g ntfsprogs ntfs-3g-system-compression +%endif +BuildRequires: openssh-clients +BuildRequires: parted +BuildRequires: pciutils +BuildRequires: pcre2 +BuildRequires: policycoreutils +BuildRequires: procps +BuildRequires: psmisc +BuildRequires: rpm-libs +BuildRequires: rsync +BuildRequires: scrub +BuildRequires: sed +%if !0%{?rhel} +BuildRequires: sleuthkit +BuildRequires: squashfs-tools +%endif +BuildRequires: strace +%if !0%{?rhel} %ifarch %{ix86} x86_64 BuildRequires: syslinux syslinux-extlinux %endif +%endif +BuildRequires: systemd +BuildRequires: tar +BuildRequires: udev +BuildRequires: util-linux +BuildRequires: vim-minimal +BuildRequires: xfsprogs +BuildRequires: xz +%if !0%{?rhel} +BuildRequires: zerofree +%endif +BuildRequires: zstd -# For complicated reasons, this is required so that -# /bin/kernel-install puts the kernel directly into /boot, instead of -# into a /boot/ subdirectory (in Fedora >= 23). Read the -# kernel-install script to understand why. -BuildRequires: grubby - -# Minimum version containing fix for armv7 pwritev bug (RHBZ#1346070). -BuildRequires: glibc >= 2.23.90-24.fc25 - -# For building the appliance. -Requires: supermin >= 5.1.12 +# Main package requires the appliance. This allows the appliance to +# be replaced if there exists a package called +# "libguestfs-noappliance". This package is not provided anywhere, +# you have to provide the dependency or make the package yourself. If +# you do then libguestfs won't install the appliance and you are free +# to replace it with (eg) a fixed appliance. +Requires: (%{name}-appliance = %{epoch}:%{version}-%{release} or %{name}-noappliance) # The daemon dependencies are not included automatically, because it # is buried inside the appliance, so list them here. Requires: augeas-libs%{?_isa} >= 1.7.0 +Requires: json-c%{?_isa} Requires: libacl%{?_isa} Requires: libcap%{?_isa} -Requires: hivex%{?_isa} -Requires: pcre%{?_isa} Requires: libselinux%{?_isa} +Requires: hivex-libs%{?_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 -Requires: libosinfo%{?_isa} # For core mount-local (FUSE) API. Requires: fuse -# For core disk-create API. -Requires: /usr/bin/qemu-img +# For core APIs: +Requires: qemu-img +Requires: coreutils +Requires: grep +Requires: tar -# For libvirt backend. -%ifarch %{ix86} x86_64 %{arm} aarch64 -Requires: libvirt-daemon-kvm >= 0.10.2-3 -%else -Requires: libvirt-daemon-qemu >= 0.10.2-3 +# libguestfs-make-fixed-appliance requires xz. +Requires: xz + +# For qemu direct and libvirt backends. +Requires: qemu-kvm-core >= 7.2.0 +%if !0%{?rhel} +Suggests: qemu-block-curl +Suggests: qemu-block-iscsi %endif -Requires: selinux-policy >= 3.11.1-63 +Suggests: qemu-block-rbd +%if !0%{?rhel} +Suggests: qemu-block-ssh +%endif +Recommends: libvirt-daemon-config-network +Requires: libvirt-daemon-driver-qemu >= 11.10.0 +Requires: libvirt-daemon-driver-secret +Requires: libvirt-daemon-driver-storage-core +Requires: passt +Requires: (selinux-policy >= 3.11.1-63 if selinux-policy) -# 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 +%ifarch aarch64 +Requires: edk2-aarch64 +%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 -# Someone managed to install libguestfs-winsupport (from RHEL!) on +%if !0%{?rhel} +# Someone managed to install libguestfs-winsupport (from RHEL!) on # Fedora, which breaks everything. Thus: Conflicts: libguestfs-winsupport +%else +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), migrate between hypervisors -(virt-p2v, virt-v2v), 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 for Fedora 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-v2v convert virtual machines to run on KVM (V2V) - virt-p2v-maker convert physical machines to run on KVM (P2V) - virt-dib safe and secure diskimage-builder replacement - For enhanced features, install: +%if !0%{?rhel} libguestfs-forensics adds filesystem forensics support libguestfs-gfs2 adds Global Filesystem (GFS2) support libguestfs-hfsplus adds HFS+ (Mac filesystem) support +%endif libguestfs-inspect-icons adds support for inspecting guest icons - libguestfs-jfs adds JFS support - libguestfs-nilfs adds NILFS v2 support - libguestfs-reiserfs adds ReiserFS support libguestfs-rescue enhances virt-rescue shell with more tools libguestfs-rsync rsync to/from guest filesystems +%if !0%{?rhel} + libguestfs-ufs adds UFS (BSD) support +%endif libguestfs-xfs adds XFS support - libguestfs-zfs adds ZFS support For developers: libguestfs-devel C/C++ header files and library - libguestfs-benchmarking Benchmarking utilities Language bindings: - erlang-libguestfs Erlang bindings - libguestfs-gobject-devel GObject bindings and GObject Introspection +%if !0%{?rhel} +libguestfs-gobject-devel GObject bindings and GObject Introspection +%endif %ifarch %{golang_arches} golang-guestfs Go language bindings %endif - libguestfs-java-devel Java bindings +%if !0%{?rhel} lua-guestfs Lua bindings +%endif ocaml-libguestfs-devel OCaml bindings perl-Sys-Guestfs Perl bindings +%if !0%{?rhel} php-libguestfs PHP bindings - python2-libguestfs Python 2 bindings - python3-libguestfs Python 3 bindings - ruby-libguestfs Ruby bindings - - -%ifarch aarch64 x86_64 -%package benchmarking -Summary: Benchmarking utilities for %{name} -Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} - - -%description benchmarking -%{name}-benchmarking contains utilities for benchmarking and -performance analysis of %{name}, and also for general -understanding of the performance of the kernel and qemu when booting -small appliances. %endif + python3-libguestfs Python 3 bindings +%if !0%{?rhel} + ruby-libguestfs Ruby bindings + libguestfs-vala Vala language bindings +%endif + + +%package appliance +Summary: Appliance for %{name} +License: GPL-2.0-or-later AND LGPL-2.1-or-later +Requires: supermin >= 5.1.18 + + +%description appliance +%{name}-appliance provides the appliance used by libguestfs. %package devel @@ -330,91 +394,64 @@ Summary: Development tools and libraries for %{name} Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} Requires: pkgconfig -# For libguestfs-make-fixed-appliance. -Requires: xz -Requires: %{name}-tools-c = %{epoch}:%{version}-%{release} - %description devel %{name}-devel contains development tools and libraries for %{name}. +%if !0%{?rhel} %package forensics Summary: Filesystem forensics support for %{name} -License: LGPLv2+ +License: GPL-2.0-or-later Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} %description forensics This adds filesystem forensics support to %{name}. Install it if you want to forensically analyze disk images using The Sleuth Kit. +%endif +%if !0%{?rhel} %package gfs2 Summary: GFS2 support for %{name} -License: LGPLv2+ +License: GPL-2.0-or-later Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} %description gfs2 This adds GFS2 support to %{name}. Install it if you want to process disk images containing GFS2. +%endif +%if !0%{?rhel} %ifnarch ppc %package hfsplus Summary: HFS+ support for %{name} -License: LGPLv2+ +License: GPL-2.0-or-later Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} %description hfsplus This adds HFS+ support to %{name}. Install it if you want to process disk images containing HFS+ / Mac OS Extended filesystems. %endif - - -%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. - - -%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. - - -%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 -License: LGPLv2+ -Requires: %{name}-tools-c = %{epoch}:%{version}-%{release} +Summary: virt-rescue shell +License: GPL-2.0-or-later +Requires: %{name}%{?_isa} = %{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 Summary: rsync support for %{name} -License: LGPLv2+ +License: GPL-2.0-or-later Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} %description rsync @@ -422,9 +459,21 @@ This adds rsync support to %{name}. Install it if you want to use rsync to upload or download files into disk images. +%if !0%{?rhel} +%package ufs +Summary: UFS (BSD) support for %{name} +License: GPL-2.0-or-later +Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} + +%description ufs +This adds UFS support to %{name}. Install it if you want to process +disk images containing UFS (BSD filesystems). +%endif + + %package xfs Summary: XFS support for %{name} -License: LGPLv2+ +License: GPL-2.0-or-later Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} %description xfs @@ -432,21 +481,9 @@ This adds XFS support to %{name}. Install it if you want to process disk images containing XFS. -%ifnarch %{arm} aarch64 -%package zfs -Summary: ZFS support for %{name} -License: LGPLv2+ -Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} - -%description zfs -This adds ZFS support to %{name}. Install it if you want to process -disk images containing ZFS. -%endif - - %package inspect-icons Summary: Additional dependencies for inspecting guest icons -License: LGPLv2+ +License: LGPL-2.1-or-later BuildArch: noarch Requires: %{name} = %{epoch}:%{version}-%{release} @@ -464,201 +501,11 @@ 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: (gnupg or gnupg2) # Fedora packaging rules forbid this -Requires: xz -#Requires: nbdkit, nbdkit-plugin-xz -Requires: curl - -# 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} - -# NB: Only list deps here which are not picked up automatically. -Requires: perl(Sys::Virt) -Requires: perl(Win::Hivex) >= 1.2.7 - - -%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 doesn’t 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 -n virt-v2v -Summary: Convert a virtual machine to run on KVM -License: GPLv2+ - -Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} -Requires: %{name}-tools-c = %{epoch}:%{version}-%{release} - -Requires: gawk -Requires: gzip -Requires: unzip -Requires: curl -Requires: /usr/bin/virsh - -# For rhsrvany.exe, used to install firstboot scripts in Windows guests. -Requires: mingw32-srvany >= 1.0-13 - - -%description -n virt-v2v -Virt-v2v converts virtual machines from non-KVM hypervisors -to run under KVM. - -To convert physical machines, see the virt-p2v-maker package. - - -%package -n virt-p2v-maker -Summary: Convert a physical machine to run on KVM -License: GPLv2+ - -Requires: gawk -Requires: gzip - -# virt-p2v-make-disk runs virt-builder: -Requires: %{name}-tools-c = %{epoch}:%{version}-%{release} - -# virt-p2v-make-kickstart runs strip: -Requires: binutils - - -%description -n virt-p2v-maker -Virt-p2v converts (virtualizes) physical machines so they can be run -as virtual machines under KVM. - -This package contains the tools needed to make a virt-p2v boot CD or -USB key which is booted on the physical machine to perform the -conversion. You also need virt-v2v installed somewhere else to -complete the conversion. - -To convert virtual machines from other hypervisors, see virt-v2v. - - %package bash-completion Summary: Bash tab-completion scripts for %{name} tools +License: GPL-2.0-or-later BuildArch: noarch Requires: bash-completion >= 2.0 -Requires: %{name}-tools-c = %{epoch}:%{version}-%{release} %description bash-completion @@ -691,25 +538,12 @@ required to use the OCaml bindings for %{name}. %package -n perl-Sys-Guestfs Summary: Perl bindings for %{name} (Sys::Guestfs) Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} -Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) %description -n perl-Sys-Guestfs perl-Sys-Guestfs contains Perl bindings for %{name} (Sys::Guestfs). -%package -n python2-%{name} -Summary: Python 2 bindings for %{name} -Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} -%{?python_provide:%python_provide python2-%{name}} - - -%description -n python2-%{name} -python2-%{name} contains Python 2 bindings for %{name}. - -For Python 3 bindings, install python3-%{name}. - - %package -n python3-%{name} Summary: Python 3 bindings for %{name} Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} @@ -719,9 +553,8 @@ Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} %description -n python3-%{name} python3-%{name} contains Python 3 bindings for %{name}. -For Python 2 bindings, install python2-%{name}. - +%if !0%{?rhel} %package -n ruby-%{name} Summary: Ruby bindings for %{name} Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} @@ -733,60 +566,16 @@ Provides: ruby(guestfs) = %{version} ruby-%{name} contains Ruby bindings for %{name}. -%package java -Summary: Java bindings for %{name} -Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} -Requires: java-headless >= 1.5.0 -Requires: jpackage-utils - -%description java -%{name}-java contains Java bindings for %{name}. - -If you want to develop software in Java which uses %{name}, then -you will also need %{name}-java-devel. - - -%package java-devel -Summary: Java development package for %{name} -Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} -Requires: %{name}-java = %{epoch}:%{version}-%{release} - -%description java-devel -%{name}-java-devel contains the tools for developing Java software -using %{name}. - -See also %{name}-javadoc. - - -%package javadoc -Summary: Java documentation for %{name} -BuildArch: noarch -Requires: %{name} = %{epoch}:%{version}-%{release} -Requires: %{name}-java = %{epoch}:%{version}-%{release} -Requires: jpackage-utils - -%description javadoc -%{name}-javadoc contains the Java documentation for %{name}. - - %package -n php-%{name} Summary: PHP bindings for %{name} Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} -Requires: php +Requires: php(zend-abi) = %{php_zend_api} +Requires: php(api) = %{php_core_api} %description -n php-%{name} php-%{name} contains PHP bindings for %{name}. -%package -n erlang-%{name} -Summary: Erlang bindings for %{name} -Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} -Requires: erlang-erts - -%description -n erlang-%{name} -erlang-%{name} contains Erlang bindings for %{name}. - - %package -n lua-guestfs Summary: Lua bindings for %{name} Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} @@ -818,6 +607,18 @@ This package is needed if you want to write software using the GObject bindings. It also contains GObject Introspection information. +%package vala +Summary: Vala for %{name} +Requires: %{name}-devel%{?_isa} = %{epoch}:%{version}-%{release} +Requires: vala + + +%description vala +%{name}-vala contains GObject bindings for %{name}. +%endif + + + %ifarch %{golang_arches} %package -n golang-guestfs Summary: Golang bindings for %{name} @@ -833,6 +634,7 @@ golang-%{name} contains Go language bindings for %{name}. %package man-pages-ja Summary: Japanese (ja) man pages for %{name} +License: GPL-2.0-or-later BuildArch: noarch Requires: %{name} = %{epoch}:%{version}-%{release} @@ -843,6 +645,7 @@ for %{name}. %package man-pages-uk Summary: Ukrainian (uk) man pages for %{name} +License: GPL-2.0-or-later BuildArch: noarch Requires: %{name} = %{epoch}:%{version}-%{release} @@ -853,20 +656,15 @@ for %{name}. %prep %if 0%{verify_tarball_signature} -tmphome="$(mktemp -d)" -gpgv2 --homedir "$tmphome" --keyring %{SOURCE7} %{SOURCE1} %{SOURCE0} +%{gpgverify} --keyring='%{SOURCE7}' --signature='%{SOURCE1}' --data='%{SOURCE0}' %endif %setup -q %autopatch -p1 -autoreconf -i -# For Python 3 we must build libguestfs twice. This creates: -# %{name}-%{version}/ -# %{name}-%{version}-python3/ -# with a second copy of the sources in the python3 subdir. -pushd .. -cp -a %{name}-%{version} %{name}-%{version}-python3 -popd +# ACLOCAL_PATH is temporarily required to work around +# https://bugzilla.redhat.com/show_bug.cgi?id=2366708 +export ACLOCAL_PATH=/usr/share/gettext/m4/ +autoreconf -fiv # For sVirt to work, the local temporary directory we use in the tests # must be labelled the same way as /tmp. This doesn't work if either @@ -887,53 +685,66 @@ sed 's/@VERSION@/%{version}/g' < %{SOURCE4} > README # Test if network is available. ip addr list ||: ip route list ||: -if ping -c 3 -w 20 8.8.8.8 && wget http://libguestfs.org -O /dev/null; then +if ping -c 3 -w 20 8.8.8.8 && curl http://libguestfs.org -o /dev/null; then extra= else mkdir cachedir repo + # For an explanation of what we are doing here, see: + # https://lists.fedorahosted.org/archives/list/koji-devel@lists.fedorahosted.org/thread/ZIBY53JAURLT3QRBBJIJJ7EZWLZDE3TI/ # -n 1 because of RHBZ#980502. - find /var/cache/{dnf,yum} -type f -name '*.rpm' -print0 | \ - xargs -0 -n 1 cp -t repo - createrepo repo + dirs= + for d in /var/cache/{dnf,libdnf5,yum} ; do + if test -d $d ; then dirs="$dirs $d" ; fi + done + test -n "$dirs" + find $dirs -type f -name '*.rpm' -print0 | xargs -0 -n 1 cp -t repo + createrepo_c repo sed -e "s|@PWD@|$(pwd)|" %{SOURCE6} > yum.conf extra=--with-supermin-packager-config=$(pwd)/yum.conf fi -%global localconfigure \ - %{configure} \\\ - --with-default-backend=libvirt \\\ - --with-extra="fedora=%{fedora},release=%{release},libvirt" \\\ - $extra -%ifnarch %{golang_arches} -%global localconfigure %{localconfigure} --disable-golang +%{configure} \ +%if 0%{?rhel} + QEMU=%{_libexecdir}/qemu-kvm \ %endif + PYTHON=%{__python3} \ + --with-default-backend=libvirt \ + --enable-appliance-format-auto \ +%if !0%{?rhel} + --with-extra="fedora=%{fedora},release=%{release},libvirt" \ +%else + --with-extra="rhel=%{rhel},release=%{release},libvirt" \ +%endif +%if 0%{?rhel} + --with-qemu="qemu-kvm qemu-system-%{_build_arch} qemu" \ +%endif +%ifnarch %{golang_arches} + --disable-golang \ +%endif + --without-java \ + --disable-erlang \ +%if 0%{?rhel} + --disable-gobject \ + --disable-lua \ + --disable-php \ + --disable-ruby \ +%endif + $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. -%global localmake \ - make -j1 -C builder index-parse.c \ - make V=1 INSTALLDIRS=vendor %{?_smp_mflags} - -%{localconfigure} -%{localmake} - -# For Python 3 we must compile libguestfs a second time. -pushd ../%{name}-%{version}-python3 -export PYTHON=%{__python3} -# Copy the cache to speed the build: -cp ../%{name}-%{version}/generator/.pod2text* generator/ -%{localconfigure} --enable-python --enable-perl --disable-ruby --disable-haskell --disable-php --disable-erlang --disable-lua --disable-golang --disable-gobject -%{localmake} -popd +%make_build INSTALLDIRS=vendor %check - %ifarch %{test_arches} +# Only run the tests with non-debug (ie. non-Rawhide) kernels. +# XXX This tests for any debug kernel installed. +if grep CONFIG_DEBUG_MUTEXES=y /lib/modules/*/config ; then + echo "Skipping tests because debug kernel is installed" + exit 0 +fi + export LIBGUESTFS_DEBUG=1 export LIBGUESTFS_TRACE=1 export LIBVIRT_DEBUG=1 @@ -942,23 +753,22 @@ if ! make quickcheck QUICKCHECK_TEST_TOOL_ARGS="-t 1200"; then cat $HOME/.cache/libvirt/qemu/log/* exit 1 fi + +# As libvirt is the default backend, test that the direct backend +# works too. It's a good place to get test coverage across all the +# architectures. +if ! LIBGUESTFS_BACKEND=direct \ + make quickcheck QUICKCHECK_TEST_TOOL_ARGS="-t 1200"; then + cat $HOME/.cache/libvirt/qemu/log/* + exit 1 +fi %endif %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 - -# Install Python 3 bindings which were built in a subdirectory. -pushd ../%{name}-%{version}-python3 -make DESTDIR=$RPM_BUILD_ROOT INSTALLDIRS=vendor -C python install -popd +%make_install INSTALLDIRS=vendor # Delete static libraries. rm $( find $RPM_BUILD_ROOT -name '*.a' | grep -v /ocaml/ ) @@ -972,52 +782,47 @@ 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* - -# Don't use versioned jar file (RHBZ#1022133). -# See: https://bugzilla.redhat.com/show_bug.cgi?id=1022184#c4 -mv $RPM_BUILD_ROOT%{_datadir}/java/%{name}-%{version}.jar \ - $RPM_BUILD_ROOT%{_datadir}/java/%{name}.jar +# debuginfo generation fails with debugedit >= 5.1 unless the files +# are writable: +find $RPM_BUILD_ROOT -name Guestfs.so -exec chmod u+w {} \; # golang: Ignore what libguestfs upstream installs, and just copy the -# source files to %{_datadir}/gocode/src. +# source files to %%{_datadir}/gocode/src. %ifarch %{golang_arches} rm -r $RPM_BUILD_ROOT/usr/lib/golang 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 move_to + +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 + remove "$1" echo "$1" >> "$2" } -move_to curl zz-packages-dib -move_to debootstrap zz-packages-dib -move_to kpartx zz-packages-dib -move_to qemu-img zz-packages-dib -move_to which zz-packages-dib + +%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 move_to openssh-clients zz-packages-rescue @@ -1026,7 +831,13 @@ move_to strace zz-packages-rescue move_to vim-minimal zz-packages-rescue move_to rsync zz-packages-rsync move_to xfsprogs zz-packages-xfs -move_to zfs-fuse zz-packages-zfs + +%if !0%{?rhel} +# On Fedora you need kernel-modules-extra to be able to mount +# UFS (BSD) filesystems. +echo "kernel-modules-extra" > zz-packages-ufs +%endif + popd # If there is a bogus dependency on kernel-*, rename it to 'kernel' @@ -1036,86 +847,67 @@ popd # On all known architectures, depending on 'kernel' should # mean "we need a kernel". pushd $RPM_BUILD_ROOT%{_libdir}/guestfs/supermin.d -sed 's/^kernel-.*/kernel/' < packages > packages-t -mv packages-t packages +sed -i 's/^kernel-.*/kernel/' packages popd # Guestfish colour prompts. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d install -m 0644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d -# Virt-tools data directory. This contains a symlink to rhsrvany.exe -# which is satisfied by the dependency on mingw32-srvany. -mkdir -p $RPM_BUILD_ROOT%{_datadir}/virt-tools -pushd $RPM_BUILD_ROOT%{_datadir}/virt-tools -ln -sf /usr/i686-w64-mingw32/sys-root/mingw/bin/rhsrvany.exe -popd - -# Delete the v2v test harness (except for the man page). -rm -r $RPM_BUILD_ROOT%{_libdir}/ocaml/v2v_test_harness -rm -r $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/dllv2v_test_harness* - # Remove the .gitignore file from ocaml/html which will be copied to docdir. rm ocaml/html/.gitignore -%ifarch aarch64 x86_64 -# Copy the benchmarking tools and man pages, since upstream doesn't -# install them by default. NB Don't install the libtool wrapper scripts. -libtool --mode=install install -m 0755 utils/boot-analysis/boot-analysis $RPM_BUILD_ROOT%{_bindir}/libguestfs-boot-analysis -libtool --mode=install install -m 0755 utils/boot-benchmark/boot-benchmark $RPM_BUILD_ROOT%{_bindir}/libguestfs-boot-benchmark -install -m 0755 utils/boot-benchmark/boot-benchmark-range.pl $RPM_BUILD_ROOT%{_bindir}/libguestfs-boot-benchmark-range.pl -install -m 0644 utils/boot-analysis/boot-analysis.1 $RPM_BUILD_ROOT%{_mandir}/man1/libguestfs-boot-analysis.1 -install -m 0644 utils/boot-benchmark/boot-benchmark.1 $RPM_BUILD_ROOT%{_mandir}/man1/libguestfs-boot-benchmark.1 -%endif # Find locale files. %find_lang %{name} -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - -%post java -p /sbin/ldconfig - -%postun java -p /sbin/ldconfig - - %files -f %{name}.lang -%doc COPYING README +%license COPYING COPYING.LIB +%doc README +%{_bindir}/guestfish +%{_bindir}/guestmount +%{_bindir}/guestunmount %{_bindir}/libguestfs-test-tool -%{_libdir}/guestfs/ -%exclude %{_libdir}/guestfs/supermin.d/zz-packages-* +%{_bindir}/virt-copy-in +%{_bindir}/virt-copy-out +%{_bindir}/virt-tar-in +%{_bindir}/virt-tar-out +%{_sbindir}/libguestfs-make-fixed-appliance %{_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.1* %{_mandir}/man1/guestfs-security.1* +%{_mandir}/man1/guestmount.1* +%{_mandir}/man1/guestunmount.1* +%{_mandir}/man1/libguestfs-make-fixed-appliance.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 -%ifarch aarch64 x86_64 -%files benchmarking -%{_bindir}/libguestfs-boot-analysis -%{_bindir}/libguestfs-boot-benchmark -%{_bindir}/libguestfs-boot-benchmark-range.pl -%{_mandir}/man1/libguestfs-boot-analysis.1* -%{_mandir}/man1/libguestfs-boot-benchmark.1* -%endif +%files appliance +%{_libdir}/guestfs/ +%exclude %{_libdir}/guestfs/supermin.d/zz-packages-* %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* %{_mandir}/man1/guestfs-hacking.1* %{_mandir}/man1/guestfs-internals.1* %{_mandir}/man1/guestfs-testing.1* -%{_mandir}/man1/libguestfs-make-fixed-appliance.1* %{_mandir}/man3/guestfs.3* %{_mandir}/man3/guestfs-examples.3* %{_mandir}/man3/libguestfs.3* @@ -1123,159 +915,76 @@ install -m 0644 utils/boot-benchmark/boot-benchmark.1 $RPM_BUILD_ROOT%{_mandir}/ %{_libdir}/pkgconfig/libguestfs.pc +%if !0%{?rhel} %files forensics %{_libdir}/guestfs/supermin.d/zz-packages-forensics +%endif +%if !0%{?rhel} %files gfs2 %{_libdir}/guestfs/supermin.d/zz-packages-gfs2 +%endif +%if !0%{?rhel} %ifnarch ppc %files hfsplus %{_libdir}/guestfs/supermin.d/zz-packages-hfsplus %endif - -%files jfs -%{_libdir}/guestfs/supermin.d/zz-packages-jfs - -%files nilfs -%{_libdir}/guestfs/supermin.d/zz-packages-nilfs - -%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 +%{_libdir}/guestfs/supermin.d/zz-packages-ufs +%endif %files xfs %{_libdir}/guestfs/supermin.d/zz-packages-xfs -%ifnarch %{arm} aarch64 -%files zfs -%{_libdir}/guestfs/supermin.d/zz-packages-zfs -%endif - - %files inspect-icons # 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-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 -n virt-v2v -%doc COPYING README v2v/TODO -%{_bindir}/virt-v2v -%{_bindir}/virt-v2v-copy-to-local -%{_mandir}/man1/virt-v2v.1* -%{_mandir}/man1/virt-v2v-copy-to-local.1* -%{_mandir}/man1/virt-v2v-test-harness.1* -%{_datadir}/virt-tools - - -%files -n virt-p2v-maker -%doc COPYING README -%{_bindir}/virt-p2v-make-disk -%{_bindir}/virt-p2v-make-kickstart -%{_bindir}/virt-p2v-make-kiwi -%{_mandir}/man1/virt-p2v.1* -%{_mandir}/man1/virt-p2v-make-disk.1* -%{_mandir}/man1/virt-p2v-make-kickstart.1* -%{_mandir}/man1/virt-p2v-make-kiwi.1* -%{_datadir}/virt-p2v -%{_libdir}/virt-p2v - - %files bash-completion +%if 0%{?fedora} || 0%{?rhel} >= 11 +%dir %{bash_completions_dir} +%{bash_completions_dir}/guestfish +%{bash_completions_dir}/guestmount +%{bash_completions_dir}/guestunmount +%{bash_completions_dir}/libguestfs-test-tool +%{bash_completions_dir}/virt-copy-in +%{bash_completions_dir}/virt-copy-out +%{bash_completions_dir}/virt-rescue +%{bash_completions_dir}/virt-tar-in +%{bash_completions_dir}/virt-tar-out +%else %dir %{_datadir}/bash-completion/completions %{_datadir}/bash-completion/completions/guestfish %{_datadir}/bash-completion/completions/guestmount %{_datadir}/bash-completion/completions/guestunmount -%{_datadir}/bash-completion/completions/virt-* +%{_datadir}/bash-completion/completions/libguestfs-test-tool +%{_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 +%endif %files -n ocaml-%{name} %{_libdir}/ocaml/guestfs %exclude %{_libdir}/ocaml/guestfs/*.a +%ifarch %{ocaml_native_compiler} %exclude %{_libdir}/ocaml/guestfs/*.cmxa %exclude %{_libdir}/ocaml/guestfs/*.cmx +%endif %exclude %{_libdir}/ocaml/guestfs/*.mli %{_libdir}/ocaml/stublibs/dllmlguestfs.so %{_libdir}/ocaml/stublibs/dllmlguestfs.so.owner @@ -1284,8 +993,10 @@ install -m 0644 utils/boot-benchmark/boot-benchmark.1 $RPM_BUILD_ROOT%{_mandir}/ %files -n ocaml-%{name}-devel %doc ocaml/examples/*.ml ocaml/html %{_libdir}/ocaml/guestfs/*.a +%ifarch %{ocaml_native_compiler} %{_libdir}/ocaml/guestfs/*.cmxa %{_libdir}/ocaml/guestfs/*.cmx +%endif %{_libdir}/ocaml/guestfs/*.mli %{_mandir}/man3/guestfs-ocaml.3* @@ -1297,15 +1008,6 @@ install -m 0644 utils/boot-benchmark/boot-benchmark.1 $RPM_BUILD_ROOT%{_mandir}/ %{_mandir}/man3/guestfs-perl.3* -%files -n python2-%{name} -%doc python/examples/*.py -%{python2_sitearch}/libguestfsmod.so -%{python2_sitearch}/guestfs.py -%{python2_sitearch}/guestfs.pyc -%{python2_sitearch}/guestfs.pyo -%{_mandir}/man3/guestfs-python.3* - - %files -n python3-%{name} %doc python/examples/*.py %{python3_sitearch}/libguestfsmod*.so @@ -1314,6 +1016,7 @@ install -m 0644 utils/boot-benchmark/boot-benchmark.1 $RPM_BUILD_ROOT%{_mandir}/ %{_mandir}/man3/guestfs-python.3* +%if !0%{?rhel} %files -n ruby-%{name} %doc ruby/examples/*.rb %doc ruby/doc/site/* @@ -1322,21 +1025,6 @@ install -m 0644 utils/boot-benchmark/boot-benchmark.1 $RPM_BUILD_ROOT%{_mandir}/ %{_mandir}/man3/guestfs-ruby.3* -%files java -%{_libdir}/libguestfs_jni*.so.* -%{_datadir}/java/*.jar - - -%files java-devel -%doc java/examples/*.java -%{_libdir}/libguestfs_jni*.so -%{_mandir}/man3/guestfs-java.3* - - -%files javadoc -%{_javadocdir}/%{name} - - %files -n php-%{name} %doc php/README-PHP %dir %{_sysconfdir}/php.d @@ -1344,15 +1032,6 @@ install -m 0644 utils/boot-benchmark/boot-benchmark.1 $RPM_BUILD_ROOT%{_mandir}/ %{_libdir}/php/modules/guestfs_php.so -%files -n erlang-%{name} -%doc erlang/README -%doc erlang/examples/*.erl -%doc erlang/examples/LICENSE -%{_bindir}/erl-guestfs -%{_libdir}/erlang/lib/%{name}-%{version} -%{_mandir}/man3/guestfs-erlang.3* - - %files -n lua-guestfs %doc lua/examples/*.lua %doc lua/examples/LICENSE @@ -1375,6 +1054,12 @@ install -m 0644 utils/boot-benchmark/boot-benchmark.1 $RPM_BUILD_ROOT%{_mandir}/ %{_mandir}/man3/guestfs-gobject.3* +%files vala +%{_datadir}/vala/vapi/libguestfs-gobject-1.0.deps +%{_datadir}/vala/vapi/libguestfs-gobject-1.0.vapi +%endif + + %ifarch %{golang_arches} %files -n golang-guestfs %doc golang/examples/*.go @@ -1397,47 +1082,961 @@ install -m 0644 utils/boot-benchmark/boot-benchmark.1 $RPM_BUILD_ROOT%{_mandir}/ %changelog -* Fri Jan 26 2018 Richard W.M. Jones - 1:1.36.13-1 -- New upstream version 1.36.13. +* Thu Jan 08 2026 Mamoru TASAKA - 1:1.58.0-2 +- Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_4.0 + +* Mon Jan 05 2026 Richard W.M. Jones - 1:1.58.0-1 +- New upstream development version 1.58.0 +- Require libvirt >= 11.10.0, qemu >= 7.2.0 and passt. + +* Wed Dec 17 2025 Tom Callaway - 1:1.57.7-2 +- rebuild for new libconfig + +* Thu Dec 04 2025 Richard W.M. Jones - 1:1.57.7-1 +- New upstream development version 1.57.7 + +* Tue Nov 04 2025 Richard W.M. Jones - 1:1.57.6-1 +- New upstream development version 1.57.6 + +* Fri Oct 17 2025 Richard W.M. Jones - 1:1.57.5-1 +- New upstream development version 1.57.5 +- Test direct backend in %%check + +* Wed Oct 15 2025 Richard W.M. Jones - 1:1.57.4-4 +- Require passt +- https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/YDHKKQSDURTMSKSN6GW3QGQI43DTFXNH/ + +* Wed Oct 15 2025 Remi Collet - 1:1.57.4-3 +- rebuild for https://fedoraproject.org/wiki/Changes/php85 + +* Mon Oct 13 2025 Richard W.M. Jones - 1:1.57.4-2 +- OCaml 5.4.0 rebuild + +* Tue Sep 30 2025 Richard W.M. Jones - 1:1.57.4-1 +- New upstream development version 1.57.4 +- Enable aarch64 tests + +* Fri Sep 19 2025 Python Maint - 1:1.57.3-2 +- Rebuilt for Python 3.14.0rc3 bytecode + +* Tue Sep 09 2025 Richard W.M. Jones - 1:1.57.3-1 +- New upstream development version 1.57.3 + +* Fri Aug 15 2025 Python Maint - 1:1.57.2-2 +- Rebuilt for Python 3.14.0rc2 bytecode + +* Fri Aug 15 2025 Richard W.M. Jones - 1:1.57.2-1 +- New upstream development version 1.57.2 + +* Wed Aug 13 2025 Richard W.M. Jones - 1:1.57.1-1 +- New upstream development version 1.57.1 + +* Thu Jul 24 2025 Fedora Release Engineering - 1:1.56.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Sat Jul 12 2025 Jerry James - 1:1.56.1-3 +- Rebuild to fix OCaml dependencies + +* Mon Jul 07 2025 Jitka Plesnikova - 1:1.56.1-2 +- Perl 5.42 rebuild + +* Mon Jun 16 2025 Richard W.M. Jones - 1:1.56.1-1 +- New upstream stable version 1.56.1 +- Remove upstream ACPI / seabios fixes included in this version. + +* Wed Jun 11 2025 Richard W.M. Jones - 1:1.56.0-1 +- New upstream stable version 1.56.0 +- Remove BR xz-devel as it is not needed. + +* Fri Jun 06 2025 Python Maint - 1:1.55.14-2 +- Rebuilt for Python 3.14 + +* Tue Jun 03 2025 Richard W.M. Jones - 1:1.55.14-1 +- New upstream development version 1.55.14 + +* Mon Jun 02 2025 Python Maint - 1:1.55.13-2 +- Rebuilt for Python 3.14 + +* Tue May 20 2025 Richard W.M. Jones - 1:1.55.13-1 +- New upstream development version 1.55.13 + +* Mon May 19 2025 Richard W.M. Jones - 1:1.55.12-1 +- New upstream development version 1.55.12 + +* Fri May 09 2025 Richard W.M. Jones - 1:1.55.11-2 +- New upstream development version 1.55.11 +- Backport upstream patch to really remove zfs-fuse dependency + +* Wed May 07 2025 Richard W.M. Jones - 1:1.55.10-2 +- Remove file-devel BR +- Remove libguestfs-zfs subpackage + +* Sat Apr 26 2025 Richard W.M. Jones - 1:1.55.10-1 +- New upstream development version 1.55.10 +- Fix macro in comment + +* Wed Apr 16 2025 Richard W.M. Jones - 1:1.55.9-1 +- New upstream development version 1.55.9 +- Remove flex and bison + +* Thu Apr 03 2025 Richard W.M. Jones - 1:1.55.8-1 +- New upstream development version 1.55.8 +- Remove oUnit + +* Tue Mar 11 2025 Richard W.M. Jones - 1:1.55.7-1 +- New upstream development version 1.55.7 + +* Wed Feb 19 2025 Richard W.M. Jones - 1:1.55.6-1 +- New upstream development version 1.55.6 + +* Tue Feb 18 2025 Richard W.M. Jones - 1:1.55.5-1 +- New upstream development version 1.55.5 + +* Wed Feb 05 2025 Richard W.M. Jones - 1:1.55.4-1 +- New upstream development version 1.55.4 + +* Fri Jan 17 2025 Fedora Release Engineering - 1:1.55.3-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Sun Jan 12 2025 Zbigniew Jędrzejewski-Szmek - 1:1.55.3-4 +- Rebuilt for the bin-sbin merge (2nd attempt) + +* Fri Jan 10 2025 Jerry James - 1:1.55.3-3 +- OCaml 5.3.0 rebuild for Fedora 42 + +* Thu Jan 09 2025 Richard W.M. Jones - 1:1.55.3-2 +- Rebuild for Ruby 3.4 again (RHBZ#2336525) + +* Wed Jan 08 2025 Richard W.M. Jones - 1:1.55.3-1 +- New upstream development version 1.55.3 +- Baseline version of OCaml moved to 4.08 + +* Wed Jan 08 2025 Mamoru TASAKA - 1:1.55.2-2 +- Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_3.4 + +* Mon Nov 18 2024 Richard W.M. Jones - 1:1.55.2-1 +- New upstream development version 1.55.2 + +* Tue Oct 22 2024 Richard W.M. Jones - 1:1.55.1-1 +- New upstream development version 1.55.1 +- Replace jansson with json-c + +* Tue Oct 22 2024 Richard W.M. Jones - 1:1.54.0-4 +- Rebuild for Jansson 2.14 + (https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/3PYINSQGKQ4BB25NQUI2A2UCGGLAG5ND/) + +* Mon Oct 21 2024 Richard W.M. Jones - 1:1.54.0-3 +- Use stable owner, group and mtime in appliance tarballs (RHBZ#2320025) +- Add support for Windows Server 2025 + +* Mon Oct 14 2024 Remi Collet - 1:1.54.0-2 +- rebuild for https://fedoraproject.org/wiki/Changes/php84 + +* Tue Oct 08 2024 Richard W.M. Jones - 1:1.54.0-1 +- New upstream stable version 1.54.0 + +* Thu Oct 03 2024 Richard W.M. Jones - 1:1.53.7-1 +- New upstream development version 1.53.7 + +* Fri Aug 16 2024 Richard W.M. Jones - 1:1.53.6-1 +- New upstream development version 1.53.6 +- Fix kernel hang (RHBZ#2303267) + +* Thu Jul 18 2024 Fedora Release Engineering - 1:1.53.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Wed Jul 10 2024 Zbigniew Jędrzejewski-Szmek - 1:1.53.5-2 +- Rebuilt for the bin-sbin merge + +* Mon Jul 08 2024 Richard W.M. Jones - 1:1.53.5-1 +- New upstream development version 1.53.5 + +* Fri Jun 28 2024 Richard W.M. Jones - 1:1.53.4-1 +- New upstream development version 1.53.4 + +* Thu Jun 27 2024 Richard W.M. Jones - 1:1.53.3-1 +- New upstream development version 1.53.3 +- Remove glusterfs support. + +* Wed Jun 19 2024 Richard W.M. Jones - 1:1.53.2-6 +- OCaml 5.2.0 ppc64le fix + +* Wed Jun 12 2024 Jitka Plesnikova - 1:1.53.2-5 +- Perl 5.40 rebuild + +* Mon Jun 10 2024 Python Maint - 1:1.53.2-4 +- Rebuilt for Python 3.13 + +* Fri May 31 2024 Richard W.M. Jones - 1:1.53.2-3 +- Re-enable perl in RHEL, needed for virt-win-reg. + +* Wed May 29 2024 Richard W.M. Jones - 1:1.53.2-2 +- OCaml 5.2.0 for Fedora 41 + +* Fri May 10 2024 Richard W.M. Jones - 1:1.53.2-1 +- New upstream development version 1.53.2 +- Remove gdisk dependency for RHEL + (https://issues.redhat.com/browse/RHEL-35998) +- Remove lua, perl, ruby, php and gobject bindings in RHEL + +* Thu Apr 25 2024 Richard W.M. Jones - 1:1.53.1-1 +- New upstream development version 1.53.1 + +* Mon Mar 25 2024 Richard W.M. Jones - 1:1.52.0-8 +- Use %%{bash_completions_dir} macro +- BR bash-completion-devel, new in Rawhide + +* Thu Jan 25 2024 Fedora Release Engineering - 1:1.52.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 1:1.52.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 15 2024 Richard W.M. Jones - 1:1.52.0-5 +- Use curl instead of wget, since wget2 is broken + (https://gitlab.com/gnuwget/wget2/-/issues/652) +- Remove yajl daemon dep and replace with jansson. + +* Tue Jan 9 2024 Richard W.M. Jones - 1:1.52.0-3 +- Make cache directory find more robust + /var/cache/libdnf5 may be missing if dnf5 is not around + +* Mon Jan 8 2024 Richard W.M. Jones - 1:1.52.0-2 +- Look for RPMs in /var/cache/libdnf5 + https://bugzilla.redhat.com/show_bug.cgi?id=2256945#c5 + +* Thu Jan 4 2024 Richard W.M. Jones - 1:1.52.0-1 +- New upstream stable branch version 1.52.0 + +* Wed Jan 03 2024 Mamoru TASAKA - 1:1.51.10-2 +- Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_3.3 + +* Tue Dec 19 2023 Richard W.M. Jones - 1:1.51.10-1 +- New upstream development version 1.51.10 + +* Mon Dec 18 2023 Richard W.M. Jones - 1:1.51.9-4 +- OCaml 5.1.1 + s390x code gen fix for Fedora 40 + +* Thu Dec 14 2023 Richard W.M. Jones - 1:1.51.9-3 +- Fixes for https://github.com/ocaml/ocaml/issues/12820 + +* Tue Dec 12 2023 Richard W.M. Jones - 1:1.51.9-2 +- OCaml 5.1.1 rebuild for Fedora 40 + +* Sat Dec 9 2023 Richard W.M. Jones - 1:1.51.9-1 +- New upstream development version 1.51.9 + +* Mon Nov 27 2023 Richard W.M. Jones - 1:1.51.8-2 +- Fix build for libxml2 2.12.1 + +* Thu Nov 16 2023 Richard W.M. Jones - 1:1.51.8-1 +- New upstream development version 1.51.8 + +* Tue Nov 14 2023 Richard W.M. Jones - 1:1.51.7-6 +- Don't pull in selinux-policy as a requires + +* Mon Oct 30 2023 Richard W.M. Jones - 1:1.51.7-5 +- Use dhcpcd instead of dhclient (RHBZ#2247057) + +* Fri Oct 06 2023 Richard W.M. Jones - 1:1.51.7-4 +- Add upstream patch to fix linking the daemon with OCaml 5.1 + +* Thu Oct 05 2023 Richard W.M. Jones - 1:1.51.7-3 +- OCaml 5.1 rebuild for Fedora 40 + +* Wed Oct 4 2023 Jerry James - 1:1.51.7-2 +- Update names of the Unix and Camlstr libraries for OCaml 5.1.0 +- Link with libzstd for OCaml 5.1.0 + +* Tue Oct 03 2023 Remi Collet - 1:1.51.7-2 +- rebuild for https://fedoraproject.org/wiki/Changes/php83 + +* Thu Sep 21 2023 Richard W.M. Jones - 1:1.51.7-1 +- New upstream development branch 1.51.7 + +* Wed Jul 26 2023 Yaakov Selkowitz - 1:1.51.6-2 +- Use qemu-kvm in ELN builds + +* Thu Jul 20 2023 Richard W.M. Jones - 1:1.51.6-1 +- New upstream development branch 1.51.6 + +* Thu Jul 20 2023 Fedora Release Engineering - 1:1.51.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Fri Jul 14 2023 Richard W.M. Jones - 1:1.51.5-1 +- New upstream development branch 1.51.5 + +* Thu Jul 13 2023 Jitka Plesnikova - 1:1.51.4-8 +- Perl 5.38 re-rebuild updated packages + +* Thu Jul 13 2023 Richard W.M. Jones - 1:1.51.4-7 +- Bump and rebuild against supermin-5.3.3-13.fc39 + +* Thu Jul 13 2023 Jitka Plesnikova - 1:1.51.4-6 +- Perl 5.38 re-rebuild updated packages + +* Tue Jul 11 2023 Richard W.M. Jones - 1:1.51.4-5 +- OCaml 5.0 rebuild for Fedora 39 + +* Tue Jul 11 2023 Jitka Plesnikova - 1:1.51.4-4 +- Perl 5.38 rebuild + +* Mon Jul 10 2023 Jerry James - 1:1.51.4-3 +- OCaml 5.0.0 rebuild + +* Tue Jun 27 2023 Python Maint - 1:1.51.4-2 +- Rebuilt for Python 3.12 + +* Tue Jun 27 2023 Richard W.M. Jones - 1:1.51.4-1 +- New upstream development version 1.51.4 + +* Thu Jun 15 2023 Python Maint - 1:1.51.3-4 +- Rebuilt for Python 3.12 + +* Mon Jun 05 2023 Richard W.M. Jones - 1:1.51.3-3 +- Migrated to SPDX license + +* Fri May 19 2023 Richard W.M. Jones - 1:1.51.3-2 +- Rebuild against librpm 10 + +* Wed Apr 19 2023 Richard W.M. Jones - 1:1.51.3-1 +- New upstream development version 1.51.3 + +* Tue Feb 21 2023 Richard W.M. Jones - 1:1.51.2-1 +- New upstream development version 1.51.2 + +* Fri Feb 10 2023 Richard W.M. Jones - 1:1.51.1-1 +- New upstream development version 1.51.1 +- Remove virt-dib + +* Tue Feb 07 2023 Richard W.M. Jones - 1:1.50.0-1 +- New upstream stable branch 1.50.0 + +* Tue Jan 24 2023 Richard W.M. Jones - 1:1.49.9-2 +- Rebuild OCaml packages for F38 + +* Fri Jan 20 2023 Richard W.M. Jones - 1:1.49.9-1 +- New upstream development version 1.49.9 +- +BR ocaml-augeas-devel + +* Thu Jan 19 2023 Fedora Release Engineering - 1:1.49.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Wed Jan 04 2023 Mamoru TASAKA - 1:1.49.8-2 +- Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_3.2 + +* Sat Dec 10 2022 Richard W.M. Jones - 1:1.49.8-1 +- New upstream development version 1.49.8 + +* Mon Nov 28 2022 Richard W.M. Jones - 1:1.49.7-1 +- New upstream development version 1.49.7 + +* Mon Nov 21 2022 Richard W.M. Jones - 1:1.49.6-1 +- New upstream development version 1.49.6 + +* Tue Nov 08 2022 Richard W.M. Jones - 1:1.49.5-3 +- Move libguestfs-make-fixed-appliance to main package (RHBZ#2140695) + +* Tue Oct 11 2022 Richard W.M. Jones - 1:1.49.5-2 +- New upstream development version 1.49.5 + +* Wed Oct 05 2022 Remi Collet - 1:1.49.4-2 +- rebuild for https://fedoraproject.org/wiki/Changes/php82 + +* Mon Aug 01 2022 Richard W.M. Jones - 1:1.49.4-1 +- New upstream development version 1.49.4 + +* Thu Jul 21 2022 Fedora Release Engineering - 1:1.49.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jul 04 2022 Richard W.M. Jones - 1:1.49.3-2 +- Add clevis-luks to BRs, required by 1.49.3 + +* Fri Jul 01 2022 Richard W.M. Jones - 1:1.49.3-1 +- New upstream development version 1.49.3 + +* Mon Jun 20 2022 Python Maint - 1:1.49.2-7 +- Rebuilt for Python 3.11 + +* Sun Jun 19 2022 Richard W.M. Jones - 1:1.49.2-6 +- OCaml 4.14.0 rebuild + +* Thu Jun 16 2022 Python Maint - 1:1.49.2-5 +- Rebuilt for Python 3.11 + +* Thu Jun 16 2022 Richard W.M. Jones - 1:1.49.2-4 +- Fix PHP bindings + +* Wed Jun 15 2022 Python Maint - 1:1.49.2-3 +- Rebuilt for Python 3.11 + +* Wed Jun 01 2022 Jitka Plesnikova - 1:1.49.2-2 +- Perl 5.36 rebuild + +* Thu May 26 2022 Richard W.M. Jones - 1:1.49.2-1 +- New upstream development version 1.49.2 + +* Sat May 21 2022 Richard W.M. Jones - 1:1.49.1-2 +- Add upstream patch which helps debugging appliance generation. + +* Thu May 12 2022 Richard W.M. Jones - 1:1.49.1-1 +- New upstream development version 1.49.1 + +* Thu Apr 14 2022 Richard W.M. Jones - 1:1.48.1-1 +- New upstream stable branch version 1.48.1 + +* Mon Mar 14 2022 Richard W.M. Jones - 1:1.48.0-1 +- New upstream stable branch version 1.48.0 +- Remove the RHEL (downstream) patches as they are out of date. + +* Tue Mar 08 2022 Richard W.M. Jones - 1:1.47.4-1 +- New upstream development version 1.47.4 +- Replace guestfs-release-notes-historical(1) with guestfs-release-notes(1) + +* Tue Mar 01 2022 Richard W.M. Jones - 1:1.47.3-1 +- New upstream development version 1.47.3 +- Enable tests on all arches again. + +* Mon Feb 28 2022 Richard W.M. Jones - 1:1.47.2-6 +- Add more external programs used by the library + +* Tue Feb 08 2022 Richard W.M. Jones - 1:1.47.2-5 +- Bump and rebuild for eln + +* Fri Feb 04 2022 Richard W.M. Jones - 1:1.47.2-4 +- OCaml 4.13.1 rebuild to remove package notes + +* Thu Jan 20 2022 Fedora Release Engineering - 1:1.47.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Tue Jan 04 2022 Richard W.M. Jones - 1:1.47.2-2 +- Build and rebuild for new glibc causing broken deps on armv7 (RHBZ#2034715) + +* Fri Dec 24 2021 Richard W.M. Jones - 1:1.47.2-1 +- New upstream development version 1.47.2 + +* Thu Dec 09 2021 Richard W.M. Jones - 1:1.47.1-1 +- New upstream development version 1.47.1 + +* Fri Oct 29 2021 Richard W.M. Jones - 1:1.46.0-4 +- Require libvirt-daemon-driver-storage-core + resolves: rhbz#2018358 + +* Thu Oct 28 2021 Remi Collet - 1:1.46.0-3 +- rebuild for https://fedoraproject.org/wiki/Changes/php81 + +* Tue Oct 05 2021 Richard W.M. Jones - 1:1.46.0-2 +- OCaml 4.13.1 build + +* Thu Sep 23 2021 Richard W.M. Jones - 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 - 1:1.45.7-2 +- Rebuild for updated ntfs-3g CVE (RHBZ#1999788) + +* Tue Aug 31 2021 Richard W.M. Jones - 1:1.45.7-1 +- New upstream development version 1.45.7. +- Fix to work with qemu 6.1 (RHBZ#1998820) + +* Fri Aug 06 2021 Richard W.M. Jones - 1:1.45.6-11 +- Fix license files. +- Move appliance to separate subpackage (RHBZ#1989514). + +* Thu Jul 22 2021 Fedora Release Engineering - 1:1.45.6-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Jun 29 2021 Richard W.M. Jones - 1:1.45.6-9 +- RHEL 9 patch for openssl missing configuration file + https://bugzilla.redhat.com/show_bug.cgi?id=1977214#c13 + +* Thu Jun 24 2021 Richard W.M. Jones - 1:1.45.6-8 +- Remove Suggests for unsupported qemu drivers in RHEL (RHBZ#1975703) + +* Sat Jun 12 2021 Richard W.M. Jones - 1:1.45.6-6 +- Depend on hivex-libs instead of hivex. + +* Fri Jun 04 2021 Python Maint - 1:1.45.6-5 +- Rebuilt for Python 3.10 + +* Thu Jun 3 2021 Richard W.M. Jones - 1:1.45.6-4 +- Add --enable-appliance-format-auto (RHBZ#1967166) + +* Wed Jun 2 2021 Richard W.M. Jones - 1:1.45.6-3 +- Add gating tests (for RHEL 9) + +* Tue Jun 01 2021 Richard W.M. Jones - 1:1.45.6-2 +- Depend on rpm-libs >= 4.16.1.3 (RHBZ#1966541). + +* Thu May 27 2021 Richard W.M. Jones - 1:1.45.6-1 +- New upstream development version 1.45.6. + +* Fri May 21 2021 Jitka Plesnikova - 1:1.45.5-3 +- Perl 5.34 rebuild + +* Mon May 10 2021 Jeff Law - 1:1.45.5-2 +- Re-enable LTO + +* Fri Apr 09 2021 Richard W.M. Jones - 1:1.45.5-1 +- New upstream development version 1.45.5. + +* Sat Apr 03 2021 Richard W.M. Jones - 1:1.45.4-1 +- New upstream version 1.45.4. + +* Wed Mar 31 2021 Richard W.M. Jones - 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 - 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 - 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 - 1:1.45.2-2 +- Remove no longer needed requires on libguestfs-tools-c. + +* Tue Mar 23 2021 Richard W.M. Jones - 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 - 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 - 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 - 1:1.45.1-3 +- Bump and rebuild for ocaml-gettext update. + +* Fri Mar 5 2021 Remi Collet - 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 - 1:1.45.1-1 +- New upstream version 1.45.1. + +* Tue Mar 2 2021 Richard W.M. Jones - 1:1.44.0-8 +- OCaml 4.12.0 build +- Fixes for OCaml 4.12. + +* Wed Feb 17 2021 Richard W.M. Jones - 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 - 1:1.44.0-5 +- Remove gfs2-utils dependency in RHEL 9. + +* Thu Jan 28 2021 Richard W.M. Jones - 1:1.44.0-4 +- ELN has full-fat qemu (not qemu-kvm). + +* Tue Jan 26 2021 Fedora Release Engineering - 1:1.44.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Thu Jan 07 2021 Mamoru TASAKA - 1:1.44.0-2 +- F-34: rebuild against ruby 3.0 + +* Wed Jan 06 2021 Richard W.M. Jones - 1:1.44.0-1 +- New upstream stable version 1.44.0. + +* Tue Jan 05 2021 Richard W.M. Jones - 1:1.43.4-1 +- New upstream version 1.43.4. + +* Mon Jan 04 2021 Richard W.M. Jones - 1:1.43.3-4 +- Drop explicit deps on perl(Sys::Virt) and perl(Win::Hivex). + +* Wed Dec 02 2020 Richard W.M. Jones - 1:1.43.3-3 +- Unify Fedora and RHEL spec files. + +* Tue Dec 01 2020 Richard W.M. Jones - 1:1.43.3-2 +- New upstream version 1.43.3. +- Disable LTO because of memory running out on ARMv7. + +* Mon Sep 21 2020 Richard W.M. Jones - 1:1.43.2-1 +- New upstream version 1.43.2. +- Replace libvirt-daemon-qemu with libvirt-daemon-kvm. + +* Tue Sep 01 2020 Richard W.M. Jones - 1:1.43.1-7 +- OCaml 4.11.1 rebuild + +* Fri Aug 21 2020 Richard W.M. Jones - 1:1.43.1-6 +- OCaml 4.11.0 rebuild + +* Mon Aug 10 2020 Merlin Mathesius - 1.43.1-5 +- Use ExclusiveArch: %%{kernel_arches} + +* Fri Jul 31 2020 Richard W.M. Jones - 1:1.43.1-4 +- Disable then reenable LTO. + https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/ULGH5JYL7MHKDKTINJLOEN2QG6LOHWH7/ + +* Tue Jul 28 2020 Fedora Release Engineering - 1:1.43.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Jul 6 2020 Richard W.M. Jones - 1:1.43.1-1 +- New development branch 1.43. +- Remove upstream patches. + +* Thu Jun 25 2020 Jitka Plesnikova - 1:1.42.0-8 +- Perl 5.32 rebuild + +* Tue May 26 2020 Miro Hrončok - 1:1.42.0-7 +- Rebuilt for Python 3.9 + +* Wed May 06 2020 Richard W.M. Jones - 1:1.42.0-6 +- Fix path to libguestfs appliance. + +* Tue May 05 2020 Richard W.M. Jones - 1:1.42.0-5 +- OCaml 4.11.0+dev2-2020-04-22 rebuild + +* Wed Apr 22 2020 Richard W.M. Jones - 1:1.42.0-4 +- OCaml 4.11.0 pre-release attempt 2 + +* Sat Apr 04 2020 Richard W.M. Jones - 1:1.42.0-3 +- Update all OCaml dependencies for RPM 4.16. + +* Thu Mar 12 2020 Richard W.M. Jones - 1:1.42.1-1 +- Enable NTFS-3g system compression. + +* Mon Mar 09 2020 Richard W.M. Jones - 1:1.42.0-1 +- New upstream stable version 1.42.0. +- Drop the benchmarking subpackage: moved to a new package upstream. +- Enable Vala bindings. + +* Thu Feb 27 2020 Richard W.M. Jones - 1:1.41.8-9 +- OCaml 4.10.0 final. + +* Wed Jan 29 2020 Fedora Release Engineering - 1:1.41.8-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Mon Jan 20 2020 Vít Ondruch - 1:1.41.8-7 +- Another rebuild against Ruby 2.7. + +* Sun Jan 19 2020 Richard W.M. Jones - 1:1.41.8-5 +- OCaml 4.10.0+beta1 rebuild. + +* Sat Jan 18 2020 Mamoru TASAKA - 1:1.41.8-4 +- F-32: rebuild against ruby27 + +* Fri Dec 06 2019 Richard W.M. Jones - 1:1.41.8-3 +- OCaml 4.09.0 (final) rebuild. + +* Wed Nov 27 2019 Richard W.M. Jones - 1:1.41.8-2 +- Use gpgverify macro instead of explicit gpgv2 command. + +* Tue Nov 19 2019 Richard W.M. Jones - 1:1.41.8-1 +- New upstream version 1.41.8. +- virt-v2v is now in a separate project. +- Drop erlang bindings. + +* Fri Oct 11 2019 Richard W.M. Jones - 1:1.41.5-1 +- New upstream version 1.41.5. + +* Fri Oct 04 2019 Remi Collet - 1:1.41.4-2 +- rebuild for https://fedoraproject.org/wiki/Changes/php74 + +* Tue Sep 17 2019 Pino Toscano - 1:1.41.4-2 +- Drop virt-p2v (virt-p2v-maker subpackage), which is now built from + its own source. + +* Mon Sep 02 2019 Richard W.M. Jones - 1:1.41.4-1 +- New upstream version 1.41.4. + +* Mon Aug 19 2019 Miro Hrončok - 1:1.40.2-10 +- Rebuilt for Python 3.8 + +* Fri Aug 16 2019 Richard W.M. Jones - 1:1.40.2-9 +- OCaml 4.08.1 (final) rebuild. + +* Thu Aug 01 2019 Richard W.M. Jones - 1:1.40.2-8 +- OCaml 4.08.1 (rc2) rebuild. + +* Thu Jul 25 2019 Fedora Release Engineering - 1:1.40.2-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild +- Disable the package entirely on i686 because there is no kernel + https://fedoraproject.org/wiki/Changes/Stop_Building_i686_Kernels + +* Fri May 31 2019 Jitka Plesnikova - 1:1.40.2-6 +- Perl 5.30 rebuild + +* Fri May 31 2019 Richard W.M. Jones - 1:1.40.2-5 +- Add proposed patch for Python 3.8 (RHBZ#1705482). + +* Mon Mar 18 2019 Richard W.M. Jones - 1:1.40.2-4 +- Remove Java bindings. + https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/CW4XMOIKMNRRPAZ4H2ER7VPBY6YV2ODL/#YHTZ7IGVTKPWCBOY5C6UW7BMX7F35R5Q + +* Thu Mar 07 2019 Richard W.M. Jones - 1:1.40.2-3 +- Remove Python 2 bindings completely. + https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal + +* Sun Feb 17 2019 Igor Gnatenko - 1:1.40.2-2 +- Rebuild for readline 8.0 + +* Fri Feb 08 2019 Richard W.M. Jones - 1:1.40.2-1 +- New upstream version 1.40.2. + +* Fri Feb 01 2019 Fedora Release Engineering - 1:1.40.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Tue Jan 22 2019 Mamoru TASAKA - 1:1.40.1-4 +- F-30: rebuild against ruby26 + +* Mon Jan 21 2019 David Abdurachmanov - 1:1.40.1-3 +- Disable ZFS for RISC-V (riscv64) + +* Thu Jan 17 2019 Richard W.M. Jones - 1:1.40.1-2 +- nbdkit Python3 plugin is called "python3" in Fedora, adjust configure line. + +* Thu Jan 17 2019 Richard W.M. Jones - 1:1.40.1-1 +- New upstream version 1.40.1. +- Remove patch which is now upstream. +- Add new virt-v2v man pages. + +* Mon Jan 14 2019 Björn Esser - 1:1.39.11-4 +- Rebuilt for libcrypt.so.2 (#1666033) + +* Tue Jan 08 2019 Richard W.M. Jones - 1:1.39.11-3 +- Small fix for qemu behaviour (RHBZ#1664318). + +* Fri Oct 12 2018 Richard W.M. Jones - 1:1.39.11-2 +- lib: Add Recommends for libvirt-daemon-config-network so that networking + works out of the box. + +* Sat Sep 22 2018 Richard W.M. Jones - 1:1.39.11-1 +- New upstream version 1.39.11. + +* Fri Sep 21 2018 Richard W.M. Jones - 1:1.39.10-1 +- New upstream version 1.39.10. + +* Fri Aug 31 2018 Richard W.M. Jones - 1:1.39.9-1 +- New upstream version 1.39.9. + +* Fri Jul 27 2018 Richard W.M. Jones - 1:1.39.8-1 +- New upstream version 1.39.8. + +* Thu Jul 26 2018 Richard W.M. Jones - 1:1.39.7-3 +- v2v: Recommends nbdkit-plugin-vddk for -it vddk mode. + +* Tue Jul 24 2018 Richard W.M. Jones - 1:1.39.7-2 +- Rebuild for unannounced soname bump in libconfig. + +* Sat Jul 14 2018 Richard W.M. Jones - 1:1.39.7-1 +- New upstream version 1.39.7. +- v2v/TODO was removed upstream. + +* Fri Jul 13 2018 Richard W.M. Jones - 1:1.39.6-10 +- v2v: Recommends nbdkit and the Python 3 plugin. + +* Fri Jul 13 2018 Fedora Release Engineering - 1:1.39.6-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Jul 11 2018 Richard W.M. Jones - 1:1.39.6-7 +- OCaml 4.07.0 (final) rebuild. + +* Tue Jul 10 2018 Richard W.M. Jones - 1:1.39.6-6 +- Update PHP dependencies. + +* Thu Jul 05 2018 Richard W.M. Jones - 1:1.39.6-5 +- Remove ldconfig + https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/SU3LJVDZ7LUSJGZR5MS72BMRAFP3PQQL/ +- BR on python-unversioned-command + https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package + +* Tue Jul 03 2018 Petr Pisar - 1:1.39.6-4 +- Perl 5.28 rebuild + +* Mon Jul 02 2018 Miro Hrončok - 1:1.39.6-3 +- Rebuilt for Python 3.7 + +* Fri Jun 29 2018 Jitka Plesnikova - 1:1.39.6-2 +- Perl 5.28 rebuild + +* Fri Jun 29 2018 Richard W.M. Jones - 1:1.39.6-1 +- New upstream version 1.39.6. +- Add new bash-completion script for libguestfs-test-tool. + +* Wed Jun 20 2018 Richard W.M. Jones - 1:1.39.5-5 +- Bump release and rebuild. + +* Wed Jun 20 2018 Richard W.M. Jones - 1:1.39.5-4 +- Bump release and rebuild. + +* Wed Jun 20 2018 Richard W.M. Jones - 1:1.39.5-3 +- OCaml 4.07.0-rc1 rebuild. + +* Tue Jun 19 2018 Miro Hrončok - 1:1.39.5-2 +- Rebuilt for Python 3.7 + +* Wed May 23 2018 Richard W.M. Jones - 1:1.39.5-1 +- New upstream version 1.39.5. + +* Wed May 02 2018 Richard W.M. Jones - 1:1.39.4-1 +- New upstream version 1.39.4. + +* Sun Apr 22 2018 Richard W.M. Jones - 1:1.39.3-1 +- New upstream version 1.39.3. +- Remove upstream patch. + +* Tue Apr 10 2018 Iryna Shcherbina - 1:1.39.2-3 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Thu Mar 29 2018 Richard W.M. Jones - 1:1.39.2-2 +- Add patch to fix detection of qemu mandatory locking. + +* Thu Mar 29 2018 Richard W.M. Jones - 1:1.39.2-1 +- New upstream version 1.39.2. + +* Tue Mar 13 2018 Richard W.M. Jones - 1:1.39.1-1 +- New upstream version 1.39.1. + +* Fri Feb 09 2018 Richard W.M. Jones - 1:1.38.0-1 +- New upstream version 1.38.0. +- Enable tarball signing since we are on a stable branch. +- Fix Source URLs. + +* Tue Feb 06 2018 Richard W.M. Jones - 1:1.37.37-1 +- New upstream version 1.37.37. + +* Thu Jan 25 2018 Richard W.M. Jones - 1:1.37.36-1 +- New upstream version 1.37.36. +- Unbreak the linker. + +* Sat Jan 20 2018 Björn Esser - 1:1.37.35-3 +- Rebuilt for switch to libxcrypt + +* Thu Jan 11 2018 Richard W.M. Jones - 1:1.37.35-2 +- Add BR rpcgen, libtirpc-devel and rebuild against updated Ruby. + +* Sun Dec 10 2017 Richard W.M. Jones - 1:1.37.35-1 +- New upstream version 1.37.35. +- Remove upstream patches. +- Add virt-builder-repository and man page. + +* Thu Dec 7 2017 Richard W.M. Jones - 1:1.37.34-4 +- Remove for libvirt >= 3.10. + +* Sun Dec 3 2017 Richard W.M. Jones - 1:1.37.34-3 +- Fix locking on NBD drives. + +* Fri Nov 17 2017 Richard W.M. Jones - 1:1.37.34-2 +- OCaml 4.06.0 rebuild. + +* Fri Nov 17 2017 Richard W.M. Jones - 1:1.37.34-1 +- New upstream version 1.37.34. + +* Thu Oct 19 2017 Richard W.M. Jones - 1:1.37.31-1 +- New upstream version 1.37.31. + +* Tue Oct 10 2017 Richard W.M. Jones - 1:1.37.29-1 +- New upstream version 1.37.29. + +* Thu Oct 05 2017 Richard W.M. Jones - 1:1.37.28-2 +- Add libguestfs-ufs (BSD) subpackage. + +* Thu Sep 28 2017 Richard W.M. Jones - 1:1.37.28-1 +- New upstream version 1.37.28. + +* Sat Sep 23 2017 Richard W.M. Jones - 1:1.37.27-1 +- New upstream version 1.37.27. + +* Sun Sep 17 2017 Richard W.M. Jones - 1:1.37.26-1 +- New upstream version 1.37.26. + +* Sat Sep 16 2017 Richard W.M. Jones - 1:1.37.25-1 +- New upstream version 1.37.25. + +* Tue Sep 05 2017 Richard W.M. Jones - 1:1.37.22-1 +- New upstream version 1.37.22. + +* Sat Aug 19 2017 Richard W.M. Jones - 1:1.37.21-2 +- Disable zfs subpackage on s390, s390x. + +* Wed Aug 09 2017 Richard W.M. Jones - 1:1.37.21-1 +- New upstream version 1.37.21. + +* Tue Aug 08 2017 Richard W.M. Jones - 1:1.37.20-2 +- OCaml 4.05.0 rebuild. + +* Fri Aug 04 2017 Richard W.M. Jones - 1:1.37.20-1 +- New upstream version 1.37.20. + +* Thu Aug 03 2017 Fedora Release Engineering - 1:1.37.19-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Sat Jul 29 2017 Richard W.M. Jones - 1:1.37.19-1 +- New upstream version 1.37.19. + +* Wed Jul 26 2017 Fedora Release Engineering - 1:1.37.18-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Tue Jul 18 2017 Richard W.M. Jones - 1:1.37.18-1 +- New upstream version 1.37.18. + +* Tue Jul 11 2017 Richard W.M. Jones - 1:1.37.17-2 +- New upstream version 1.37.17. - Drop libguestfs-gobject-doc because gtk-doc is no longer provided upstream. - Add new man page guestfs-gobject(3) to libguestfs-gobject-devel. -- Run autoreconf after applying patches. -* Fri Nov 17 2017 Richard W.M. Jones - 1:1.36.11-1 -- New upstream version 1.36.11. +* Mon Jun 26 2017 Richard W.M. Jones - 1:1.37.16-2 +- OCaml 4.04.2 rebuild. -* Thu Oct 19 2017 Richard W.M. Jones - 1:1.36.10-1 -- New upstream version 1.36.10. +* Fri Jun 23 2017 Richard W.M. Jones - 1:1.37.16-1 +- New upstream version 1.37.16. -* Wed Oct 04 2017 Richard W.M. Jones - 1:1.36.7-1 -- New upstream version 1.36.7. +* Tue Jun 06 2017 Jitka Plesnikova - 1:1.37.14-3 +- Perl 5.26 rebuild -* Sat Sep 16 2017 Richard W.M. Jones - 1:1.36.6-1 -- New upstream version 1.36.6. +* Mon May 22 2017 Richard W.M. Jones - 1:1.37.14-2 +- Bump release and rebuild for ppc64, ppc64le and s390x. -* Fri Jun 23 2017 Richard W.M. Jones - 1:1.36.5-1 -- New upstream version 1.36.5. -- Fixes small data corruption problem in virt-resize. - https://www.redhat.com/archives/libguestfs/2017-June/msg00231.html +* Fri May 19 2017 Richard W.M. Jones - 1:1.37.14-1 +- New upstream version 1.37.14. -* Fri May 19 2017 Richard W.M. Jones - 1:1.36.4-1 -- New upstream version 1.36.4. -- Depend on gnupg2 at runtime (RHBZ#1438939). +* Fri May 12 2017 Richard W.M. Jones - 1:1.37.13-2 +- OCaml 4.04.1 rebuild. -* Sat Apr 1 2017 Richard W.M. Jones - 1:1.36.3-2 -- Include rewritten and greatly improved virt-rescue from upstream. +* Mon May 08 2017 Richard W.M. Jones - 1:1.37.13-1 +- New upstream version 1.37.13. -* Fri Mar 24 2017 Richard W.M. Jones - 1:1.36.3-1 -- New upstream version 1.36.3. +* Wed Apr 26 2017 Richard W.M. Jones - 1:1.37.12-1 +- New upstream version 1.37.12. -* Tue Mar 07 2017 Richard W.M. Jones - 1:1.36.2-2 -- Disable all tests because virtio in the F26 kernel is broken. +* Sat Apr 15 2017 Richard W.M. Jones - 1:1.37.11-1 +- New upstream version 1.37.11. -* Tue Mar 07 2017 Richard W.M. Jones - 1:1.36.2-1 -- New upstream version 1.36.2. +* Wed Apr 12 2017 Richard W.M. Jones - 1:1.37.10-1 +- New upstream version 1.37.10. -* Tue Feb 28 2017 Richard W.M. Jones - 1:1.36.1-1 -- New upstream version 1.36.1. +* Sat Apr 08 2017 Richard W.M. Jones - 1:1.37.9-1 +- New upstream version 1.37.9. + +* Fri Mar 31 2017 Richard W.M. Jones - 1:1.37.8-1 +- New upstream version 1.37.8. + +* Fri Mar 24 2017 Richard W.M. Jones - 1:1.37.7-1 +- New upstream version 1.37.7. + +* Mon Mar 20 2017 Richard W.M. Jones - 1:1.37.6-1 +- New upstream version 1.37.6. + +* Tue Mar 14 2017 Richard W.M. Jones - 1:1.37.2-1 +- New upstream version 1.37.2. + +* Tue Mar 07 2017 Richard W.M. Jones - 1:1.37.1-1 +- New upstream version 1.37.1. + +* Tue Feb 28 2017 Richard W.M. Jones - 1:1.37.0-1 +- New upstream version 1.37.0. * Fri Feb 24 2017 Richard W.M. Jones - 1:1.35.28-1 - New upstream version 1.35.28. @@ -1823,7 +2422,6 @@ install -m 0644 utils/boot-benchmark/boot-benchmark.1 $RPM_BUILD_ROOT%{_mandir}/ * Thu Jul 09 2015 Richard W.M. Jones - 1:1.29.50-1 - New upstream version 1.29.50. - - Add virt-dib. * Thu Jul 02 2015 Richard W.M. Jones - 1:1.29.49-1 diff --git a/rpminspect.yaml b/rpminspect.yaml new file mode 100644 index 0000000..ba87399 --- /dev/null +++ b/rpminspect.yaml @@ -0,0 +1,5 @@ +# Ignore copy-patches.sh. It is an internal script we use to +# manage the patches. +upstream: + ignore: + - copy-patches.sh diff --git a/sources b/sources index 98c4e5a..23cf369 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (libguestfs-1.36.13.tar.gz) = 7c9799d5d563ffd8296f70a8402582aba85f3bf3c0dcaa18c44ecff5b7f771a3bc3f297aa85a4056351758298c79752d456a4b46e41924ff9acf196c992d51fb -SHA512 (libguestfs-1.36.13.tar.gz.sig) = 50bf6282d9c10d7ad455b6a8986c9ada71e886b10c971042c04a8abac50d8d78e5e8a701f1c55188ed0130e82c240141e5dde7094267198b8d5231b35c1beb49 +SHA512 (libguestfs-1.58.0.tar.gz) = 67abbd37fe64935ae5cca13dbe1860fe2eab9df492fd134eacbdc1831e6034c849855e76118ce0002d3ac83205122947582dbe47b66f12b94dcb51155881501a +SHA512 (libguestfs-1.58.0.tar.gz.sig) = e07758ed3901f9ae95dace16cbb4de194dbbde788155efcde7982226785928d1805af6939f201d74770923ad55997f1d465f9594cb81bc2435c0ea882ce546d8 diff --git a/tests/run-libguestfs-test-tool.sh b/tests/run-libguestfs-test-tool.sh new file mode 100755 index 0000000..d36d5ea --- /dev/null +++ b/tests/run-libguestfs-test-tool.sh @@ -0,0 +1,10 @@ +#!/bin/bash - +set -e +set -x + +# This only makes sure that libguestfs isn't totally broken. + +# Fix libvirt. +systemctl restart virtqemud virtsecretd virtstoraged virtnetworkd + +libguestfs-test-tool diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..3809111 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,14 @@ +# https://fedoraproject.org/wiki/CI/Tests +# https://fedoraproject.org/wiki/CI/Standard_Test_Roles +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + required_packages: + - libguestfs + - libvirt-daemon-kvm + tests: + - libguestfs-test-tool: + dir: . + run: ./run-libguestfs-test-tool.sh diff --git a/yum.conf.in b/yum.conf.in index be4932a..d5e30d0 100644 --- a/yum.conf.in +++ b/yum.conf.in @@ -7,6 +7,7 @@ obsoletes=1 gpgcheck=0 assumeyes=1 reposdir=/dev/null +modulesdir=@PWD@/modules [local] name=local