]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/mini-os.git/commitdiff
mini-os: Fix xenbus_switch_state's transaction retry
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 7 Apr 2010 07:17:21 +0000 (08:17 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 7 Apr 2010 07:17:21 +0000 (08:17 +0100)
When xenbus_switch_state has to retry the transaction which it just
created, it needs to recreate another one.  Clearing xbt triggers it.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
xenbus/xenbus.c

index 22f109fd07c5f3847be3aa07748356f3c4c11b34..a8081fd943e100e91757e06d79b2bdf0990105c1 100644 (file)
@@ -154,8 +154,10 @@ char *xenbus_switch_state(xenbus_transaction_t xbt, const char* path, XenbusStat
         msg = xenbus_write(xbt, path, value);
 
 exit:
-        if (xbt_flag)
+        if (xbt_flag) {
             msg2 = xenbus_transaction_end(xbt, 0, &retry);
+            xbt = XBT_NIL;
+        }
         if (msg == NULL && msg2 != NULL)
             msg = msg2;
     } while (retry);