Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=2184967
v1:
https://listman.redhat.com/archives/libguestfs/2023-July/031984.html
V2 implements small updates; the cumulative v1->v2 diff is just
diff --git a/lib/launch-direct.c b/lib/launch-direct.c
index 8d6ad025a4e1..cdfd25a9afed 100644
--- a/lib/launch-direct.c
+++ b/lib/launch-direct.c
@@ -338,9 +338,9 @@ add_drives (guestfs_h *g, struct backend_direct_data *data,
/**
* Launch passt such that it daemonizes.
*
- * On error, -1 is returned; C<passt_pid> and C<sockpath> are not modified.
+ * On error, C<-1> is returned; C<passt_pid> and C<sockpath> are not
modified.
*
- * On success, 0 is returned. C<passt_pid> contains the PID of the passt
+ * On success, C<0> is returned. C<passt_pid> contains the PID of the
passt
* background process. C<sockpath> contains the pathname of the unix domain
* socket where passt will accept a single connection.
*/
@@ -394,7 +394,12 @@ launch_passt (guestfs_h *g, long *passt_pid, char
(*sockpath)[UNIX_PATH_MAX])
goto close_cmd;
}
- assert (WIFEXITED (passt_status));
+ if (!WIFEXITED (passt_status)) {
+ error (g, _("internal error: unexpected exit status from passt (%d)"),
+ passt_status);
+ goto close_cmd;
+ }
+
passt_exit = WEXITSTATUS (passt_status);
if (passt_exit != 0) {
error (g, _("passt exited with status %d"), passt_exit);
diff --git a/lib/launch.c b/lib/launch.c
index a0a8e1c45a51..b9b76e509162 100644
--- a/lib/launch.c
+++ b/lib/launch.c
@@ -408,6 +408,9 @@ guestfs_int_passt_runnable (guestfs_h *g)
return false;
guestfs_int_cmd_add_string_unquoted (cmd, "passt --help");
+ if (!g->verbose)
+ guestfs_int_cmd_add_string_unquoted (cmd, " >/dev/null 2>&1");
+
r = guestfs_int_cmd_run (cmd);
if (r == -1 || !WIFEXITED (r))
return false;
dispersed over patches #2 and #7.
I lightly tested the updates with virt-rescue (direct & libvirt backends
with passt installed).
Thanks
Laszlo
Laszlo Ersek (7):
lib: fix NETWORK_ADDRESS: make it an actual IP address, not a subnet
base
lib/launch-libvirt: support networking with passt
docs: fix broken link in the guestfs manual
docs: clarify sockdir's separation
lib: move guestfs_int_create_socketname() from "launch.c" to
"tmpdirs.c"
lib: introduce guestfs_int_make_pid_path()
lib/launch-direct: support networking with passt
fish/guestfish.pod | 4 +-
generator/actions_properties.ml | 8 +-
lib/guestfs-internal.h | 32 ++++-
lib/guestfs.pod | 6 +-
lib/launch-direct.c | 152 +++++++++++++++++++-
lib/launch-libvirt.c | 11 ++
lib/launch.c | 57 ++++----
lib/tmpdirs.c | 41 ++++++
8 files changed, 271 insertions(+), 40 deletions(-)
base-commit: 13c7052ff96d5ee99ec1b1252f1a3b4d7aed44d2