struct mount_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct mount_ctx *ctx = (struct mount_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_mount");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_mount (guestfs_h *g,
guestfs_set_reply_callback (g, mount_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_mount");
guestfs_set_ready (g);
return -1;
struct sync_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct sync_ctx *ctx = (struct sync_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_sync");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_sync (guestfs_h *g)
guestfs_set_reply_callback (g, sync_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_sync");
guestfs_set_ready (g);
return -1;
struct touch_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct touch_ctx *ctx = (struct touch_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_touch");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_touch (guestfs_h *g,
guestfs_set_reply_callback (g, touch_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_touch");
guestfs_set_ready (g);
return -1;
struct cat_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct cat_ctx *ctx = (struct cat_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_cat");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char *guestfs_cat (guestfs_h *g,
guestfs_set_reply_callback (g, cat_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_cat");
guestfs_set_ready (g);
return NULL;
struct ll_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct ll_ctx *ctx = (struct ll_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_ll");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char *guestfs_ll (guestfs_h *g,
guestfs_set_reply_callback (g, ll_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_ll");
guestfs_set_ready (g);
return NULL;
struct ls_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct ls_ctx *ctx = (struct ls_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_ls");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char **guestfs_ls (guestfs_h *g,
guestfs_set_reply_callback (g, ls_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_ls");
guestfs_set_ready (g);
return NULL;
struct list_devices_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct list_devices_ctx *ctx = (struct list_devices_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_list_devices");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char **guestfs_list_devices (guestfs_h *g)
guestfs_set_reply_callback (g, list_devices_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_list_devices");
guestfs_set_ready (g);
return NULL;
struct list_partitions_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct list_partitions_ctx *ctx = (struct list_partitions_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_list_partitions");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char **guestfs_list_partitions (guestfs_h *g)
guestfs_set_reply_callback (g, list_partitions_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_list_partitions");
guestfs_set_ready (g);
return NULL;
struct pvs_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct pvs_ctx *ctx = (struct pvs_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_pvs");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char **guestfs_pvs (guestfs_h *g)
guestfs_set_reply_callback (g, pvs_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_pvs");
guestfs_set_ready (g);
return NULL;
struct vgs_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct vgs_ctx *ctx = (struct vgs_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_vgs");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char **guestfs_vgs (guestfs_h *g)
guestfs_set_reply_callback (g, vgs_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_vgs");
guestfs_set_ready (g);
return NULL;
struct lvs_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct lvs_ctx *ctx = (struct lvs_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_lvs");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char **guestfs_lvs (guestfs_h *g)
guestfs_set_reply_callback (g, lvs_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_lvs");
guestfs_set_ready (g);
return NULL;
struct pvs_full_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct pvs_full_ctx *ctx = (struct pvs_full_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_pvs_full");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
struct guestfs_lvm_pv_list *guestfs_pvs_full (guestfs_h *g)
guestfs_set_reply_callback (g, pvs_full_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_pvs_full");
guestfs_set_ready (g);
return NULL;
struct vgs_full_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct vgs_full_ctx *ctx = (struct vgs_full_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_vgs_full");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
struct guestfs_lvm_vg_list *guestfs_vgs_full (guestfs_h *g)
guestfs_set_reply_callback (g, vgs_full_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_vgs_full");
guestfs_set_ready (g);
return NULL;
struct lvs_full_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct lvs_full_ctx *ctx = (struct lvs_full_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_lvs_full");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
struct guestfs_lvm_lv_list *guestfs_lvs_full (guestfs_h *g)
guestfs_set_reply_callback (g, lvs_full_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_lvs_full");
guestfs_set_ready (g);
return NULL;
struct read_lines_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct read_lines_ctx *ctx = (struct read_lines_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_read_lines");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char **guestfs_read_lines (guestfs_h *g,
guestfs_set_reply_callback (g, read_lines_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_read_lines");
guestfs_set_ready (g);
return NULL;
struct aug_init_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct aug_init_ctx *ctx = (struct aug_init_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_aug_init");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_aug_init (guestfs_h *g,
guestfs_set_reply_callback (g, aug_init_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_aug_init");
guestfs_set_ready (g);
return -1;
struct aug_close_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct aug_close_ctx *ctx = (struct aug_close_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_aug_close");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_aug_close (guestfs_h *g)
guestfs_set_reply_callback (g, aug_close_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_aug_close");
guestfs_set_ready (g);
return -1;
struct aug_defvar_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct aug_defvar_ctx *ctx = (struct aug_defvar_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_aug_defvar");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_aug_defvar (guestfs_h *g,
guestfs_set_reply_callback (g, aug_defvar_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_aug_defvar");
guestfs_set_ready (g);
return -1;
struct aug_defnode_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct aug_defnode_ctx *ctx = (struct aug_defnode_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_aug_defnode");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
struct guestfs_int_bool *guestfs_aug_defnode (guestfs_h *g,
guestfs_set_reply_callback (g, aug_defnode_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_aug_defnode");
guestfs_set_ready (g);
return NULL;
struct aug_get_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct aug_get_ctx *ctx = (struct aug_get_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_aug_get");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char *guestfs_aug_get (guestfs_h *g,
guestfs_set_reply_callback (g, aug_get_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_aug_get");
guestfs_set_ready (g);
return NULL;
struct aug_set_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct aug_set_ctx *ctx = (struct aug_set_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_aug_set");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_aug_set (guestfs_h *g,
guestfs_set_reply_callback (g, aug_set_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_aug_set");
guestfs_set_ready (g);
return -1;
struct aug_insert_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct aug_insert_ctx *ctx = (struct aug_insert_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_aug_insert");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_aug_insert (guestfs_h *g,
guestfs_set_reply_callback (g, aug_insert_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_aug_insert");
guestfs_set_ready (g);
return -1;
struct aug_rm_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct aug_rm_ctx *ctx = (struct aug_rm_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_aug_rm");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_aug_rm (guestfs_h *g,
guestfs_set_reply_callback (g, aug_rm_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_aug_rm");
guestfs_set_ready (g);
return -1;
struct aug_mv_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct aug_mv_ctx *ctx = (struct aug_mv_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_aug_mv");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_aug_mv (guestfs_h *g,
guestfs_set_reply_callback (g, aug_mv_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_aug_mv");
guestfs_set_ready (g);
return -1;
struct aug_match_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct aug_match_ctx *ctx = (struct aug_match_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_aug_match");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char **guestfs_aug_match (guestfs_h *g,
guestfs_set_reply_callback (g, aug_match_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_aug_match");
guestfs_set_ready (g);
return NULL;
struct aug_save_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct aug_save_ctx *ctx = (struct aug_save_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_aug_save");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_aug_save (guestfs_h *g)
guestfs_set_reply_callback (g, aug_save_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_aug_save");
guestfs_set_ready (g);
return -1;
struct aug_load_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct aug_load_ctx *ctx = (struct aug_load_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_aug_load");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_aug_load (guestfs_h *g)
guestfs_set_reply_callback (g, aug_load_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_aug_load");
guestfs_set_ready (g);
return -1;
struct aug_ls_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct aug_ls_ctx *ctx = (struct aug_ls_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_aug_ls");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char **guestfs_aug_ls (guestfs_h *g,
guestfs_set_reply_callback (g, aug_ls_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_aug_ls");
guestfs_set_ready (g);
return NULL;
struct rm_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct rm_ctx *ctx = (struct rm_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_rm");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_rm (guestfs_h *g,
guestfs_set_reply_callback (g, rm_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_rm");
guestfs_set_ready (g);
return -1;
struct rmdir_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct rmdir_ctx *ctx = (struct rmdir_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_rmdir");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_rmdir (guestfs_h *g,
guestfs_set_reply_callback (g, rmdir_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_rmdir");
guestfs_set_ready (g);
return -1;
struct rm_rf_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct rm_rf_ctx *ctx = (struct rm_rf_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_rm_rf");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_rm_rf (guestfs_h *g,
guestfs_set_reply_callback (g, rm_rf_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_rm_rf");
guestfs_set_ready (g);
return -1;
struct mkdir_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct mkdir_ctx *ctx = (struct mkdir_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_mkdir");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_mkdir (guestfs_h *g,
guestfs_set_reply_callback (g, mkdir_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_mkdir");
guestfs_set_ready (g);
return -1;
struct mkdir_p_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct mkdir_p_ctx *ctx = (struct mkdir_p_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_mkdir_p");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_mkdir_p (guestfs_h *g,
guestfs_set_reply_callback (g, mkdir_p_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_mkdir_p");
guestfs_set_ready (g);
return -1;
struct chmod_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct chmod_ctx *ctx = (struct chmod_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_chmod");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_chmod (guestfs_h *g,
guestfs_set_reply_callback (g, chmod_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_chmod");
guestfs_set_ready (g);
return -1;
struct chown_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct chown_ctx *ctx = (struct chown_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_chown");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_chown (guestfs_h *g,
guestfs_set_reply_callback (g, chown_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_chown");
guestfs_set_ready (g);
return -1;
struct exists_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct exists_ctx *ctx = (struct exists_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_exists");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_exists (guestfs_h *g,
guestfs_set_reply_callback (g, exists_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_exists");
guestfs_set_ready (g);
return -1;
struct is_file_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct is_file_ctx *ctx = (struct is_file_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_is_file");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_is_file (guestfs_h *g,
guestfs_set_reply_callback (g, is_file_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_is_file");
guestfs_set_ready (g);
return -1;
struct is_dir_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct is_dir_ctx *ctx = (struct is_dir_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_is_dir");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_is_dir (guestfs_h *g,
guestfs_set_reply_callback (g, is_dir_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_is_dir");
guestfs_set_ready (g);
return -1;
struct pvcreate_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct pvcreate_ctx *ctx = (struct pvcreate_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_pvcreate");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_pvcreate (guestfs_h *g,
guestfs_set_reply_callback (g, pvcreate_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_pvcreate");
guestfs_set_ready (g);
return -1;
struct vgcreate_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct vgcreate_ctx *ctx = (struct vgcreate_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_vgcreate");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_vgcreate (guestfs_h *g,
guestfs_set_reply_callback (g, vgcreate_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_vgcreate");
guestfs_set_ready (g);
return -1;
struct lvcreate_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct lvcreate_ctx *ctx = (struct lvcreate_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_lvcreate");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_lvcreate (guestfs_h *g,
guestfs_set_reply_callback (g, lvcreate_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_lvcreate");
guestfs_set_ready (g);
return -1;
struct mkfs_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct mkfs_ctx *ctx = (struct mkfs_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_mkfs");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_mkfs (guestfs_h *g,
guestfs_set_reply_callback (g, mkfs_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_mkfs");
guestfs_set_ready (g);
return -1;
struct sfdisk_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct sfdisk_ctx *ctx = (struct sfdisk_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_sfdisk");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_sfdisk (guestfs_h *g,
guestfs_set_reply_callback (g, sfdisk_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_sfdisk");
guestfs_set_ready (g);
return -1;
struct write_file_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct write_file_ctx *ctx = (struct write_file_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_write_file");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_write_file (guestfs_h *g,
guestfs_set_reply_callback (g, write_file_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_write_file");
guestfs_set_ready (g);
return -1;
struct umount_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct umount_ctx *ctx = (struct umount_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_umount");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_umount (guestfs_h *g,
guestfs_set_reply_callback (g, umount_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_umount");
guestfs_set_ready (g);
return -1;
struct mounts_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct mounts_ctx *ctx = (struct mounts_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_mounts");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char **guestfs_mounts (guestfs_h *g)
guestfs_set_reply_callback (g, mounts_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_mounts");
guestfs_set_ready (g);
return NULL;
struct umount_all_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct umount_all_ctx *ctx = (struct umount_all_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_umount_all");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_umount_all (guestfs_h *g)
guestfs_set_reply_callback (g, umount_all_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_umount_all");
guestfs_set_ready (g);
return -1;
struct lvm_remove_all_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct lvm_remove_all_ctx *ctx = (struct lvm_remove_all_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_lvm_remove_all");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_lvm_remove_all (guestfs_h *g)
guestfs_set_reply_callback (g, lvm_remove_all_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_lvm_remove_all");
guestfs_set_ready (g);
return -1;
struct file_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct file_ctx *ctx = (struct file_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_file");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char *guestfs_file (guestfs_h *g,
guestfs_set_reply_callback (g, file_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_file");
guestfs_set_ready (g);
return NULL;
struct command_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct command_ctx *ctx = (struct command_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_command");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char *guestfs_command (guestfs_h *g,
guestfs_set_reply_callback (g, command_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_command");
guestfs_set_ready (g);
return NULL;
struct command_lines_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct command_lines_ctx *ctx = (struct command_lines_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_command_lines");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char **guestfs_command_lines (guestfs_h *g,
guestfs_set_reply_callback (g, command_lines_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_command_lines");
guestfs_set_ready (g);
return NULL;
struct stat_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct stat_ctx *ctx = (struct stat_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_stat");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
struct guestfs_stat *guestfs_stat (guestfs_h *g,
guestfs_set_reply_callback (g, stat_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_stat");
guestfs_set_ready (g);
return NULL;
struct lstat_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct lstat_ctx *ctx = (struct lstat_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_lstat");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
struct guestfs_stat *guestfs_lstat (guestfs_h *g,
guestfs_set_reply_callback (g, lstat_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_lstat");
guestfs_set_ready (g);
return NULL;
struct statvfs_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct statvfs_ctx *ctx = (struct statvfs_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_statvfs");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
struct guestfs_statvfs *guestfs_statvfs (guestfs_h *g,
guestfs_set_reply_callback (g, statvfs_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_statvfs");
guestfs_set_ready (g);
return NULL;
struct tune2fs_l_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct tune2fs_l_ctx *ctx = (struct tune2fs_l_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_tune2fs_l");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char **guestfs_tune2fs_l (guestfs_h *g,
guestfs_set_reply_callback (g, tune2fs_l_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_tune2fs_l");
guestfs_set_ready (g);
return NULL;
struct blockdev_setro_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct blockdev_setro_ctx *ctx = (struct blockdev_setro_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_blockdev_setro");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_blockdev_setro (guestfs_h *g,
guestfs_set_reply_callback (g, blockdev_setro_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_setro");
guestfs_set_ready (g);
return -1;
struct blockdev_setrw_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct blockdev_setrw_ctx *ctx = (struct blockdev_setrw_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_blockdev_setrw");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_blockdev_setrw (guestfs_h *g,
guestfs_set_reply_callback (g, blockdev_setrw_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_setrw");
guestfs_set_ready (g);
return -1;
struct blockdev_getro_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct blockdev_getro_ctx *ctx = (struct blockdev_getro_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_blockdev_getro");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_blockdev_getro (guestfs_h *g,
guestfs_set_reply_callback (g, blockdev_getro_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_getro");
guestfs_set_ready (g);
return -1;
struct blockdev_getss_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct blockdev_getss_ctx *ctx = (struct blockdev_getss_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_blockdev_getss");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_blockdev_getss (guestfs_h *g,
guestfs_set_reply_callback (g, blockdev_getss_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_getss");
guestfs_set_ready (g);
return -1;
struct blockdev_getbsz_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct blockdev_getbsz_ctx *ctx = (struct blockdev_getbsz_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_blockdev_getbsz");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_blockdev_getbsz (guestfs_h *g,
guestfs_set_reply_callback (g, blockdev_getbsz_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_getbsz");
guestfs_set_ready (g);
return -1;
struct blockdev_setbsz_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct blockdev_setbsz_ctx *ctx = (struct blockdev_setbsz_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_blockdev_setbsz");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_blockdev_setbsz (guestfs_h *g,
guestfs_set_reply_callback (g, blockdev_setbsz_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_setbsz");
guestfs_set_ready (g);
return -1;
struct blockdev_getsz_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct blockdev_getsz_ctx *ctx = (struct blockdev_getsz_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_blockdev_getsz");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int64_t guestfs_blockdev_getsz (guestfs_h *g,
guestfs_set_reply_callback (g, blockdev_getsz_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_getsz");
guestfs_set_ready (g);
return -1;
struct blockdev_getsize64_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct blockdev_getsize64_ctx *ctx = (struct blockdev_getsize64_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_blockdev_getsize64");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int64_t guestfs_blockdev_getsize64 (guestfs_h *g,
guestfs_set_reply_callback (g, blockdev_getsize64_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_getsize64");
guestfs_set_ready (g);
return -1;
struct blockdev_flushbufs_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct blockdev_flushbufs_ctx *ctx = (struct blockdev_flushbufs_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_blockdev_flushbufs");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_blockdev_flushbufs (guestfs_h *g,
guestfs_set_reply_callback (g, blockdev_flushbufs_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_flushbufs");
guestfs_set_ready (g);
return -1;
struct blockdev_rereadpt_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct blockdev_rereadpt_ctx *ctx = (struct blockdev_rereadpt_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_blockdev_rereadpt");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_blockdev_rereadpt (guestfs_h *g,
guestfs_set_reply_callback (g, blockdev_rereadpt_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_rereadpt");
guestfs_set_ready (g);
return -1;
struct upload_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct upload_ctx *ctx = (struct upload_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_upload");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_upload (guestfs_h *g,
guestfs_set_reply_callback (g, upload_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_upload");
guestfs_set_ready (g);
return -1;
struct download_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct download_ctx *ctx = (struct download_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_download");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_download (guestfs_h *g,
guestfs_set_reply_callback (g, download_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_download");
guestfs_set_ready (g);
return -1;
struct checksum_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct checksum_ctx *ctx = (struct checksum_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_checksum");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char *guestfs_checksum (guestfs_h *g,
guestfs_set_reply_callback (g, checksum_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_checksum");
guestfs_set_ready (g);
return NULL;
struct tar_in_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct tar_in_ctx *ctx = (struct tar_in_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_tar_in");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_tar_in (guestfs_h *g,
guestfs_set_reply_callback (g, tar_in_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_tar_in");
guestfs_set_ready (g);
return -1;
struct tar_out_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct tar_out_ctx *ctx = (struct tar_out_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_tar_out");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_tar_out (guestfs_h *g,
guestfs_set_reply_callback (g, tar_out_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_tar_out");
guestfs_set_ready (g);
return -1;
struct tgz_in_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct tgz_in_ctx *ctx = (struct tgz_in_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_tgz_in");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_tgz_in (guestfs_h *g,
guestfs_set_reply_callback (g, tgz_in_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_tgz_in");
guestfs_set_ready (g);
return -1;
struct tgz_out_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct tgz_out_ctx *ctx = (struct tgz_out_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_tgz_out");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_tgz_out (guestfs_h *g,
guestfs_set_reply_callback (g, tgz_out_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_tgz_out");
guestfs_set_ready (g);
return -1;
struct mount_ro_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct mount_ro_ctx *ctx = (struct mount_ro_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_mount_ro");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_mount_ro (guestfs_h *g,
guestfs_set_reply_callback (g, mount_ro_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_mount_ro");
guestfs_set_ready (g);
return -1;
struct mount_options_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct mount_options_ctx *ctx = (struct mount_options_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_mount_options");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_mount_options (guestfs_h *g,
guestfs_set_reply_callback (g, mount_options_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_mount_options");
guestfs_set_ready (g);
return -1;
struct mount_vfs_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct mount_vfs_ctx *ctx = (struct mount_vfs_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_mount_vfs");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_mount_vfs (guestfs_h *g,
guestfs_set_reply_callback (g, mount_vfs_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_mount_vfs");
guestfs_set_ready (g);
return -1;
struct debug_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct debug_ctx *ctx = (struct debug_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_debug");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
return;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
char *guestfs_debug (guestfs_h *g,
guestfs_set_reply_callback (g, debug_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_debug");
guestfs_set_ready (g);
return NULL;
struct lvremove_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct lvremove_ctx *ctx = (struct lvremove_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_lvremove");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_lvremove (guestfs_h *g,
guestfs_set_reply_callback (g, lvremove_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_lvremove");
guestfs_set_ready (g);
return -1;
struct vgremove_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct vgremove_ctx *ctx = (struct vgremove_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_vgremove");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_vgremove (guestfs_h *g,
guestfs_set_reply_callback (g, vgremove_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_vgremove");
guestfs_set_ready (g);
return -1;
struct pvremove_ctx {
/* This flag is set by the callbacks, so we know we've done
* the callbacks as expected, and in the right sequence.
- * 0 = not called, 1 = send called,
- * 1001 = reply called.
+ * 0 = not called, 1 = reply_cb called.
*/
int cb_sequence;
struct guestfs_message_header hdr;
guestfs_main_loop *ml = guestfs_get_main_loop (g);
struct pvremove_ctx *ctx = (struct pvremove_ctx *) data;
+ /* This should definitely not happen. */
+ if (ctx->cb_sequence != 0) {
+ ctx->cb_sequence = 9999;
+ error (g, "%s: internal error: reply callback called twice", "guestfs_pvremove");
+ return;
+ }
+
ml->main_loop_quit (ml, g);
if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
goto done;
}
done:
- ctx->cb_sequence = 1001;
+ ctx->cb_sequence = 1;
}
int guestfs_pvremove (guestfs_h *g,
guestfs_set_reply_callback (g, pvremove_reply_cb, &ctx);
(void) ml->main_loop_run (ml, g);
guestfs_set_reply_callback (g, NULL, NULL);
- if (ctx.cb_sequence != 1001) {
+ if (ctx.cb_sequence != 1) {
error (g, "%s reply failed, see earlier error messages", "guestfs_pvremove");
guestfs_set_ready (g);
return -1;