X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fstubs.c;h=ee27997729ebb6da0aad2b29b38fe1d8dbfda07f;hp=9e0ce559b34f64af276267ed97cf3d96ea01ac7d;hb=e118c14b9552de311cbc1734e03a3226b484c1e8;hpb=0703248d233744047515418893dac05ce013a642 diff --git a/daemon/stubs.c b/daemon/stubs.c index 9e0ce55..ee27997 100644 --- a/daemon/stubs.c +++ b/daemon/stubs.c @@ -2103,6 +2103,56 @@ 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); +} + +static void grub_install_stub (XDR *xdr_in) +{ + int r; + struct guestfs_grub_install_args args; + const char *root; + const char *device; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_grub_install_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "grub_install"); + return; + } + root = args.root; + device = args.device; + + r = do_grub_install (root, device); + if (r == -1) + /* do_grub_install has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_grub_install_args, (char *) &args); +} + void dispatch_incoming_message (XDR *xdr_in) { switch (proc_nr) { @@ -2358,6 +2408,12 @@ 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; + case GUESTFS_PROC_GRUB_INSTALL: + grub_install_stub (xdr_in); + break; default: reply_with_error ("dispatch_incoming_message: unknown procedure number %d", proc_nr); }