Olaf Hering
2014-Jan-19 19:22 UTC
[Libguestfs] [PATCH] daemon: add missing GUESTFSD_EXT_CMD usage
Signed-off-by: Olaf Hering <olaf@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;
Richard W.M. Jones
2014-Jan-19 20:31 UTC
Re: [Libguestfs] [PATCH] daemon: add missing GUESTFSD_EXT_CMD usage
On Sun, Jan 19, 2014 at 08:22:49PM +0100, Olaf Hering wrote:> Signed-off-by: Olaf Hering <olaf@aepfle.de> > --- > Not even compile tested, against 1.24 branch.ACK. It seems to work here, so I have pushed it. Thanks, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Apparently Analagous Threads
- [PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
- [PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
- [PATCH v2] daemon: collect list of called external commands
- [PATCH] collect list of called external commands
- Re: [PATCH 0/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.