X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fstubs.c;h=526a86170493b43c093e22c9a9b1a89e0f0c8b7f;hp=820164122ff62d1ca8d8bba7b60bbb967689df23;hb=8f9f02d483b87c787d089cf9329f5f1b81d3a77e;hpb=0232e722826cfda0f6042da983f9eb871f24e946 diff --git a/daemon/stubs.c b/daemon/stubs.c index 8201641..526a861 100644 --- a/daemon/stubs.c +++ b/daemon/stubs.c @@ -1757,6 +1757,121 @@ done: xdr_free ((xdrproc_t) xdr_guestfs_tgz_out_args, (char *) &args); } +static void mount_ro_stub (XDR *xdr_in) +{ + int r; + struct guestfs_mount_ro_args args; + const char *device; + const char *mountpoint; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_mount_ro_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "mount_ro"); + return; + } + device = args.device; + mountpoint = args.mountpoint; + + r = do_mount_ro (device, mountpoint); + if (r == -1) + /* do_mount_ro has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_mount_ro_args, (char *) &args); +} + +static void mount_options_stub (XDR *xdr_in) +{ + int r; + struct guestfs_mount_options_args args; + const char *options; + const char *device; + const char *mountpoint; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_mount_options_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "mount_options"); + return; + } + options = args.options; + device = args.device; + mountpoint = args.mountpoint; + + r = do_mount_options (options, device, mountpoint); + if (r == -1) + /* do_mount_options has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_mount_options_args, (char *) &args); +} + +static void mount_vfs_stub (XDR *xdr_in) +{ + int r; + struct guestfs_mount_vfs_args args; + const char *options; + const char *vfstype; + const char *device; + const char *mountpoint; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_mount_vfs_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "mount_vfs"); + return; + } + options = args.options; + vfstype = args.vfstype; + device = args.device; + mountpoint = args.mountpoint; + + r = do_mount_vfs (options, vfstype, device, mountpoint); + if (r == -1) + /* do_mount_vfs has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_mount_vfs_args, (char *) &args); +} + +static void debug_stub (XDR *xdr_in) +{ + char *r; + struct guestfs_debug_args args; + const char *subcmd; + char **extraargs; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_debug_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "debug"); + return; + } + subcmd = args.subcmd; + args.extraargs.extraargs_val = realloc (args.extraargs.extraargs_val, sizeof (char *) * (args.extraargs.extraargs_len+1)); + args.extraargs.extraargs_val[args.extraargs.extraargs_len] = NULL; + extraargs = args.extraargs.extraargs_val; + + r = do_debug (subcmd, extraargs); + if (r == NULL) + /* do_debug has already called reply_with_error */ + goto done; + + struct guestfs_debug_ret ret; + ret.result = r; + reply ((xdrproc_t) &xdr_guestfs_debug_ret, (char *) &ret); + free (r); +done: + xdr_free ((xdrproc_t) xdr_guestfs_debug_args, (char *) &args); +} + void dispatch_incoming_message (XDR *xdr_in) { switch (proc_nr) { @@ -1976,6 +2091,18 @@ void dispatch_incoming_message (XDR *xdr_in) case GUESTFS_PROC_TGZ_OUT: tgz_out_stub (xdr_in); break; + case GUESTFS_PROC_MOUNT_RO: + mount_ro_stub (xdr_in); + break; + case GUESTFS_PROC_MOUNT_OPTIONS: + mount_options_stub (xdr_in); + break; + case GUESTFS_PROC_MOUNT_VFS: + mount_vfs_stub (xdr_in); + break; + case GUESTFS_PROC_DEBUG: + debug_stub (xdr_in); + break; default: reply_with_error ("dispatch_incoming_message: unknown procedure number %d", proc_nr); }