X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Flaunch.c;h=03ad39b4b3b61df873ea9d13fa1740bde8efd1ba;hb=86dad5c7f117dc05c730a1184a53b0ce38e62ed9;hp=db76885a4c9dd8114e24e5f5e1c391e4d501cde0;hpb=a9411de27d0dcc8d793aa1d0a7e96c7dc1d58585;p=libguestfs.git diff --git a/src/launch.c b/src/launch.c index db76885..03ad39b 100644 --- a/src/launch.c +++ b/src/launch.c @@ -1071,6 +1071,11 @@ test_qemu (guestfs_h *g) char cmd[1024]; FILE *fp; + free (g->qemu_help); + g->qemu_help = NULL; + free (g->qemu_version); + g->qemu_version = NULL; + snprintf (cmd, sizeof cmd, "LC_ALL=C '%s' -nographic -help", g->qemu); /* qemu -help should always work (qemu -version OTOH wasn't @@ -1078,7 +1083,8 @@ test_qemu (guestfs_h *g) * probably indicates that the qemu binary is missing. */ if (test_qemu_cmd (g, cmd, &g->qemu_help) == -1) { - perrorf (g, _("%s: command failed: If qemu is located on a non-standard path, try setting the LIBGUESTFS_QEMU environment variable."), cmd); + error (g, _("command failed: %s\n\nIf qemu is located on a non-standard path, try setting the LIBGUESTFS_QEMU\nenvironment variable. There may also be errors printed above."), + cmd); return -1; } @@ -1105,7 +1111,7 @@ test_qemu_cmd (guestfs_h *g, const char *cmd, char **ret) return -1; } - if (pclose (fp) == -1) + if (pclose (fp) != 0) return -1; return 0;