mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
Today fire_watches() has the boolean "exact" parameter specifying how the matching of the modified node with registered watches is to be handled (only the exact node name is matching or all nodes being in the subtree beneath the watched node). For the handling of <special-watch>/<domid> watch events 2 additional matching possibility needs to be added, as those events should only be delivered to clients having requested such events, either by watching <special-watch> with the depth=1 parameter, or by directly watching for <special-watch>/<domid>, while the traditional special watch events should NOT delivered to those watchers. For this purpose rename the "exact" parameter to "match" and make it an enum with four possible values. Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
64 lines
2.2 KiB
C
64 lines
2.2 KiB
C
/*
|
|
Transaction code for Xen Store Daemon.
|
|
Copyright (C) 2005 Rusty Russell IBM Corporation
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
#ifndef _XENSTORED_TRANSACTION_H
|
|
#define _XENSTORED_TRANSACTION_H
|
|
#include "core.h"
|
|
#include "watch.h"
|
|
|
|
enum node_access_type {
|
|
NODE_ACCESS_READ,
|
|
NODE_ACCESS_WRITE,
|
|
NODE_ACCESS_DELETE
|
|
};
|
|
|
|
struct transaction;
|
|
|
|
extern uint64_t generation;
|
|
|
|
int do_transaction_start(const void *ctx, struct connection *conn,
|
|
struct buffered_data *node);
|
|
int do_transaction_end(const void *ctx, struct connection *conn,
|
|
struct buffered_data *in);
|
|
|
|
struct transaction *transaction_lookup(struct connection *conn, uint32_t id);
|
|
|
|
/* Set flag for created node. */
|
|
void ta_node_created(struct transaction *trans);
|
|
|
|
/* This node was accessed. */
|
|
int __must_check access_node(struct connection *conn, struct node *node,
|
|
enum node_access_type type, const char **db_name);
|
|
|
|
/* Queue watches for a modified node. */
|
|
void queue_watches(struct connection *conn, const char *name,
|
|
enum watch_match watch_match);
|
|
|
|
/* Prepend the transaction to name if appropriate. */
|
|
const char *transaction_prepend(struct connection *conn, const char *name);
|
|
|
|
/* Mark the transaction as failed. This will prevent it to be committed. */
|
|
void fail_transaction(struct transaction *trans);
|
|
|
|
/* Get the list head of the changed domains. */
|
|
struct list_head *transaction_get_changed_domains(struct transaction *trans);
|
|
|
|
void conn_delete_all_transactions(struct connection *conn);
|
|
int check_transactions(struct hashtable *hash);
|
|
|
|
#endif /* _XENSTORED_TRANSACTION_H */
|