+static void upload_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_upload_args args;
+ const char *remotefilename;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_upload_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "upload");
+ return;
+ }
+ remotefilename = args.remotefilename;
+
+ r = do_upload (remotefilename);
+ if (r == -1)
+ /* do_upload has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_upload_args, (char *) &args);
+}
+
+static void download_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_download_args args;
+ const char *remotefilename;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_download_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "download");
+ return;
+ }
+ remotefilename = args.remotefilename;
+
+ r = do_download (remotefilename);
+ if (r == -1)
+ /* do_download has already called reply_with_error */
+ goto done;
+
+ /* do_download has already sent a reply */
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_download_args, (char *) &args);
+}
+
+static void checksum_stub (XDR *xdr_in)
+{
+ char *r;
+ struct guestfs_checksum_args args;
+ const char *csumtype;
+ const char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_checksum_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "checksum");
+ return;
+ }
+ csumtype = args.csumtype;
+ path = args.path;
+
+ r = do_checksum (csumtype, path);
+ if (r == NULL)
+ /* do_checksum has already called reply_with_error */
+ goto done;
+
+ struct guestfs_checksum_ret ret;
+ ret.checksum = r;
+ reply ((xdrproc_t) &xdr_guestfs_checksum_ret, (char *) &ret);
+ free (r);
+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);
+}
+
+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;
+ extraargs = realloc (args.extraargs.extraargs_val,
+ sizeof (char *) * (args.extraargs.extraargs_len+1));
+ if (extraargs == NULL) {
+ reply_with_perror ("realloc");
+ goto done;
+ }
+ extraargs[args.extraargs.extraargs_len] = NULL;
+ args.extraargs.extraargs_val = extraargs;
+
+ 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);
+}
+
+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);
+}
+
+static void set_e2label_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_set_e2label_args args;
+ const char *device;
+ const char *label;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_set_e2label_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "set_e2label");
+ return;
+ }
+ device = args.device;
+ label = args.label;
+
+ r = do_set_e2label (device, label);
+ if (r == -1)
+ /* do_set_e2label has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_set_e2label_args, (char *) &args);
+}
+
+static void get_e2label_stub (XDR *xdr_in)
+{
+ char *r;
+ struct guestfs_get_e2label_args args;
+ const char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_get_e2label_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "get_e2label");
+ return;
+ }
+ device = args.device;
+
+ r = do_get_e2label (device);
+ if (r == NULL)
+ /* do_get_e2label has already called reply_with_error */
+ goto done;
+
+ struct guestfs_get_e2label_ret ret;
+ ret.label = r;
+ reply ((xdrproc_t) &xdr_guestfs_get_e2label_ret, (char *) &ret);
+ free (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_get_e2label_args, (char *) &args);
+}
+
+static void set_e2uuid_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_set_e2uuid_args args;
+ const char *device;
+ const char *uuid;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_set_e2uuid_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "set_e2uuid");
+ return;
+ }
+ device = args.device;
+ uuid = args.uuid;
+
+ r = do_set_e2uuid (device, uuid);
+ if (r == -1)
+ /* do_set_e2uuid has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_set_e2uuid_args, (char *) &args);
+}
+
+static void get_e2uuid_stub (XDR *xdr_in)
+{
+ char *r;
+ struct guestfs_get_e2uuid_args args;
+ const char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_get_e2uuid_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "get_e2uuid");
+ return;
+ }
+ device = args.device;
+
+ r = do_get_e2uuid (device);
+ if (r == NULL)
+ /* do_get_e2uuid has already called reply_with_error */
+ goto done;
+
+ struct guestfs_get_e2uuid_ret ret;
+ ret.uuid = r;
+ reply ((xdrproc_t) &xdr_guestfs_get_e2uuid_ret, (char *) &ret);
+ free (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_get_e2uuid_args, (char *) &args);
+}
+
+static void fsck_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_fsck_args args;
+ const char *fstype;
+ const char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_fsck_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "fsck");
+ return;
+ }
+ fstype = args.fstype;
+ device = args.device;
+
+ r = do_fsck (fstype, device);
+ if (r == -1)
+ /* do_fsck has already called reply_with_error */
+ goto done;
+
+ struct guestfs_fsck_ret ret;
+ ret.status = r;
+ reply ((xdrproc_t) &xdr_guestfs_fsck_ret, (char *) &ret);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_fsck_args, (char *) &args);
+}
+