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 9e0ce559..937913f3 100644 --- a/daemon/stubs.c +++ b/daemon/stubs.c @@ -2103,6 +2103,30 @@ done: xdr_free ((xdrproc_t) xdr_guestfs_fsck_args, (char *) &args); } +static void zero_stub (XDR *xdr_in) +{ + int r; + struct guestfs_zero_args args; + const char *device; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_zero_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "zero"); + return; + } + device = args.device; + + r = do_zero (device); + if (r == -1) + /* do_zero has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_zero_args, (char *) &args); +} + void dispatch_incoming_message (XDR *xdr_in) { switch (proc_nr) { @@ -2358,6 +2382,9 @@ void dispatch_incoming_message (XDR *xdr_in) case GUESTFS_PROC_FSCK: fsck_stub (xdr_in); break; + case GUESTFS_PROC_ZERO: + zero_stub (xdr_in); + break; default: reply_with_error ("dispatch_incoming_message: unknown procedure number %d", proc_nr); } |