X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fstubs.c;h=e9d9f594f4bed34c56e657e3eaf9fb1342f33c65;hp=3039404931b419979a8931a0f395bf4f30c9185b;hb=79cdf81e2fb717ea4372a55170d16800cdbddf23;hpb=24ccbb29ac475187f51a27dcd318db2b4824a0c1 diff --git a/daemon/stubs.c b/daemon/stubs.c index 3039404..e9d9f59 100644 --- a/daemon/stubs.c +++ b/daemon/stubs.c @@ -1661,6 +1661,186 @@ done: xdr_free ((xdrproc_t) xdr_guestfs_checksum_args, (char *) &args); } +static void tar_in_stub (XDR *xdr_in) +{ + int r; + struct guestfs_tar_in_args args; + const char *directory; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_tar_in_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "tar_in"); + return; + } + directory = args.directory; + + r = do_tar_in (directory); + if (r == -1) + /* do_tar_in has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_tar_in_args, (char *) &args); +} + +static void tar_out_stub (XDR *xdr_in) +{ + int r; + struct guestfs_tar_out_args args; + const char *directory; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_tar_out_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "tar_out"); + return; + } + directory = args.directory; + + r = do_tar_out (directory); + if (r == -1) + /* do_tar_out has already called reply_with_error */ + goto done; + + /* do_tar_out has already sent a reply */ +done: + xdr_free ((xdrproc_t) xdr_guestfs_tar_out_args, (char *) &args); +} + +static void tgz_in_stub (XDR *xdr_in) +{ + int r; + struct guestfs_tgz_in_args args; + const char *directory; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_tgz_in_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "tgz_in"); + return; + } + directory = args.directory; + + r = do_tgz_in (directory); + if (r == -1) + /* do_tgz_in has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_tgz_in_args, (char *) &args); +} + +static void tgz_out_stub (XDR *xdr_in) +{ + int r; + struct guestfs_tgz_out_args args; + const char *directory; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_tgz_out_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "tgz_out"); + return; + } + directory = args.directory; + + r = do_tgz_out (directory); + if (r == -1) + /* do_tgz_out has already called reply_with_error */ + goto done; + + /* do_tgz_out has already sent a reply */ +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); +} + void dispatch_incoming_message (XDR *xdr_in) { switch (proc_nr) { @@ -1868,6 +2048,27 @@ void dispatch_incoming_message (XDR *xdr_in) case GUESTFS_PROC_CHECKSUM: checksum_stub (xdr_in); break; + case GUESTFS_PROC_TAR_IN: + tar_in_stub (xdr_in); + break; + case GUESTFS_PROC_TAR_OUT: + tar_out_stub (xdr_in); + break; + case GUESTFS_PROC_TGZ_IN: + tgz_in_stub (xdr_in); + break; + 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; default: reply_with_error ("dispatch_incoming_message: unknown procedure number %d", proc_nr); }