xemu/hw/i386/kvm
David Woodhouse 3ef7ff83ca hw/xen: Add basic XenStore tree walk and write/read/directory support
This is a fairly simple implementation of a copy-on-write tree.

The node walk function starts off at the root, with 'inplace == true'.
If it ever encounters a node with a refcount greater than one (including
the root node), then that node is shared with other trees, and cannot
be modified in place, so the inplace flag is cleared and we copy on
write from there on down.

Xenstore write has 'mkdir -p' semantics and will create the intermediate
nodes if they don't already exist, so in that case we flip the inplace
flag back to true as we populate the newly-created nodes.

We put a copy of the absolute path into the buffer in the struct walk_op,
with *two* NUL terminators at the end. As xs_node_walk() goes down the
tree, it replaces the next '/' separator with a NUL so that it can use
the 'child name' in place. The next recursion down then puts the '/'
back and repeats the exercise for the next path element... if it doesn't
hit that *second* NUL termination which indicates the true end of the
path.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
2023-03-07 17:04:30 +00:00
..
apic.c i386/kvm: The value passed to strerror should be positive 2021-06-05 21:01:17 +02:00
clock.c i386/kvm: The value passed to strerror should be positive 2021-06-05 21:01:17 +02:00
i8254.c i386/kvm: Replace abs64() with uabs64() from host-utils 2021-09-29 19:37:38 +10:00
i8259.c hw/intc: Extract the IRQ counting functions into a separate file 2023-01-13 16:22:57 +01:00
ioapic.c hw: Move ioapic*.h to intc/ 2023-02-27 22:29:01 +01:00
meson.build hw/xen: Add xenstore wire implementation and implementation stubs 2023-03-07 17:04:30 +00:00
trace-events hw/xen: Add xenstore wire implementation and implementation stubs 2023-03-07 17:04:30 +00:00
trace.h hw/xen: Implement emulated PIRQ hypercall support 2023-03-01 09:09:01 +00:00
xen-stubs.c hw/xen: Support MSI mapping to PIRQ 2023-03-01 09:09:22 +00:00
xen_evtchn.c kvm/i386: Add xen-evtchn-max-pirq property 2023-03-01 09:09:22 +00:00
xen_evtchn.h hw/xen: Support MSI mapping to PIRQ 2023-03-01 09:09:22 +00:00
xen_gnttab.c hw/xen: Implement GNTTABOP_query_size 2023-03-01 09:07:52 +00:00
xen_gnttab.h hw/xen: Implement GNTTABOP_query_size 2023-03-01 09:07:52 +00:00
xen_overlay.c hw/xen: Support mapping grant frames 2023-03-01 09:07:52 +00:00
xen_overlay.h hw/xen: Support mapping grant frames 2023-03-01 09:07:52 +00:00
xen_xenstore.c hw/xen: Add xenstore wire implementation and implementation stubs 2023-03-07 17:04:30 +00:00
xen_xenstore.h hw/xen: Add xen_xenstore device for xenstore emulation 2023-03-01 09:08:26 +00:00
xenstore_impl.c hw/xen: Add basic XenStore tree walk and write/read/directory support 2023-03-07 17:04:30 +00:00
xenstore_impl.h hw/xen: Add xenstore wire implementation and implementation stubs 2023-03-07 17:04:30 +00:00