X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=sidebyside;f=daemon%2Fstubs.c;h=fd9c7eae48489ee107a97edced663193ff2453c4;hb=6f0b962724a087a11edb5ce47aa06fa276fcb54b;hp=ddd3fced413b39bb84963f2339e90eb59514b943;hpb=ac286b26df1aabceca26dac66c325a3676ace4cc;p=libguestfs.git diff --git a/daemon/stubs.c b/daemon/stubs.c index ddd3fce..fd9c7ea 100644 --- a/daemon/stubs.c +++ b/daemon/stubs.c @@ -2231,6 +2231,87 @@ done: xdr_free ((xdrproc_t) xdr_guestfs_mv_args, (char *) &args); } +static void drop_caches_stub (XDR *xdr_in) +{ + int r; + struct guestfs_drop_caches_args args; + int whattodrop; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_drop_caches_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "drop_caches"); + return; + } + whattodrop = args.whattodrop; + + r = do_drop_caches (whattodrop); + if (r == -1) + /* do_drop_caches has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_drop_caches_args, (char *) &args); +} + +static void dmesg_stub (XDR *xdr_in) +{ + char *r; + + r = do_dmesg (); + if (r == NULL) + /* do_dmesg has already called reply_with_error */ + goto done; + + struct guestfs_dmesg_ret ret; + ret.kmsgs = r; + reply ((xdrproc_t) &xdr_guestfs_dmesg_ret, (char *) &ret); + free (r); +done: ; +} + +static void ping_daemon_stub (XDR *xdr_in) +{ + int r; + + r = do_ping_daemon (); + if (r == -1) + /* do_ping_daemon has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: ; +} + +static void equal_stub (XDR *xdr_in) +{ + int r; + struct guestfs_equal_args args; + const char *file1; + const char *file2; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_equal_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "equal"); + return; + } + file1 = args.file1; + file2 = args.file2; + + r = do_equal (file1, file2); + if (r == -1) + /* do_equal has already called reply_with_error */ + goto done; + + struct guestfs_equal_ret ret; + ret.equality = r; + reply ((xdrproc_t) &xdr_guestfs_equal_ret, (char *) &ret); +done: + xdr_free ((xdrproc_t) xdr_guestfs_equal_args, (char *) &args); +} + void dispatch_incoming_message (XDR *xdr_in) { switch (proc_nr) { @@ -2501,6 +2582,18 @@ void dispatch_incoming_message (XDR *xdr_in) case GUESTFS_PROC_MV: mv_stub (xdr_in); break; + case GUESTFS_PROC_DROP_CACHES: + drop_caches_stub (xdr_in); + break; + case GUESTFS_PROC_DMESG: + dmesg_stub (xdr_in); + break; + case GUESTFS_PROC_PING_DAEMON: + ping_daemon_stub (xdr_in); + break; + case GUESTFS_PROC_EQUAL: + equal_stub (xdr_in); + break; default: reply_with_error ("dispatch_incoming_message: unknown procedure number %d", proc_nr); }