From 15e0fd573a87488c66cb3a6f0da01f3ab5f2f6ed Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Fri, 8 May 2009 15:20:36 +0100 Subject: [PATCH] Generated code to support last 3 commits. --- daemon/debug.c | 10 + guestfs-actions.pod | 12 + java/com/redhat/et/libguestfs/GuestFS.java | 21 + java/com_redhat_et_libguestfs_GuestFS.c | 14 + ocaml/guestfs.ml | 1 + ocaml/guestfs.mli | 3 + ocaml/guestfs_c_actions.c | 22 + perl/Guestfs.xs | 10 + perl/lib/Sys/Guestfs.pm | 8 + python/guestfs-py.c | 25 + python/guestfs.py | 9 + ruby/ext/guestfs/_guestfs.c | 19 + src/guestfs-actions.c | 972 ++++++++++++++--------------- src/guestfs-actions.h | 1 + tests.c | 1 + 15 files changed, 642 insertions(+), 486 deletions(-) diff --git a/daemon/debug.c b/daemon/debug.c index e4a7f05..6d6d2b5 100644 --- a/daemon/debug.c +++ b/daemon/debug.c @@ -46,11 +46,13 @@ struct cmd { static char *debug_help (const char *subcmd, int argc, char *const *const argv); static char *debug_fds (const char *subcmd, int argc, char *const *const argv); +static char *debug_segv (const char *subcmd, int argc, char *const *const argv); static char *debug_sh (const char *subcmd, int argc, char *const *const argv); static struct cmd cmds[] = { { "help", debug_help }, { "fds", debug_fds }, + { "segv", debug_segv }, { "sh", debug_sh }, { NULL, NULL } }; @@ -177,6 +179,14 @@ debug_fds (const char *subcmd, int argc, char *const *const argv) return out; } +/* Force a segfault in the daemon. */ +static char * +debug_segv (const char *subcmd, int argc, char *const *const argv) +{ + *(int*)0 = 0; + return NULL; +} + /* Run an arbitrary shell command. */ static char * debug_sh (const char *subcmd, int argc, char *const *const argv) diff --git a/guestfs-actions.pod b/guestfs-actions.pod index 51b80a1..8f602b8 100644 --- a/guestfs-actions.pod +++ b/guestfs-actions.pod @@ -609,6 +609,18 @@ so that the maximum guest memory is freed. This function returns 0 on success or -1 on error. +=head2 guestfs_end_busy + + int guestfs_end_busy (guestfs_h *handle); + +This sets the state to C, or if in C then it leaves the +state as is. This is only used when implementing +actions using the low-level API. + +For more information on states, see L. + +This function returns 0 on success or -1 on error. + =head2 guestfs_equal int guestfs_equal (guestfs_h *handle, diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index 0d9ae9d..26f1aaa 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -535,6 +535,27 @@ public class GuestFS { throws LibGuestFSException; /** + * leave the busy state + * + * This sets the state to "READY", or if in "CONFIG" then + * it leaves the state as is. This is only used when + * implementing actions using the low-level API. + * + * For more information on states, see guestfs(3). + * + * @throws LibGuestFSException + */ + public void end_busy () + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("end_busy: handle is closed"); + _end_busy (g); + } + private native void _end_busy (long g) + throws LibGuestFSException; + + /** * mount a guest disk at a position in the filesystem * * Mount a guest disk at a position in the filesystem. diff --git a/java/com_redhat_et_libguestfs_GuestFS.c b/java/com_redhat_et_libguestfs_GuestFS.c index 48cd60f..2ad4c6a 100644 --- a/java/com_redhat_et_libguestfs_GuestFS.c +++ b/java/com_redhat_et_libguestfs_GuestFS.c @@ -387,6 +387,20 @@ Java_com_redhat_et_libguestfs_GuestFS__1set_1ready } JNIEXPORT void JNICALL +Java_com_redhat_et_libguestfs_GuestFS__1end_1busy + (JNIEnv *env, jobject obj, jlong jg) +{ + guestfs_h *g = (guestfs_h *) (long) jg; + int r; + + r = guestfs_end_busy (g); + if (r == -1) { + throw_exception (env, guestfs_last_error (g)); + return ; + } +} + +JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mount (JNIEnv *env, jobject obj, jlong jg, jstring jdevice, jstring jmountpoint) { diff --git a/ocaml/guestfs.ml b/ocaml/guestfs.ml index ab958b7..39d2329 100644 --- a/ocaml/guestfs.ml +++ b/ocaml/guestfs.ml @@ -136,6 +136,7 @@ external is_busy : t -> bool = "ocaml_guestfs_is_busy" external get_state : t -> int = "ocaml_guestfs_get_state" external set_busy : t -> unit = "ocaml_guestfs_set_busy" external set_ready : t -> unit = "ocaml_guestfs_set_ready" +external end_busy : t -> unit = "ocaml_guestfs_end_busy" external mount : t -> string -> string -> unit = "ocaml_guestfs_mount" external sync : t -> unit = "ocaml_guestfs_sync" external touch : t -> string -> unit = "ocaml_guestfs_touch" diff --git a/ocaml/guestfs.mli b/ocaml/guestfs.mli index d44fb06..21e6eeb 100644 --- a/ocaml/guestfs.mli +++ b/ocaml/guestfs.mli @@ -187,6 +187,9 @@ val set_busy : t -> unit val set_ready : t -> unit (** set state to ready *) +val end_busy : t -> unit +(** leave the busy state *) + val mount : t -> string -> string -> unit (** mount a guest disk at a position in the filesystem *) diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c index a707897..fa352fc 100644 --- a/ocaml/guestfs_c_actions.c +++ b/ocaml/guestfs_c_actions.c @@ -800,6 +800,28 @@ ocaml_guestfs_set_ready (value gv) } CAMLprim value +ocaml_guestfs_end_busy (value gv) +{ + CAMLparam1 (gv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("end_busy: used handle after closing it"); + + int r; + + caml_enter_blocking_section (); + r = guestfs_end_busy (g); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "end_busy"); + + rv = Val_unit; + CAMLreturn (rv); +} + +CAMLprim value ocaml_guestfs_mount (value gv, value devicev, value mountpointv) { CAMLparam3 (gv, devicev, mountpointv); diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs index ce697c5..27e03d0 100644 --- a/perl/Guestfs.xs +++ b/perl/Guestfs.xs @@ -352,6 +352,16 @@ PREINIT: croak ("set_ready: %s", guestfs_last_error (g)); void +end_busy (g) + guestfs_h *g; +PREINIT: + int r; + PPCODE: + r = guestfs_end_busy (g); + if (r == -1) + croak ("end_busy: %s", guestfs_last_error (g)); + +void mount (g, device, mountpoint) guestfs_h *g; char *device; diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm index d059ae4..5aac2e9 100644 --- a/perl/lib/Sys/Guestfs.pm +++ b/perl/lib/Sys/Guestfs.pm @@ -484,6 +484,14 @@ Setting C to 3 should drop everything. This automatically calls L before the operation, so that the maximum guest memory is freed. +=item $h->end_busy (); + +This sets the state to C, or if in C then it leaves the +state as is. This is only used when implementing +actions using the low-level API. + +For more information on states, see L. + =item $equality = $h->equal ($file1, $file2); This compares the two files C and C and returns diff --git a/python/guestfs-py.c b/python/guestfs-py.c index efc5792..11ea6a4 100644 --- a/python/guestfs-py.c +++ b/python/guestfs-py.c @@ -892,6 +892,30 @@ py_guestfs_set_ready (PyObject *self, PyObject *args) } static PyObject * +py_guestfs_end_busy (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + int r; + + if (!PyArg_ParseTuple (args, (char *) "O:guestfs_end_busy", + &py_g)) + return NULL; + g = get_handle (py_g); + + r = guestfs_end_busy (g); + if (r == -1) { + PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g)); + return NULL; + } + + Py_INCREF (Py_None); + py_r = Py_None; + return py_r; +} + +static PyObject * py_guestfs_mount (PyObject *self, PyObject *args) { PyObject *py_g; @@ -3354,6 +3378,7 @@ static PyMethodDef methods[] = { { (char *) "get_state", py_guestfs_get_state, METH_VARARGS, NULL }, { (char *) "set_busy", py_guestfs_set_busy, METH_VARARGS, NULL }, { (char *) "set_ready", py_guestfs_set_ready, METH_VARARGS, NULL }, + { (char *) "end_busy", py_guestfs_end_busy, METH_VARARGS, NULL }, { (char *) "mount", py_guestfs_mount, METH_VARARGS, NULL }, { (char *) "sync", py_guestfs_sync, METH_VARARGS, NULL }, { (char *) "touch", py_guestfs_touch, METH_VARARGS, NULL }, diff --git a/python/guestfs.py b/python/guestfs.py index 9cf9d88..678e298 100644 --- a/python/guestfs.py +++ b/python/guestfs.py @@ -279,6 +279,15 @@ class GuestFS: """ return libguestfsmod.set_ready (self._o) + def end_busy (self): + u"""This sets the state to "READY", or if in "CONFIG" then + it leaves the state as is. This is only used when + implementing actions using the low-level API. + + For more information on states, see guestfs(3). + """ + return libguestfsmod.end_busy (self._o) + def mount (self, device, mountpoint): u"""Mount a guest disk at a position in the filesystem. Block devices are named "/dev/sda", "/dev/sdb" and so diff --git a/ruby/ext/guestfs/_guestfs.c b/ruby/ext/guestfs/_guestfs.c index 8b87aed..dd51ca5 100644 --- a/ruby/ext/guestfs/_guestfs.c +++ b/ruby/ext/guestfs/_guestfs.c @@ -451,6 +451,23 @@ static VALUE ruby_guestfs_set_ready (VALUE gv) return Qnil; } +static VALUE ruby_guestfs_end_busy (VALUE gv) +{ + guestfs_h *g; + Data_Get_Struct (gv, guestfs_h, g); + if (!g) + rb_raise (rb_eArgError, "%s: used handle after closing it", "end_busy"); + + + int r; + + r = guestfs_end_busy (g); + if (r == -1) + rb_raise (e_Error, "%s", guestfs_last_error (g)); + + return Qnil; +} + static VALUE ruby_guestfs_mount (VALUE gv, VALUE devicev, VALUE mountpointv) { guestfs_h *g; @@ -2882,6 +2899,8 @@ void Init__guestfs () ruby_guestfs_set_busy, 0); rb_define_method (c_guestfs, "set_ready", ruby_guestfs_set_ready, 0); + rb_define_method (c_guestfs, "end_busy", + ruby_guestfs_end_busy, 0); rb_define_method (c_guestfs, "mount", ruby_guestfs_mount, 2); rb_define_method (c_guestfs, "sync", diff --git a/src/guestfs-actions.c b/src/guestfs-actions.c index f49e79f..2dc84e5 100644 --- a/src/guestfs-actions.c +++ b/src/guestfs-actions.c @@ -141,7 +141,7 @@ int guestfs_mount (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_MOUNT, (xdrproc_t) xdr_guestfs_mount_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -152,22 +152,22 @@ int guestfs_mount (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_mount"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_MOUNT, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -223,7 +223,7 @@ int guestfs_sync (guestfs_h *g) serial = guestfs__send_sync (g, GUESTFS_PROC_SYNC, NULL, NULL); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -234,22 +234,22 @@ int guestfs_sync (guestfs_h *g) guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_sync"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_SYNC, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -309,7 +309,7 @@ int guestfs_touch (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_TOUCH, (xdrproc_t) xdr_guestfs_touch_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -320,22 +320,22 @@ int guestfs_touch (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_touch"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_TOUCH, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -400,7 +400,7 @@ char *guestfs_cat (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_CAT, (xdrproc_t) xdr_guestfs_cat_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -411,22 +411,22 @@ char *guestfs_cat (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_cat"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_CAT, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.content; /* caller will free */ } @@ -491,7 +491,7 @@ char *guestfs_ll (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_LL, (xdrproc_t) xdr_guestfs_ll_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -502,22 +502,22 @@ char *guestfs_ll (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_ll"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_LL, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.listing; /* caller will free */ } @@ -582,7 +582,7 @@ char **guestfs_ls (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_LS, (xdrproc_t) xdr_guestfs_ls_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -593,22 +593,22 @@ char **guestfs_ls (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_ls"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_LS, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this, but we need to add a NULL entry */ ctx.ret.listing.listing_val = safe_realloc (g, ctx.ret.listing.listing_val, @@ -674,7 +674,7 @@ char **guestfs_list_devices (guestfs_h *g) serial = guestfs__send_sync (g, GUESTFS_PROC_LIST_DEVICES, NULL, NULL); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -685,22 +685,22 @@ char **guestfs_list_devices (guestfs_h *g) guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_list_devices"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_LIST_DEVICES, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this, but we need to add a NULL entry */ ctx.ret.devices.devices_val = safe_realloc (g, ctx.ret.devices.devices_val, @@ -766,7 +766,7 @@ char **guestfs_list_partitions (guestfs_h *g) serial = guestfs__send_sync (g, GUESTFS_PROC_LIST_PARTITIONS, NULL, NULL); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -777,22 +777,22 @@ char **guestfs_list_partitions (guestfs_h *g) guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_list_partitions"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_LIST_PARTITIONS, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this, but we need to add a NULL entry */ ctx.ret.partitions.partitions_val = safe_realloc (g, ctx.ret.partitions.partitions_val, @@ -858,7 +858,7 @@ char **guestfs_pvs (guestfs_h *g) serial = guestfs__send_sync (g, GUESTFS_PROC_PVS, NULL, NULL); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -869,22 +869,22 @@ char **guestfs_pvs (guestfs_h *g) guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_pvs"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_PVS, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this, but we need to add a NULL entry */ ctx.ret.physvols.physvols_val = safe_realloc (g, ctx.ret.physvols.physvols_val, @@ -950,7 +950,7 @@ char **guestfs_vgs (guestfs_h *g) serial = guestfs__send_sync (g, GUESTFS_PROC_VGS, NULL, NULL); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -961,22 +961,22 @@ char **guestfs_vgs (guestfs_h *g) guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_vgs"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_VGS, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this, but we need to add a NULL entry */ ctx.ret.volgroups.volgroups_val = safe_realloc (g, ctx.ret.volgroups.volgroups_val, @@ -1042,7 +1042,7 @@ char **guestfs_lvs (guestfs_h *g) serial = guestfs__send_sync (g, GUESTFS_PROC_LVS, NULL, NULL); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -1053,22 +1053,22 @@ char **guestfs_lvs (guestfs_h *g) guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_lvs"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_LVS, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this, but we need to add a NULL entry */ ctx.ret.logvols.logvols_val = safe_realloc (g, ctx.ret.logvols.logvols_val, @@ -1134,7 +1134,7 @@ struct guestfs_lvm_pv_list *guestfs_pvs_full (guestfs_h *g) serial = guestfs__send_sync (g, GUESTFS_PROC_PVS_FULL, NULL, NULL); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -1145,22 +1145,22 @@ struct guestfs_lvm_pv_list *guestfs_pvs_full (guestfs_h *g) guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_pvs_full"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_PVS_FULL, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this */ return safe_memdup (g, &ctx.ret.physvols, sizeof (ctx.ret.physvols)); } @@ -1222,7 +1222,7 @@ struct guestfs_lvm_vg_list *guestfs_vgs_full (guestfs_h *g) serial = guestfs__send_sync (g, GUESTFS_PROC_VGS_FULL, NULL, NULL); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -1233,22 +1233,22 @@ struct guestfs_lvm_vg_list *guestfs_vgs_full (guestfs_h *g) guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_vgs_full"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_VGS_FULL, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this */ return safe_memdup (g, &ctx.ret.volgroups, sizeof (ctx.ret.volgroups)); } @@ -1310,7 +1310,7 @@ struct guestfs_lvm_lv_list *guestfs_lvs_full (guestfs_h *g) serial = guestfs__send_sync (g, GUESTFS_PROC_LVS_FULL, NULL, NULL); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -1321,22 +1321,22 @@ struct guestfs_lvm_lv_list *guestfs_lvs_full (guestfs_h *g) guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_lvs_full"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_LVS_FULL, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this */ return safe_memdup (g, &ctx.ret.logvols, sizeof (ctx.ret.logvols)); } @@ -1402,7 +1402,7 @@ char **guestfs_read_lines (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_READ_LINES, (xdrproc_t) xdr_guestfs_read_lines_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -1413,22 +1413,22 @@ char **guestfs_read_lines (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_read_lines"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_READ_LINES, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this, but we need to add a NULL entry */ ctx.ret.lines.lines_val = safe_realloc (g, ctx.ret.lines.lines_val, @@ -1495,7 +1495,7 @@ int guestfs_aug_init (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_AUG_INIT, (xdrproc_t) xdr_guestfs_aug_init_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -1506,22 +1506,22 @@ int guestfs_aug_init (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_aug_init"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_AUG_INIT, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -1577,7 +1577,7 @@ int guestfs_aug_close (guestfs_h *g) serial = guestfs__send_sync (g, GUESTFS_PROC_AUG_CLOSE, NULL, NULL); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -1588,22 +1588,22 @@ int guestfs_aug_close (guestfs_h *g) guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_aug_close"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_AUG_CLOSE, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -1670,7 +1670,7 @@ int guestfs_aug_defvar (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_AUG_DEFVAR, (xdrproc_t) xdr_guestfs_aug_defvar_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -1681,22 +1681,22 @@ int guestfs_aug_defvar (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_aug_defvar"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_AUG_DEFVAR, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.nrnodes; } @@ -1765,7 +1765,7 @@ struct guestfs_int_bool *guestfs_aug_defnode (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_AUG_DEFNODE, (xdrproc_t) xdr_guestfs_aug_defnode_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -1776,22 +1776,22 @@ struct guestfs_int_bool *guestfs_aug_defnode (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_aug_defnode"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_AUG_DEFNODE, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller with free this */ return safe_memdup (g, &ctx.ret, sizeof (ctx.ret)); } @@ -1857,7 +1857,7 @@ char *guestfs_aug_get (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_AUG_GET, (xdrproc_t) xdr_guestfs_aug_get_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -1868,22 +1868,22 @@ char *guestfs_aug_get (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_aug_get"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_AUG_GET, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.val; /* caller will free */ } @@ -1945,7 +1945,7 @@ int guestfs_aug_set (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_AUG_SET, (xdrproc_t) xdr_guestfs_aug_set_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -1956,22 +1956,22 @@ int guestfs_aug_set (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_aug_set"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_AUG_SET, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -2035,7 +2035,7 @@ int guestfs_aug_insert (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_AUG_INSERT, (xdrproc_t) xdr_guestfs_aug_insert_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -2046,22 +2046,22 @@ int guestfs_aug_insert (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_aug_insert"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_AUG_INSERT, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -2126,7 +2126,7 @@ int guestfs_aug_rm (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_AUG_RM, (xdrproc_t) xdr_guestfs_aug_rm_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -2137,22 +2137,22 @@ int guestfs_aug_rm (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_aug_rm"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_AUG_RM, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.nrnodes; } @@ -2214,7 +2214,7 @@ int guestfs_aug_mv (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_AUG_MV, (xdrproc_t) xdr_guestfs_aug_mv_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -2225,22 +2225,22 @@ int guestfs_aug_mv (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_aug_mv"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_AUG_MV, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -2305,7 +2305,7 @@ char **guestfs_aug_match (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_AUG_MATCH, (xdrproc_t) xdr_guestfs_aug_match_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -2316,22 +2316,22 @@ char **guestfs_aug_match (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_aug_match"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_AUG_MATCH, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this, but we need to add a NULL entry */ ctx.ret.matches.matches_val = safe_realloc (g, ctx.ret.matches.matches_val, @@ -2392,7 +2392,7 @@ int guestfs_aug_save (guestfs_h *g) serial = guestfs__send_sync (g, GUESTFS_PROC_AUG_SAVE, NULL, NULL); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -2403,22 +2403,22 @@ int guestfs_aug_save (guestfs_h *g) guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_aug_save"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_AUG_SAVE, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -2474,7 +2474,7 @@ int guestfs_aug_load (guestfs_h *g) serial = guestfs__send_sync (g, GUESTFS_PROC_AUG_LOAD, NULL, NULL); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -2485,22 +2485,22 @@ int guestfs_aug_load (guestfs_h *g) guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_aug_load"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_AUG_LOAD, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -2565,7 +2565,7 @@ char **guestfs_aug_ls (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_AUG_LS, (xdrproc_t) xdr_guestfs_aug_ls_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -2576,22 +2576,22 @@ char **guestfs_aug_ls (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_aug_ls"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_AUG_LS, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this, but we need to add a NULL entry */ ctx.ret.matches.matches_val = safe_realloc (g, ctx.ret.matches.matches_val, @@ -2656,7 +2656,7 @@ int guestfs_rm (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_RM, (xdrproc_t) xdr_guestfs_rm_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -2667,22 +2667,22 @@ int guestfs_rm (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_rm"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_RM, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -2742,7 +2742,7 @@ int guestfs_rmdir (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_RMDIR, (xdrproc_t) xdr_guestfs_rmdir_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -2753,22 +2753,22 @@ int guestfs_rmdir (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_rmdir"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_RMDIR, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -2828,7 +2828,7 @@ int guestfs_rm_rf (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_RM_RF, (xdrproc_t) xdr_guestfs_rm_rf_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -2839,22 +2839,22 @@ int guestfs_rm_rf (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_rm_rf"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_RM_RF, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -2914,7 +2914,7 @@ int guestfs_mkdir (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_MKDIR, (xdrproc_t) xdr_guestfs_mkdir_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -2925,22 +2925,22 @@ int guestfs_mkdir (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_mkdir"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_MKDIR, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -3000,7 +3000,7 @@ int guestfs_mkdir_p (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_MKDIR_P, (xdrproc_t) xdr_guestfs_mkdir_p_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -3011,22 +3011,22 @@ int guestfs_mkdir_p (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_mkdir_p"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_MKDIR_P, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -3088,7 +3088,7 @@ int guestfs_chmod (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_CHMOD, (xdrproc_t) xdr_guestfs_chmod_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -3099,22 +3099,22 @@ int guestfs_chmod (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_chmod"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_CHMOD, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -3178,7 +3178,7 @@ int guestfs_chown (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_CHOWN, (xdrproc_t) xdr_guestfs_chown_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -3189,22 +3189,22 @@ int guestfs_chown (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_chown"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_CHOWN, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -3269,7 +3269,7 @@ int guestfs_exists (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_EXISTS, (xdrproc_t) xdr_guestfs_exists_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -3280,22 +3280,22 @@ int guestfs_exists (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_exists"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_EXISTS, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.existsflag; } @@ -3360,7 +3360,7 @@ int guestfs_is_file (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_IS_FILE, (xdrproc_t) xdr_guestfs_is_file_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -3371,22 +3371,22 @@ int guestfs_is_file (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_is_file"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_IS_FILE, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.fileflag; } @@ -3451,7 +3451,7 @@ int guestfs_is_dir (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_IS_DIR, (xdrproc_t) xdr_guestfs_is_dir_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -3462,22 +3462,22 @@ int guestfs_is_dir (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_is_dir"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_IS_DIR, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.dirflag; } @@ -3537,7 +3537,7 @@ int guestfs_pvcreate (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_PVCREATE, (xdrproc_t) xdr_guestfs_pvcreate_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -3548,22 +3548,22 @@ int guestfs_pvcreate (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_pvcreate"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_PVCREATE, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -3626,7 +3626,7 @@ int guestfs_vgcreate (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_VGCREATE, (xdrproc_t) xdr_guestfs_vgcreate_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -3637,22 +3637,22 @@ int guestfs_vgcreate (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_vgcreate"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_VGCREATE, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -3716,7 +3716,7 @@ int guestfs_lvcreate (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_LVCREATE, (xdrproc_t) xdr_guestfs_lvcreate_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -3727,22 +3727,22 @@ int guestfs_lvcreate (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_lvcreate"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_LVCREATE, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -3804,7 +3804,7 @@ int guestfs_mkfs (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_MKFS, (xdrproc_t) xdr_guestfs_mkfs_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -3815,22 +3815,22 @@ int guestfs_mkfs (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_mkfs"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_MKFS, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -3899,7 +3899,7 @@ int guestfs_sfdisk (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_SFDISK, (xdrproc_t) xdr_guestfs_sfdisk_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -3910,22 +3910,22 @@ int guestfs_sfdisk (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_sfdisk"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_SFDISK, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -3989,7 +3989,7 @@ int guestfs_write_file (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_WRITE_FILE, (xdrproc_t) xdr_guestfs_write_file_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -4000,22 +4000,22 @@ int guestfs_write_file (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_write_file"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_WRITE_FILE, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -4075,7 +4075,7 @@ int guestfs_umount (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_UMOUNT, (xdrproc_t) xdr_guestfs_umount_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -4086,22 +4086,22 @@ int guestfs_umount (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_umount"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_UMOUNT, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -4162,7 +4162,7 @@ char **guestfs_mounts (guestfs_h *g) serial = guestfs__send_sync (g, GUESTFS_PROC_MOUNTS, NULL, NULL); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -4173,22 +4173,22 @@ char **guestfs_mounts (guestfs_h *g) guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_mounts"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_MOUNTS, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this, but we need to add a NULL entry */ ctx.ret.devices.devices_val = safe_realloc (g, ctx.ret.devices.devices_val, @@ -4249,7 +4249,7 @@ int guestfs_umount_all (guestfs_h *g) serial = guestfs__send_sync (g, GUESTFS_PROC_UMOUNT_ALL, NULL, NULL); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -4260,22 +4260,22 @@ int guestfs_umount_all (guestfs_h *g) guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_umount_all"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_UMOUNT_ALL, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -4331,7 +4331,7 @@ int guestfs_lvm_remove_all (guestfs_h *g) serial = guestfs__send_sync (g, GUESTFS_PROC_LVM_REMOVE_ALL, NULL, NULL); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -4342,22 +4342,22 @@ int guestfs_lvm_remove_all (guestfs_h *g) guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_lvm_remove_all"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_LVM_REMOVE_ALL, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -4422,7 +4422,7 @@ char *guestfs_file (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_FILE, (xdrproc_t) xdr_guestfs_file_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -4433,22 +4433,22 @@ char *guestfs_file (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_file"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_FILE, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.description; /* caller will free */ } @@ -4514,7 +4514,7 @@ char *guestfs_command (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_COMMAND, (xdrproc_t) xdr_guestfs_command_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -4525,22 +4525,22 @@ char *guestfs_command (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_command"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_COMMAND, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.output; /* caller will free */ } @@ -4606,7 +4606,7 @@ char **guestfs_command_lines (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_COMMAND_LINES, (xdrproc_t) xdr_guestfs_command_lines_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -4617,22 +4617,22 @@ char **guestfs_command_lines (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_command_lines"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_COMMAND_LINES, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this, but we need to add a NULL entry */ ctx.ret.lines.lines_val = safe_realloc (g, ctx.ret.lines.lines_val, @@ -4702,7 +4702,7 @@ struct guestfs_stat *guestfs_stat (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_STAT, (xdrproc_t) xdr_guestfs_stat_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -4713,22 +4713,22 @@ struct guestfs_stat *guestfs_stat (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_stat"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_STAT, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this */ return safe_memdup (g, &ctx.ret.statbuf, sizeof (ctx.ret.statbuf)); } @@ -4794,7 +4794,7 @@ struct guestfs_stat *guestfs_lstat (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_LSTAT, (xdrproc_t) xdr_guestfs_lstat_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -4805,22 +4805,22 @@ struct guestfs_stat *guestfs_lstat (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_lstat"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_LSTAT, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this */ return safe_memdup (g, &ctx.ret.statbuf, sizeof (ctx.ret.statbuf)); } @@ -4886,7 +4886,7 @@ struct guestfs_statvfs *guestfs_statvfs (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_STATVFS, (xdrproc_t) xdr_guestfs_statvfs_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -4897,22 +4897,22 @@ struct guestfs_statvfs *guestfs_statvfs (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_statvfs"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_STATVFS, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this */ return safe_memdup (g, &ctx.ret.statbuf, sizeof (ctx.ret.statbuf)); } @@ -4978,7 +4978,7 @@ char **guestfs_tune2fs_l (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_TUNE2FS_L, (xdrproc_t) xdr_guestfs_tune2fs_l_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -4989,22 +4989,22 @@ char **guestfs_tune2fs_l (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_tune2fs_l"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_TUNE2FS_L, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this, but we need to add a NULL entry */ ctx.ret.superblock.superblock_val = safe_realloc (g, ctx.ret.superblock.superblock_val, @@ -5069,7 +5069,7 @@ int guestfs_blockdev_setro (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_BLOCKDEV_SETRO, (xdrproc_t) xdr_guestfs_blockdev_setro_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -5080,22 +5080,22 @@ int guestfs_blockdev_setro (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_setro"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_BLOCKDEV_SETRO, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -5155,7 +5155,7 @@ int guestfs_blockdev_setrw (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_BLOCKDEV_SETRW, (xdrproc_t) xdr_guestfs_blockdev_setrw_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -5166,22 +5166,22 @@ int guestfs_blockdev_setrw (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_setrw"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_BLOCKDEV_SETRW, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -5246,7 +5246,7 @@ int guestfs_blockdev_getro (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_BLOCKDEV_GETRO, (xdrproc_t) xdr_guestfs_blockdev_getro_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -5257,22 +5257,22 @@ int guestfs_blockdev_getro (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_getro"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_BLOCKDEV_GETRO, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.ro; } @@ -5337,7 +5337,7 @@ int guestfs_blockdev_getss (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_BLOCKDEV_GETSS, (xdrproc_t) xdr_guestfs_blockdev_getss_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -5348,22 +5348,22 @@ int guestfs_blockdev_getss (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_getss"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_BLOCKDEV_GETSS, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.sectorsize; } @@ -5428,7 +5428,7 @@ int guestfs_blockdev_getbsz (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_BLOCKDEV_GETBSZ, (xdrproc_t) xdr_guestfs_blockdev_getbsz_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -5439,22 +5439,22 @@ int guestfs_blockdev_getbsz (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_getbsz"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_BLOCKDEV_GETBSZ, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.blocksize; } @@ -5516,7 +5516,7 @@ int guestfs_blockdev_setbsz (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_BLOCKDEV_SETBSZ, (xdrproc_t) xdr_guestfs_blockdev_setbsz_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -5527,22 +5527,22 @@ int guestfs_blockdev_setbsz (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_setbsz"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_BLOCKDEV_SETBSZ, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -5607,7 +5607,7 @@ int64_t guestfs_blockdev_getsz (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_BLOCKDEV_GETSZ, (xdrproc_t) xdr_guestfs_blockdev_getsz_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -5618,22 +5618,22 @@ int64_t guestfs_blockdev_getsz (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_getsz"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_BLOCKDEV_GETSZ, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.sizeinsectors; } @@ -5698,7 +5698,7 @@ int64_t guestfs_blockdev_getsize64 (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_BLOCKDEV_GETSIZE64, (xdrproc_t) xdr_guestfs_blockdev_getsize64_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -5709,22 +5709,22 @@ int64_t guestfs_blockdev_getsize64 (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_getsize64"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_BLOCKDEV_GETSIZE64, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.sizeinbytes; } @@ -5784,7 +5784,7 @@ int guestfs_blockdev_flushbufs (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_BLOCKDEV_FLUSHBUFS, (xdrproc_t) xdr_guestfs_blockdev_flushbufs_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -5795,22 +5795,22 @@ int guestfs_blockdev_flushbufs (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_flushbufs"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_BLOCKDEV_FLUSHBUFS, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -5870,7 +5870,7 @@ int guestfs_blockdev_rereadpt (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_BLOCKDEV_REREADPT, (xdrproc_t) xdr_guestfs_blockdev_rereadpt_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -5881,22 +5881,22 @@ int guestfs_blockdev_rereadpt (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_blockdev_rereadpt"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_BLOCKDEV_REREADPT, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -5957,7 +5957,7 @@ int guestfs_upload (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_UPLOAD, (xdrproc_t) xdr_guestfs_upload_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -5966,7 +5966,7 @@ int guestfs_upload (guestfs_h *g, r = guestfs__send_file_sync (g, filename); if (r == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (r == -2) /* daemon cancelled */ @@ -5981,22 +5981,22 @@ int guestfs_upload (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_upload"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_UPLOAD, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -6057,7 +6057,7 @@ int guestfs_download (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_DOWNLOAD, (xdrproc_t) xdr_guestfs_download_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -6068,27 +6068,27 @@ int guestfs_download (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_download"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_DOWNLOAD, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (guestfs__receive_file_sync (g, filename) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -6155,7 +6155,7 @@ char *guestfs_checksum (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_CHECKSUM, (xdrproc_t) xdr_guestfs_checksum_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -6166,22 +6166,22 @@ char *guestfs_checksum (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_checksum"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_CHECKSUM, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.checksum; /* caller will free */ } @@ -6242,7 +6242,7 @@ int guestfs_tar_in (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_TAR_IN, (xdrproc_t) xdr_guestfs_tar_in_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -6251,7 +6251,7 @@ int guestfs_tar_in (guestfs_h *g, r = guestfs__send_file_sync (g, tarfile); if (r == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (r == -2) /* daemon cancelled */ @@ -6266,22 +6266,22 @@ int guestfs_tar_in (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_tar_in"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_TAR_IN, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -6342,7 +6342,7 @@ int guestfs_tar_out (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_TAR_OUT, (xdrproc_t) xdr_guestfs_tar_out_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -6353,27 +6353,27 @@ int guestfs_tar_out (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_tar_out"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_TAR_OUT, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (guestfs__receive_file_sync (g, tarfile) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -6434,7 +6434,7 @@ int guestfs_tgz_in (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_TGZ_IN, (xdrproc_t) xdr_guestfs_tgz_in_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -6443,7 +6443,7 @@ int guestfs_tgz_in (guestfs_h *g, r = guestfs__send_file_sync (g, tarball); if (r == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (r == -2) /* daemon cancelled */ @@ -6458,22 +6458,22 @@ int guestfs_tgz_in (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_tgz_in"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_TGZ_IN, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -6534,7 +6534,7 @@ int guestfs_tgz_out (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_TGZ_OUT, (xdrproc_t) xdr_guestfs_tgz_out_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -6545,27 +6545,27 @@ int guestfs_tgz_out (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_tgz_out"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_TGZ_OUT, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (guestfs__receive_file_sync (g, tarball) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -6627,7 +6627,7 @@ int guestfs_mount_ro (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_MOUNT_RO, (xdrproc_t) xdr_guestfs_mount_ro_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -6638,22 +6638,22 @@ int guestfs_mount_ro (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_mount_ro"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_MOUNT_RO, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -6717,7 +6717,7 @@ int guestfs_mount_options (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_MOUNT_OPTIONS, (xdrproc_t) xdr_guestfs_mount_options_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -6728,22 +6728,22 @@ int guestfs_mount_options (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_mount_options"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_MOUNT_OPTIONS, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -6809,7 +6809,7 @@ int guestfs_mount_vfs (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_MOUNT_VFS, (xdrproc_t) xdr_guestfs_mount_vfs_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -6820,22 +6820,22 @@ int guestfs_mount_vfs (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_mount_vfs"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_MOUNT_VFS, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -6903,7 +6903,7 @@ char *guestfs_debug (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_DEBUG, (xdrproc_t) xdr_guestfs_debug_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -6914,22 +6914,22 @@ char *guestfs_debug (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_debug"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_DEBUG, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.result; /* caller will free */ } @@ -6989,7 +6989,7 @@ int guestfs_lvremove (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_LVREMOVE, (xdrproc_t) xdr_guestfs_lvremove_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -7000,22 +7000,22 @@ int guestfs_lvremove (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_lvremove"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_LVREMOVE, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -7075,7 +7075,7 @@ int guestfs_vgremove (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_VGREMOVE, (xdrproc_t) xdr_guestfs_vgremove_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -7086,22 +7086,22 @@ int guestfs_vgremove (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_vgremove"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_VGREMOVE, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -7161,7 +7161,7 @@ int guestfs_pvremove (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_PVREMOVE, (xdrproc_t) xdr_guestfs_pvremove_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -7172,22 +7172,22 @@ int guestfs_pvremove (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_pvremove"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_PVREMOVE, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -7249,7 +7249,7 @@ int guestfs_set_e2label (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_SET_E2LABEL, (xdrproc_t) xdr_guestfs_set_e2label_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -7260,22 +7260,22 @@ int guestfs_set_e2label (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_set_e2label"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_SET_E2LABEL, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -7340,7 +7340,7 @@ char *guestfs_get_e2label (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_GET_E2LABEL, (xdrproc_t) xdr_guestfs_get_e2label_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -7351,22 +7351,22 @@ char *guestfs_get_e2label (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_get_e2label"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_GET_E2LABEL, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.label; /* caller will free */ } @@ -7428,7 +7428,7 @@ int guestfs_set_e2uuid (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_SET_E2UUID, (xdrproc_t) xdr_guestfs_set_e2uuid_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -7439,22 +7439,22 @@ int guestfs_set_e2uuid (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_set_e2uuid"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_SET_E2UUID, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -7519,7 +7519,7 @@ char *guestfs_get_e2uuid (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_GET_E2UUID, (xdrproc_t) xdr_guestfs_get_e2uuid_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -7530,22 +7530,22 @@ char *guestfs_get_e2uuid (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_get_e2uuid"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_GET_E2UUID, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.uuid; /* caller will free */ } @@ -7612,7 +7612,7 @@ int guestfs_fsck (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_FSCK, (xdrproc_t) xdr_guestfs_fsck_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -7623,22 +7623,22 @@ int guestfs_fsck (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_fsck"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_FSCK, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.status; } @@ -7698,7 +7698,7 @@ int guestfs_zero (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_ZERO, (xdrproc_t) xdr_guestfs_zero_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -7709,22 +7709,22 @@ int guestfs_zero (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_zero"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_ZERO, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -7786,7 +7786,7 @@ int guestfs_grub_install (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_GRUB_INSTALL, (xdrproc_t) xdr_guestfs_grub_install_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -7797,22 +7797,22 @@ int guestfs_grub_install (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_grub_install"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_GRUB_INSTALL, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -7874,7 +7874,7 @@ int guestfs_cp (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_CP, (xdrproc_t) xdr_guestfs_cp_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -7885,22 +7885,22 @@ int guestfs_cp (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_cp"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_CP, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -7962,7 +7962,7 @@ int guestfs_cp_a (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_CP_A, (xdrproc_t) xdr_guestfs_cp_a_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -7973,22 +7973,22 @@ int guestfs_cp_a (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_cp_a"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_CP_A, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -8050,7 +8050,7 @@ int guestfs_mv (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_MV, (xdrproc_t) xdr_guestfs_mv_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -8061,22 +8061,22 @@ int guestfs_mv (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_mv"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_MV, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -8136,7 +8136,7 @@ int guestfs_drop_caches (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_DROP_CACHES, (xdrproc_t) xdr_guestfs_drop_caches_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -8147,22 +8147,22 @@ int guestfs_drop_caches (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_drop_caches"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_DROP_CACHES, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -8223,7 +8223,7 @@ char *guestfs_dmesg (guestfs_h *g) serial = guestfs__send_sync (g, GUESTFS_PROC_DMESG, NULL, NULL); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -8234,22 +8234,22 @@ char *guestfs_dmesg (guestfs_h *g) guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_dmesg"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_DMESG, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.kmsgs; /* caller will free */ } @@ -8305,7 +8305,7 @@ int guestfs_ping_daemon (guestfs_h *g) serial = guestfs__send_sync (g, GUESTFS_PROC_PING_DAEMON, NULL, NULL); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -8316,22 +8316,22 @@ int guestfs_ping_daemon (guestfs_h *g) guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_ping_daemon"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_PING_DAEMON, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return 0; } @@ -8398,7 +8398,7 @@ int guestfs_equal (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_EQUAL, (xdrproc_t) xdr_guestfs_equal_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } @@ -8409,22 +8409,22 @@ int guestfs_equal (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_equal"); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_EQUAL, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return -1; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.equality; } @@ -8489,7 +8489,7 @@ char **guestfs_strings (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_STRINGS, (xdrproc_t) xdr_guestfs_strings_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -8500,22 +8500,22 @@ char **guestfs_strings (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_strings"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_STRINGS, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this, but we need to add a NULL entry */ ctx.ret.stringsout.stringsout_val = safe_realloc (g, ctx.ret.stringsout.stringsout_val, @@ -8587,7 +8587,7 @@ char **guestfs_strings_e (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_STRINGS_E, (xdrproc_t) xdr_guestfs_strings_e_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -8598,22 +8598,22 @@ char **guestfs_strings_e (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_strings_e"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_STRINGS_E, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); /* caller will free this, but we need to add a NULL entry */ ctx.ret.stringsout.stringsout_val = safe_realloc (g, ctx.ret.stringsout.stringsout_val, @@ -8683,7 +8683,7 @@ char *guestfs_hexdump (guestfs_h *g, serial = guestfs__send_sync (g, GUESTFS_PROC_HEXDUMP, (xdrproc_t) xdr_guestfs_hexdump_args, (char *) &args); if (serial == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } @@ -8694,22 +8694,22 @@ char *guestfs_hexdump (guestfs_h *g, guestfs_set_reply_callback (g, NULL, NULL); if (ctx.cb_sequence != 1) { error (g, "%s reply failed, see earlier error messages", "guestfs_hexdump"); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_HEXDUMP, serial) == -1) { - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { error (g, "%s", ctx.err.error_message); - guestfs_set_ready (g); + guestfs_end_busy (g); return NULL; } - guestfs_set_ready (g); + guestfs_end_busy (g); return ctx.ret.dump; /* caller will free */ } diff --git a/src/guestfs-actions.h b/src/guestfs-actions.h index 12b33d6..bad7271 100644 --- a/src/guestfs-actions.h +++ b/src/guestfs-actions.h @@ -40,6 +40,7 @@ extern int guestfs_is_busy (guestfs_h *handle); extern int guestfs_get_state (guestfs_h *handle); extern int guestfs_set_busy (guestfs_h *handle); extern int guestfs_set_ready (guestfs_h *handle); +extern int guestfs_end_busy (guestfs_h *handle); extern int guestfs_mount (guestfs_h *handle, const char *device, const char *mountpoint); extern int guestfs_sync (guestfs_h *handle); extern int guestfs_touch (guestfs_h *handle, const char *path); diff --git a/tests.c b/tests.c index 3123513..a8f1d73 100644 --- a/tests.c +++ b/tests.c @@ -83,6 +83,7 @@ static void no_test_warnings (void) fprintf (stderr, "warning: \"guestfs_get_state\" has no tests\n"); fprintf (stderr, "warning: \"guestfs_set_busy\" has no tests\n"); fprintf (stderr, "warning: \"guestfs_set_ready\" has no tests\n"); + fprintf (stderr, "warning: \"guestfs_end_busy\" has no tests\n"); fprintf (stderr, "warning: \"guestfs_ll\" has no tests\n"); fprintf (stderr, "warning: \"guestfs_pvs_full\" has no tests\n"); fprintf (stderr, "warning: \"guestfs_vgs_full\" has no tests\n"); -- 1.8.3.1