+ if (!xdr_guestfs_lvcreate_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "lvcreate");
+ return;
+ }
+ logvol = args.logvol;
+ volgroup = args.volgroup;
+ mbytes = args.mbytes;
+
+ r = do_lvcreate (logvol, volgroup, mbytes);
+ if (r == -1)
+ /* do_lvcreate has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_lvcreate_args, (char *) &args);
+}
+
+static void mkfs_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_mkfs_args args;
+ char *fstype;
+ char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_mkfs_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "mkfs");
+ return;
+ }
+ fstype = args.fstype;
+ device = args.device;
+
+ r = do_mkfs (fstype, device);
+ if (r == -1)
+ /* do_mkfs has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_mkfs_args, (char *) &args);
+}
+
+static void sfdisk_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_sfdisk_args args;
+ char *device;
+ int cyls;
+ int heads;
+ int sectors;
+ char **lines;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_sfdisk_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "sfdisk");
+ return;
+ }
+ device = args.device;
+ cyls = args.cyls;
+ heads = args.heads;
+ sectors = args.sectors;
+ lines = realloc (args.lines.lines_val,
+ sizeof (char *) * (args.lines.lines_len+1));
+ if (lines == NULL) {
+ reply_with_perror ("realloc");
+ goto done;
+ }
+ lines[args.lines.lines_len] = NULL;
+ args.lines.lines_val = lines;
+
+ r = do_sfdisk (device, cyls, heads, sectors, lines);
+ if (r == -1)
+ /* do_sfdisk has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_sfdisk_args, (char *) &args);
+}
+
+static void write_file_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_write_file_args args;
+ char *path;
+ char *content;
+ int size;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_write_file_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "write_file");
+ return;
+ }
+ path = args.path;
+ content = args.content;
+ size = args.size;
+
+ r = do_write_file (path, content, size);
+ if (r == -1)
+ /* do_write_file has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_write_file_args, (char *) &args);
+}
+
+static void umount_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_umount_args args;
+ char *pathordevice;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_umount_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "umount");
+ return;
+ }
+ pathordevice = args.pathordevice;
+
+ r = do_umount (pathordevice);
+ if (r == -1)
+ /* do_umount has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_umount_args, (char *) &args);
+}
+
+static void mounts_stub (XDR *xdr_in)
+{
+ char **r;
+
+ r = do_mounts ();
+ if (r == NULL)
+ /* do_mounts has already called reply_with_error */
+ goto done;
+
+ struct guestfs_mounts_ret ret;
+ ret.devices.devices_len = count_strings (r);
+ ret.devices.devices_val = r;
+ reply ((xdrproc_t) &xdr_guestfs_mounts_ret, (char *) &ret);
+ free_strings (r);
+done: ;
+}
+
+static void umount_all_stub (XDR *xdr_in)
+{
+ int r;
+
+ r = do_umount_all ();
+ if (r == -1)
+ /* do_umount_all has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done: ;
+}
+
+static void lvm_remove_all_stub (XDR *xdr_in)
+{
+ int r;
+
+ r = do_lvm_remove_all ();
+ if (r == -1)
+ /* do_lvm_remove_all has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done: ;
+}
+
+static void file_stub (XDR *xdr_in)
+{
+ char *r;
+ struct guestfs_file_args args;
+ char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_file_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "file");
+ return;
+ }
+ path = args.path;
+
+ r = do_file (path);
+ if (r == NULL)
+ /* do_file has already called reply_with_error */
+ goto done;
+
+ struct guestfs_file_ret ret;
+ ret.description = r;
+ reply ((xdrproc_t) &xdr_guestfs_file_ret, (char *) &ret);
+ free (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_file_args, (char *) &args);
+}
+
+static void command_stub (XDR *xdr_in)
+{
+ char *r;
+ struct guestfs_command_args args;
+ char **arguments;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_command_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "command");
+ return;
+ }
+ arguments = realloc (args.arguments.arguments_val,
+ sizeof (char *) * (args.arguments.arguments_len+1));
+ if (arguments == NULL) {
+ reply_with_perror ("realloc");
+ goto done;
+ }
+ arguments[args.arguments.arguments_len] = NULL;
+ args.arguments.arguments_val = arguments;
+
+ r = do_command (arguments);
+ if (r == NULL)
+ /* do_command has already called reply_with_error */
+ goto done;
+
+ struct guestfs_command_ret ret;
+ ret.output = r;
+ reply ((xdrproc_t) &xdr_guestfs_command_ret, (char *) &ret);
+ free (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_command_args, (char *) &args);
+}
+
+static void command_lines_stub (XDR *xdr_in)
+{
+ char **r;
+ struct guestfs_command_lines_args args;
+ char **arguments;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_command_lines_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "command_lines");
+ return;
+ }
+ arguments = realloc (args.arguments.arguments_val,
+ sizeof (char *) * (args.arguments.arguments_len+1));
+ if (arguments == NULL) {
+ reply_with_perror ("realloc");
+ goto done;
+ }
+ arguments[args.arguments.arguments_len] = NULL;
+ args.arguments.arguments_val = arguments;
+
+ r = do_command_lines (arguments);
+ if (r == NULL)
+ /* do_command_lines has already called reply_with_error */
+ goto done;
+
+ struct guestfs_command_lines_ret ret;
+ ret.lines.lines_len = count_strings (r);
+ ret.lines.lines_val = r;
+ reply ((xdrproc_t) &xdr_guestfs_command_lines_ret, (char *) &ret);
+ free_strings (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_command_lines_args, (char *) &args);
+}
+
+static void stat_stub (XDR *xdr_in)
+{
+ guestfs_int_stat *r;
+ struct guestfs_stat_args args;
+ char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_stat_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "stat");
+ return;
+ }
+ path = args.path;
+
+ r = do_stat (path);
+ if (r == NULL)
+ /* do_stat has already called reply_with_error */
+ goto done;
+
+ struct guestfs_stat_ret ret;
+ ret.statbuf = *r;
+ reply ((xdrproc_t) xdr_guestfs_stat_ret, (char *) &ret);
+ xdr_free ((xdrproc_t) xdr_guestfs_stat_ret, (char *) &ret);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_stat_args, (char *) &args);
+}
+
+static void lstat_stub (XDR *xdr_in)
+{
+ guestfs_int_stat *r;
+ struct guestfs_lstat_args args;
+ char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_lstat_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "lstat");
+ return;
+ }
+ path = args.path;
+
+ r = do_lstat (path);
+ if (r == NULL)
+ /* do_lstat has already called reply_with_error */
+ goto done;
+
+ struct guestfs_lstat_ret ret;
+ ret.statbuf = *r;
+ reply ((xdrproc_t) xdr_guestfs_lstat_ret, (char *) &ret);
+ xdr_free ((xdrproc_t) xdr_guestfs_lstat_ret, (char *) &ret);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_lstat_args, (char *) &args);
+}
+
+static void statvfs_stub (XDR *xdr_in)
+{
+ guestfs_int_statvfs *r;
+ struct guestfs_statvfs_args args;
+ char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_statvfs_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "statvfs");
+ return;
+ }
+ path = args.path;
+
+ r = do_statvfs (path);
+ if (r == NULL)
+ /* do_statvfs has already called reply_with_error */
+ goto done;
+
+ struct guestfs_statvfs_ret ret;
+ ret.statbuf = *r;
+ reply ((xdrproc_t) xdr_guestfs_statvfs_ret, (char *) &ret);
+ xdr_free ((xdrproc_t) xdr_guestfs_statvfs_ret, (char *) &ret);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_statvfs_args, (char *) &args);
+}
+
+static void tune2fs_l_stub (XDR *xdr_in)
+{
+ char **r;
+ struct guestfs_tune2fs_l_args args;
+ char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_tune2fs_l_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "tune2fs_l");
+ return;
+ }
+ device = args.device;
+
+ r = do_tune2fs_l (device);
+ if (r == NULL)
+ /* do_tune2fs_l has already called reply_with_error */
+ goto done;
+
+ struct guestfs_tune2fs_l_ret ret;
+ ret.superblock.superblock_len = count_strings (r);
+ ret.superblock.superblock_val = r;
+ reply ((xdrproc_t) &xdr_guestfs_tune2fs_l_ret, (char *) &ret);
+ free_strings (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_tune2fs_l_args, (char *) &args);
+}
+
+static void blockdev_setro_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_blockdev_setro_args args;
+ char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_blockdev_setro_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_setro");
+ return;
+ }
+ device = args.device;
+
+ r = do_blockdev_setro (device);
+ if (r == -1)
+ /* do_blockdev_setro has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_blockdev_setro_args, (char *) &args);
+}
+
+static void blockdev_setrw_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_blockdev_setrw_args args;
+ char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_blockdev_setrw_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_setrw");
+ return;
+ }
+ device = args.device;
+
+ r = do_blockdev_setrw (device);
+ if (r == -1)
+ /* do_blockdev_setrw has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_blockdev_setrw_args, (char *) &args);
+}
+
+static void blockdev_getro_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_blockdev_getro_args args;
+ char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_blockdev_getro_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_getro");
+ return;
+ }
+ device = args.device;
+
+ r = do_blockdev_getro (device);
+ if (r == -1)
+ /* do_blockdev_getro has already called reply_with_error */
+ goto done;
+
+ struct guestfs_blockdev_getro_ret ret;
+ ret.ro = r;
+ reply ((xdrproc_t) &xdr_guestfs_blockdev_getro_ret, (char *) &ret);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_blockdev_getro_args, (char *) &args);
+}
+
+static void blockdev_getss_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_blockdev_getss_args args;
+ char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_blockdev_getss_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_getss");
+ return;
+ }
+ device = args.device;
+
+ r = do_blockdev_getss (device);
+ if (r == -1)
+ /* do_blockdev_getss has already called reply_with_error */
+ goto done;
+
+ struct guestfs_blockdev_getss_ret ret;
+ ret.sectorsize = r;
+ reply ((xdrproc_t) &xdr_guestfs_blockdev_getss_ret, (char *) &ret);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_blockdev_getss_args, (char *) &args);
+}
+
+static void blockdev_getbsz_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_blockdev_getbsz_args args;
+ char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_blockdev_getbsz_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_getbsz");
+ return;
+ }
+ device = args.device;
+
+ r = do_blockdev_getbsz (device);
+ if (r == -1)
+ /* do_blockdev_getbsz has already called reply_with_error */
+ goto done;
+
+ struct guestfs_blockdev_getbsz_ret ret;
+ ret.blocksize = r;
+ reply ((xdrproc_t) &xdr_guestfs_blockdev_getbsz_ret, (char *) &ret);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_blockdev_getbsz_args, (char *) &args);
+}
+
+static void blockdev_setbsz_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_blockdev_setbsz_args args;
+ char *device;
+ int blocksize;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_blockdev_setbsz_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_setbsz");
+ return;
+ }
+ device = args.device;
+ blocksize = args.blocksize;
+
+ r = do_blockdev_setbsz (device, blocksize);
+ if (r == -1)
+ /* do_blockdev_setbsz has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_blockdev_setbsz_args, (char *) &args);
+}
+
+static void blockdev_getsz_stub (XDR *xdr_in)
+{
+ int64_t r;
+ struct guestfs_blockdev_getsz_args args;
+ char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_blockdev_getsz_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_getsz");
+ return;
+ }
+ device = args.device;
+
+ r = do_blockdev_getsz (device);
+ if (r == -1)
+ /* do_blockdev_getsz has already called reply_with_error */
+ goto done;
+
+ struct guestfs_blockdev_getsz_ret ret;
+ ret.sizeinsectors = r;
+ reply ((xdrproc_t) &xdr_guestfs_blockdev_getsz_ret, (char *) &ret);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_blockdev_getsz_args, (char *) &args);
+}
+
+static void blockdev_getsize64_stub (XDR *xdr_in)
+{
+ int64_t r;
+ struct guestfs_blockdev_getsize64_args args;
+ char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_blockdev_getsize64_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_getsize64");
+ return;
+ }
+ device = args.device;
+
+ r = do_blockdev_getsize64 (device);
+ if (r == -1)
+ /* do_blockdev_getsize64 has already called reply_with_error */
+ goto done;
+
+ struct guestfs_blockdev_getsize64_ret ret;
+ ret.sizeinbytes = r;
+ reply ((xdrproc_t) &xdr_guestfs_blockdev_getsize64_ret, (char *) &ret);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_blockdev_getsize64_args, (char *) &args);
+}
+
+static void blockdev_flushbufs_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_blockdev_flushbufs_args args;
+ char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_blockdev_flushbufs_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_flushbufs");
+ return;
+ }
+ device = args.device;
+
+ r = do_blockdev_flushbufs (device);
+ if (r == -1)
+ /* do_blockdev_flushbufs has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_blockdev_flushbufs_args, (char *) &args);
+}
+
+static void blockdev_rereadpt_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_blockdev_rereadpt_args args;
+ char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_blockdev_rereadpt_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_rereadpt");
+ return;
+ }
+ device = args.device;
+
+ r = do_blockdev_rereadpt (device);
+ if (r == -1)
+ /* do_blockdev_rereadpt has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_blockdev_rereadpt_args, (char *) &args);
+}
+
+static void upload_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_upload_args args;
+ 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;
+ 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;
+ char *csumtype;
+ 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;
+ 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;
+ 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;
+ 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;
+ 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;
+ char *device;
+ 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;
+ char *options;
+ char *device;
+ 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;
+ char *options;
+ char *vfstype;
+ char *device;
+ 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;
+ 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;
+ 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;
+ 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;
+ 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;
+ char *device;
+ 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;
+ 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;
+ char *device;
+ 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;
+ 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;
+ char *fstype;
+ 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);
+}
+
+static void zero_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_zero_args args;
+ 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;
+ char *root;
+ 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);
+}
+
+static void cp_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_cp_args args;
+ char *src;
+ char *dest;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_cp_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "cp");
+ return;
+ }
+ src = args.src;
+ dest = args.dest;
+
+ r = do_cp (src, dest);
+ if (r == -1)
+ /* do_cp has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_cp_args, (char *) &args);
+}
+
+static void cp_a_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_cp_a_args args;
+ char *src;
+ char *dest;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_cp_a_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "cp_a");
+ return;
+ }
+ src = args.src;
+ dest = args.dest;
+
+ r = do_cp_a (src, dest);
+ if (r == -1)
+ /* do_cp_a has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_cp_a_args, (char *) &args);
+}
+
+static void mv_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_mv_args args;
+ char *src;
+ char *dest;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_mv_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "mv");
+ return;
+ }
+ src = args.src;
+ dest = args.dest;
+
+ r = do_mv (src, dest);
+ if (r == -1)
+ /* do_mv has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_mv_args, (char *) &args);
+}
+
+static void drop_caches_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_drop_caches_args args;
+ int whattodrop;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_drop_caches_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "drop_caches");
+ return;
+ }
+ whattodrop = args.whattodrop;
+
+ r = do_drop_caches (whattodrop);
+ if (r == -1)
+ /* do_drop_caches has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_drop_caches_args, (char *) &args);
+}
+
+static void dmesg_stub (XDR *xdr_in)
+{
+ char *r;
+
+ r = do_dmesg ();
+ if (r == NULL)
+ /* do_dmesg has already called reply_with_error */
+ goto done;
+
+ struct guestfs_dmesg_ret ret;
+ ret.kmsgs = r;
+ reply ((xdrproc_t) &xdr_guestfs_dmesg_ret, (char *) &ret);
+ free (r);
+done: ;
+}
+
+static void ping_daemon_stub (XDR *xdr_in)
+{
+ int r;
+
+ r = do_ping_daemon ();
+ if (r == -1)
+ /* do_ping_daemon has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done: ;
+}
+
+static void equal_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_equal_args args;
+ char *file1;
+ char *file2;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_equal_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "equal");
+ return;
+ }
+ file1 = args.file1;
+ file2 = args.file2;
+
+ r = do_equal (file1, file2);
+ if (r == -1)
+ /* do_equal has already called reply_with_error */
+ goto done;
+
+ struct guestfs_equal_ret ret;
+ ret.equality = r;
+ reply ((xdrproc_t) &xdr_guestfs_equal_ret, (char *) &ret);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_equal_args, (char *) &args);
+}
+
+static void strings_stub (XDR *xdr_in)
+{
+ char **r;
+ struct guestfs_strings_args args;
+ char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_strings_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "strings");
+ return;
+ }
+ path = args.path;
+
+ r = do_strings (path);
+ if (r == NULL)
+ /* do_strings has already called reply_with_error */
+ goto done;
+
+ struct guestfs_strings_ret ret;
+ ret.stringsout.stringsout_len = count_strings (r);
+ ret.stringsout.stringsout_val = r;
+ reply ((xdrproc_t) &xdr_guestfs_strings_ret, (char *) &ret);
+ free_strings (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_strings_args, (char *) &args);
+}
+
+static void strings_e_stub (XDR *xdr_in)
+{
+ char **r;
+ struct guestfs_strings_e_args args;
+ char *encoding;
+ char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_strings_e_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "strings_e");
+ return;
+ }
+ encoding = args.encoding;
+ path = args.path;
+
+ r = do_strings_e (encoding, path);
+ if (r == NULL)
+ /* do_strings_e has already called reply_with_error */
+ goto done;
+
+ struct guestfs_strings_e_ret ret;
+ ret.stringsout.stringsout_len = count_strings (r);
+ ret.stringsout.stringsout_val = r;
+ reply ((xdrproc_t) &xdr_guestfs_strings_e_ret, (char *) &ret);
+ free_strings (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_strings_e_args, (char *) &args);
+}
+
+static void hexdump_stub (XDR *xdr_in)
+{
+ char *r;
+ struct guestfs_hexdump_args args;
+ char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_hexdump_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "hexdump");
+ return;
+ }
+ path = args.path;
+
+ r = do_hexdump (path);
+ if (r == NULL)
+ /* do_hexdump has already called reply_with_error */
+ goto done;
+
+ struct guestfs_hexdump_ret ret;
+ ret.dump = r;
+ reply ((xdrproc_t) &xdr_guestfs_hexdump_ret, (char *) &ret);
+ free (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_hexdump_args, (char *) &args);
+}
+
+static void zerofree_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_zerofree_args args;
+ char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_zerofree_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "zerofree");