xref: /openbmc/qemu/docs/interop/dbus-vmstate.rst (revision f7160f32)
1=============
2D-Bus VMState
3=============
4
5Introduction
6============
7
8The QEMU dbus-vmstate object's aim is to migrate helpers' data running
9on a QEMU D-Bus bus. (refer to the :doc:`dbus` document for
10some recommendations on D-Bus usage)
11
12Upon migration, QEMU will go through the queue of
13``org.qemu.VMState1`` D-Bus name owners and query their ``Id``. It
14must be unique among the helpers.
15
16It will then save arbitrary data of each Id to be transferred in the
17migration stream and restored/loaded at the corresponding destination
18helper.
19
20For now, the data amount to be transferred is arbitrarily limited to
211Mb. The state must be saved quickly (a fraction of a second). (D-Bus
22imposes a time limit on reply anyway, and migration would fail if data
23isn't given quickly enough.)
24
25dbus-vmstate object can be configured with the expected list of
26helpers by setting its ``id-list`` property, with a comma-separated
27``Id`` list.
28
29Interface
30=========
31
32On object path ``/org/qemu/VMState1``, the following
33``org.qemu.VMState1`` interface should be implemented:
34
35.. code:: xml
36
37  <interface name="org.qemu.VMState1">
38    <property name="Id" type="s" access="read"/>
39    <method name="Load">
40      <arg type="ay" name="data" direction="in"/>
41    </method>
42    <method name="Save">
43      <arg type="ay" name="data" direction="out"/>
44    </method>
45  </interface>
46
47"Id" property
48-------------
49
50A string that identifies the helper uniquely. (maximum 256 bytes
51including terminating NUL byte)
52
53.. note::
54
55   The helper ID namespace is a separate namespace. In particular, it is not
56   related to QEMU "id" used in -object/-device objects.
57
58Load(in u8[] bytes) method
59--------------------------
60
61The method called on destination with the state to restore.
62
63The helper may be initially started in a waiting state (with
64an --incoming argument for example), and it may resume on success.
65
66An error may be returned to the caller.
67
68Save(out u8[] bytes) method
69---------------------------
70
71The method called on the source to get the current state to be
72migrated. The helper should continue to run normally.
73
74An error may be returned to the caller.
75