diff options
Diffstat (limited to 'daemon/stubs.c')
-rw-r--r-- | daemon/stubs.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/daemon/stubs.c b/daemon/stubs.c index 0e5b3513..212634fd 100644 --- a/daemon/stubs.c +++ b/daemon/stubs.c @@ -2397,6 +2397,30 @@ done: xdr_free ((xdrproc_t) xdr_guestfs_hexdump_args, (char *) &args); } +static void zerofree_stub (XDR *xdr_in) +{ + int r; + struct guestfs_zerofree_args args; + const char *device; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_zerofree_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "zerofree"); + return; + } + device = args.device; + + r = do_zerofree (device); + if (r == -1) + /* do_zerofree has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_zerofree_args, (char *) &args); +} + void dispatch_incoming_message (XDR *xdr_in) { switch (proc_nr) { @@ -2688,6 +2712,9 @@ void dispatch_incoming_message (XDR *xdr_in) case GUESTFS_PROC_HEXDUMP: hexdump_stub (xdr_in); break; + case GUESTFS_PROC_ZEROFREE: + zerofree_stub (xdr_in); + break; default: reply_with_error ("dispatch_incoming_message: unknown procedure number %d", proc_nr); } |