diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-03-01 14:51:12 +0000 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-03-01 14:51:12 +0000 |
commit | 5d8d99be048899c0438dab4e726238eb97b0440f (patch) | |
tree | 47f33af3a57368d29ee163411943b600c933cf67 /tools/xenstore/xenstored_transaction.c | |
parent | 4bbfa3da11b9d28cb3e17a49193ac2c60fbae09b (diff) | |
download | xen-5d8d99be048899c0438dab4e726238eb97b0440f.tar.gz xen-5d8d99be048899c0438dab4e726238eb97b0440f.tar.bz2 xen-5d8d99be048899c0438dab4e726238eb97b0440f.zip |
Fully reset the xenstore connection when a domain is (re)introduced to xenstored.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'tools/xenstore/xenstored_transaction.c')
-rw-r--r-- | tools/xenstore/xenstored_transaction.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c index 69cc520bb9..cf10ecc348 100644 --- a/tools/xenstore/xenstored_transaction.c +++ b/tools/xenstore/xenstored_transaction.c @@ -23,6 +23,7 @@ #include <sys/wait.h> #include <sys/time.h> #include <time.h> +#include <assert.h> #include <stdarg.h> #include <stdlib.h> #include <fcntl.h> @@ -211,6 +212,21 @@ void do_transaction_end(struct connection *conn, const char *arg) send_ack(conn, XS_TRANSACTION_END); } +void conn_delete_all_transactions(struct connection *conn) +{ + struct transaction *trans; + + while ((trans = list_top(&conn->transaction_list, + struct transaction, list))) { + list_del(&trans->list); + talloc_free(trans); + } + + assert(conn->transaction == NULL); + + conn->transaction_started = 0; +} + /* * Local variables: * c-file-style: "linux" |