On 7/14/23 15:32, Richard W.M. Jones wrote:
On Fri, Jul 14, 2023 at 03:22:06PM +0200, Laszlo Ersek wrote:
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).
For the series:
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
If you can push it today then I can do a libguestfs release for Fedora.
Commit range 13c7052ff96d..02bbc9daa742. Cheers Laszlo