diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2012-06-29 11:19:02 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2012-06-29 11:19:02 +0100 |
commit | a79655807bdc466f43a7f0c2f0d683ee50a311f5 (patch) | |
tree | 7811650dc9ade2cc20809181b283362ca419cb6f /tools/libxl/libxl_xshelp.c | |
parent | 83cc69faaf25b7b629b7c0a9ab70287219b86344 (diff) | |
download | xen-a79655807bdc466f43a7f0c2f0d683ee50a311f5.tar.gz xen-a79655807bdc466f43a7f0c2f0d683ee50a311f5.tar.bz2 xen-a79655807bdc466f43a7f0c2f0d683ee50a311f5.zip |
libxl: libxl__xs_transaction_commit should always clear the transaction.
This includes the EAGAIN case.
Users are of the form:
xs_transaction_t t = 0;
for (;;) {
rc = libxl__xs_transaction_start(gc, &t);
rc = stuff
if (rc) goto out;
...more...
rc = libxl__xs_transaction_commit(gc, &t);
if (!rc) break;
if (rc<0) goto out;
}
...
out:
So in EAGAIN (commit -> +1) we will go round the loop again and call start
which leads to:
xl: libxl_xshelp.c:174: libxl__xs_transaction_start: Assertion `!*t' failed.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_xshelp.c')
-rw-r--r-- | tools/libxl/libxl_xshelp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/libxl/libxl_xshelp.c b/tools/libxl/libxl_xshelp.c index 7fdf164c42..7ca17328f9 100644 --- a/tools/libxl/libxl_xshelp.c +++ b/tools/libxl/libxl_xshelp.c @@ -185,10 +185,10 @@ int libxl__xs_transaction_commit(libxl__gc *gc, xs_transaction_t *t) assert(*t); if (!xs_transaction_end(CTX->xsh, *t, 0)) { + *t = 0; if (errno == EAGAIN) return +1; - *t = 0; LOGE(ERROR, "could not commit xenstore transaction"); return ERROR_FAIL; } |