summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-04-20 10:19:45 +0100
committerRichard Jones <rjones@redhat.com>2009-04-20 10:19:45 +0100
commit24ccbb29ac475187f51a27dcd318db2b4824a0c1 (patch)
treeecb06a1b2985b33b7bdd8dad6e222a380b274ac5 /daemon
parentaef3d2013fee188c9607f35657c45df88503cd64 (diff)
downloadlibguestfs-24ccbb29ac475187f51a27dcd318db2b4824a0c1.tar.gz
libguestfs-24ccbb29ac475187f51a27dcd318db2b4824a0c1.tar.xz
libguestfs-24ccbb29ac475187f51a27dcd318db2b4824a0c1.zip
Generated code for 'checksum' command.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/actions.h1
-rw-r--r--daemon/stubs.c32
2 files changed, 33 insertions, 0 deletions
diff --git a/daemon/actions.h b/daemon/actions.h
index 01ef882a..cffd8efa 100644
--- a/daemon/actions.h
+++ b/daemon/actions.h
@@ -88,3 +88,4 @@ extern int do_blockdev_flushbufs (const char *device);
extern int do_blockdev_rereadpt (const char *device);
extern int do_upload (const char *remotefilename);
extern int do_download (const char *remotefilename);
+extern char *do_checksum (const char *csumtype, const char *path);
diff --git a/daemon/stubs.c b/daemon/stubs.c
index df067ccc..30394049 100644
--- a/daemon/stubs.c
+++ b/daemon/stubs.c
@@ -1632,6 +1632,35 @@ done:
xdr_free ((xdrproc_t) xdr_guestfs_download_args, (char *) &args);
}
+static void checksum_stub (XDR *xdr_in)
+{
+ char *r;
+ struct guestfs_checksum_args args;
+ const char *csumtype;
+ const char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_checksum_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "checksum");
+ return;
+ }
+ csumtype = args.csumtype;
+ path = args.path;
+
+ r = do_checksum (csumtype, path);
+ if (r == NULL)
+ /* do_checksum has already called reply_with_error */
+ goto done;
+
+ struct guestfs_checksum_ret ret;
+ ret.checksum = r;
+ reply ((xdrproc_t) &xdr_guestfs_checksum_ret, (char *) &ret);
+ free (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_checksum_args, (char *) &args);
+}
+
void dispatch_incoming_message (XDR *xdr_in)
{
switch (proc_nr) {
@@ -1836,6 +1865,9 @@ void dispatch_incoming_message (XDR *xdr_in)
case GUESTFS_PROC_DOWNLOAD:
download_stub (xdr_in);
break;
+ case GUESTFS_PROC_CHECKSUM:
+ checksum_stub (xdr_in);
+ break;
default:
reply_with_error ("dispatch_incoming_message: unknown procedure number %d", proc_nr);
}