[Libguestfs] [PATCH] daemon: add missing GUESTFSD_EXT_CMD usage

Olaf Hering olaf at aepfle.de
Sun Jan 19 19:22:49 UTC 2014


Signed-off-by: Olaf Hering <olaf at aepfle.de>
---
Not even compile tested, against 1.24 branch.

 daemon/btrfs.c   | 2 +-
 daemon/command.c | 3 ++-
 daemon/debug.c   | 3 ++-
 daemon/ldm.c     | 4 ++--
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 0b877f8..a0c1542 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -597,7 +597,7 @@ test_btrfs_device_add_needs_force (void)
   int r;
   CLEANUP_FREE char *out = NULL, *err = NULL;
 
-  r = command (&out, &err, "btrfs", "device", "add", "--help", NULL);
+  r = command (&out, &err, str_btrfs, "device", "add", "--help", NULL);
   if (r == -1) {
     reply_with_error ("%s: %s", "btrfs device add --help", err);
     return -1;
diff --git a/daemon/command.c b/daemon/command.c
index 02e1dd4..066c773 100644
--- a/daemon/command.c
+++ b/daemon/command.c
@@ -30,6 +30,7 @@
 
 #include "ignore-value.h"
 
+GUESTFSD_EXT_CMD(str_cp, cp);
 GUESTFSD_EXT_CMD(str_mount, mount);
 GUESTFSD_EXT_CMD(str_umount, umount);
 
@@ -179,7 +180,7 @@ set_up_etc_resolv_conf (struct resolver_state *rs)
   /* Now that the guest's <sysroot>/etc/resolv.conf is out the way, we
    * can create our own copy of the appliance /etc/resolv.conf.
    */
-  ignore_value (command (NULL, NULL, "cp", "/etc/resolv.conf",
+  ignore_value (command (NULL, NULL, str_cp, "/etc/resolv.conf",
                          rs->sysroot_etc_resolv_conf, NULL));
 
   rs->mounted = true;
diff --git a/daemon/debug.c b/daemon/debug.c
index 9fe57fc..b5470d7 100644
--- a/daemon/debug.c
+++ b/daemon/debug.c
@@ -41,6 +41,7 @@ GUESTFSD_EXT_CMD(str_xargs, xargs);
 GUESTFSD_EXT_CMD(str_file, file);
 GUESTFSD_EXT_CMD(str_grep, grep);
 GUESTFSD_EXT_CMD(str_gawk, gawk);
+GUESTFSD_EXT_CMD(str_sh, sh);
 
 /* This command exposes debugging information, internals and
  * status.  There is no comprehensive documentation for this
@@ -335,7 +336,7 @@ debug_binaries (const char *subcmd, size_t argc, char *const *const argv)
             "| %s -F: '{print $1}'",
             str_find, str_xargs, str_file, str_grep, str_gawk);
 
-  r = command (&out, &err, "sh", "-c", cmd, NULL);
+  r = command (&out, &err, str_sh, "-c", cmd, NULL);
   if (r == -1) {
     reply_with_error ("find: %s", err);
     free (out);
diff --git a/daemon/ldm.c b/daemon/ldm.c
index aed8a0d..e89fc90 100644
--- a/daemon/ldm.c
+++ b/daemon/ldm.c
@@ -130,7 +130,7 @@ do_ldmtool_create_all (void)
   int r;
   CLEANUP_FREE char *err = NULL;
 
-  r = command (NULL, &err, "ldmtool", "create", "all", NULL);
+  r = command (NULL, &err, str_ldmtool, "create", "all", NULL);
   if (r == -1) {
     reply_with_error ("%s", err);
     return -1;
@@ -144,7 +144,7 @@ do_ldmtool_remove_all (void)
   int r;
   CLEANUP_FREE char *err = NULL;
 
-  r = command (NULL, &err, "ldmtool", "remove", "all", NULL);
+  r = command (NULL, &err, str_ldmtool, "remove", "all", NULL);
   if (r == -1) {
     reply_with_error ("%s", err);
     return -1;




More information about the Libguestfs mailing list