1 /* libguestfs generated file
2 * WARNING: THIS FILE IS GENERATED BY 'src/generator.ml'.
3 * ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
5 * Copyright (C) 2009 Red Hat Inc.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 #include <rpc/types.h>
33 #include "../src/guestfs_protocol.h"
36 static void mount_stub (XDR *xdr_in)
39 struct guestfs_mount_args args;
41 const char *mountpoint;
43 memset (&args, 0, sizeof args);
45 if (!xdr_guestfs_mount_args (xdr_in, &args)) {
46 reply_with_error ("%s: daemon failed to decode procedure arguments", "mount");
50 mountpoint = args.mountpoint;
52 r = do_mount (device, mountpoint);
54 /* do_mount has already called reply_with_error */
59 xdr_free ((xdrproc_t) xdr_guestfs_mount_args, (char *) &args);
62 static void sync_stub (XDR *xdr_in)
68 /* do_sync has already called reply_with_error */
75 static void touch_stub (XDR *xdr_in)
78 struct guestfs_touch_args args;
81 memset (&args, 0, sizeof args);
83 if (!xdr_guestfs_touch_args (xdr_in, &args)) {
84 reply_with_error ("%s: daemon failed to decode procedure arguments", "touch");
91 /* do_touch has already called reply_with_error */
96 xdr_free ((xdrproc_t) xdr_guestfs_touch_args, (char *) &args);
99 static void cat_stub (XDR *xdr_in)
102 struct guestfs_cat_args args;
105 memset (&args, 0, sizeof args);
107 if (!xdr_guestfs_cat_args (xdr_in, &args)) {
108 reply_with_error ("%s: daemon failed to decode procedure arguments", "cat");
115 /* do_cat has already called reply_with_error */
118 struct guestfs_cat_ret ret;
120 reply ((xdrproc_t) &xdr_guestfs_cat_ret, (char *) &ret);
123 xdr_free ((xdrproc_t) xdr_guestfs_cat_args, (char *) &args);
126 static void ll_stub (XDR *xdr_in)
129 struct guestfs_ll_args args;
130 const char *directory;
132 memset (&args, 0, sizeof args);
134 if (!xdr_guestfs_ll_args (xdr_in, &args)) {
135 reply_with_error ("%s: daemon failed to decode procedure arguments", "ll");
138 directory = args.directory;
140 r = do_ll (directory);
142 /* do_ll has already called reply_with_error */
145 struct guestfs_ll_ret ret;
147 reply ((xdrproc_t) &xdr_guestfs_ll_ret, (char *) &ret);
150 xdr_free ((xdrproc_t) xdr_guestfs_ll_args, (char *) &args);
153 static void ls_stub (XDR *xdr_in)
156 struct guestfs_ls_args args;
157 const char *directory;
159 memset (&args, 0, sizeof args);
161 if (!xdr_guestfs_ls_args (xdr_in, &args)) {
162 reply_with_error ("%s: daemon failed to decode procedure arguments", "ls");
165 directory = args.directory;
167 r = do_ls (directory);
169 /* do_ls has already called reply_with_error */
172 struct guestfs_ls_ret ret;
173 ret.listing.listing_len = count_strings (r);
174 ret.listing.listing_val = r;
175 reply ((xdrproc_t) &xdr_guestfs_ls_ret, (char *) &ret);
178 xdr_free ((xdrproc_t) xdr_guestfs_ls_args, (char *) &args);
181 static void list_devices_stub (XDR *xdr_in)
185 r = do_list_devices ();
187 /* do_list_devices has already called reply_with_error */
190 struct guestfs_list_devices_ret ret;
191 ret.devices.devices_len = count_strings (r);
192 ret.devices.devices_val = r;
193 reply ((xdrproc_t) &xdr_guestfs_list_devices_ret, (char *) &ret);
198 static void list_partitions_stub (XDR *xdr_in)
202 r = do_list_partitions ();
204 /* do_list_partitions has already called reply_with_error */
207 struct guestfs_list_partitions_ret ret;
208 ret.partitions.partitions_len = count_strings (r);
209 ret.partitions.partitions_val = r;
210 reply ((xdrproc_t) &xdr_guestfs_list_partitions_ret, (char *) &ret);
215 static void pvs_stub (XDR *xdr_in)
221 /* do_pvs has already called reply_with_error */
224 struct guestfs_pvs_ret ret;
225 ret.physvols.physvols_len = count_strings (r);
226 ret.physvols.physvols_val = r;
227 reply ((xdrproc_t) &xdr_guestfs_pvs_ret, (char *) &ret);
232 static void vgs_stub (XDR *xdr_in)
238 /* do_vgs has already called reply_with_error */
241 struct guestfs_vgs_ret ret;
242 ret.volgroups.volgroups_len = count_strings (r);
243 ret.volgroups.volgroups_val = r;
244 reply ((xdrproc_t) &xdr_guestfs_vgs_ret, (char *) &ret);
249 static void lvs_stub (XDR *xdr_in)
255 /* do_lvs has already called reply_with_error */
258 struct guestfs_lvs_ret ret;
259 ret.logvols.logvols_len = count_strings (r);
260 ret.logvols.logvols_val = r;
261 reply ((xdrproc_t) &xdr_guestfs_lvs_ret, (char *) &ret);
266 static void pvs_full_stub (XDR *xdr_in)
268 guestfs_lvm_int_pv_list *r;
272 /* do_pvs_full has already called reply_with_error */
275 struct guestfs_pvs_full_ret ret;
277 reply ((xdrproc_t) xdr_guestfs_pvs_full_ret, (char *) &ret);
278 xdr_free ((xdrproc_t) xdr_guestfs_pvs_full_ret, (char *) &ret);
282 static void vgs_full_stub (XDR *xdr_in)
284 guestfs_lvm_int_vg_list *r;
288 /* do_vgs_full has already called reply_with_error */
291 struct guestfs_vgs_full_ret ret;
293 reply ((xdrproc_t) xdr_guestfs_vgs_full_ret, (char *) &ret);
294 xdr_free ((xdrproc_t) xdr_guestfs_vgs_full_ret, (char *) &ret);
298 static void lvs_full_stub (XDR *xdr_in)
300 guestfs_lvm_int_lv_list *r;
304 /* do_lvs_full has already called reply_with_error */
307 struct guestfs_lvs_full_ret ret;
309 reply ((xdrproc_t) xdr_guestfs_lvs_full_ret, (char *) &ret);
310 xdr_free ((xdrproc_t) xdr_guestfs_lvs_full_ret, (char *) &ret);
314 static void read_lines_stub (XDR *xdr_in)
317 struct guestfs_read_lines_args args;
320 memset (&args, 0, sizeof args);
322 if (!xdr_guestfs_read_lines_args (xdr_in, &args)) {
323 reply_with_error ("%s: daemon failed to decode procedure arguments", "read_lines");
328 r = do_read_lines (path);
330 /* do_read_lines has already called reply_with_error */
333 struct guestfs_read_lines_ret ret;
334 ret.lines.lines_len = count_strings (r);
335 ret.lines.lines_val = r;
336 reply ((xdrproc_t) &xdr_guestfs_read_lines_ret, (char *) &ret);
339 xdr_free ((xdrproc_t) xdr_guestfs_read_lines_args, (char *) &args);
342 static void aug_init_stub (XDR *xdr_in)
345 struct guestfs_aug_init_args args;
349 memset (&args, 0, sizeof args);
351 if (!xdr_guestfs_aug_init_args (xdr_in, &args)) {
352 reply_with_error ("%s: daemon failed to decode procedure arguments", "aug_init");
358 r = do_aug_init (root, flags);
360 /* do_aug_init has already called reply_with_error */
365 xdr_free ((xdrproc_t) xdr_guestfs_aug_init_args, (char *) &args);
368 static void aug_close_stub (XDR *xdr_in)
374 /* do_aug_close has already called reply_with_error */
381 static void aug_defvar_stub (XDR *xdr_in)
384 struct guestfs_aug_defvar_args args;
388 memset (&args, 0, sizeof args);
390 if (!xdr_guestfs_aug_defvar_args (xdr_in, &args)) {
391 reply_with_error ("%s: daemon failed to decode procedure arguments", "aug_defvar");
395 expr = args.expr ? *args.expr : NULL;
397 r = do_aug_defvar (name, expr);
399 /* do_aug_defvar has already called reply_with_error */
402 struct guestfs_aug_defvar_ret ret;
404 reply ((xdrproc_t) &xdr_guestfs_aug_defvar_ret, (char *) &ret);
406 xdr_free ((xdrproc_t) xdr_guestfs_aug_defvar_args, (char *) &args);
409 static void aug_defnode_stub (XDR *xdr_in)
411 guestfs_aug_defnode_ret *r;
412 struct guestfs_aug_defnode_args args;
417 memset (&args, 0, sizeof args);
419 if (!xdr_guestfs_aug_defnode_args (xdr_in, &args)) {
420 reply_with_error ("%s: daemon failed to decode procedure arguments", "aug_defnode");
427 r = do_aug_defnode (name, expr, val);
429 /* do_aug_defnode has already called reply_with_error */
432 reply ((xdrproc_t) xdr_guestfs_aug_defnode_ret, (char *) r);
433 xdr_free ((xdrproc_t) xdr_guestfs_aug_defnode_ret, (char *) r);
435 xdr_free ((xdrproc_t) xdr_guestfs_aug_defnode_args, (char *) &args);
438 static void aug_get_stub (XDR *xdr_in)
441 struct guestfs_aug_get_args args;
444 memset (&args, 0, sizeof args);
446 if (!xdr_guestfs_aug_get_args (xdr_in, &args)) {
447 reply_with_error ("%s: daemon failed to decode procedure arguments", "aug_get");
452 r = do_aug_get (path);
454 /* do_aug_get has already called reply_with_error */
457 struct guestfs_aug_get_ret ret;
459 reply ((xdrproc_t) &xdr_guestfs_aug_get_ret, (char *) &ret);
462 xdr_free ((xdrproc_t) xdr_guestfs_aug_get_args, (char *) &args);
465 static void aug_set_stub (XDR *xdr_in)
468 struct guestfs_aug_set_args args;
472 memset (&args, 0, sizeof args);
474 if (!xdr_guestfs_aug_set_args (xdr_in, &args)) {
475 reply_with_error ("%s: daemon failed to decode procedure arguments", "aug_set");
481 r = do_aug_set (path, val);
483 /* do_aug_set has already called reply_with_error */
488 xdr_free ((xdrproc_t) xdr_guestfs_aug_set_args, (char *) &args);
491 static void aug_insert_stub (XDR *xdr_in)
494 struct guestfs_aug_insert_args args;
499 memset (&args, 0, sizeof args);
501 if (!xdr_guestfs_aug_insert_args (xdr_in, &args)) {
502 reply_with_error ("%s: daemon failed to decode procedure arguments", "aug_insert");
507 before = args.before;
509 r = do_aug_insert (path, label, before);
511 /* do_aug_insert has already called reply_with_error */
516 xdr_free ((xdrproc_t) xdr_guestfs_aug_insert_args, (char *) &args);
519 static void aug_rm_stub (XDR *xdr_in)
522 struct guestfs_aug_rm_args args;
525 memset (&args, 0, sizeof args);
527 if (!xdr_guestfs_aug_rm_args (xdr_in, &args)) {
528 reply_with_error ("%s: daemon failed to decode procedure arguments", "aug_rm");
533 r = do_aug_rm (path);
535 /* do_aug_rm has already called reply_with_error */
538 struct guestfs_aug_rm_ret ret;
540 reply ((xdrproc_t) &xdr_guestfs_aug_rm_ret, (char *) &ret);
542 xdr_free ((xdrproc_t) xdr_guestfs_aug_rm_args, (char *) &args);
545 static void aug_mv_stub (XDR *xdr_in)
548 struct guestfs_aug_mv_args args;
552 memset (&args, 0, sizeof args);
554 if (!xdr_guestfs_aug_mv_args (xdr_in, &args)) {
555 reply_with_error ("%s: daemon failed to decode procedure arguments", "aug_mv");
561 r = do_aug_mv (src, dest);
563 /* do_aug_mv has already called reply_with_error */
568 xdr_free ((xdrproc_t) xdr_guestfs_aug_mv_args, (char *) &args);
571 static void aug_match_stub (XDR *xdr_in)
574 struct guestfs_aug_match_args args;
577 memset (&args, 0, sizeof args);
579 if (!xdr_guestfs_aug_match_args (xdr_in, &args)) {
580 reply_with_error ("%s: daemon failed to decode procedure arguments", "aug_match");
585 r = do_aug_match (path);
587 /* do_aug_match has already called reply_with_error */
590 struct guestfs_aug_match_ret ret;
591 ret.matches.matches_len = count_strings (r);
592 ret.matches.matches_val = r;
593 reply ((xdrproc_t) &xdr_guestfs_aug_match_ret, (char *) &ret);
596 xdr_free ((xdrproc_t) xdr_guestfs_aug_match_args, (char *) &args);
599 static void aug_save_stub (XDR *xdr_in)
605 /* do_aug_save has already called reply_with_error */
612 static void aug_load_stub (XDR *xdr_in)
618 /* do_aug_load has already called reply_with_error */
625 static void aug_ls_stub (XDR *xdr_in)
628 struct guestfs_aug_ls_args args;
631 memset (&args, 0, sizeof args);
633 if (!xdr_guestfs_aug_ls_args (xdr_in, &args)) {
634 reply_with_error ("%s: daemon failed to decode procedure arguments", "aug_ls");
639 r = do_aug_ls (path);
641 /* do_aug_ls has already called reply_with_error */
644 struct guestfs_aug_ls_ret ret;
645 ret.matches.matches_len = count_strings (r);
646 ret.matches.matches_val = r;
647 reply ((xdrproc_t) &xdr_guestfs_aug_ls_ret, (char *) &ret);
650 xdr_free ((xdrproc_t) xdr_guestfs_aug_ls_args, (char *) &args);
653 static void rm_stub (XDR *xdr_in)
656 struct guestfs_rm_args args;
659 memset (&args, 0, sizeof args);
661 if (!xdr_guestfs_rm_args (xdr_in, &args)) {
662 reply_with_error ("%s: daemon failed to decode procedure arguments", "rm");
669 /* do_rm has already called reply_with_error */
674 xdr_free ((xdrproc_t) xdr_guestfs_rm_args, (char *) &args);
677 static void rmdir_stub (XDR *xdr_in)
680 struct guestfs_rmdir_args args;
683 memset (&args, 0, sizeof args);
685 if (!xdr_guestfs_rmdir_args (xdr_in, &args)) {
686 reply_with_error ("%s: daemon failed to decode procedure arguments", "rmdir");
693 /* do_rmdir has already called reply_with_error */
698 xdr_free ((xdrproc_t) xdr_guestfs_rmdir_args, (char *) &args);
701 static void rm_rf_stub (XDR *xdr_in)
704 struct guestfs_rm_rf_args args;
707 memset (&args, 0, sizeof args);
709 if (!xdr_guestfs_rm_rf_args (xdr_in, &args)) {
710 reply_with_error ("%s: daemon failed to decode procedure arguments", "rm_rf");
717 /* do_rm_rf has already called reply_with_error */
722 xdr_free ((xdrproc_t) xdr_guestfs_rm_rf_args, (char *) &args);
725 static void mkdir_stub (XDR *xdr_in)
728 struct guestfs_mkdir_args args;
731 memset (&args, 0, sizeof args);
733 if (!xdr_guestfs_mkdir_args (xdr_in, &args)) {
734 reply_with_error ("%s: daemon failed to decode procedure arguments", "mkdir");
741 /* do_mkdir has already called reply_with_error */
746 xdr_free ((xdrproc_t) xdr_guestfs_mkdir_args, (char *) &args);
749 static void mkdir_p_stub (XDR *xdr_in)
752 struct guestfs_mkdir_p_args args;
755 memset (&args, 0, sizeof args);
757 if (!xdr_guestfs_mkdir_p_args (xdr_in, &args)) {
758 reply_with_error ("%s: daemon failed to decode procedure arguments", "mkdir_p");
763 r = do_mkdir_p (path);
765 /* do_mkdir_p has already called reply_with_error */
770 xdr_free ((xdrproc_t) xdr_guestfs_mkdir_p_args, (char *) &args);
773 static void chmod_stub (XDR *xdr_in)
776 struct guestfs_chmod_args args;
780 memset (&args, 0, sizeof args);
782 if (!xdr_guestfs_chmod_args (xdr_in, &args)) {
783 reply_with_error ("%s: daemon failed to decode procedure arguments", "chmod");
789 r = do_chmod (mode, path);
791 /* do_chmod has already called reply_with_error */
796 xdr_free ((xdrproc_t) xdr_guestfs_chmod_args, (char *) &args);
799 static void chown_stub (XDR *xdr_in)
802 struct guestfs_chown_args args;
807 memset (&args, 0, sizeof args);
809 if (!xdr_guestfs_chown_args (xdr_in, &args)) {
810 reply_with_error ("%s: daemon failed to decode procedure arguments", "chown");
817 r = do_chown (owner, group, path);
819 /* do_chown has already called reply_with_error */
824 xdr_free ((xdrproc_t) xdr_guestfs_chown_args, (char *) &args);
827 static void exists_stub (XDR *xdr_in)
830 struct guestfs_exists_args args;
833 memset (&args, 0, sizeof args);
835 if (!xdr_guestfs_exists_args (xdr_in, &args)) {
836 reply_with_error ("%s: daemon failed to decode procedure arguments", "exists");
841 r = do_exists (path);
843 /* do_exists has already called reply_with_error */
846 struct guestfs_exists_ret ret;
848 reply ((xdrproc_t) &xdr_guestfs_exists_ret, (char *) &ret);
850 xdr_free ((xdrproc_t) xdr_guestfs_exists_args, (char *) &args);
853 static void is_file_stub (XDR *xdr_in)
856 struct guestfs_is_file_args args;
859 memset (&args, 0, sizeof args);
861 if (!xdr_guestfs_is_file_args (xdr_in, &args)) {
862 reply_with_error ("%s: daemon failed to decode procedure arguments", "is_file");
867 r = do_is_file (path);
869 /* do_is_file has already called reply_with_error */
872 struct guestfs_is_file_ret ret;
874 reply ((xdrproc_t) &xdr_guestfs_is_file_ret, (char *) &ret);
876 xdr_free ((xdrproc_t) xdr_guestfs_is_file_args, (char *) &args);
879 static void is_dir_stub (XDR *xdr_in)
882 struct guestfs_is_dir_args args;
885 memset (&args, 0, sizeof args);
887 if (!xdr_guestfs_is_dir_args (xdr_in, &args)) {
888 reply_with_error ("%s: daemon failed to decode procedure arguments", "is_dir");
893 r = do_is_dir (path);
895 /* do_is_dir has already called reply_with_error */
898 struct guestfs_is_dir_ret ret;
900 reply ((xdrproc_t) &xdr_guestfs_is_dir_ret, (char *) &ret);
902 xdr_free ((xdrproc_t) xdr_guestfs_is_dir_args, (char *) &args);
905 static void pvcreate_stub (XDR *xdr_in)
908 struct guestfs_pvcreate_args args;
911 memset (&args, 0, sizeof args);
913 if (!xdr_guestfs_pvcreate_args (xdr_in, &args)) {
914 reply_with_error ("%s: daemon failed to decode procedure arguments", "pvcreate");
917 device = args.device;
919 r = do_pvcreate (device);
921 /* do_pvcreate has already called reply_with_error */
926 xdr_free ((xdrproc_t) xdr_guestfs_pvcreate_args, (char *) &args);
929 static void vgcreate_stub (XDR *xdr_in)
932 struct guestfs_vgcreate_args args;
933 const char *volgroup;
936 memset (&args, 0, sizeof args);
938 if (!xdr_guestfs_vgcreate_args (xdr_in, &args)) {
939 reply_with_error ("%s: daemon failed to decode procedure arguments", "vgcreate");
942 volgroup = args.volgroup;
943 physvols = realloc (args.physvols.physvols_val,
944 sizeof (char *) * (args.physvols.physvols_len+1));
945 if (physvols == NULL) {
946 reply_with_perror ("realloc");
949 physvols[args.physvols.physvols_len] = NULL;
950 args.physvols.physvols_val = physvols;
952 r = do_vgcreate (volgroup, physvols);
954 /* do_vgcreate has already called reply_with_error */
959 xdr_free ((xdrproc_t) xdr_guestfs_vgcreate_args, (char *) &args);
962 static void lvcreate_stub (XDR *xdr_in)
965 struct guestfs_lvcreate_args args;
967 const char *volgroup;
970 memset (&args, 0, sizeof args);
972 if (!xdr_guestfs_lvcreate_args (xdr_in, &args)) {
973 reply_with_error ("%s: daemon failed to decode procedure arguments", "lvcreate");
976 logvol = args.logvol;
977 volgroup = args.volgroup;
978 mbytes = args.mbytes;
980 r = do_lvcreate (logvol, volgroup, mbytes);
982 /* do_lvcreate has already called reply_with_error */
987 xdr_free ((xdrproc_t) xdr_guestfs_lvcreate_args, (char *) &args);
990 static void mkfs_stub (XDR *xdr_in)
993 struct guestfs_mkfs_args args;
997 memset (&args, 0, sizeof args);
999 if (!xdr_guestfs_mkfs_args (xdr_in, &args)) {
1000 reply_with_error ("%s: daemon failed to decode procedure arguments", "mkfs");
1003 fstype = args.fstype;
1004 device = args.device;
1006 r = do_mkfs (fstype, device);
1008 /* do_mkfs has already called reply_with_error */
1013 xdr_free ((xdrproc_t) xdr_guestfs_mkfs_args, (char *) &args);
1016 static void sfdisk_stub (XDR *xdr_in)
1019 struct guestfs_sfdisk_args args;
1026 memset (&args, 0, sizeof args);
1028 if (!xdr_guestfs_sfdisk_args (xdr_in, &args)) {
1029 reply_with_error ("%s: daemon failed to decode procedure arguments", "sfdisk");
1032 device = args.device;
1035 sectors = args.sectors;
1036 lines = realloc (args.lines.lines_val,
1037 sizeof (char *) * (args.lines.lines_len+1));
1038 if (lines == NULL) {
1039 reply_with_perror ("realloc");
1042 lines[args.lines.lines_len] = NULL;
1043 args.lines.lines_val = lines;
1045 r = do_sfdisk (device, cyls, heads, sectors, lines);
1047 /* do_sfdisk has already called reply_with_error */
1052 xdr_free ((xdrproc_t) xdr_guestfs_sfdisk_args, (char *) &args);
1055 static void write_file_stub (XDR *xdr_in)
1058 struct guestfs_write_file_args args;
1060 const char *content;
1063 memset (&args, 0, sizeof args);
1065 if (!xdr_guestfs_write_file_args (xdr_in, &args)) {
1066 reply_with_error ("%s: daemon failed to decode procedure arguments", "write_file");
1070 content = args.content;
1073 r = do_write_file (path, content, size);
1075 /* do_write_file has already called reply_with_error */
1080 xdr_free ((xdrproc_t) xdr_guestfs_write_file_args, (char *) &args);
1083 static void umount_stub (XDR *xdr_in)
1086 struct guestfs_umount_args args;
1087 const char *pathordevice;
1089 memset (&args, 0, sizeof args);
1091 if (!xdr_guestfs_umount_args (xdr_in, &args)) {
1092 reply_with_error ("%s: daemon failed to decode procedure arguments", "umount");
1095 pathordevice = args.pathordevice;
1097 r = do_umount (pathordevice);
1099 /* do_umount has already called reply_with_error */
1104 xdr_free ((xdrproc_t) xdr_guestfs_umount_args, (char *) &args);
1107 static void mounts_stub (XDR *xdr_in)
1113 /* do_mounts has already called reply_with_error */
1116 struct guestfs_mounts_ret ret;
1117 ret.devices.devices_len = count_strings (r);
1118 ret.devices.devices_val = r;
1119 reply ((xdrproc_t) &xdr_guestfs_mounts_ret, (char *) &ret);
1124 static void umount_all_stub (XDR *xdr_in)
1128 r = do_umount_all ();
1130 /* do_umount_all has already called reply_with_error */
1137 static void lvm_remove_all_stub (XDR *xdr_in)
1141 r = do_lvm_remove_all ();
1143 /* do_lvm_remove_all has already called reply_with_error */
1150 static void file_stub (XDR *xdr_in)
1153 struct guestfs_file_args args;
1156 memset (&args, 0, sizeof args);
1158 if (!xdr_guestfs_file_args (xdr_in, &args)) {
1159 reply_with_error ("%s: daemon failed to decode procedure arguments", "file");
1166 /* do_file has already called reply_with_error */
1169 struct guestfs_file_ret ret;
1170 ret.description = r;
1171 reply ((xdrproc_t) &xdr_guestfs_file_ret, (char *) &ret);
1174 xdr_free ((xdrproc_t) xdr_guestfs_file_args, (char *) &args);
1177 static void command_stub (XDR *xdr_in)
1180 struct guestfs_command_args args;
1183 memset (&args, 0, sizeof args);
1185 if (!xdr_guestfs_command_args (xdr_in, &args)) {
1186 reply_with_error ("%s: daemon failed to decode procedure arguments", "command");
1189 arguments = realloc (args.arguments.arguments_val,
1190 sizeof (char *) * (args.arguments.arguments_len+1));
1191 if (arguments == NULL) {
1192 reply_with_perror ("realloc");
1195 arguments[args.arguments.arguments_len] = NULL;
1196 args.arguments.arguments_val = arguments;
1198 r = do_command (arguments);
1200 /* do_command has already called reply_with_error */
1203 struct guestfs_command_ret ret;
1205 reply ((xdrproc_t) &xdr_guestfs_command_ret, (char *) &ret);
1208 xdr_free ((xdrproc_t) xdr_guestfs_command_args, (char *) &args);
1211 static void command_lines_stub (XDR *xdr_in)
1214 struct guestfs_command_lines_args args;
1217 memset (&args, 0, sizeof args);
1219 if (!xdr_guestfs_command_lines_args (xdr_in, &args)) {
1220 reply_with_error ("%s: daemon failed to decode procedure arguments", "command_lines");
1223 arguments = realloc (args.arguments.arguments_val,
1224 sizeof (char *) * (args.arguments.arguments_len+1));
1225 if (arguments == NULL) {
1226 reply_with_perror ("realloc");
1229 arguments[args.arguments.arguments_len] = NULL;
1230 args.arguments.arguments_val = arguments;
1232 r = do_command_lines (arguments);
1234 /* do_command_lines has already called reply_with_error */
1237 struct guestfs_command_lines_ret ret;
1238 ret.lines.lines_len = count_strings (r);
1239 ret.lines.lines_val = r;
1240 reply ((xdrproc_t) &xdr_guestfs_command_lines_ret, (char *) &ret);
1243 xdr_free ((xdrproc_t) xdr_guestfs_command_lines_args, (char *) &args);
1246 static void stat_stub (XDR *xdr_in)
1248 guestfs_int_stat *r;
1249 struct guestfs_stat_args args;
1252 memset (&args, 0, sizeof args);
1254 if (!xdr_guestfs_stat_args (xdr_in, &args)) {
1255 reply_with_error ("%s: daemon failed to decode procedure arguments", "stat");
1262 /* do_stat has already called reply_with_error */
1265 struct guestfs_stat_ret ret;
1267 reply ((xdrproc_t) xdr_guestfs_stat_ret, (char *) &ret);
1268 xdr_free ((xdrproc_t) xdr_guestfs_stat_ret, (char *) &ret);
1270 xdr_free ((xdrproc_t) xdr_guestfs_stat_args, (char *) &args);
1273 static void lstat_stub (XDR *xdr_in)
1275 guestfs_int_stat *r;
1276 struct guestfs_lstat_args args;
1279 memset (&args, 0, sizeof args);
1281 if (!xdr_guestfs_lstat_args (xdr_in, &args)) {
1282 reply_with_error ("%s: daemon failed to decode procedure arguments", "lstat");
1287 r = do_lstat (path);
1289 /* do_lstat has already called reply_with_error */
1292 struct guestfs_lstat_ret ret;
1294 reply ((xdrproc_t) xdr_guestfs_lstat_ret, (char *) &ret);
1295 xdr_free ((xdrproc_t) xdr_guestfs_lstat_ret, (char *) &ret);
1297 xdr_free ((xdrproc_t) xdr_guestfs_lstat_args, (char *) &args);
1300 static void statvfs_stub (XDR *xdr_in)
1302 guestfs_int_statvfs *r;
1303 struct guestfs_statvfs_args args;
1306 memset (&args, 0, sizeof args);
1308 if (!xdr_guestfs_statvfs_args (xdr_in, &args)) {
1309 reply_with_error ("%s: daemon failed to decode procedure arguments", "statvfs");
1314 r = do_statvfs (path);
1316 /* do_statvfs has already called reply_with_error */
1319 struct guestfs_statvfs_ret ret;
1321 reply ((xdrproc_t) xdr_guestfs_statvfs_ret, (char *) &ret);
1322 xdr_free ((xdrproc_t) xdr_guestfs_statvfs_ret, (char *) &ret);
1324 xdr_free ((xdrproc_t) xdr_guestfs_statvfs_args, (char *) &args);
1327 static void tune2fs_l_stub (XDR *xdr_in)
1330 struct guestfs_tune2fs_l_args args;
1333 memset (&args, 0, sizeof args);
1335 if (!xdr_guestfs_tune2fs_l_args (xdr_in, &args)) {
1336 reply_with_error ("%s: daemon failed to decode procedure arguments", "tune2fs_l");
1339 device = args.device;
1341 r = do_tune2fs_l (device);
1343 /* do_tune2fs_l has already called reply_with_error */
1346 struct guestfs_tune2fs_l_ret ret;
1347 ret.superblock.superblock_len = count_strings (r);
1348 ret.superblock.superblock_val = r;
1349 reply ((xdrproc_t) &xdr_guestfs_tune2fs_l_ret, (char *) &ret);
1352 xdr_free ((xdrproc_t) xdr_guestfs_tune2fs_l_args, (char *) &args);
1355 static void blockdev_setro_stub (XDR *xdr_in)
1358 struct guestfs_blockdev_setro_args args;
1361 memset (&args, 0, sizeof args);
1363 if (!xdr_guestfs_blockdev_setro_args (xdr_in, &args)) {
1364 reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_setro");
1367 device = args.device;
1369 r = do_blockdev_setro (device);
1371 /* do_blockdev_setro has already called reply_with_error */
1376 xdr_free ((xdrproc_t) xdr_guestfs_blockdev_setro_args, (char *) &args);
1379 static void blockdev_setrw_stub (XDR *xdr_in)
1382 struct guestfs_blockdev_setrw_args args;
1385 memset (&args, 0, sizeof args);
1387 if (!xdr_guestfs_blockdev_setrw_args (xdr_in, &args)) {
1388 reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_setrw");
1391 device = args.device;
1393 r = do_blockdev_setrw (device);
1395 /* do_blockdev_setrw has already called reply_with_error */
1400 xdr_free ((xdrproc_t) xdr_guestfs_blockdev_setrw_args, (char *) &args);
1403 static void blockdev_getro_stub (XDR *xdr_in)
1406 struct guestfs_blockdev_getro_args args;
1409 memset (&args, 0, sizeof args);
1411 if (!xdr_guestfs_blockdev_getro_args (xdr_in, &args)) {
1412 reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_getro");
1415 device = args.device;
1417 r = do_blockdev_getro (device);
1419 /* do_blockdev_getro has already called reply_with_error */
1422 struct guestfs_blockdev_getro_ret ret;
1424 reply ((xdrproc_t) &xdr_guestfs_blockdev_getro_ret, (char *) &ret);
1426 xdr_free ((xdrproc_t) xdr_guestfs_blockdev_getro_args, (char *) &args);
1429 static void blockdev_getss_stub (XDR *xdr_in)
1432 struct guestfs_blockdev_getss_args args;
1435 memset (&args, 0, sizeof args);
1437 if (!xdr_guestfs_blockdev_getss_args (xdr_in, &args)) {
1438 reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_getss");
1441 device = args.device;
1443 r = do_blockdev_getss (device);
1445 /* do_blockdev_getss has already called reply_with_error */
1448 struct guestfs_blockdev_getss_ret ret;
1450 reply ((xdrproc_t) &xdr_guestfs_blockdev_getss_ret, (char *) &ret);
1452 xdr_free ((xdrproc_t) xdr_guestfs_blockdev_getss_args, (char *) &args);
1455 static void blockdev_getbsz_stub (XDR *xdr_in)
1458 struct guestfs_blockdev_getbsz_args args;
1461 memset (&args, 0, sizeof args);
1463 if (!xdr_guestfs_blockdev_getbsz_args (xdr_in, &args)) {
1464 reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_getbsz");
1467 device = args.device;
1469 r = do_blockdev_getbsz (device);
1471 /* do_blockdev_getbsz has already called reply_with_error */
1474 struct guestfs_blockdev_getbsz_ret ret;
1476 reply ((xdrproc_t) &xdr_guestfs_blockdev_getbsz_ret, (char *) &ret);
1478 xdr_free ((xdrproc_t) xdr_guestfs_blockdev_getbsz_args, (char *) &args);
1481 static void blockdev_setbsz_stub (XDR *xdr_in)
1484 struct guestfs_blockdev_setbsz_args args;
1488 memset (&args, 0, sizeof args);
1490 if (!xdr_guestfs_blockdev_setbsz_args (xdr_in, &args)) {
1491 reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_setbsz");
1494 device = args.device;
1495 blocksize = args.blocksize;
1497 r = do_blockdev_setbsz (device, blocksize);
1499 /* do_blockdev_setbsz has already called reply_with_error */
1504 xdr_free ((xdrproc_t) xdr_guestfs_blockdev_setbsz_args, (char *) &args);
1507 static void blockdev_getsz_stub (XDR *xdr_in)
1510 struct guestfs_blockdev_getsz_args args;
1513 memset (&args, 0, sizeof args);
1515 if (!xdr_guestfs_blockdev_getsz_args (xdr_in, &args)) {
1516 reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_getsz");
1519 device = args.device;
1521 r = do_blockdev_getsz (device);
1523 /* do_blockdev_getsz has already called reply_with_error */
1526 struct guestfs_blockdev_getsz_ret ret;
1527 ret.sizeinsectors = r;
1528 reply ((xdrproc_t) &xdr_guestfs_blockdev_getsz_ret, (char *) &ret);
1530 xdr_free ((xdrproc_t) xdr_guestfs_blockdev_getsz_args, (char *) &args);
1533 static void blockdev_getsize64_stub (XDR *xdr_in)
1536 struct guestfs_blockdev_getsize64_args args;
1539 memset (&args, 0, sizeof args);
1541 if (!xdr_guestfs_blockdev_getsize64_args (xdr_in, &args)) {
1542 reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_getsize64");
1545 device = args.device;
1547 r = do_blockdev_getsize64 (device);
1549 /* do_blockdev_getsize64 has already called reply_with_error */
1552 struct guestfs_blockdev_getsize64_ret ret;
1553 ret.sizeinbytes = r;
1554 reply ((xdrproc_t) &xdr_guestfs_blockdev_getsize64_ret, (char *) &ret);
1556 xdr_free ((xdrproc_t) xdr_guestfs_blockdev_getsize64_args, (char *) &args);
1559 static void blockdev_flushbufs_stub (XDR *xdr_in)
1562 struct guestfs_blockdev_flushbufs_args args;
1565 memset (&args, 0, sizeof args);
1567 if (!xdr_guestfs_blockdev_flushbufs_args (xdr_in, &args)) {
1568 reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_flushbufs");
1571 device = args.device;
1573 r = do_blockdev_flushbufs (device);
1575 /* do_blockdev_flushbufs has already called reply_with_error */
1580 xdr_free ((xdrproc_t) xdr_guestfs_blockdev_flushbufs_args, (char *) &args);
1583 static void blockdev_rereadpt_stub (XDR *xdr_in)
1586 struct guestfs_blockdev_rereadpt_args args;
1589 memset (&args, 0, sizeof args);
1591 if (!xdr_guestfs_blockdev_rereadpt_args (xdr_in, &args)) {
1592 reply_with_error ("%s: daemon failed to decode procedure arguments", "blockdev_rereadpt");
1595 device = args.device;
1597 r = do_blockdev_rereadpt (device);
1599 /* do_blockdev_rereadpt has already called reply_with_error */
1604 xdr_free ((xdrproc_t) xdr_guestfs_blockdev_rereadpt_args, (char *) &args);
1607 static void upload_stub (XDR *xdr_in)
1610 struct guestfs_upload_args args;
1611 const char *remotefilename;
1613 memset (&args, 0, sizeof args);
1615 if (!xdr_guestfs_upload_args (xdr_in, &args)) {
1616 reply_with_error ("%s: daemon failed to decode procedure arguments", "upload");
1619 remotefilename = args.remotefilename;
1621 r = do_upload (remotefilename);
1623 /* do_upload has already called reply_with_error */
1628 xdr_free ((xdrproc_t) xdr_guestfs_upload_args, (char *) &args);
1631 static void download_stub (XDR *xdr_in)
1634 struct guestfs_download_args args;
1635 const char *remotefilename;
1637 memset (&args, 0, sizeof args);
1639 if (!xdr_guestfs_download_args (xdr_in, &args)) {
1640 reply_with_error ("%s: daemon failed to decode procedure arguments", "download");
1643 remotefilename = args.remotefilename;
1645 r = do_download (remotefilename);
1647 /* do_download has already called reply_with_error */
1650 /* do_download has already sent a reply */
1652 xdr_free ((xdrproc_t) xdr_guestfs_download_args, (char *) &args);
1655 static void checksum_stub (XDR *xdr_in)
1658 struct guestfs_checksum_args args;
1659 const char *csumtype;
1662 memset (&args, 0, sizeof args);
1664 if (!xdr_guestfs_checksum_args (xdr_in, &args)) {
1665 reply_with_error ("%s: daemon failed to decode procedure arguments", "checksum");
1668 csumtype = args.csumtype;
1671 r = do_checksum (csumtype, path);
1673 /* do_checksum has already called reply_with_error */
1676 struct guestfs_checksum_ret ret;
1678 reply ((xdrproc_t) &xdr_guestfs_checksum_ret, (char *) &ret);
1681 xdr_free ((xdrproc_t) xdr_guestfs_checksum_args, (char *) &args);
1684 static void tar_in_stub (XDR *xdr_in)
1687 struct guestfs_tar_in_args args;
1688 const char *directory;
1690 memset (&args, 0, sizeof args);
1692 if (!xdr_guestfs_tar_in_args (xdr_in, &args)) {
1693 reply_with_error ("%s: daemon failed to decode procedure arguments", "tar_in");
1696 directory = args.directory;
1698 r = do_tar_in (directory);
1700 /* do_tar_in has already called reply_with_error */
1705 xdr_free ((xdrproc_t) xdr_guestfs_tar_in_args, (char *) &args);
1708 static void tar_out_stub (XDR *xdr_in)
1711 struct guestfs_tar_out_args args;
1712 const char *directory;
1714 memset (&args, 0, sizeof args);
1716 if (!xdr_guestfs_tar_out_args (xdr_in, &args)) {
1717 reply_with_error ("%s: daemon failed to decode procedure arguments", "tar_out");
1720 directory = args.directory;
1722 r = do_tar_out (directory);
1724 /* do_tar_out has already called reply_with_error */
1727 /* do_tar_out has already sent a reply */
1729 xdr_free ((xdrproc_t) xdr_guestfs_tar_out_args, (char *) &args);
1732 static void tgz_in_stub (XDR *xdr_in)
1735 struct guestfs_tgz_in_args args;
1736 const char *directory;
1738 memset (&args, 0, sizeof args);
1740 if (!xdr_guestfs_tgz_in_args (xdr_in, &args)) {
1741 reply_with_error ("%s: daemon failed to decode procedure arguments", "tgz_in");
1744 directory = args.directory;
1746 r = do_tgz_in (directory);
1748 /* do_tgz_in has already called reply_with_error */
1753 xdr_free ((xdrproc_t) xdr_guestfs_tgz_in_args, (char *) &args);
1756 static void tgz_out_stub (XDR *xdr_in)
1759 struct guestfs_tgz_out_args args;
1760 const char *directory;
1762 memset (&args, 0, sizeof args);
1764 if (!xdr_guestfs_tgz_out_args (xdr_in, &args)) {
1765 reply_with_error ("%s: daemon failed to decode procedure arguments", "tgz_out");
1768 directory = args.directory;
1770 r = do_tgz_out (directory);
1772 /* do_tgz_out has already called reply_with_error */
1775 /* do_tgz_out has already sent a reply */
1777 xdr_free ((xdrproc_t) xdr_guestfs_tgz_out_args, (char *) &args);
1780 static void mount_ro_stub (XDR *xdr_in)
1783 struct guestfs_mount_ro_args args;
1785 const char *mountpoint;
1787 memset (&args, 0, sizeof args);
1789 if (!xdr_guestfs_mount_ro_args (xdr_in, &args)) {
1790 reply_with_error ("%s: daemon failed to decode procedure arguments", "mount_ro");
1793 device = args.device;
1794 mountpoint = args.mountpoint;
1796 r = do_mount_ro (device, mountpoint);
1798 /* do_mount_ro has already called reply_with_error */
1803 xdr_free ((xdrproc_t) xdr_guestfs_mount_ro_args, (char *) &args);
1806 static void mount_options_stub (XDR *xdr_in)
1809 struct guestfs_mount_options_args args;
1810 const char *options;
1812 const char *mountpoint;
1814 memset (&args, 0, sizeof args);
1816 if (!xdr_guestfs_mount_options_args (xdr_in, &args)) {
1817 reply_with_error ("%s: daemon failed to decode procedure arguments", "mount_options");
1820 options = args.options;
1821 device = args.device;
1822 mountpoint = args.mountpoint;
1824 r = do_mount_options (options, device, mountpoint);
1826 /* do_mount_options has already called reply_with_error */
1831 xdr_free ((xdrproc_t) xdr_guestfs_mount_options_args, (char *) &args);
1834 static void mount_vfs_stub (XDR *xdr_in)
1837 struct guestfs_mount_vfs_args args;
1838 const char *options;
1839 const char *vfstype;
1841 const char *mountpoint;
1843 memset (&args, 0, sizeof args);
1845 if (!xdr_guestfs_mount_vfs_args (xdr_in, &args)) {
1846 reply_with_error ("%s: daemon failed to decode procedure arguments", "mount_vfs");
1849 options = args.options;
1850 vfstype = args.vfstype;
1851 device = args.device;
1852 mountpoint = args.mountpoint;
1854 r = do_mount_vfs (options, vfstype, device, mountpoint);
1856 /* do_mount_vfs has already called reply_with_error */
1861 xdr_free ((xdrproc_t) xdr_guestfs_mount_vfs_args, (char *) &args);
1864 static void debug_stub (XDR *xdr_in)
1867 struct guestfs_debug_args args;
1871 memset (&args, 0, sizeof args);
1873 if (!xdr_guestfs_debug_args (xdr_in, &args)) {
1874 reply_with_error ("%s: daemon failed to decode procedure arguments", "debug");
1877 subcmd = args.subcmd;
1878 extraargs = realloc (args.extraargs.extraargs_val,
1879 sizeof (char *) * (args.extraargs.extraargs_len+1));
1880 if (extraargs == NULL) {
1881 reply_with_perror ("realloc");
1884 extraargs[args.extraargs.extraargs_len] = NULL;
1885 args.extraargs.extraargs_val = extraargs;
1887 r = do_debug (subcmd, extraargs);
1889 /* do_debug has already called reply_with_error */
1892 struct guestfs_debug_ret ret;
1894 reply ((xdrproc_t) &xdr_guestfs_debug_ret, (char *) &ret);
1897 xdr_free ((xdrproc_t) xdr_guestfs_debug_args, (char *) &args);
1900 static void lvremove_stub (XDR *xdr_in)
1903 struct guestfs_lvremove_args args;
1906 memset (&args, 0, sizeof args);
1908 if (!xdr_guestfs_lvremove_args (xdr_in, &args)) {
1909 reply_with_error ("%s: daemon failed to decode procedure arguments", "lvremove");
1912 device = args.device;
1914 r = do_lvremove (device);
1916 /* do_lvremove has already called reply_with_error */
1921 xdr_free ((xdrproc_t) xdr_guestfs_lvremove_args, (char *) &args);
1924 static void vgremove_stub (XDR *xdr_in)
1927 struct guestfs_vgremove_args args;
1930 memset (&args, 0, sizeof args);
1932 if (!xdr_guestfs_vgremove_args (xdr_in, &args)) {
1933 reply_with_error ("%s: daemon failed to decode procedure arguments", "vgremove");
1936 vgname = args.vgname;
1938 r = do_vgremove (vgname);
1940 /* do_vgremove has already called reply_with_error */
1945 xdr_free ((xdrproc_t) xdr_guestfs_vgremove_args, (char *) &args);
1948 static void pvremove_stub (XDR *xdr_in)
1951 struct guestfs_pvremove_args args;
1954 memset (&args, 0, sizeof args);
1956 if (!xdr_guestfs_pvremove_args (xdr_in, &args)) {
1957 reply_with_error ("%s: daemon failed to decode procedure arguments", "pvremove");
1960 device = args.device;
1962 r = do_pvremove (device);
1964 /* do_pvremove has already called reply_with_error */
1969 xdr_free ((xdrproc_t) xdr_guestfs_pvremove_args, (char *) &args);
1972 static void set_e2label_stub (XDR *xdr_in)
1975 struct guestfs_set_e2label_args args;
1979 memset (&args, 0, sizeof args);
1981 if (!xdr_guestfs_set_e2label_args (xdr_in, &args)) {
1982 reply_with_error ("%s: daemon failed to decode procedure arguments", "set_e2label");
1985 device = args.device;
1988 r = do_set_e2label (device, label);
1990 /* do_set_e2label has already called reply_with_error */
1995 xdr_free ((xdrproc_t) xdr_guestfs_set_e2label_args, (char *) &args);
1998 static void get_e2label_stub (XDR *xdr_in)
2001 struct guestfs_get_e2label_args args;
2004 memset (&args, 0, sizeof args);
2006 if (!xdr_guestfs_get_e2label_args (xdr_in, &args)) {
2007 reply_with_error ("%s: daemon failed to decode procedure arguments", "get_e2label");
2010 device = args.device;
2012 r = do_get_e2label (device);
2014 /* do_get_e2label has already called reply_with_error */
2017 struct guestfs_get_e2label_ret ret;
2019 reply ((xdrproc_t) &xdr_guestfs_get_e2label_ret, (char *) &ret);
2022 xdr_free ((xdrproc_t) xdr_guestfs_get_e2label_args, (char *) &args);
2025 static void set_e2uuid_stub (XDR *xdr_in)
2028 struct guestfs_set_e2uuid_args args;
2032 memset (&args, 0, sizeof args);
2034 if (!xdr_guestfs_set_e2uuid_args (xdr_in, &args)) {
2035 reply_with_error ("%s: daemon failed to decode procedure arguments", "set_e2uuid");
2038 device = args.device;
2041 r = do_set_e2uuid (device, uuid);
2043 /* do_set_e2uuid has already called reply_with_error */
2048 xdr_free ((xdrproc_t) xdr_guestfs_set_e2uuid_args, (char *) &args);
2051 static void get_e2uuid_stub (XDR *xdr_in)
2054 struct guestfs_get_e2uuid_args args;
2057 memset (&args, 0, sizeof args);
2059 if (!xdr_guestfs_get_e2uuid_args (xdr_in, &args)) {
2060 reply_with_error ("%s: daemon failed to decode procedure arguments", "get_e2uuid");
2063 device = args.device;
2065 r = do_get_e2uuid (device);
2067 /* do_get_e2uuid has already called reply_with_error */
2070 struct guestfs_get_e2uuid_ret ret;
2072 reply ((xdrproc_t) &xdr_guestfs_get_e2uuid_ret, (char *) &ret);
2075 xdr_free ((xdrproc_t) xdr_guestfs_get_e2uuid_args, (char *) &args);
2078 static void fsck_stub (XDR *xdr_in)
2081 struct guestfs_fsck_args args;
2085 memset (&args, 0, sizeof args);
2087 if (!xdr_guestfs_fsck_args (xdr_in, &args)) {
2088 reply_with_error ("%s: daemon failed to decode procedure arguments", "fsck");
2091 fstype = args.fstype;
2092 device = args.device;
2094 r = do_fsck (fstype, device);
2096 /* do_fsck has already called reply_with_error */
2099 struct guestfs_fsck_ret ret;
2101 reply ((xdrproc_t) &xdr_guestfs_fsck_ret, (char *) &ret);
2103 xdr_free ((xdrproc_t) xdr_guestfs_fsck_args, (char *) &args);
2106 static void zero_stub (XDR *xdr_in)
2109 struct guestfs_zero_args args;
2112 memset (&args, 0, sizeof args);
2114 if (!xdr_guestfs_zero_args (xdr_in, &args)) {
2115 reply_with_error ("%s: daemon failed to decode procedure arguments", "zero");
2118 device = args.device;
2120 r = do_zero (device);
2122 /* do_zero has already called reply_with_error */
2127 xdr_free ((xdrproc_t) xdr_guestfs_zero_args, (char *) &args);
2130 static void grub_install_stub (XDR *xdr_in)
2133 struct guestfs_grub_install_args args;
2137 memset (&args, 0, sizeof args);
2139 if (!xdr_guestfs_grub_install_args (xdr_in, &args)) {
2140 reply_with_error ("%s: daemon failed to decode procedure arguments", "grub_install");
2144 device = args.device;
2146 r = do_grub_install (root, device);
2148 /* do_grub_install has already called reply_with_error */
2153 xdr_free ((xdrproc_t) xdr_guestfs_grub_install_args, (char *) &args);
2156 static void cp_stub (XDR *xdr_in)
2159 struct guestfs_cp_args args;
2163 memset (&args, 0, sizeof args);
2165 if (!xdr_guestfs_cp_args (xdr_in, &args)) {
2166 reply_with_error ("%s: daemon failed to decode procedure arguments", "cp");
2172 r = do_cp (src, dest);
2174 /* do_cp has already called reply_with_error */
2179 xdr_free ((xdrproc_t) xdr_guestfs_cp_args, (char *) &args);
2182 static void cp_a_stub (XDR *xdr_in)
2185 struct guestfs_cp_a_args args;
2189 memset (&args, 0, sizeof args);
2191 if (!xdr_guestfs_cp_a_args (xdr_in, &args)) {
2192 reply_with_error ("%s: daemon failed to decode procedure arguments", "cp_a");
2198 r = do_cp_a (src, dest);
2200 /* do_cp_a has already called reply_with_error */
2205 xdr_free ((xdrproc_t) xdr_guestfs_cp_a_args, (char *) &args);
2208 static void mv_stub (XDR *xdr_in)
2211 struct guestfs_mv_args args;
2215 memset (&args, 0, sizeof args);
2217 if (!xdr_guestfs_mv_args (xdr_in, &args)) {
2218 reply_with_error ("%s: daemon failed to decode procedure arguments", "mv");
2224 r = do_mv (src, dest);
2226 /* do_mv has already called reply_with_error */
2231 xdr_free ((xdrproc_t) xdr_guestfs_mv_args, (char *) &args);
2234 static void drop_caches_stub (XDR *xdr_in)
2237 struct guestfs_drop_caches_args args;
2240 memset (&args, 0, sizeof args);
2242 if (!xdr_guestfs_drop_caches_args (xdr_in, &args)) {
2243 reply_with_error ("%s: daemon failed to decode procedure arguments", "drop_caches");
2246 whattodrop = args.whattodrop;
2248 r = do_drop_caches (whattodrop);
2250 /* do_drop_caches has already called reply_with_error */
2255 xdr_free ((xdrproc_t) xdr_guestfs_drop_caches_args, (char *) &args);
2258 static void dmesg_stub (XDR *xdr_in)
2264 /* do_dmesg has already called reply_with_error */
2267 struct guestfs_dmesg_ret ret;
2269 reply ((xdrproc_t) &xdr_guestfs_dmesg_ret, (char *) &ret);
2274 static void ping_daemon_stub (XDR *xdr_in)
2278 r = do_ping_daemon ();
2280 /* do_ping_daemon has already called reply_with_error */
2287 static void equal_stub (XDR *xdr_in)
2290 struct guestfs_equal_args args;
2294 memset (&args, 0, sizeof args);
2296 if (!xdr_guestfs_equal_args (xdr_in, &args)) {
2297 reply_with_error ("%s: daemon failed to decode procedure arguments", "equal");
2303 r = do_equal (file1, file2);
2305 /* do_equal has already called reply_with_error */
2308 struct guestfs_equal_ret ret;
2310 reply ((xdrproc_t) &xdr_guestfs_equal_ret, (char *) &ret);
2312 xdr_free ((xdrproc_t) xdr_guestfs_equal_args, (char *) &args);
2315 static void strings_stub (XDR *xdr_in)
2318 struct guestfs_strings_args args;
2321 memset (&args, 0, sizeof args);
2323 if (!xdr_guestfs_strings_args (xdr_in, &args)) {
2324 reply_with_error ("%s: daemon failed to decode procedure arguments", "strings");
2329 r = do_strings (path);
2331 /* do_strings has already called reply_with_error */
2334 struct guestfs_strings_ret ret;
2335 ret.stringsout.stringsout_len = count_strings (r);
2336 ret.stringsout.stringsout_val = r;
2337 reply ((xdrproc_t) &xdr_guestfs_strings_ret, (char *) &ret);
2340 xdr_free ((xdrproc_t) xdr_guestfs_strings_args, (char *) &args);
2343 static void strings_e_stub (XDR *xdr_in)
2346 struct guestfs_strings_e_args args;
2347 const char *encoding;
2350 memset (&args, 0, sizeof args);
2352 if (!xdr_guestfs_strings_e_args (xdr_in, &args)) {
2353 reply_with_error ("%s: daemon failed to decode procedure arguments", "strings_e");
2356 encoding = args.encoding;
2359 r = do_strings_e (encoding, path);
2361 /* do_strings_e has already called reply_with_error */
2364 struct guestfs_strings_e_ret ret;
2365 ret.stringsout.stringsout_len = count_strings (r);
2366 ret.stringsout.stringsout_val = r;
2367 reply ((xdrproc_t) &xdr_guestfs_strings_e_ret, (char *) &ret);
2370 xdr_free ((xdrproc_t) xdr_guestfs_strings_e_args, (char *) &args);
2373 static void hexdump_stub (XDR *xdr_in)
2376 struct guestfs_hexdump_args args;
2379 memset (&args, 0, sizeof args);
2381 if (!xdr_guestfs_hexdump_args (xdr_in, &args)) {
2382 reply_with_error ("%s: daemon failed to decode procedure arguments", "hexdump");
2387 r = do_hexdump (path);
2389 /* do_hexdump has already called reply_with_error */
2392 struct guestfs_hexdump_ret ret;
2394 reply ((xdrproc_t) &xdr_guestfs_hexdump_ret, (char *) &ret);
2397 xdr_free ((xdrproc_t) xdr_guestfs_hexdump_args, (char *) &args);
2400 static void zerofree_stub (XDR *xdr_in)
2403 struct guestfs_zerofree_args args;
2406 memset (&args, 0, sizeof args);
2408 if (!xdr_guestfs_zerofree_args (xdr_in, &args)) {
2409 reply_with_error ("%s: daemon failed to decode procedure arguments", "zerofree");
2412 device = args.device;
2414 r = do_zerofree (device);
2416 /* do_zerofree has already called reply_with_error */
2421 xdr_free ((xdrproc_t) xdr_guestfs_zerofree_args, (char *) &args);
2424 static void pvresize_stub (XDR *xdr_in)
2427 struct guestfs_pvresize_args args;
2430 memset (&args, 0, sizeof args);
2432 if (!xdr_guestfs_pvresize_args (xdr_in, &args)) {
2433 reply_with_error ("%s: daemon failed to decode procedure arguments", "pvresize");
2436 device = args.device;
2438 r = do_pvresize (device);
2440 /* do_pvresize has already called reply_with_error */
2445 xdr_free ((xdrproc_t) xdr_guestfs_pvresize_args, (char *) &args);
2448 static void sfdisk_N_stub (XDR *xdr_in)
2451 struct guestfs_sfdisk_N_args args;
2459 memset (&args, 0, sizeof args);
2461 if (!xdr_guestfs_sfdisk_N_args (xdr_in, &args)) {
2462 reply_with_error ("%s: daemon failed to decode procedure arguments", "sfdisk_N");
2465 device = args.device;
2469 sectors = args.sectors;
2472 r = do_sfdisk_N (device, n, cyls, heads, sectors, line);
2474 /* do_sfdisk_N has already called reply_with_error */
2479 xdr_free ((xdrproc_t) xdr_guestfs_sfdisk_N_args, (char *) &args);
2482 static void sfdisk_l_stub (XDR *xdr_in)
2485 struct guestfs_sfdisk_l_args args;
2488 memset (&args, 0, sizeof args);
2490 if (!xdr_guestfs_sfdisk_l_args (xdr_in, &args)) {
2491 reply_with_error ("%s: daemon failed to decode procedure arguments", "sfdisk_l");
2494 device = args.device;
2496 r = do_sfdisk_l (device);
2498 /* do_sfdisk_l has already called reply_with_error */
2501 struct guestfs_sfdisk_l_ret ret;
2503 reply ((xdrproc_t) &xdr_guestfs_sfdisk_l_ret, (char *) &ret);
2506 xdr_free ((xdrproc_t) xdr_guestfs_sfdisk_l_args, (char *) &args);
2509 static void sfdisk_kernel_geometry_stub (XDR *xdr_in)
2512 struct guestfs_sfdisk_kernel_geometry_args args;
2515 memset (&args, 0, sizeof args);
2517 if (!xdr_guestfs_sfdisk_kernel_geometry_args (xdr_in, &args)) {
2518 reply_with_error ("%s: daemon failed to decode procedure arguments", "sfdisk_kernel_geometry");
2521 device = args.device;
2523 r = do_sfdisk_kernel_geometry (device);
2525 /* do_sfdisk_kernel_geometry has already called reply_with_error */
2528 struct guestfs_sfdisk_kernel_geometry_ret ret;
2530 reply ((xdrproc_t) &xdr_guestfs_sfdisk_kernel_geometry_ret, (char *) &ret);
2533 xdr_free ((xdrproc_t) xdr_guestfs_sfdisk_kernel_geometry_args, (char *) &args);
2536 static void sfdisk_disk_geometry_stub (XDR *xdr_in)
2539 struct guestfs_sfdisk_disk_geometry_args args;
2542 memset (&args, 0, sizeof args);
2544 if (!xdr_guestfs_sfdisk_disk_geometry_args (xdr_in, &args)) {
2545 reply_with_error ("%s: daemon failed to decode procedure arguments", "sfdisk_disk_geometry");
2548 device = args.device;
2550 r = do_sfdisk_disk_geometry (device);
2552 /* do_sfdisk_disk_geometry has already called reply_with_error */
2555 struct guestfs_sfdisk_disk_geometry_ret ret;
2557 reply ((xdrproc_t) &xdr_guestfs_sfdisk_disk_geometry_ret, (char *) &ret);
2560 xdr_free ((xdrproc_t) xdr_guestfs_sfdisk_disk_geometry_args, (char *) &args);
2563 static void vg_activate_all_stub (XDR *xdr_in)
2566 struct guestfs_vg_activate_all_args args;
2569 memset (&args, 0, sizeof args);
2571 if (!xdr_guestfs_vg_activate_all_args (xdr_in, &args)) {
2572 reply_with_error ("%s: daemon failed to decode procedure arguments", "vg_activate_all");
2575 activate = args.activate;
2577 r = do_vg_activate_all (activate);
2579 /* do_vg_activate_all has already called reply_with_error */
2584 xdr_free ((xdrproc_t) xdr_guestfs_vg_activate_all_args, (char *) &args);
2587 static void vg_activate_stub (XDR *xdr_in)
2590 struct guestfs_vg_activate_args args;
2594 memset (&args, 0, sizeof args);
2596 if (!xdr_guestfs_vg_activate_args (xdr_in, &args)) {
2597 reply_with_error ("%s: daemon failed to decode procedure arguments", "vg_activate");
2600 activate = args.activate;
2601 volgroups = realloc (args.volgroups.volgroups_val,
2602 sizeof (char *) * (args.volgroups.volgroups_len+1));
2603 if (volgroups == NULL) {
2604 reply_with_perror ("realloc");
2607 volgroups[args.volgroups.volgroups_len] = NULL;
2608 args.volgroups.volgroups_val = volgroups;
2610 r = do_vg_activate (activate, volgroups);
2612 /* do_vg_activate has already called reply_with_error */
2617 xdr_free ((xdrproc_t) xdr_guestfs_vg_activate_args, (char *) &args);
2620 static void lvresize_stub (XDR *xdr_in)
2623 struct guestfs_lvresize_args args;
2627 memset (&args, 0, sizeof args);
2629 if (!xdr_guestfs_lvresize_args (xdr_in, &args)) {
2630 reply_with_error ("%s: daemon failed to decode procedure arguments", "lvresize");
2633 device = args.device;
2634 mbytes = args.mbytes;
2636 r = do_lvresize (device, mbytes);
2638 /* do_lvresize has already called reply_with_error */
2643 xdr_free ((xdrproc_t) xdr_guestfs_lvresize_args, (char *) &args);
2646 static void resize2fs_stub (XDR *xdr_in)
2649 struct guestfs_resize2fs_args args;
2652 memset (&args, 0, sizeof args);
2654 if (!xdr_guestfs_resize2fs_args (xdr_in, &args)) {
2655 reply_with_error ("%s: daemon failed to decode procedure arguments", "resize2fs");
2658 device = args.device;
2660 r = do_resize2fs (device);
2662 /* do_resize2fs has already called reply_with_error */
2667 xdr_free ((xdrproc_t) xdr_guestfs_resize2fs_args, (char *) &args);
2670 static void find_stub (XDR *xdr_in)
2673 struct guestfs_find_args args;
2674 const char *directory;
2676 memset (&args, 0, sizeof args);
2678 if (!xdr_guestfs_find_args (xdr_in, &args)) {
2679 reply_with_error ("%s: daemon failed to decode procedure arguments", "find");
2682 directory = args.directory;
2684 r = do_find (directory);
2686 /* do_find has already called reply_with_error */
2689 struct guestfs_find_ret ret;
2690 ret.names.names_len = count_strings (r);
2691 ret.names.names_val = r;
2692 reply ((xdrproc_t) &xdr_guestfs_find_ret, (char *) &ret);
2695 xdr_free ((xdrproc_t) xdr_guestfs_find_args, (char *) &args);
2698 void dispatch_incoming_message (XDR *xdr_in)
2701 case GUESTFS_PROC_MOUNT:
2702 mount_stub (xdr_in);
2704 case GUESTFS_PROC_SYNC:
2707 case GUESTFS_PROC_TOUCH:
2708 touch_stub (xdr_in);
2710 case GUESTFS_PROC_CAT:
2713 case GUESTFS_PROC_LL:
2716 case GUESTFS_PROC_LS:
2719 case GUESTFS_PROC_LIST_DEVICES:
2720 list_devices_stub (xdr_in);
2722 case GUESTFS_PROC_LIST_PARTITIONS:
2723 list_partitions_stub (xdr_in);
2725 case GUESTFS_PROC_PVS:
2728 case GUESTFS_PROC_VGS:
2731 case GUESTFS_PROC_LVS:
2734 case GUESTFS_PROC_PVS_FULL:
2735 pvs_full_stub (xdr_in);
2737 case GUESTFS_PROC_VGS_FULL:
2738 vgs_full_stub (xdr_in);
2740 case GUESTFS_PROC_LVS_FULL:
2741 lvs_full_stub (xdr_in);
2743 case GUESTFS_PROC_READ_LINES:
2744 read_lines_stub (xdr_in);
2746 case GUESTFS_PROC_AUG_INIT:
2747 aug_init_stub (xdr_in);
2749 case GUESTFS_PROC_AUG_CLOSE:
2750 aug_close_stub (xdr_in);
2752 case GUESTFS_PROC_AUG_DEFVAR:
2753 aug_defvar_stub (xdr_in);
2755 case GUESTFS_PROC_AUG_DEFNODE:
2756 aug_defnode_stub (xdr_in);
2758 case GUESTFS_PROC_AUG_GET:
2759 aug_get_stub (xdr_in);
2761 case GUESTFS_PROC_AUG_SET:
2762 aug_set_stub (xdr_in);
2764 case GUESTFS_PROC_AUG_INSERT:
2765 aug_insert_stub (xdr_in);
2767 case GUESTFS_PROC_AUG_RM:
2768 aug_rm_stub (xdr_in);
2770 case GUESTFS_PROC_AUG_MV:
2771 aug_mv_stub (xdr_in);
2773 case GUESTFS_PROC_AUG_MATCH:
2774 aug_match_stub (xdr_in);
2776 case GUESTFS_PROC_AUG_SAVE:
2777 aug_save_stub (xdr_in);
2779 case GUESTFS_PROC_AUG_LOAD:
2780 aug_load_stub (xdr_in);
2782 case GUESTFS_PROC_AUG_LS:
2783 aug_ls_stub (xdr_in);
2785 case GUESTFS_PROC_RM:
2788 case GUESTFS_PROC_RMDIR:
2789 rmdir_stub (xdr_in);
2791 case GUESTFS_PROC_RM_RF:
2792 rm_rf_stub (xdr_in);
2794 case GUESTFS_PROC_MKDIR:
2795 mkdir_stub (xdr_in);
2797 case GUESTFS_PROC_MKDIR_P:
2798 mkdir_p_stub (xdr_in);
2800 case GUESTFS_PROC_CHMOD:
2801 chmod_stub (xdr_in);
2803 case GUESTFS_PROC_CHOWN:
2804 chown_stub (xdr_in);
2806 case GUESTFS_PROC_EXISTS:
2807 exists_stub (xdr_in);
2809 case GUESTFS_PROC_IS_FILE:
2810 is_file_stub (xdr_in);
2812 case GUESTFS_PROC_IS_DIR:
2813 is_dir_stub (xdr_in);
2815 case GUESTFS_PROC_PVCREATE:
2816 pvcreate_stub (xdr_in);
2818 case GUESTFS_PROC_VGCREATE:
2819 vgcreate_stub (xdr_in);
2821 case GUESTFS_PROC_LVCREATE:
2822 lvcreate_stub (xdr_in);
2824 case GUESTFS_PROC_MKFS:
2827 case GUESTFS_PROC_SFDISK:
2828 sfdisk_stub (xdr_in);
2830 case GUESTFS_PROC_WRITE_FILE:
2831 write_file_stub (xdr_in);
2833 case GUESTFS_PROC_UMOUNT:
2834 umount_stub (xdr_in);
2836 case GUESTFS_PROC_MOUNTS:
2837 mounts_stub (xdr_in);
2839 case GUESTFS_PROC_UMOUNT_ALL:
2840 umount_all_stub (xdr_in);
2842 case GUESTFS_PROC_LVM_REMOVE_ALL:
2843 lvm_remove_all_stub (xdr_in);
2845 case GUESTFS_PROC_FILE:
2848 case GUESTFS_PROC_COMMAND:
2849 command_stub (xdr_in);
2851 case GUESTFS_PROC_COMMAND_LINES:
2852 command_lines_stub (xdr_in);
2854 case GUESTFS_PROC_STAT:
2857 case GUESTFS_PROC_LSTAT:
2858 lstat_stub (xdr_in);
2860 case GUESTFS_PROC_STATVFS:
2861 statvfs_stub (xdr_in);
2863 case GUESTFS_PROC_TUNE2FS_L:
2864 tune2fs_l_stub (xdr_in);
2866 case GUESTFS_PROC_BLOCKDEV_SETRO:
2867 blockdev_setro_stub (xdr_in);
2869 case GUESTFS_PROC_BLOCKDEV_SETRW:
2870 blockdev_setrw_stub (xdr_in);
2872 case GUESTFS_PROC_BLOCKDEV_GETRO:
2873 blockdev_getro_stub (xdr_in);
2875 case GUESTFS_PROC_BLOCKDEV_GETSS:
2876 blockdev_getss_stub (xdr_in);
2878 case GUESTFS_PROC_BLOCKDEV_GETBSZ:
2879 blockdev_getbsz_stub (xdr_in);
2881 case GUESTFS_PROC_BLOCKDEV_SETBSZ:
2882 blockdev_setbsz_stub (xdr_in);
2884 case GUESTFS_PROC_BLOCKDEV_GETSZ:
2885 blockdev_getsz_stub (xdr_in);
2887 case GUESTFS_PROC_BLOCKDEV_GETSIZE64:
2888 blockdev_getsize64_stub (xdr_in);
2890 case GUESTFS_PROC_BLOCKDEV_FLUSHBUFS:
2891 blockdev_flushbufs_stub (xdr_in);
2893 case GUESTFS_PROC_BLOCKDEV_REREADPT:
2894 blockdev_rereadpt_stub (xdr_in);
2896 case GUESTFS_PROC_UPLOAD:
2897 upload_stub (xdr_in);
2899 case GUESTFS_PROC_DOWNLOAD:
2900 download_stub (xdr_in);
2902 case GUESTFS_PROC_CHECKSUM:
2903 checksum_stub (xdr_in);
2905 case GUESTFS_PROC_TAR_IN:
2906 tar_in_stub (xdr_in);
2908 case GUESTFS_PROC_TAR_OUT:
2909 tar_out_stub (xdr_in);
2911 case GUESTFS_PROC_TGZ_IN:
2912 tgz_in_stub (xdr_in);
2914 case GUESTFS_PROC_TGZ_OUT:
2915 tgz_out_stub (xdr_in);
2917 case GUESTFS_PROC_MOUNT_RO:
2918 mount_ro_stub (xdr_in);
2920 case GUESTFS_PROC_MOUNT_OPTIONS:
2921 mount_options_stub (xdr_in);
2923 case GUESTFS_PROC_MOUNT_VFS:
2924 mount_vfs_stub (xdr_in);
2926 case GUESTFS_PROC_DEBUG:
2927 debug_stub (xdr_in);
2929 case GUESTFS_PROC_LVREMOVE:
2930 lvremove_stub (xdr_in);
2932 case GUESTFS_PROC_VGREMOVE:
2933 vgremove_stub (xdr_in);
2935 case GUESTFS_PROC_PVREMOVE:
2936 pvremove_stub (xdr_in);
2938 case GUESTFS_PROC_SET_E2LABEL:
2939 set_e2label_stub (xdr_in);
2941 case GUESTFS_PROC_GET_E2LABEL:
2942 get_e2label_stub (xdr_in);
2944 case GUESTFS_PROC_SET_E2UUID:
2945 set_e2uuid_stub (xdr_in);
2947 case GUESTFS_PROC_GET_E2UUID:
2948 get_e2uuid_stub (xdr_in);
2950 case GUESTFS_PROC_FSCK:
2953 case GUESTFS_PROC_ZERO:
2956 case GUESTFS_PROC_GRUB_INSTALL:
2957 grub_install_stub (xdr_in);
2959 case GUESTFS_PROC_CP:
2962 case GUESTFS_PROC_CP_A:
2965 case GUESTFS_PROC_MV:
2968 case GUESTFS_PROC_DROP_CACHES:
2969 drop_caches_stub (xdr_in);
2971 case GUESTFS_PROC_DMESG:
2972 dmesg_stub (xdr_in);
2974 case GUESTFS_PROC_PING_DAEMON:
2975 ping_daemon_stub (xdr_in);
2977 case GUESTFS_PROC_EQUAL:
2978 equal_stub (xdr_in);
2980 case GUESTFS_PROC_STRINGS:
2981 strings_stub (xdr_in);
2983 case GUESTFS_PROC_STRINGS_E:
2984 strings_e_stub (xdr_in);
2986 case GUESTFS_PROC_HEXDUMP:
2987 hexdump_stub (xdr_in);
2989 case GUESTFS_PROC_ZEROFREE:
2990 zerofree_stub (xdr_in);
2992 case GUESTFS_PROC_PVRESIZE:
2993 pvresize_stub (xdr_in);
2995 case GUESTFS_PROC_SFDISK_N:
2996 sfdisk_N_stub (xdr_in);
2998 case GUESTFS_PROC_SFDISK_L:
2999 sfdisk_l_stub (xdr_in);
3001 case GUESTFS_PROC_SFDISK_KERNEL_GEOMETRY:
3002 sfdisk_kernel_geometry_stub (xdr_in);
3004 case GUESTFS_PROC_SFDISK_DISK_GEOMETRY:
3005 sfdisk_disk_geometry_stub (xdr_in);
3007 case GUESTFS_PROC_VG_ACTIVATE_ALL:
3008 vg_activate_all_stub (xdr_in);
3010 case GUESTFS_PROC_VG_ACTIVATE:
3011 vg_activate_stub (xdr_in);
3013 case GUESTFS_PROC_LVRESIZE:
3014 lvresize_stub (xdr_in);
3016 case GUESTFS_PROC_RESIZE2FS:
3017 resize2fs_stub (xdr_in);
3019 case GUESTFS_PROC_FIND:
3023 reply_with_error ("dispatch_incoming_message: unknown procedure number %d", proc_nr);
3027 static const char *lvm_pv_cols = "pv_name,pv_uuid,pv_fmt,pv_size,dev_size,pv_free,pv_used,pv_attr,pv_pe_count,pv_pe_alloc_count,pv_tags,pe_start,pv_mda_count,pv_mda_free";
3029 static int lvm_tokenize_pv (char *str, struct guestfs_lvm_int_pv *r)
3031 char *tok, *p, *next;
3035 fprintf (stderr, "%s: failed: passed a NULL string\n", __func__);
3038 if (!*str || isspace (*str)) {
3039 fprintf (stderr, "%s: failed: passed a empty string or one beginning with whitespace\n", __func__);
3044 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "pv_name");
3047 p = strchrnul (tok, ',');
3048 if (*p) next = p+1; else next = NULL;
3050 r->pv_name = strdup (tok);
3051 if (r->pv_name == NULL) {
3057 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "pv_uuid");
3060 p = strchrnul (tok, ',');
3061 if (*p) next = p+1; else next = NULL;
3063 for (i = j = 0; i < 32; ++j) {
3064 if (tok[j] == '\0') {
3065 fprintf (stderr, "%s: failed to parse UUID from '%s'\n", __func__, tok);
3067 } else if (tok[j] != '-')
3068 r->pv_uuid[i++] = tok[j];
3072 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "pv_fmt");
3075 p = strchrnul (tok, ',');
3076 if (*p) next = p+1; else next = NULL;
3078 r->pv_fmt = strdup (tok);
3079 if (r->pv_fmt == NULL) {
3085 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "pv_size");
3088 p = strchrnul (tok, ',');
3089 if (*p) next = p+1; else next = NULL;
3091 if (sscanf (tok, "%"SCNu64, &r->pv_size) != 1) {
3092 fprintf (stderr, "%s: failed to parse size '%s' from token %s\n", __func__, tok, "pv_size");
3097 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "dev_size");
3100 p = strchrnul (tok, ',');
3101 if (*p) next = p+1; else next = NULL;
3103 if (sscanf (tok, "%"SCNu64, &r->dev_size) != 1) {
3104 fprintf (stderr, "%s: failed to parse size '%s' from token %s\n", __func__, tok, "dev_size");
3109 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "pv_free");
3112 p = strchrnul (tok, ',');
3113 if (*p) next = p+1; else next = NULL;
3115 if (sscanf (tok, "%"SCNu64, &r->pv_free) != 1) {
3116 fprintf (stderr, "%s: failed to parse size '%s' from token %s\n", __func__, tok, "pv_free");
3121 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "pv_used");
3124 p = strchrnul (tok, ',');
3125 if (*p) next = p+1; else next = NULL;
3127 if (sscanf (tok, "%"SCNu64, &r->pv_used) != 1) {
3128 fprintf (stderr, "%s: failed to parse size '%s' from token %s\n", __func__, tok, "pv_used");
3133 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "pv_attr");
3136 p = strchrnul (tok, ',');
3137 if (*p) next = p+1; else next = NULL;
3139 r->pv_attr = strdup (tok);
3140 if (r->pv_attr == NULL) {
3146 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "pv_pe_count");
3149 p = strchrnul (tok, ',');
3150 if (*p) next = p+1; else next = NULL;
3152 if (sscanf (tok, "%"SCNi64, &r->pv_pe_count) != 1) {
3153 fprintf (stderr, "%s: failed to parse int '%s' from token %s\n", __func__, tok, "pv_pe_count");
3158 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "pv_pe_alloc_count");
3161 p = strchrnul (tok, ',');
3162 if (*p) next = p+1; else next = NULL;
3164 if (sscanf (tok, "%"SCNi64, &r->pv_pe_alloc_count) != 1) {
3165 fprintf (stderr, "%s: failed to parse int '%s' from token %s\n", __func__, tok, "pv_pe_alloc_count");
3170 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "pv_tags");
3173 p = strchrnul (tok, ',');
3174 if (*p) next = p+1; else next = NULL;
3176 r->pv_tags = strdup (tok);
3177 if (r->pv_tags == NULL) {
3183 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "pe_start");
3186 p = strchrnul (tok, ',');
3187 if (*p) next = p+1; else next = NULL;
3189 if (sscanf (tok, "%"SCNu64, &r->pe_start) != 1) {
3190 fprintf (stderr, "%s: failed to parse size '%s' from token %s\n", __func__, tok, "pe_start");
3195 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "pv_mda_count");
3198 p = strchrnul (tok, ',');
3199 if (*p) next = p+1; else next = NULL;
3201 if (sscanf (tok, "%"SCNi64, &r->pv_mda_count) != 1) {
3202 fprintf (stderr, "%s: failed to parse int '%s' from token %s\n", __func__, tok, "pv_mda_count");
3207 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "pv_mda_free");
3210 p = strchrnul (tok, ',');
3211 if (*p) next = p+1; else next = NULL;
3213 if (sscanf (tok, "%"SCNu64, &r->pv_mda_free) != 1) {
3214 fprintf (stderr, "%s: failed to parse size '%s' from token %s\n", __func__, tok, "pv_mda_free");
3219 fprintf (stderr, "%s: failed: extra tokens at end of string\n", __func__);
3225 guestfs_lvm_int_pv_list *
3226 parse_command_line_pvs (void)
3231 guestfs_lvm_int_pv_list *ret;
3234 ret = malloc (sizeof *ret);
3236 reply_with_perror ("malloc");
3240 ret->guestfs_lvm_int_pv_list_len = 0;
3241 ret->guestfs_lvm_int_pv_list_val = NULL;
3243 r = command (&out, &err,
3245 "-o", lvm_pv_cols, "--unbuffered", "--noheadings",
3246 "--nosuffix", "--separator", ",", "--units", "b", NULL);
3248 reply_with_error ("%s", err);
3257 /* Tokenize each line of the output. */
3261 pend = strchr (p, '\n'); /* Get the next line of output. */
3267 while (*p && isspace (*p)) /* Skip any leading whitespace. */
3270 if (!*p) { /* Empty line? Skip it. */
3275 /* Allocate some space to store this next entry. */
3276 newp = realloc (ret->guestfs_lvm_int_pv_list_val,
3277 sizeof (guestfs_lvm_int_pv) * (i+1));
3279 reply_with_perror ("realloc");
3280 free (ret->guestfs_lvm_int_pv_list_val);
3285 ret->guestfs_lvm_int_pv_list_val = newp;
3287 /* Tokenize the next entry. */
3288 r = lvm_tokenize_pv (p, &ret->guestfs_lvm_int_pv_list_val[i]);
3290 reply_with_error ("failed to parse output of 'pvs' command");
3291 free (ret->guestfs_lvm_int_pv_list_val);
3301 ret->guestfs_lvm_int_pv_list_len = i;
3306 static const char *lvm_vg_cols = "vg_name,vg_uuid,vg_fmt,vg_attr,vg_size,vg_free,vg_sysid,vg_extent_size,vg_extent_count,vg_free_count,max_lv,max_pv,pv_count,lv_count,snap_count,vg_seqno,vg_tags,vg_mda_count,vg_mda_free";
3308 static int lvm_tokenize_vg (char *str, struct guestfs_lvm_int_vg *r)
3310 char *tok, *p, *next;
3314 fprintf (stderr, "%s: failed: passed a NULL string\n", __func__);
3317 if (!*str || isspace (*str)) {
3318 fprintf (stderr, "%s: failed: passed a empty string or one beginning with whitespace\n", __func__);
3323 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "vg_name");
3326 p = strchrnul (tok, ',');
3327 if (*p) next = p+1; else next = NULL;
3329 r->vg_name = strdup (tok);
3330 if (r->vg_name == NULL) {
3336 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "vg_uuid");
3339 p = strchrnul (tok, ',');
3340 if (*p) next = p+1; else next = NULL;
3342 for (i = j = 0; i < 32; ++j) {
3343 if (tok[j] == '\0') {
3344 fprintf (stderr, "%s: failed to parse UUID from '%s'\n", __func__, tok);
3346 } else if (tok[j] != '-')
3347 r->vg_uuid[i++] = tok[j];
3351 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "vg_fmt");
3354 p = strchrnul (tok, ',');
3355 if (*p) next = p+1; else next = NULL;
3357 r->vg_fmt = strdup (tok);
3358 if (r->vg_fmt == NULL) {
3364 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "vg_attr");
3367 p = strchrnul (tok, ',');
3368 if (*p) next = p+1; else next = NULL;
3370 r->vg_attr = strdup (tok);
3371 if (r->vg_attr == NULL) {
3377 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "vg_size");
3380 p = strchrnul (tok, ',');
3381 if (*p) next = p+1; else next = NULL;
3383 if (sscanf (tok, "%"SCNu64, &r->vg_size) != 1) {
3384 fprintf (stderr, "%s: failed to parse size '%s' from token %s\n", __func__, tok, "vg_size");
3389 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "vg_free");
3392 p = strchrnul (tok, ',');
3393 if (*p) next = p+1; else next = NULL;
3395 if (sscanf (tok, "%"SCNu64, &r->vg_free) != 1) {
3396 fprintf (stderr, "%s: failed to parse size '%s' from token %s\n", __func__, tok, "vg_free");
3401 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "vg_sysid");
3404 p = strchrnul (tok, ',');
3405 if (*p) next = p+1; else next = NULL;
3407 r->vg_sysid = strdup (tok);
3408 if (r->vg_sysid == NULL) {
3414 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "vg_extent_size");
3417 p = strchrnul (tok, ',');
3418 if (*p) next = p+1; else next = NULL;
3420 if (sscanf (tok, "%"SCNu64, &r->vg_extent_size) != 1) {
3421 fprintf (stderr, "%s: failed to parse size '%s' from token %s\n", __func__, tok, "vg_extent_size");
3426 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "vg_extent_count");
3429 p = strchrnul (tok, ',');
3430 if (*p) next = p+1; else next = NULL;
3432 if (sscanf (tok, "%"SCNi64, &r->vg_extent_count) != 1) {
3433 fprintf (stderr, "%s: failed to parse int '%s' from token %s\n", __func__, tok, "vg_extent_count");
3438 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "vg_free_count");
3441 p = strchrnul (tok, ',');
3442 if (*p) next = p+1; else next = NULL;
3444 if (sscanf (tok, "%"SCNi64, &r->vg_free_count) != 1) {
3445 fprintf (stderr, "%s: failed to parse int '%s' from token %s\n", __func__, tok, "vg_free_count");
3450 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "max_lv");
3453 p = strchrnul (tok, ',');
3454 if (*p) next = p+1; else next = NULL;
3456 if (sscanf (tok, "%"SCNi64, &r->max_lv) != 1) {
3457 fprintf (stderr, "%s: failed to parse int '%s' from token %s\n", __func__, tok, "max_lv");
3462 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "max_pv");
3465 p = strchrnul (tok, ',');
3466 if (*p) next = p+1; else next = NULL;
3468 if (sscanf (tok, "%"SCNi64, &r->max_pv) != 1) {
3469 fprintf (stderr, "%s: failed to parse int '%s' from token %s\n", __func__, tok, "max_pv");
3474 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "pv_count");
3477 p = strchrnul (tok, ',');
3478 if (*p) next = p+1; else next = NULL;
3480 if (sscanf (tok, "%"SCNi64, &r->pv_count) != 1) {
3481 fprintf (stderr, "%s: failed to parse int '%s' from token %s\n", __func__, tok, "pv_count");
3486 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "lv_count");
3489 p = strchrnul (tok, ',');
3490 if (*p) next = p+1; else next = NULL;
3492 if (sscanf (tok, "%"SCNi64, &r->lv_count) != 1) {
3493 fprintf (stderr, "%s: failed to parse int '%s' from token %s\n", __func__, tok, "lv_count");
3498 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "snap_count");
3501 p = strchrnul (tok, ',');
3502 if (*p) next = p+1; else next = NULL;
3504 if (sscanf (tok, "%"SCNi64, &r->snap_count) != 1) {
3505 fprintf (stderr, "%s: failed to parse int '%s' from token %s\n", __func__, tok, "snap_count");
3510 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "vg_seqno");
3513 p = strchrnul (tok, ',');
3514 if (*p) next = p+1; else next = NULL;
3516 if (sscanf (tok, "%"SCNi64, &r->vg_seqno) != 1) {
3517 fprintf (stderr, "%s: failed to parse int '%s' from token %s\n", __func__, tok, "vg_seqno");
3522 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "vg_tags");
3525 p = strchrnul (tok, ',');
3526 if (*p) next = p+1; else next = NULL;
3528 r->vg_tags = strdup (tok);
3529 if (r->vg_tags == NULL) {
3535 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "vg_mda_count");
3538 p = strchrnul (tok, ',');
3539 if (*p) next = p+1; else next = NULL;
3541 if (sscanf (tok, "%"SCNi64, &r->vg_mda_count) != 1) {
3542 fprintf (stderr, "%s: failed to parse int '%s' from token %s\n", __func__, tok, "vg_mda_count");
3547 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "vg_mda_free");
3550 p = strchrnul (tok, ',');
3551 if (*p) next = p+1; else next = NULL;
3553 if (sscanf (tok, "%"SCNu64, &r->vg_mda_free) != 1) {
3554 fprintf (stderr, "%s: failed to parse size '%s' from token %s\n", __func__, tok, "vg_mda_free");
3559 fprintf (stderr, "%s: failed: extra tokens at end of string\n", __func__);
3565 guestfs_lvm_int_vg_list *
3566 parse_command_line_vgs (void)
3571 guestfs_lvm_int_vg_list *ret;
3574 ret = malloc (sizeof *ret);
3576 reply_with_perror ("malloc");
3580 ret->guestfs_lvm_int_vg_list_len = 0;
3581 ret->guestfs_lvm_int_vg_list_val = NULL;
3583 r = command (&out, &err,
3585 "-o", lvm_vg_cols, "--unbuffered", "--noheadings",
3586 "--nosuffix", "--separator", ",", "--units", "b", NULL);
3588 reply_with_error ("%s", err);
3597 /* Tokenize each line of the output. */
3601 pend = strchr (p, '\n'); /* Get the next line of output. */
3607 while (*p && isspace (*p)) /* Skip any leading whitespace. */
3610 if (!*p) { /* Empty line? Skip it. */
3615 /* Allocate some space to store this next entry. */
3616 newp = realloc (ret->guestfs_lvm_int_vg_list_val,
3617 sizeof (guestfs_lvm_int_vg) * (i+1));
3619 reply_with_perror ("realloc");
3620 free (ret->guestfs_lvm_int_vg_list_val);
3625 ret->guestfs_lvm_int_vg_list_val = newp;
3627 /* Tokenize the next entry. */
3628 r = lvm_tokenize_vg (p, &ret->guestfs_lvm_int_vg_list_val[i]);
3630 reply_with_error ("failed to parse output of 'vgs' command");
3631 free (ret->guestfs_lvm_int_vg_list_val);
3641 ret->guestfs_lvm_int_vg_list_len = i;
3646 static const char *lvm_lv_cols = "lv_name,lv_uuid,lv_attr,lv_major,lv_minor,lv_kernel_major,lv_kernel_minor,lv_size,seg_count,origin,snap_percent,copy_percent,move_pv,lv_tags,mirror_log,modules";
3648 static int lvm_tokenize_lv (char *str, struct guestfs_lvm_int_lv *r)
3650 char *tok, *p, *next;
3654 fprintf (stderr, "%s: failed: passed a NULL string\n", __func__);
3657 if (!*str || isspace (*str)) {
3658 fprintf (stderr, "%s: failed: passed a empty string or one beginning with whitespace\n", __func__);
3663 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "lv_name");
3666 p = strchrnul (tok, ',');
3667 if (*p) next = p+1; else next = NULL;
3669 r->lv_name = strdup (tok);
3670 if (r->lv_name == NULL) {
3676 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "lv_uuid");
3679 p = strchrnul (tok, ',');
3680 if (*p) next = p+1; else next = NULL;
3682 for (i = j = 0; i < 32; ++j) {
3683 if (tok[j] == '\0') {
3684 fprintf (stderr, "%s: failed to parse UUID from '%s'\n", __func__, tok);
3686 } else if (tok[j] != '-')
3687 r->lv_uuid[i++] = tok[j];
3691 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "lv_attr");
3694 p = strchrnul (tok, ',');
3695 if (*p) next = p+1; else next = NULL;
3697 r->lv_attr = strdup (tok);
3698 if (r->lv_attr == NULL) {
3704 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "lv_major");
3707 p = strchrnul (tok, ',');
3708 if (*p) next = p+1; else next = NULL;
3710 if (sscanf (tok, "%"SCNi64, &r->lv_major) != 1) {
3711 fprintf (stderr, "%s: failed to parse int '%s' from token %s\n", __func__, tok, "lv_major");
3716 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "lv_minor");
3719 p = strchrnul (tok, ',');
3720 if (*p) next = p+1; else next = NULL;
3722 if (sscanf (tok, "%"SCNi64, &r->lv_minor) != 1) {
3723 fprintf (stderr, "%s: failed to parse int '%s' from token %s\n", __func__, tok, "lv_minor");
3728 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "lv_kernel_major");
3731 p = strchrnul (tok, ',');
3732 if (*p) next = p+1; else next = NULL;
3734 if (sscanf (tok, "%"SCNi64, &r->lv_kernel_major) != 1) {
3735 fprintf (stderr, "%s: failed to parse int '%s' from token %s\n", __func__, tok, "lv_kernel_major");
3740 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "lv_kernel_minor");
3743 p = strchrnul (tok, ',');
3744 if (*p) next = p+1; else next = NULL;
3746 if (sscanf (tok, "%"SCNi64, &r->lv_kernel_minor) != 1) {
3747 fprintf (stderr, "%s: failed to parse int '%s' from token %s\n", __func__, tok, "lv_kernel_minor");
3752 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "lv_size");
3755 p = strchrnul (tok, ',');
3756 if (*p) next = p+1; else next = NULL;
3758 if (sscanf (tok, "%"SCNu64, &r->lv_size) != 1) {
3759 fprintf (stderr, "%s: failed to parse size '%s' from token %s\n", __func__, tok, "lv_size");
3764 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "seg_count");
3767 p = strchrnul (tok, ',');
3768 if (*p) next = p+1; else next = NULL;
3770 if (sscanf (tok, "%"SCNi64, &r->seg_count) != 1) {
3771 fprintf (stderr, "%s: failed to parse int '%s' from token %s\n", __func__, tok, "seg_count");
3776 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "origin");
3779 p = strchrnul (tok, ',');
3780 if (*p) next = p+1; else next = NULL;
3782 r->origin = strdup (tok);
3783 if (r->origin == NULL) {
3789 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "snap_percent");
3792 p = strchrnul (tok, ',');
3793 if (*p) next = p+1; else next = NULL;
3796 r->snap_percent = -1;
3797 else if (sscanf (tok, "%f", &r->snap_percent) != 1) {
3798 fprintf (stderr, "%s: failed to parse float '%s' from token %s\n", __func__, tok, "snap_percent");
3803 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "copy_percent");
3806 p = strchrnul (tok, ',');
3807 if (*p) next = p+1; else next = NULL;
3810 r->copy_percent = -1;
3811 else if (sscanf (tok, "%f", &r->copy_percent) != 1) {
3812 fprintf (stderr, "%s: failed to parse float '%s' from token %s\n", __func__, tok, "copy_percent");
3817 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "move_pv");
3820 p = strchrnul (tok, ',');
3821 if (*p) next = p+1; else next = NULL;
3823 r->move_pv = strdup (tok);
3824 if (r->move_pv == NULL) {
3830 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "lv_tags");
3833 p = strchrnul (tok, ',');
3834 if (*p) next = p+1; else next = NULL;
3836 r->lv_tags = strdup (tok);
3837 if (r->lv_tags == NULL) {
3843 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "mirror_log");
3846 p = strchrnul (tok, ',');
3847 if (*p) next = p+1; else next = NULL;
3849 r->mirror_log = strdup (tok);
3850 if (r->mirror_log == NULL) {
3856 fprintf (stderr, "%s: failed: string finished early, around token %s\n", __func__, "modules");
3859 p = strchrnul (tok, ',');
3860 if (*p) next = p+1; else next = NULL;
3862 r->modules = strdup (tok);
3863 if (r->modules == NULL) {
3869 fprintf (stderr, "%s: failed: extra tokens at end of string\n", __func__);
3875 guestfs_lvm_int_lv_list *
3876 parse_command_line_lvs (void)
3881 guestfs_lvm_int_lv_list *ret;
3884 ret = malloc (sizeof *ret);
3886 reply_with_perror ("malloc");
3890 ret->guestfs_lvm_int_lv_list_len = 0;
3891 ret->guestfs_lvm_int_lv_list_val = NULL;
3893 r = command (&out, &err,
3895 "-o", lvm_lv_cols, "--unbuffered", "--noheadings",
3896 "--nosuffix", "--separator", ",", "--units", "b", NULL);
3898 reply_with_error ("%s", err);
3907 /* Tokenize each line of the output. */
3911 pend = strchr (p, '\n'); /* Get the next line of output. */
3917 while (*p && isspace (*p)) /* Skip any leading whitespace. */
3920 if (!*p) { /* Empty line? Skip it. */
3925 /* Allocate some space to store this next entry. */
3926 newp = realloc (ret->guestfs_lvm_int_lv_list_val,
3927 sizeof (guestfs_lvm_int_lv) * (i+1));
3929 reply_with_perror ("realloc");
3930 free (ret->guestfs_lvm_int_lv_list_val);
3935 ret->guestfs_lvm_int_lv_list_val = newp;
3937 /* Tokenize the next entry. */
3938 r = lvm_tokenize_lv (p, &ret->guestfs_lvm_int_lv_list_val[i]);
3940 reply_with_error ("failed to parse output of 'lvs' command");
3941 free (ret->guestfs_lvm_int_lv_list_val);
3951 ret->guestfs_lvm_int_lv_list_len = i;