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 library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library 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 GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 int cb_done; /* flag to indicate callback was called */
24 struct guestfs_message_header hdr;
25 struct guestfs_message_error err;
28 static void mount_cb (guestfs_h *g, void *data, XDR *xdr)
30 struct mount_rv *rv = (struct mount_rv *) data;
32 if (!xdr_guestfs_message_header (xdr, &rv->hdr)) {
33 error (g, "guestfs_mount: failed to parse reply header");
36 if (rv->hdr.status == GUESTFS_STATUS_ERROR) {
37 if (!xdr_guestfs_message_error (xdr, &rv->err)) {
38 error (g, "guestfs_mount: failed to parse reply error");
45 main_loop.main_loop_quit (g);
48 int guestfs_mount (guestfs_h *g,
50 const char *mountpoint)
52 struct guestfs_mount_args args;
56 if (g->state != READY) {
57 error (g, "guestfs_mount called from the wrong state, %d != READY",
62 memset (&rv, 0, sizeof rv);
64 args.device = (char *) device;
65 args.mountpoint = (char *) mountpoint;
66 serial = dispatch (g, GUESTFS_PROC_MOUNT,
67 (xdrproc_t) xdr_guestfs_mount_args, (char *) &args);
72 g->reply_cb_internal = mount_cb;
73 g->reply_cb_internal_data = &rv;
74 main_loop.main_loop_run (g);
75 g->reply_cb_internal = NULL;
76 g->reply_cb_internal_data = NULL;
78 error (g, "guestfs_mount failed, see earlier error messages");
82 if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_MOUNT, serial) == -1)
85 if (rv.hdr.status == GUESTFS_STATUS_ERROR) {
86 error (g, "%s", rv.err.error);
94 int cb_done; /* flag to indicate callback was called */
95 struct guestfs_message_header hdr;
96 struct guestfs_message_error err;
99 static void sync_cb (guestfs_h *g, void *data, XDR *xdr)
101 struct sync_rv *rv = (struct sync_rv *) data;
103 if (!xdr_guestfs_message_header (xdr, &rv->hdr)) {
104 error (g, "guestfs_sync: failed to parse reply header");
107 if (rv->hdr.status == GUESTFS_STATUS_ERROR) {
108 if (!xdr_guestfs_message_error (xdr, &rv->err)) {
109 error (g, "guestfs_sync: failed to parse reply error");
116 main_loop.main_loop_quit (g);
119 int guestfs_sync (guestfs_h *g)
124 if (g->state != READY) {
125 error (g, "guestfs_sync called from the wrong state, %d != READY",
130 memset (&rv, 0, sizeof rv);
132 serial = dispatch (g, GUESTFS_PROC_SYNC, NULL, NULL);
137 g->reply_cb_internal = sync_cb;
138 g->reply_cb_internal_data = &rv;
139 main_loop.main_loop_run (g);
140 g->reply_cb_internal = NULL;
141 g->reply_cb_internal_data = NULL;
143 error (g, "guestfs_sync failed, see earlier error messages");
147 if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_SYNC, serial) == -1)
150 if (rv.hdr.status == GUESTFS_STATUS_ERROR) {
151 error (g, "%s", rv.err.error);
159 int cb_done; /* flag to indicate callback was called */
160 struct guestfs_message_header hdr;
161 struct guestfs_message_error err;
164 static void touch_cb (guestfs_h *g, void *data, XDR *xdr)
166 struct touch_rv *rv = (struct touch_rv *) data;
168 if (!xdr_guestfs_message_header (xdr, &rv->hdr)) {
169 error (g, "guestfs_touch: failed to parse reply header");
172 if (rv->hdr.status == GUESTFS_STATUS_ERROR) {
173 if (!xdr_guestfs_message_error (xdr, &rv->err)) {
174 error (g, "guestfs_touch: failed to parse reply error");
181 main_loop.main_loop_quit (g);
184 int guestfs_touch (guestfs_h *g,
187 struct guestfs_touch_args args;
191 if (g->state != READY) {
192 error (g, "guestfs_touch called from the wrong state, %d != READY",
197 memset (&rv, 0, sizeof rv);
199 args.path = (char *) path;
200 serial = dispatch (g, GUESTFS_PROC_TOUCH,
201 (xdrproc_t) xdr_guestfs_touch_args, (char *) &args);
206 g->reply_cb_internal = touch_cb;
207 g->reply_cb_internal_data = &rv;
208 main_loop.main_loop_run (g);
209 g->reply_cb_internal = NULL;
210 g->reply_cb_internal_data = NULL;
212 error (g, "guestfs_touch failed, see earlier error messages");
216 if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_TOUCH, serial) == -1)
219 if (rv.hdr.status == GUESTFS_STATUS_ERROR) {
220 error (g, "%s", rv.err.error);
228 int cb_done; /* flag to indicate callback was called */
229 struct guestfs_message_header hdr;
230 struct guestfs_message_error err;
231 struct guestfs_cat_ret ret;
234 static void cat_cb (guestfs_h *g, void *data, XDR *xdr)
236 struct cat_rv *rv = (struct cat_rv *) data;
238 if (!xdr_guestfs_message_header (xdr, &rv->hdr)) {
239 error (g, "guestfs_cat: failed to parse reply header");
242 if (rv->hdr.status == GUESTFS_STATUS_ERROR) {
243 if (!xdr_guestfs_message_error (xdr, &rv->err)) {
244 error (g, "guestfs_cat: failed to parse reply error");
249 if (!xdr_guestfs_cat_ret (xdr, &rv->ret)) {
250 error (g, "guestfs_cat: failed to parse reply");
255 main_loop.main_loop_quit (g);
258 char *guestfs_cat (guestfs_h *g,
261 struct guestfs_cat_args args;
265 if (g->state != READY) {
266 error (g, "guestfs_cat called from the wrong state, %d != READY",
271 memset (&rv, 0, sizeof rv);
273 args.path = (char *) path;
274 serial = dispatch (g, GUESTFS_PROC_CAT,
275 (xdrproc_t) xdr_guestfs_cat_args, (char *) &args);
280 g->reply_cb_internal = cat_cb;
281 g->reply_cb_internal_data = &rv;
282 main_loop.main_loop_run (g);
283 g->reply_cb_internal = NULL;
284 g->reply_cb_internal_data = NULL;
286 error (g, "guestfs_cat failed, see earlier error messages");
290 if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_CAT, serial) == -1)
293 if (rv.hdr.status == GUESTFS_STATUS_ERROR) {
294 error (g, "%s", rv.err.error);
298 return rv.ret.content; /* caller will free */
302 int cb_done; /* flag to indicate callback was called */
303 struct guestfs_message_header hdr;
304 struct guestfs_message_error err;
305 struct guestfs_ll_ret ret;
308 static void ll_cb (guestfs_h *g, void *data, XDR *xdr)
310 struct ll_rv *rv = (struct ll_rv *) data;
312 if (!xdr_guestfs_message_header (xdr, &rv->hdr)) {
313 error (g, "guestfs_ll: failed to parse reply header");
316 if (rv->hdr.status == GUESTFS_STATUS_ERROR) {
317 if (!xdr_guestfs_message_error (xdr, &rv->err)) {
318 error (g, "guestfs_ll: failed to parse reply error");
323 if (!xdr_guestfs_ll_ret (xdr, &rv->ret)) {
324 error (g, "guestfs_ll: failed to parse reply");
329 main_loop.main_loop_quit (g);
332 char *guestfs_ll (guestfs_h *g,
333 const char *directory)
335 struct guestfs_ll_args args;
339 if (g->state != READY) {
340 error (g, "guestfs_ll called from the wrong state, %d != READY",
345 memset (&rv, 0, sizeof rv);
347 args.directory = (char *) directory;
348 serial = dispatch (g, GUESTFS_PROC_LL,
349 (xdrproc_t) xdr_guestfs_ll_args, (char *) &args);
354 g->reply_cb_internal = ll_cb;
355 g->reply_cb_internal_data = &rv;
356 main_loop.main_loop_run (g);
357 g->reply_cb_internal = NULL;
358 g->reply_cb_internal_data = NULL;
360 error (g, "guestfs_ll failed, see earlier error messages");
364 if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_LL, serial) == -1)
367 if (rv.hdr.status == GUESTFS_STATUS_ERROR) {
368 error (g, "%s", rv.err.error);
372 return rv.ret.listing; /* caller will free */
376 int cb_done; /* flag to indicate callback was called */
377 struct guestfs_message_header hdr;
378 struct guestfs_message_error err;
379 struct guestfs_ls_ret ret;
382 static void ls_cb (guestfs_h *g, void *data, XDR *xdr)
384 struct ls_rv *rv = (struct ls_rv *) data;
386 if (!xdr_guestfs_message_header (xdr, &rv->hdr)) {
387 error (g, "guestfs_ls: failed to parse reply header");
390 if (rv->hdr.status == GUESTFS_STATUS_ERROR) {
391 if (!xdr_guestfs_message_error (xdr, &rv->err)) {
392 error (g, "guestfs_ls: failed to parse reply error");
397 if (!xdr_guestfs_ls_ret (xdr, &rv->ret)) {
398 error (g, "guestfs_ls: failed to parse reply");
403 main_loop.main_loop_quit (g);
406 char **guestfs_ls (guestfs_h *g,
407 const char *directory)
409 struct guestfs_ls_args args;
413 if (g->state != READY) {
414 error (g, "guestfs_ls called from the wrong state, %d != READY",
419 memset (&rv, 0, sizeof rv);
421 args.directory = (char *) directory;
422 serial = dispatch (g, GUESTFS_PROC_LS,
423 (xdrproc_t) xdr_guestfs_ls_args, (char *) &args);
428 g->reply_cb_internal = ls_cb;
429 g->reply_cb_internal_data = &rv;
430 main_loop.main_loop_run (g);
431 g->reply_cb_internal = NULL;
432 g->reply_cb_internal_data = NULL;
434 error (g, "guestfs_ls failed, see earlier error messages");
438 if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_LS, serial) == -1)
441 if (rv.hdr.status == GUESTFS_STATUS_ERROR) {
442 error (g, "%s", rv.err.error);
446 /* caller will free this, but we need to add a NULL entry */
447 rv.ret.listing.listing_val = safe_realloc (g, rv.ret.listing.listing_val, rv.ret.listing.listing_len + 1);
448 rv.ret.listing.listing_val[rv.ret.listing.listing_len] = NULL;
449 return rv.ret.listing.listing_val;
452 struct list_devices_rv {
453 int cb_done; /* flag to indicate callback was called */
454 struct guestfs_message_header hdr;
455 struct guestfs_message_error err;
456 struct guestfs_list_devices_ret ret;
459 static void list_devices_cb (guestfs_h *g, void *data, XDR *xdr)
461 struct list_devices_rv *rv = (struct list_devices_rv *) data;
463 if (!xdr_guestfs_message_header (xdr, &rv->hdr)) {
464 error (g, "guestfs_list_devices: failed to parse reply header");
467 if (rv->hdr.status == GUESTFS_STATUS_ERROR) {
468 if (!xdr_guestfs_message_error (xdr, &rv->err)) {
469 error (g, "guestfs_list_devices: failed to parse reply error");
474 if (!xdr_guestfs_list_devices_ret (xdr, &rv->ret)) {
475 error (g, "guestfs_list_devices: failed to parse reply");
480 main_loop.main_loop_quit (g);
483 char **guestfs_list_devices (guestfs_h *g)
485 struct list_devices_rv rv;
488 if (g->state != READY) {
489 error (g, "guestfs_list_devices called from the wrong state, %d != READY",
494 memset (&rv, 0, sizeof rv);
496 serial = dispatch (g, GUESTFS_PROC_LIST_DEVICES, NULL, NULL);
501 g->reply_cb_internal = list_devices_cb;
502 g->reply_cb_internal_data = &rv;
503 main_loop.main_loop_run (g);
504 g->reply_cb_internal = NULL;
505 g->reply_cb_internal_data = NULL;
507 error (g, "guestfs_list_devices failed, see earlier error messages");
511 if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_LIST_DEVICES, serial) == -1)
514 if (rv.hdr.status == GUESTFS_STATUS_ERROR) {
515 error (g, "%s", rv.err.error);
519 /* caller will free this, but we need to add a NULL entry */
520 rv.ret.devices.devices_val = safe_realloc (g, rv.ret.devices.devices_val, rv.ret.devices.devices_len + 1);
521 rv.ret.devices.devices_val[rv.ret.devices.devices_len] = NULL;
522 return rv.ret.devices.devices_val;
525 struct list_partitions_rv {
526 int cb_done; /* flag to indicate callback was called */
527 struct guestfs_message_header hdr;
528 struct guestfs_message_error err;
529 struct guestfs_list_partitions_ret ret;
532 static void list_partitions_cb (guestfs_h *g, void *data, XDR *xdr)
534 struct list_partitions_rv *rv = (struct list_partitions_rv *) data;
536 if (!xdr_guestfs_message_header (xdr, &rv->hdr)) {
537 error (g, "guestfs_list_partitions: failed to parse reply header");
540 if (rv->hdr.status == GUESTFS_STATUS_ERROR) {
541 if (!xdr_guestfs_message_error (xdr, &rv->err)) {
542 error (g, "guestfs_list_partitions: failed to parse reply error");
547 if (!xdr_guestfs_list_partitions_ret (xdr, &rv->ret)) {
548 error (g, "guestfs_list_partitions: failed to parse reply");
553 main_loop.main_loop_quit (g);
556 char **guestfs_list_partitions (guestfs_h *g)
558 struct list_partitions_rv rv;
561 if (g->state != READY) {
562 error (g, "guestfs_list_partitions called from the wrong state, %d != READY",
567 memset (&rv, 0, sizeof rv);
569 serial = dispatch (g, GUESTFS_PROC_LIST_PARTITIONS, NULL, NULL);
574 g->reply_cb_internal = list_partitions_cb;
575 g->reply_cb_internal_data = &rv;
576 main_loop.main_loop_run (g);
577 g->reply_cb_internal = NULL;
578 g->reply_cb_internal_data = NULL;
580 error (g, "guestfs_list_partitions failed, see earlier error messages");
584 if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_LIST_PARTITIONS, serial) == -1)
587 if (rv.hdr.status == GUESTFS_STATUS_ERROR) {
588 error (g, "%s", rv.err.error);
592 /* caller will free this, but we need to add a NULL entry */
593 rv.ret.partitions.partitions_val = safe_realloc (g, rv.ret.partitions.partitions_val, rv.ret.partitions.partitions_len + 1);
594 rv.ret.partitions.partitions_val[rv.ret.partitions.partitions_len] = NULL;
595 return rv.ret.partitions.partitions_val;
599 int cb_done; /* flag to indicate callback was called */
600 struct guestfs_message_header hdr;
601 struct guestfs_message_error err;
602 struct guestfs_pvs_ret ret;
605 static void pvs_cb (guestfs_h *g, void *data, XDR *xdr)
607 struct pvs_rv *rv = (struct pvs_rv *) data;
609 if (!xdr_guestfs_message_header (xdr, &rv->hdr)) {
610 error (g, "guestfs_pvs: failed to parse reply header");
613 if (rv->hdr.status == GUESTFS_STATUS_ERROR) {
614 if (!xdr_guestfs_message_error (xdr, &rv->err)) {
615 error (g, "guestfs_pvs: failed to parse reply error");
620 if (!xdr_guestfs_pvs_ret (xdr, &rv->ret)) {
621 error (g, "guestfs_pvs: failed to parse reply");
626 main_loop.main_loop_quit (g);
629 char **guestfs_pvs (guestfs_h *g)
634 if (g->state != READY) {
635 error (g, "guestfs_pvs called from the wrong state, %d != READY",
640 memset (&rv, 0, sizeof rv);
642 serial = dispatch (g, GUESTFS_PROC_PVS, NULL, NULL);
647 g->reply_cb_internal = pvs_cb;
648 g->reply_cb_internal_data = &rv;
649 main_loop.main_loop_run (g);
650 g->reply_cb_internal = NULL;
651 g->reply_cb_internal_data = NULL;
653 error (g, "guestfs_pvs failed, see earlier error messages");
657 if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_PVS, serial) == -1)
660 if (rv.hdr.status == GUESTFS_STATUS_ERROR) {
661 error (g, "%s", rv.err.error);
665 /* caller will free this, but we need to add a NULL entry */
666 rv.ret.physvols.physvols_val = safe_realloc (g, rv.ret.physvols.physvols_val, rv.ret.physvols.physvols_len + 1);
667 rv.ret.physvols.physvols_val[rv.ret.physvols.physvols_len] = NULL;
668 return rv.ret.physvols.physvols_val;
672 int cb_done; /* flag to indicate callback was called */
673 struct guestfs_message_header hdr;
674 struct guestfs_message_error err;
675 struct guestfs_vgs_ret ret;
678 static void vgs_cb (guestfs_h *g, void *data, XDR *xdr)
680 struct vgs_rv *rv = (struct vgs_rv *) data;
682 if (!xdr_guestfs_message_header (xdr, &rv->hdr)) {
683 error (g, "guestfs_vgs: failed to parse reply header");
686 if (rv->hdr.status == GUESTFS_STATUS_ERROR) {
687 if (!xdr_guestfs_message_error (xdr, &rv->err)) {
688 error (g, "guestfs_vgs: failed to parse reply error");
693 if (!xdr_guestfs_vgs_ret (xdr, &rv->ret)) {
694 error (g, "guestfs_vgs: failed to parse reply");
699 main_loop.main_loop_quit (g);
702 char **guestfs_vgs (guestfs_h *g)
707 if (g->state != READY) {
708 error (g, "guestfs_vgs called from the wrong state, %d != READY",
713 memset (&rv, 0, sizeof rv);
715 serial = dispatch (g, GUESTFS_PROC_VGS, NULL, NULL);
720 g->reply_cb_internal = vgs_cb;
721 g->reply_cb_internal_data = &rv;
722 main_loop.main_loop_run (g);
723 g->reply_cb_internal = NULL;
724 g->reply_cb_internal_data = NULL;
726 error (g, "guestfs_vgs failed, see earlier error messages");
730 if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_VGS, serial) == -1)
733 if (rv.hdr.status == GUESTFS_STATUS_ERROR) {
734 error (g, "%s", rv.err.error);
738 /* caller will free this, but we need to add a NULL entry */
739 rv.ret.volgroups.volgroups_val = safe_realloc (g, rv.ret.volgroups.volgroups_val, rv.ret.volgroups.volgroups_len + 1);
740 rv.ret.volgroups.volgroups_val[rv.ret.volgroups.volgroups_len] = NULL;
741 return rv.ret.volgroups.volgroups_val;
745 int cb_done; /* flag to indicate callback was called */
746 struct guestfs_message_header hdr;
747 struct guestfs_message_error err;
748 struct guestfs_lvs_ret ret;
751 static void lvs_cb (guestfs_h *g, void *data, XDR *xdr)
753 struct lvs_rv *rv = (struct lvs_rv *) data;
755 if (!xdr_guestfs_message_header (xdr, &rv->hdr)) {
756 error (g, "guestfs_lvs: failed to parse reply header");
759 if (rv->hdr.status == GUESTFS_STATUS_ERROR) {
760 if (!xdr_guestfs_message_error (xdr, &rv->err)) {
761 error (g, "guestfs_lvs: failed to parse reply error");
766 if (!xdr_guestfs_lvs_ret (xdr, &rv->ret)) {
767 error (g, "guestfs_lvs: failed to parse reply");
772 main_loop.main_loop_quit (g);
775 char **guestfs_lvs (guestfs_h *g)
780 if (g->state != READY) {
781 error (g, "guestfs_lvs called from the wrong state, %d != READY",
786 memset (&rv, 0, sizeof rv);
788 serial = dispatch (g, GUESTFS_PROC_LVS, NULL, NULL);
793 g->reply_cb_internal = lvs_cb;
794 g->reply_cb_internal_data = &rv;
795 main_loop.main_loop_run (g);
796 g->reply_cb_internal = NULL;
797 g->reply_cb_internal_data = NULL;
799 error (g, "guestfs_lvs failed, see earlier error messages");
803 if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_LVS, serial) == -1)
806 if (rv.hdr.status == GUESTFS_STATUS_ERROR) {
807 error (g, "%s", rv.err.error);
811 /* caller will free this, but we need to add a NULL entry */
812 rv.ret.logvols.logvols_val = safe_realloc (g, rv.ret.logvols.logvols_val, rv.ret.logvols.logvols_len + 1);
813 rv.ret.logvols.logvols_val[rv.ret.logvols.logvols_len] = NULL;
814 return rv.ret.logvols.logvols_val;
818 int cb_done; /* flag to indicate callback was called */
819 struct guestfs_message_header hdr;
820 struct guestfs_message_error err;
821 struct guestfs_pvs_full_ret ret;
824 static void pvs_full_cb (guestfs_h *g, void *data, XDR *xdr)
826 struct pvs_full_rv *rv = (struct pvs_full_rv *) data;
828 if (!xdr_guestfs_message_header (xdr, &rv->hdr)) {
829 error (g, "guestfs_pvs_full: failed to parse reply header");
832 if (rv->hdr.status == GUESTFS_STATUS_ERROR) {
833 if (!xdr_guestfs_message_error (xdr, &rv->err)) {
834 error (g, "guestfs_pvs_full: failed to parse reply error");
839 if (!xdr_guestfs_pvs_full_ret (xdr, &rv->ret)) {
840 error (g, "guestfs_pvs_full: failed to parse reply");
845 main_loop.main_loop_quit (g);
848 struct guestfs_lvm_pv_list *guestfs_pvs_full (guestfs_h *g)
850 struct pvs_full_rv rv;
853 if (g->state != READY) {
854 error (g, "guestfs_pvs_full called from the wrong state, %d != READY",
859 memset (&rv, 0, sizeof rv);
861 serial = dispatch (g, GUESTFS_PROC_PVS_FULL, NULL, NULL);
866 g->reply_cb_internal = pvs_full_cb;
867 g->reply_cb_internal_data = &rv;
868 main_loop.main_loop_run (g);
869 g->reply_cb_internal = NULL;
870 g->reply_cb_internal_data = NULL;
872 error (g, "guestfs_pvs_full failed, see earlier error messages");
876 if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_PVS_FULL, serial) == -1)
879 if (rv.hdr.status == GUESTFS_STATUS_ERROR) {
880 error (g, "%s", rv.err.error);
884 /* caller will free this */
885 return safe_memdup (g, &rv.ret.physvols, sizeof (rv.ret.physvols));
889 int cb_done; /* flag to indicate callback was called */
890 struct guestfs_message_header hdr;
891 struct guestfs_message_error err;
892 struct guestfs_vgs_full_ret ret;
895 static void vgs_full_cb (guestfs_h *g, void *data, XDR *xdr)
897 struct vgs_full_rv *rv = (struct vgs_full_rv *) data;
899 if (!xdr_guestfs_message_header (xdr, &rv->hdr)) {
900 error (g, "guestfs_vgs_full: failed to parse reply header");
903 if (rv->hdr.status == GUESTFS_STATUS_ERROR) {
904 if (!xdr_guestfs_message_error (xdr, &rv->err)) {
905 error (g, "guestfs_vgs_full: failed to parse reply error");
910 if (!xdr_guestfs_vgs_full_ret (xdr, &rv->ret)) {
911 error (g, "guestfs_vgs_full: failed to parse reply");
916 main_loop.main_loop_quit (g);
919 struct guestfs_lvm_vg_list *guestfs_vgs_full (guestfs_h *g)
921 struct vgs_full_rv rv;
924 if (g->state != READY) {
925 error (g, "guestfs_vgs_full called from the wrong state, %d != READY",
930 memset (&rv, 0, sizeof rv);
932 serial = dispatch (g, GUESTFS_PROC_VGS_FULL, NULL, NULL);
937 g->reply_cb_internal = vgs_full_cb;
938 g->reply_cb_internal_data = &rv;
939 main_loop.main_loop_run (g);
940 g->reply_cb_internal = NULL;
941 g->reply_cb_internal_data = NULL;
943 error (g, "guestfs_vgs_full failed, see earlier error messages");
947 if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_VGS_FULL, serial) == -1)
950 if (rv.hdr.status == GUESTFS_STATUS_ERROR) {
951 error (g, "%s", rv.err.error);
955 /* caller will free this */
956 return safe_memdup (g, &rv.ret.volgroups, sizeof (rv.ret.volgroups));
960 int cb_done; /* flag to indicate callback was called */
961 struct guestfs_message_header hdr;
962 struct guestfs_message_error err;
963 struct guestfs_lvs_full_ret ret;
966 static void lvs_full_cb (guestfs_h *g, void *data, XDR *xdr)
968 struct lvs_full_rv *rv = (struct lvs_full_rv *) data;
970 if (!xdr_guestfs_message_header (xdr, &rv->hdr)) {
971 error (g, "guestfs_lvs_full: failed to parse reply header");
974 if (rv->hdr.status == GUESTFS_STATUS_ERROR) {
975 if (!xdr_guestfs_message_error (xdr, &rv->err)) {
976 error (g, "guestfs_lvs_full: failed to parse reply error");
981 if (!xdr_guestfs_lvs_full_ret (xdr, &rv->ret)) {
982 error (g, "guestfs_lvs_full: failed to parse reply");
987 main_loop.main_loop_quit (g);
990 struct guestfs_lvm_lv_list *guestfs_lvs_full (guestfs_h *g)
992 struct lvs_full_rv rv;
995 if (g->state != READY) {
996 error (g, "guestfs_lvs_full called from the wrong state, %d != READY",
1001 memset (&rv, 0, sizeof rv);
1003 serial = dispatch (g, GUESTFS_PROC_LVS_FULL, NULL, NULL);
1008 g->reply_cb_internal = lvs_full_cb;
1009 g->reply_cb_internal_data = &rv;
1010 main_loop.main_loop_run (g);
1011 g->reply_cb_internal = NULL;
1012 g->reply_cb_internal_data = NULL;
1014 error (g, "guestfs_lvs_full failed, see earlier error messages");
1018 if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_LVS_FULL, serial) == -1)
1021 if (rv.hdr.status == GUESTFS_STATUS_ERROR) {
1022 error (g, "%s", rv.err.error);
1026 /* caller will free this */
1027 return safe_memdup (g, &rv.ret.logvols, sizeof (rv.ret.logvols));