diff options
author | Olaf Hering <olaf@aepfle.de> | 2011-09-15 11:08:05 +0100 |
---|---|---|
committer | Olaf Hering <olaf@aepfle.de> | 2011-09-15 11:08:05 +0100 |
commit | 1f9d04fb021cbf35cc420d401a88c696d6524c14 (patch) | |
tree | faf66934ac97c71f944e7d33cd558295fc03bd02 /tools/xenstore/xenstored_domain.c | |
parent | dcbc297aea6a159f2f5fad5de84666f23c2d17ad (diff) | |
download | xen-1f9d04fb021cbf35cc420d401a88c696d6524c14.tar.gz xen-1f9d04fb021cbf35cc420d401a88c696d6524c14.tar.bz2 xen-1f9d04fb021cbf35cc420d401a88c696d6524c14.zip |
xenstored: allow guest to shutdown all its watches/transactions
During kexec all old watches have to be removed, otherwise the new
kernel will receive unexpected events. Allow a guest to reset itself
and cleanup all of its watches and transactions.
Add a new XS_RESET_WATCHES command to do the reset on behalf of the
guest.
(Changes by iwj: specify the argument to be a single nul byte. Permit
read-only clients to use the new command.)
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/xenstore/xenstored_domain.c')
-rw-r--r-- | tools/xenstore/xenstored_domain.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c index 654185d4bb..443af8250a 100644 --- a/tools/xenstore/xenstored_domain.c +++ b/tools/xenstore/xenstored_domain.c @@ -537,6 +537,15 @@ void do_is_domain_introduced(struct connection *conn, const char *domid_str) send_reply(conn, XS_IS_DOMAIN_INTRODUCED, result ? "T" : "F", 2); } +/* Allow guest to reset all watches */ +void do_reset_watches(struct connection *conn) +{ + conn_delete_all_watches(conn); + conn_delete_all_transactions(conn); + + send_ack(conn, XS_RESET_WATCHES); +} + static int close_xc_handle(void *_handle) { xc_interface_close(*(xc_interface**)_handle); |