From cf8add59d297d196facc2d0b9af45bb1d7946344 Mon Sep 17 00:00:00 2001 From: Matthew Booth Date: Thu, 28 Oct 2010 15:19:12 +0100 Subject: [PATCH] Log the febootstrap-supermin-helper command line A side-effect of change 17e7cb9937a63ed8f9bb0fb6ac7302758be76846 was the the febootstrap-supermin-helper was no longer logged. This change adds it back using the new guestfs___print_timestamped_argv internal function. --- src/appliance.c | 55 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/src/appliance.c b/src/appliance.c index 80f0f46..a4f5f6f 100644 --- a/src/appliance.c +++ b/src/appliance.c @@ -371,6 +371,32 @@ static int run_supermin_helper (guestfs_h *g, const char *supermin_path, const char *cachedir, size_t cdlen) { + size_t pathlen = strlen (supermin_path); + + const char *argv[30]; + size_t i = 0; + + char supermin_d[pathlen + 32]; + snprintf (supermin_d, pathlen + 32, "%s/supermin.d", supermin_path); + char kernel[cdlen + 32]; + snprintf (kernel, cdlen + 32, "%s/kernel", cachedir); + char initrd[cdlen + 32]; + snprintf (initrd, cdlen + 32, "%s/initrd", cachedir); + char root[cdlen + 32]; + snprintf (root, cdlen + 32, "%s/root", cachedir); + + argv[i++] = "febootstrap-supermin-helper"; + if (g->verbose) + argv[i++] = "--verbose"; + argv[i++] = "-f"; + argv[i++] = "ext2"; + argv[i++] = supermin_d; + argv[i++] = host_cpu; + argv[i++] = kernel; + argv[i++] = initrd; + argv[i++] = root; + argv[i++] = NULL; + pid_t pid = fork (); if (pid == -1) { perrorf (g, "fork"); @@ -378,6 +404,9 @@ run_supermin_helper (guestfs_h *g, const char *supermin_path, } if (pid > 0) { /* Parent. */ + if (g->verbose) + guestfs___print_timestamped_argv (g, argv); + int status; if (waitpid (pid, &status, 0) == -1) { perrorf (g, "waitpid"); @@ -422,32 +451,6 @@ run_supermin_helper (guestfs_h *g, const char *supermin_path, } } } - - size_t pathlen = strlen (supermin_path); - - const char *argv[30]; - size_t i = 0; - - argv[i++] = "febootstrap-supermin-helper"; - if (g->verbose) - argv[i++] = "--verbose"; - argv[i++] = "-f"; - argv[i++] = "ext2"; - char supermin_d[pathlen + 32]; - snprintf (supermin_d, pathlen + 32, "%s/supermin.d", supermin_path); - argv[i++] = supermin_d; - argv[i++] = host_cpu; - char kernel[cdlen + 32]; - snprintf (kernel, cdlen + 32, "%s/kernel", cachedir); - argv[i++] = kernel; - char initrd[cdlen + 32]; - snprintf (initrd, cdlen + 32, "%s/initrd", cachedir); - argv[i++] = initrd; - char root[cdlen + 32]; - snprintf (root, cdlen + 32, "%s/root", cachedir); - argv[i++] = root; - argv[i++] = NULL; - execvp ("febootstrap-supermin-helper", (char * const *) argv); perror ("execvp"); _exit (EXIT_FAILURE); -- 1.8.3.1