[Pkg-libvirt-commits] [libguestfs] 101/165: daemon: grub: show grub-install's output on error if verbose

Hilko Bengen bengen at moszumanska.debian.org
Sat Aug 30 08:24:58 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch experimental
in repository libguestfs.

commit 844066597dc9ed92c0685c136f613c06276c6132
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Tue Jun 10 15:18:37 2014 +0200

    daemon: grub: show grub-install's output on error if verbose
---
 daemon/grub.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/daemon/grub.c b/daemon/grub.c
index c058599..9596d7a 100644
--- a/daemon/grub.c
+++ b/daemon/grub.c
@@ -38,16 +38,19 @@ int
 do_grub_install (const char *root, const char *device)
 {
   int r;
-  CLEANUP_FREE char *err = NULL, *buf = NULL;
+  CLEANUP_FREE char *err = NULL, *buf = NULL, *out = NULL;
 
   if (asprintf_nowarn (&buf, "--root-directory=%R", root) == -1) {
     reply_with_perror ("asprintf");
     return -1;
   }
 
-  r = command (NULL, &err, str_grub_install, buf, device, NULL);
+  r = command (verbose ? &out : NULL, &err,
+               str_grub_install, buf, device, NULL);
 
   if (r == -1) {
+    if (verbose)
+      fprintf (stderr, "grub output:\n%s\n", out);
     reply_with_error ("%s", err);
     return -1;
   }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list