qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v1 04/25] hw/xen: Implement XenStore transactions


From: Paul Durrant
Subject: Re: [RFC PATCH v1 04/25] hw/xen: Implement XenStore transactions
Date: Tue, 7 Mar 2023 13:16:13 +0000
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

On 02/03/2023 15:34, David Woodhouse wrote:
From: David Woodhouse <dwmw@amazon.co.uk>

Given that the whole thing supported copy on write from the beginning,
transactions end up being fairly simple. On starting a transaction, just
take a ref of the existing root; swap it back in on a successful commit.

The main tree has a transaction ID too, and we keep a record of the last
transaction ID given out. if the main tree is ever modified when it isn't
the latest, it gets a new transaction ID.

A commit can only succeed if the main tree hasn't moved on since it was
forked. Strictly speaking, the XenStore protocol allows a transaction to
succeed as long as nothing *it* read or wrote has changed in the interim,
but no implementations do that; *any* change is sufficient to abort a
transaction.

This does not yet fire watches on the changed nodes on a commit. That bit
is more fun and will come in a follow-on commit.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
  hw/i386/kvm/xenstore_impl.c | 150 ++++++++++++++++++++++++++++++++++--
  tests/unit/test-xs-node.c   | 118 ++++++++++++++++++++++++++++
  2 files changed, 262 insertions(+), 6 deletions(-)


Reviewed-by: Paul Durrant <paul@xen.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]