From: David Woodhouse <dwmw2@infradead.org>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Paul Durrant" <paul@xen.org>,
"Joao Martins" <joao.m.martins@oracle.com>,
"Ankur Arora" <ankur.a.arora@oracle.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Juan Quintela" <quintela@redhat.com>,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
"Claudio Fontana" <cfontana@suse.de>,
"Julien Grall" <julien@xen.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
armbru@redhat.com
Subject: [RFC PATCH v1 0/8] Look Ma! We made a XenStore
Date: Wed, 1 Feb 2023 14:43:50 +0000 [thread overview]
Message-ID: <20230201144358.1744876-1-dwmw2@infradead.org> (raw)
Starts fairly simple; a node tree with some basic refcounting and copy
on write semantics.
Add in watches to fire when a given subtree gets modified, then
transactions which *would* have been a fairly trivial case of keeping
the new one and unreffing the old if it wasn't for the fact that we need
to fire watches on anything that changes as we commit the transaction.
So on commit, we walk the parts of the tree with a refcount of one,
since those by definition are the parts which are new and unique to this
transaction. And fire watches on the ones which have the appropriate
flag to show that *they* were modified, and they weren't just part of
the CoW bubbling up to the root of the tree.
Watches on nodes that were *deleted* in a transaction are even more fun
since they mean we have to *keep* those nodes with a 'deleted_in_tx' flag
so that we can fire watches on them when we commit. But it all works out
fairly simply in the end.
I'd be particularly interested in thoughts on the way I've handled
serialization/deserialization, by generating and consuming a GByteArray
and using VMSTATE_VARRAY_UINT32_ALLOC(…vmstate_info_uint8…). It seems
to work.
As we hook up the actual PV back ends to work with this XenStore (which
is fully functional in the part of the tree I haven't posted yet), there
will be a bit more work to ensure a seamless handover on resume from
migration. We *might* end up serializing only the guest nodes under
/local/domain/${domid} and letting the rest be recreated on the QEMU
side just as they were created the first time. But there's plenty here
to heckle even before we tweak those details...
https://git.infradead.org/users/dwmw2/qemu.git/shortlog/refs/heads/xenfv-kvm-10-xenstore
David Woodhouse (6):
hw/xen: Add xenstore wire implementation and implementation stubs
hw/xen: Add basic XenStore tree walk and write/read/directory support
hw/xen: Implement XenStore watches
hw/xen: Implement XenStore transactions
hw/xen: Watches on XenStore transactions
hw/xen: Implement core serialize/deserialize methods for xenstore_impl
Paul Durrant (2):
xenstore perms WIP
hw/xen: Create initial XenStore nodes
hw/i386/kvm/meson.build | 1 +
hw/i386/kvm/trace-events | 14 +
hw/i386/kvm/xen_xenstore.c | 844 ++++++++++++++++++++-
hw/i386/kvm/xenstore_impl.c | 1724 +++++++++++++++++++++++++++++++++++++++++++
hw/i386/kvm/xenstore_impl.h | 68 ++
tests/unit/meson.build | 1 +
tests/unit/test-xs-node.c | 705 ++++++++++++++++++
7 files changed, 3347 insertions(+), 10 deletions(-)
next reply other threads:[~2023-02-01 14:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-01 14:43 David Woodhouse [this message]
2023-02-01 14:43 ` [RFC PATCH v1 1/8] hw/xen: Add xenstore wire implementation and implementation stubs David Woodhouse
2023-02-01 14:43 ` [RFC PATCH v1 2/8] hw/xen: Add basic XenStore tree walk and write/read/directory support David Woodhouse
2023-02-01 14:43 ` [RFC PATCH v1 3/8] hw/xen: Implement XenStore watches David Woodhouse
2023-02-01 14:43 ` [RFC PATCH v1 4/8] hw/xen: Implement XenStore transactions David Woodhouse
2023-02-01 14:43 ` [RFC PATCH v1 5/8] hw/xen: Watches on " David Woodhouse
2023-02-01 14:43 ` [RFC PATCH v1 6/8] xenstore perms WIP David Woodhouse
2023-02-01 14:43 ` [RFC PATCH v1 7/8] hw/xen: Implement core serialize/deserialize methods for xenstore_impl David Woodhouse
2023-02-01 14:43 ` [RFC PATCH v1 8/8] hw/xen: Create initial XenStore nodes David Woodhouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230201144358.1744876-1-dwmw2@infradead.org \
--to=dwmw2@infradead.org \
--cc=alex.bennee@linaro.org \
--cc=ankur.a.arora@oracle.com \
--cc=armbru@redhat.com \
--cc=cfontana@suse.de \
--cc=dgilbert@redhat.com \
--cc=joao.m.martins@oracle.com \
--cc=julien@xen.org \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=paul@xen.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).