summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-06-29 12:47:20 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-06-29 12:47:20 +0100
commite492608f2f3809a824cb70ee03ff305964b69dd7 (patch)
tree953ec56c34431549dab177eec9e0fe979606e5eb /daemon
parent9a92446bcad09b492dee42dd5950bac67073fbea (diff)
downloadlibguestfs-e492608f2f3809a824cb70ee03ff305964b69dd7.tar.gz
libguestfs-e492608f2f3809a824cb70ee03ff305964b69dd7.tar.xz
libguestfs-e492608f2f3809a824cb70ee03ff305964b69dd7.zip
Generated code for 'du' command.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/actions.h1
-rw-r--r--daemon/stubs.c29
2 files changed, 30 insertions, 0 deletions
diff --git a/daemon/actions.h b/daemon/actions.h
index 8f381634..7d87b677 100644
--- a/daemon/actions.h
+++ b/daemon/actions.h
@@ -147,3 +147,4 @@ extern char **do_tail (char *path);
extern char **do_tail_n (int nrlines, char *path);
extern char *do_df (void);
extern char *do_df_h (void);
+extern int64_t do_du (char *path);
diff --git a/daemon/stubs.c b/daemon/stubs.c
index 0c311a9d..67e6ef5b 100644
--- a/daemon/stubs.c
+++ b/daemon/stubs.c
@@ -3179,6 +3179,32 @@ static void df_h_stub (XDR *xdr_in)
done: ;
}
+static void du_stub (XDR *xdr_in)
+{
+ int64_t r;
+ struct guestfs_du_args args;
+ char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_du_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "du");
+ return;
+ }
+ path = args.path;
+
+ r = do_du (path);
+ if (r == -1)
+ /* do_du has already called reply_with_error */
+ goto done;
+
+ struct guestfs_du_ret ret;
+ ret.sizekb = r;
+ reply ((xdrproc_t) &xdr_guestfs_du_ret, (char *) &ret);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_du_args, (char *) &args);
+}
+
void dispatch_incoming_message (XDR *xdr_in)
{
switch (proc_nr) {
@@ -3560,6 +3586,9 @@ void dispatch_incoming_message (XDR *xdr_in)
case GUESTFS_PROC_DF_H:
df_h_stub (xdr_in);
break;
+ case GUESTFS_PROC_DU:
+ du_stub (xdr_in);
+ break;
default:
reply_with_error ("dispatch_incoming_message: unknown procedure number %d, set LIBGUESTFS_PATH to point to the matching libguestfs appliance directory", proc_nr);
}