summaryrefslogtreecommitdiffstats
path: root/daemon/guestfsd.c
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-04-20 00:22:02 +0100
committerRichard Jones <rjones@redhat.com>2009-04-20 00:22:02 +0100
commit170f262f0413de843af62b968f6d12c1c476ae7f (patch)
treeb9be7ae0e59f784dfdd57ef063536218ee3f0c7d /daemon/guestfsd.c
parentd5151686d82b66c50935010fd5458be0e4386bab (diff)
downloadlibguestfs-170f262f0413de843af62b968f6d12c1c476ae7f.tar.gz
libguestfs-170f262f0413de843af62b968f6d12c1c476ae7f.tar.xz
libguestfs-170f262f0413de843af62b968f6d12c1c476ae7f.zip
Implement upload and download commands.
Diffstat (limited to 'daemon/guestfsd.c')
-rw-r--r--daemon/guestfsd.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
index c3f5e821..2553ea2c 100644
--- a/daemon/guestfsd.c
+++ b/daemon/guestfsd.c
@@ -41,6 +41,8 @@ static void usage (void);
#define VMCHANNEL_PORT "6666"
#define VMCHANNEL_ADDR "10.0.2.4"
+int verbose = 0;
+
int
main (int argc, char *argv[])
{
@@ -108,6 +110,14 @@ main (int argc, char *argv[])
fclose (fp);
buf[n] = '\0';
+ /* Set the verbose flag. Not quite right because this will only
+ * set the flag if host and port aren't set on the command line.
+ * Don't worry about this for now. (XXX)
+ */
+ verbose = strstr (buf, "guestfs_verbose=1") != NULL;
+ if (verbose)
+ printf ("verbose daemon enabled\n");
+
p = strstr (buf, "guestfs=");
if (p) {
@@ -359,10 +369,12 @@ commandv (char **stdoutput, char **stderror, char * const* const argv)
if (stdoutput) *stdoutput = NULL;
if (stderror) *stderror = NULL;
- printf ("%s", argv[0]);
- for (i = 1; argv[i] != NULL; ++i)
- printf (" %s", argv[i]);
- printf ("\n");
+ if (verbose) {
+ printf ("%s", argv[0]);
+ for (i = 1; argv[i] != NULL; ++i)
+ printf (" %s", argv[i]);
+ printf ("\n");
+ }
if (pipe (so_fd) == -1 || pipe (se_fd) == -1) {
perror ("pipe");