qemu-e2k/include/qemu
Peter Maydell c4d1069c25 Add dbus-vmstate
Hi,
 
 With external processes or helpers participating to the VM support, it
 becomes necessary to handle their migration. Various options exist to
 transfer their state:
 1) as the VM memory, RAM or devices (we could say that's how
    vhost-user devices can be handled today, they are expected to
    restore from ring state)
 2) other "vmstate" (as with TPM emulator state blobs)
 3) left to be handled by management layer
 
 1) is not practical, since an external processes may legitimatelly
 need arbitrary state date to back a device or a service, or may not
 even have an associated device.
 
 2) needs ad-hoc code for each helper, but is simple and working
 
 3) is complicated for management layer, QEMU has the migration timing
 
 The proposed "dbus-vmstate" object will connect to a given D-Bus
 address, and save/load from org.qemu.VMState1 owners on migration.
 
 Thus helpers can easily have their state migrated with QEMU, without
 implementing ad-hoc support (such as done for TPM emulation)
 
 D-Bus is ubiquitous on Linux (it is systemd IPC), and can be made to
 work on various other OSes. There are several implementations and good
 bindings for various languages.  (the tests/dbus-vmstate-test.c is a
 good example of how simple the implementation of services can be, even
 in C)
 
 dbus-vmstate is put into use by the libvirt series "[PATCH 00/23] Use
 a slirp helper process".
 
 v2:
  - fix build with broken mingw-glib
 -----BEGIN PGP SIGNATURE-----
 
 iQJQBAABCAA6FiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAl4TR5ccHG1hcmNhbmRy
 ZS5sdXJlYXVAcmVkaGF0LmNvbQAKCRDa6OEJdZac5R6EEACFTd4hDG8i/GnxCFut
 MGcTusJr+2IklIT/K0qpLf0axNUoIqycwv8m0T9QhoG8h+9lMykOd1YJpNetT5qK
 gifOF2gcPK/9WIdFbX7dLSUAWpzO6fG/RzKK65Nc1uJSnXlb8JV0BU/6FrfCE+3U
 Bg5PvVtxxtwejQfQPOI7bPxOqxr/SmjUGcbFgacMAMG0Lm/VG/92kdoC6Z4Xf/bd
 FcAeiO2CiPoGXG5zD4WF1emwxnSu65PgcFpSpqvvFlmDbYlTwoMt4VWxTfkAzbAM
 IES7j2IbhUEe3p0hvMTqmmsmds1QNCBgnQI/LtQiXPTnbfpBcZ0wT6QsSZXWvHz8
 ClA9OAimxyELblTGjD9vsi3G5m2DQS+NdfPOX7hfHouVQzDJJaS8jxDItpPgXwSO
 fZ9mUO8ps3N2YTakuKNBP/IzDOuyExrBg80GF+HbEc59Uhj8Yq/awyz1XsqjQzVP
 54+TUjwC8HZxVWgMeqiJ1njPTfRJo6uAnguLbfAXj8P9vaXLtsy/3JGsmKiziXXW
 XzvQDzhfOMjm7Uo7vN7Hp3X/UYJxnaQ3dViqZnv/gqG6yv+igVlqyrTx2IBhN2NW
 DZt3c7VqVUBYFShLgfy0zDjzM/s7mFkQKCFHUsBqIwODugYEc3TTdAa60QYjX5i9
 negngax45KM6nF3tq74fJpwWVw==
 =M4kD
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/elmarco/tags/dbus-vmstate7-pull-request' into staging

Add dbus-vmstate

Hi,

With external processes or helpers participating to the VM support, it
becomes necessary to handle their migration. Various options exist to
transfer their state:
1) as the VM memory, RAM or devices (we could say that's how
   vhost-user devices can be handled today, they are expected to
   restore from ring state)
2) other "vmstate" (as with TPM emulator state blobs)
3) left to be handled by management layer

1) is not practical, since an external processes may legitimatelly
need arbitrary state date to back a device or a service, or may not
even have an associated device.

2) needs ad-hoc code for each helper, but is simple and working

3) is complicated for management layer, QEMU has the migration timing

The proposed "dbus-vmstate" object will connect to a given D-Bus
address, and save/load from org.qemu.VMState1 owners on migration.

Thus helpers can easily have their state migrated with QEMU, without
implementing ad-hoc support (such as done for TPM emulation)

D-Bus is ubiquitous on Linux (it is systemd IPC), and can be made to
work on various other OSes. There are several implementations and good
bindings for various languages.  (the tests/dbus-vmstate-test.c is a
good example of how simple the implementation of services can be, even
in C)

dbus-vmstate is put into use by the libvirt series "[PATCH 00/23] Use
a slirp helper process".

v2:
 - fix build with broken mingw-glib

# gpg: Signature made Mon 06 Jan 2020 14:43:35 GMT
# gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
# gpg:                issuer "marcandre.lureau@redhat.com"
# gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
# gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* remotes/elmarco/tags/dbus-vmstate7-pull-request:
  tests: add dbus-vmstate-test
  tests: add migration-helpers unit
  dockerfiles: add dbus-daemon to some of latest distributions
  configure: add GDBUS_CODEGEN
  Add dbus-vmstate object
  util: add dbus helper unit
  docs: start a document to describe D-Bus usage
  vmstate: replace DeviceState with VMStateIf
  vmstate: add qom interface to get id

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-01-06 18:22:42 +00:00
..
atomic128.h
atomic.h
base64.h
bcd.h
bitmap.h
bitops.h bitops.h: Silence kernel-doc complaints 2019-12-17 19:36:57 +01:00
bswap.h
buffer.h
co-shared-resource.h util: introduce SharedResource 2019-10-28 11:22:31 +01:00
compiler.h include: Move endof() up from hw/virtio/virtio.h 2019-10-28 11:51:07 +01:00
config-file.h
coroutine_int.h
coroutine.h coroutine: Add qemu_co_mutex_assert_locked() 2019-10-25 15:18:38 +02:00
cpuid.h
crc32c.h
ctype.h
cutils.h Memory: Enable writeback for given memory region 2019-12-16 10:46:35 +00:00
dbus.h util: add dbus helper unit 2020-01-06 18:41:32 +04:00
drm.h
envlist.h
error-report.h error: Fix -msg timestamp default 2019-12-18 08:36:15 +01:00
event_notifier.h
fifo8.h Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
fifo32.h
filemonitor.h
futex.h
guest-random.h
hbitmap.h util/hbitmap: strict hbitmap_reset 2019-10-17 17:02:32 -04:00
help_option.h
host-utils.h
id.h
int128.h
iov.h block/qcow2: implement .bdrv_co_pwritev(_compressed)_part 2019-08-27 14:58:42 +01:00
iova-tree.h
jhash.h
job.h job: drop job_drain 2019-09-10 08:58:43 +02:00
lockable.h
log-for-trace.h
log.h Add use of RCU for qemu_logfile. 2019-12-18 20:18:02 +00:00
main-loop.h
memfd.h linux-user: add memfd_create 2019-09-11 08:46:17 +02:00
mmap-alloc.h
module.h module: return success on module load 2019-08-21 16:29:57 +02:00
notify.h xen / notify: introduce a new XenWatchList abstraction 2019-09-24 12:18:47 +01:00
option_int.h
option.h
osdep.h osdep: add qemu_unlink() 2020-01-02 16:29:32 +04:00
path.h
plugin-memory.h plugins: implement helpers for resolving hwaddr 2019-10-28 15:12:38 +00:00
plugin.h plugin: add core code 2019-10-28 15:12:38 +00:00
pmem.h
processor.h
qdist.h
qemu-plugin.h tcg plugins: expose an API version concept 2019-11-12 14:32:55 +00:00
qemu-print.h
qht.h
qsp.h
queue.h queue: add QTAILQ_REMOVE_SEVERAL 2019-10-28 15:12:38 +00:00
range.h Include qemu/queue.h slightly less 2019-08-16 13:31:52 +02:00
ratelimit.h
rcu_queue.h
rcu.h rcu: Add automatically released rcu_read_lock variants 2019-10-11 14:19:49 +01:00
readline.h
seqlock.h
sockets.h socket: Add backlog parameter to socket_listen 2019-09-03 23:24:42 +02:00
stats64.h
sys_membarrier.h
systemd.h
thread-posix.h
thread-win32.h
thread.h qemu-thread: Add qemu_cond_timedwait 2019-09-16 17:13:06 +02:00
throttle-options.h
throttle.h
timed-average.h
timer.h util/qemu-timer: refactor deadline calculation for external timers 2019-08-20 17:26:21 +02:00
typedefs.h sysemu: Move the VMChangeStateEntry typedef to qemu/typedefs.h 2019-08-16 13:31:53 +02:00
unicode.h
units.h
uri.h
uuid.h
vfio-helpers.h
win_dump_defs.h
xattr.h
xxhash.h