qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v1 0/8] Look Ma! We made a XenStore
@ 2023-02-01 14:43 David Woodhouse
  2023-02-01 14:43 ` [RFC PATCH v1 1/8] hw/xen: Add xenstore wire implementation and implementation stubs David Woodhouse
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: David Woodhouse @ 2023-02-01 14:43 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Paolo Bonzini, Paul Durrant, Joao Martins, Ankur Arora,
	Philippe Mathieu-Daudé, Thomas Huth, Alex Bennée,
	Juan Quintela, Dr . David Alan Gilbert, Claudio Fontana,
	Julien Grall, Michael S. Tsirkin, Marcel Apfelbaum, armbru

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(-)





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-02-01 14:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-01 14:43 [RFC PATCH v1 0/8] Look Ma! We made a XenStore David Woodhouse
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

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).