[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxl: libxl__xs_transaction_commit should always clear the transaction.


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Wed, 04 Jul 2012 04:11:26 +0000
  • Delivery-date: Wed, 04 Jul 2012 04:11:37 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1340965142 -3600
# Node ID cf6ca262ef6a2320b6ed8a90b2797a71fc8827c3
# Parent  0455d8317631b74c436fd2fadc6dc1c0cc86cb86
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@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r 0455d8317631 -r cf6ca262ef6a tools/libxl/libxl_xshelp.c
--- a/tools/libxl/libxl_xshelp.c        Thu Jun 28 18:43:28 2012 +0100
+++ b/tools/libxl/libxl_xshelp.c        Fri Jun 29 11:19:02 2012 +0100
@@ -185,10 +185,10 @@ int libxl__xs_transaction_commit(libxl__
     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;
     }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.