X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fstubs.c;h=02c76f1e52037ff49c46c8285ce36511635ebff5;hb=027897d4ddaf886a309a032b488f64512d2dc873;hp=526a86170493b43c093e22c9a9b1a89e0f0c8b7f;hpb=8f9f02d483b87c787d089cf9329f5f1b81d3a77e;p=libguestfs.git diff --git a/daemon/stubs.c b/daemon/stubs.c index 526a861..02c76f1 100644 --- a/daemon/stubs.c +++ b/daemon/stubs.c @@ -19,7 +19,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE // for strchrnul +#include #include #include @@ -1872,6 +1872,78 @@ done: xdr_free ((xdrproc_t) xdr_guestfs_debug_args, (char *) &args); } +static void lvremove_stub (XDR *xdr_in) +{ + int r; + struct guestfs_lvremove_args args; + const char *device; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_lvremove_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "lvremove"); + return; + } + device = args.device; + + r = do_lvremove (device); + if (r == -1) + /* do_lvremove has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_lvremove_args, (char *) &args); +} + +static void vgremove_stub (XDR *xdr_in) +{ + int r; + struct guestfs_vgremove_args args; + const char *vgname; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_vgremove_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "vgremove"); + return; + } + vgname = args.vgname; + + r = do_vgremove (vgname); + if (r == -1) + /* do_vgremove has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_vgremove_args, (char *) &args); +} + +static void pvremove_stub (XDR *xdr_in) +{ + int r; + struct guestfs_pvremove_args args; + const char *device; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_pvremove_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "pvremove"); + return; + } + device = args.device; + + r = do_pvremove (device); + if (r == -1) + /* do_pvremove has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_pvremove_args, (char *) &args); +} + void dispatch_incoming_message (XDR *xdr_in) { switch (proc_nr) { @@ -2103,6 +2175,15 @@ void dispatch_incoming_message (XDR *xdr_in) case GUESTFS_PROC_DEBUG: debug_stub (xdr_in); break; + case GUESTFS_PROC_LVREMOVE: + lvremove_stub (xdr_in); + break; + case GUESTFS_PROC_VGREMOVE: + vgremove_stub (xdr_in); + break; + case GUESTFS_PROC_PVREMOVE: + pvremove_stub (xdr_in); + break; default: reply_with_error ("dispatch_incoming_message: unknown procedure number %d", proc_nr); }