int r;
struct guestfs_sfdisk_N_args args;
char *device;
- int n;
+ int partnum;
int cyls;
int heads;
int sectors;
return;
}
device = args.device;
- n = args.n;
+ partnum = args.partnum;
cyls = args.cyls;
heads = args.heads;
sectors = args.sectors;
line = args.line;
- r = do_sfdisk_N (device, n, cyls, heads, sectors, line);
+ r = do_sfdisk_N (device, partnum, cyls, heads, sectors, line);
if (r == -1)
/* do_sfdisk_N has already called reply_with_error */
goto done;
xdr_free ((xdrproc_t) xdr_guestfs_ntfs_3g_probe_args, (char *) &args);
}
+static void sh_stub (XDR *xdr_in)
+{
+ char *r;
+ struct guestfs_sh_args args;
+ char *command;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_sh_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "sh");
+ return;
+ }
+ command = args.command;
+
+ r = do_sh (command);
+ if (r == NULL)
+ /* do_sh has already called reply_with_error */
+ goto done;
+
+ struct guestfs_sh_ret ret;
+ ret.output = r;
+ reply ((xdrproc_t) &xdr_guestfs_sh_ret, (char *) &ret);
+ free (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_sh_args, (char *) &args);
+}
+
+static void sh_lines_stub (XDR *xdr_in)
+{
+ char **r;
+ struct guestfs_sh_lines_args args;
+ char *command;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_sh_lines_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "sh_lines");
+ return;
+ }
+ command = args.command;
+
+ r = do_sh_lines (command);
+ if (r == NULL)
+ /* do_sh_lines has already called reply_with_error */
+ goto done;
+
+ struct guestfs_sh_lines_ret ret;
+ ret.lines.lines_len = count_strings (r);
+ ret.lines.lines_val = r;
+ reply ((xdrproc_t) &xdr_guestfs_sh_lines_ret, (char *) &ret);
+ free_strings (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_sh_lines_args, (char *) &args);
+}
+
+static void glob_expand_stub (XDR *xdr_in)
+{
+ char **r;
+ struct guestfs_glob_expand_args args;
+ char *pattern;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_glob_expand_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "glob_expand");
+ return;
+ }
+ pattern = args.pattern;
+
+ r = do_glob_expand (pattern);
+ if (r == NULL)
+ /* do_glob_expand has already called reply_with_error */
+ goto done;
+
+ struct guestfs_glob_expand_ret ret;
+ ret.paths.paths_len = count_strings (r);
+ ret.paths.paths_val = r;
+ reply ((xdrproc_t) &xdr_guestfs_glob_expand_ret, (char *) &ret);
+ free_strings (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_glob_expand_args, (char *) &args);
+}
+
+static void scrub_device_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_scrub_device_args args;
+ char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_scrub_device_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "scrub_device");
+ return;
+ }
+ device = args.device;
+
+ r = do_scrub_device (device);
+ if (r == -1)
+ /* do_scrub_device has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_scrub_device_args, (char *) &args);
+}
+
+static void scrub_file_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_scrub_file_args args;
+ char *file;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_scrub_file_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "scrub_file");
+ return;
+ }
+ file = args.file;
+
+ r = do_scrub_file (file);
+ if (r == -1)
+ /* do_scrub_file has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_scrub_file_args, (char *) &args);
+}
+
+static void scrub_freespace_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_scrub_freespace_args args;
+ char *dir;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_scrub_freespace_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "scrub_freespace");
+ return;
+ }
+ dir = args.dir;
+
+ r = do_scrub_freespace (dir);
+ if (r == -1)
+ /* do_scrub_freespace has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_scrub_freespace_args, (char *) &args);
+}
+
+static void mkdtemp_stub (XDR *xdr_in)
+{
+ char *r;
+ struct guestfs_mkdtemp_args args;
+ char *template;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_mkdtemp_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "mkdtemp");
+ return;
+ }
+ template = args.template;
+
+ r = do_mkdtemp (template);
+ if (r == NULL)
+ /* do_mkdtemp has already called reply_with_error */
+ goto done;
+
+ struct guestfs_mkdtemp_ret ret;
+ ret.dir = r;
+ reply ((xdrproc_t) &xdr_guestfs_mkdtemp_ret, (char *) &ret);
+ free (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_mkdtemp_args, (char *) &args);
+}
+
+static void wc_l_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_wc_l_args args;
+ char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_wc_l_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "wc_l");
+ return;
+ }
+ path = args.path;
+
+ r = do_wc_l (path);
+ if (r == -1)
+ /* do_wc_l has already called reply_with_error */
+ goto done;
+
+ struct guestfs_wc_l_ret ret;
+ ret.lines = r;
+ reply ((xdrproc_t) &xdr_guestfs_wc_l_ret, (char *) &ret);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_wc_l_args, (char *) &args);
+}
+
+static void wc_w_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_wc_w_args args;
+ char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_wc_w_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "wc_w");
+ return;
+ }
+ path = args.path;
+
+ r = do_wc_w (path);
+ if (r == -1)
+ /* do_wc_w has already called reply_with_error */
+ goto done;
+
+ struct guestfs_wc_w_ret ret;
+ ret.words = r;
+ reply ((xdrproc_t) &xdr_guestfs_wc_w_ret, (char *) &ret);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_wc_w_args, (char *) &args);
+}
+
+static void wc_c_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_wc_c_args args;
+ char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_wc_c_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "wc_c");
+ return;
+ }
+ path = args.path;
+
+ r = do_wc_c (path);
+ if (r == -1)
+ /* do_wc_c has already called reply_with_error */
+ goto done;
+
+ struct guestfs_wc_c_ret ret;
+ ret.chars = r;
+ reply ((xdrproc_t) &xdr_guestfs_wc_c_ret, (char *) &ret);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_wc_c_args, (char *) &args);
+}
+
+static void head_stub (XDR *xdr_in)
+{
+ char **r;
+ struct guestfs_head_args args;
+ char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_head_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "head");
+ return;
+ }
+ path = args.path;
+
+ r = do_head (path);
+ if (r == NULL)
+ /* do_head has already called reply_with_error */
+ goto done;
+
+ struct guestfs_head_ret ret;
+ ret.lines.lines_len = count_strings (r);
+ ret.lines.lines_val = r;
+ reply ((xdrproc_t) &xdr_guestfs_head_ret, (char *) &ret);
+ free_strings (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_head_args, (char *) &args);
+}
+
+static void head_n_stub (XDR *xdr_in)
+{
+ char **r;
+ struct guestfs_head_n_args args;
+ int nrlines;
+ char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_head_n_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "head_n");
+ return;
+ }
+ nrlines = args.nrlines;
+ path = args.path;
+
+ r = do_head_n (nrlines, path);
+ if (r == NULL)
+ /* do_head_n has already called reply_with_error */
+ goto done;
+
+ struct guestfs_head_n_ret ret;
+ ret.lines.lines_len = count_strings (r);
+ ret.lines.lines_val = r;
+ reply ((xdrproc_t) &xdr_guestfs_head_n_ret, (char *) &ret);
+ free_strings (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_head_n_args, (char *) &args);
+}
+
+static void tail_stub (XDR *xdr_in)
+{
+ char **r;
+ struct guestfs_tail_args args;
+ char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_tail_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "tail");
+ return;
+ }
+ path = args.path;
+
+ r = do_tail (path);
+ if (r == NULL)
+ /* do_tail has already called reply_with_error */
+ goto done;
+
+ struct guestfs_tail_ret ret;
+ ret.lines.lines_len = count_strings (r);
+ ret.lines.lines_val = r;
+ reply ((xdrproc_t) &xdr_guestfs_tail_ret, (char *) &ret);
+ free_strings (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_tail_args, (char *) &args);
+}
+
+static void tail_n_stub (XDR *xdr_in)
+{
+ char **r;
+ struct guestfs_tail_n_args args;
+ int nrlines;
+ char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_tail_n_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "tail_n");
+ return;
+ }
+ nrlines = args.nrlines;
+ path = args.path;
+
+ r = do_tail_n (nrlines, path);
+ if (r == NULL)
+ /* do_tail_n has already called reply_with_error */
+ goto done;
+
+ struct guestfs_tail_n_ret ret;
+ ret.lines.lines_len = count_strings (r);
+ ret.lines.lines_val = r;
+ reply ((xdrproc_t) &xdr_guestfs_tail_n_ret, (char *) &ret);
+ free_strings (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_tail_n_args, (char *) &args);
+}
+
+static void df_stub (XDR *xdr_in)
+{
+ char *r;
+
+ r = do_df ();
+ if (r == NULL)
+ /* do_df has already called reply_with_error */
+ goto done;
+
+ struct guestfs_df_ret ret;
+ ret.output = r;
+ reply ((xdrproc_t) &xdr_guestfs_df_ret, (char *) &ret);
+ free (r);
+done: ;
+}
+
+static void df_h_stub (XDR *xdr_in)
+{
+ char *r;
+
+ r = do_df_h ();
+ if (r == NULL)
+ /* do_df_h has already called reply_with_error */
+ goto done;
+
+ struct guestfs_df_h_ret ret;
+ ret.output = r;
+ reply ((xdrproc_t) &xdr_guestfs_df_h_ret, (char *) &ret);
+ free (r);
+done: ;
+}
+
+static void du_stub (XDR *xdr_in)
+{
+ int64_t r;
+ struct guestfs_du_args args;
+ char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_du_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "du");
+ return;
+ }
+ path = args.path;
+
+ r = do_du (path);
+ if (r == -1)
+ /* do_du has already called reply_with_error */
+ goto done;
+
+ struct guestfs_du_ret ret;
+ ret.sizekb = r;
+ reply ((xdrproc_t) &xdr_guestfs_du_ret, (char *) &ret);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_du_args, (char *) &args);
+}
+
+static void initrd_list_stub (XDR *xdr_in)
+{
+ char **r;
+ struct guestfs_initrd_list_args args;
+ char *path;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_initrd_list_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "initrd_list");
+ return;
+ }
+ path = args.path;
+
+ r = do_initrd_list (path);
+ if (r == NULL)
+ /* do_initrd_list has already called reply_with_error */
+ goto done;
+
+ struct guestfs_initrd_list_ret ret;
+ ret.filenames.filenames_len = count_strings (r);
+ ret.filenames.filenames_val = r;
+ reply ((xdrproc_t) &xdr_guestfs_initrd_list_ret, (char *) &ret);
+ free_strings (r);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_initrd_list_args, (char *) &args);
+}
+
+static void mount_loop_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_mount_loop_args args;
+ char *file;
+ char *mountpoint;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_mount_loop_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "mount_loop");
+ return;
+ }
+ file = args.file;
+ mountpoint = args.mountpoint;
+
+ r = do_mount_loop (file, mountpoint);
+ if (r == -1)
+ /* do_mount_loop has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_mount_loop_args, (char *) &args);
+}
+
+static void mkswap_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_mkswap_args args;
+ char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_mkswap_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "mkswap");
+ return;
+ }
+ device = args.device;
+
+ r = do_mkswap (device);
+ if (r == -1)
+ /* do_mkswap has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_mkswap_args, (char *) &args);
+}
+
+static void mkswap_L_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_mkswap_L_args args;
+ char *label;
+ char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_mkswap_L_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "mkswap_L");
+ return;
+ }
+ label = args.label;
+ device = args.device;
+
+ r = do_mkswap_L (label, device);
+ if (r == -1)
+ /* do_mkswap_L has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_mkswap_L_args, (char *) &args);
+}
+
+static void mkswap_U_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_mkswap_U_args args;
+ char *uuid;
+ char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_mkswap_U_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "mkswap_U");
+ return;
+ }
+ uuid = args.uuid;
+ device = args.device;
+
+ r = do_mkswap_U (uuid, device);
+ if (r == -1)
+ /* do_mkswap_U has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_mkswap_U_args, (char *) &args);
+}
+
void dispatch_incoming_message (XDR *xdr_in)
{
switch (proc_nr) {
case GUESTFS_PROC_NTFS_3G_PROBE:
ntfs_3g_probe_stub (xdr_in);
break;
+ case GUESTFS_PROC_SH:
+ sh_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_SH_LINES:
+ sh_lines_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_GLOB_EXPAND:
+ glob_expand_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_SCRUB_DEVICE:
+ scrub_device_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_SCRUB_FILE:
+ scrub_file_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_SCRUB_FREESPACE:
+ scrub_freespace_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_MKDTEMP:
+ mkdtemp_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_WC_L:
+ wc_l_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_WC_W:
+ wc_w_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_WC_C:
+ wc_c_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_HEAD:
+ head_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_HEAD_N:
+ head_n_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_TAIL:
+ tail_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_TAIL_N:
+ tail_n_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_DF:
+ df_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_DF_H:
+ df_h_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_DU:
+ du_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_INITRD_LIST:
+ initrd_list_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_MOUNT_LOOP:
+ mount_loop_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_MKSWAP:
+ mkswap_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_MKSWAP_L:
+ mkswap_L_stub (xdr_in);
+ break;
+ case GUESTFS_PROC_MKSWAP_U:
+ mkswap_U_stub (xdr_in);
+ break;
default:
- reply_with_error ("dispatch_incoming_message: unknown procedure number %d", proc_nr);
+ reply_with_error ("dispatch_incoming_message: unknown procedure number %d, set LIBGUESTFS_PATH to point to the matching libguestfs appliance directory", proc_nr);
}
}