|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [RFC PATCH v1 05/25] hw/xen: Watches on XenStore transactions
On 02/03/2023 15:34, David Woodhouse wrote: From: David Woodhouse <dwmw@xxxxxxxxxxxx> Firing watches on the nodes that still exist is relatively easy; just walk the tree and look at the nodes with refcount of one. Firing watches on *deleted* nodes is more fun. We add 'modified_in_tx' and 'deleted_in_tx' flags to each node. Nodes with those flags cannot be shared, as they will always be unique to the transaction in which they were created. When xs_node_walk would need to *create* a node as scaffolding and it encounters a deleted_in_tx node, it can resurrect it simply by clearing its deleted_in_tx flag. If that node originally had any *data*, they're gone, and the modified_in_tx flag will have been set when it was first deleted. We then attempt to send appropriate watches when the transaction is committed, properly delete the deleted_in_tx nodes, and remove the modified_in_tx flag from the others. Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx> --- hw/i386/kvm/xenstore_impl.c | 151 ++++++++++++++++++++++- tests/unit/test-xs-node.c | 231 +++++++++++++++++++++++++++++++++++- 2 files changed, 380 insertions(+), 2 deletions(-) Reviewed-by: Paul Durrant <paul@xxxxxxx> ... with a couple of nits in comments called out below... [snip] We first *fire* watches on our parents... s/modifieD/modified
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |