WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [xenstore] Don't create a transaction for

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [xenstore] Don't create a transaction for singleton read/write operations.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 12 Oct 2006 15:50:19 +0000
Delivery-date: Thu, 12 Oct 2006 08:50:58 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Christian Limpach <Christian.Limpach@xxxxxxxxxxxxx>
# Node ID 5297ced4d6102b08a890f9944eff98f3258e8eb5
# Parent  b0ee6789e428fc06593c1862c54c3cac98737d95
[xenstore] Don't create a transaction for singleton read/write operations.

Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxxx>
---
 tools/xenstore/xenstore_client.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff -r b0ee6789e428 -r 5297ced4d610 tools/xenstore/xenstore_client.c
--- a/tools/xenstore/xenstore_client.c  Thu Oct 12 11:25:32 2006 +0100
+++ b/tools/xenstore/xenstore_client.c  Thu Oct 12 11:26:07 2006 +0100
@@ -267,12 +267,13 @@ main(int argc, char **argv)
 main(int argc, char **argv)
 {
     struct xs_handle *xsh;
-    xs_transaction_t xth;
+    xs_transaction_t xth = XBT_NULL;
     int ret = 0, socket = 0;
     int prefix = 0;
     int tidy = 0;
     int upto = 0;
     int recurse = 0;
+    int transaction;
 
     while (1) {
        int c, index = 0;
@@ -339,18 +340,28 @@ main(int argc, char **argv)
     }
 #endif
 
+#if defined(CLIENT_read)
+    transaction = (argc - optind) > 1;
+#elif defined(CLIENT_write)
+    transaction = (argc - optind) > 2;
+#else
+    transaction = 1;
+#endif
+
     xsh = socket ? xs_daemon_open() : xs_domain_open();
     if (xsh == NULL)
        err(1, socket ? "xs_daemon_open" : "xs_domain_open");
 
   again:
-    xth = xs_transaction_start(xsh);
-    if (xth == XBT_NULL)
-       errx(1, "couldn't start transaction");
+    if (transaction) {
+       xth = xs_transaction_start(xsh);
+       if (xth == XBT_NULL)
+           errx(1, "couldn't start transaction");
+    }
 
     ret = perform(optind, argc, argv, xsh, xth, prefix, tidy, upto, recurse);
 
-    if (!xs_transaction_end(xsh, xth, ret)) {
+    if (transaction && !xs_transaction_end(xsh, xth, ret)) {
        if (ret == 0 && errno == EAGAIN) {
            output_pos = 0;
            goto again;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [xenstore] Don't create a transaction for singleton read/write operations., Xen patchbot-unstable <=