aboutsummaryrefslogtreecommitdiff
path: root/docs/interop/dbus-vmstate.rst
blob: 1d719c1c604f1dd7f0e7f57fa4e8f453bfea26c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
=============
D-Bus VMState
=============

Introduction
============

The QEMU dbus-vmstate object's aim is to migrate helpers' data running
on a QEMU D-Bus bus. (refer to the :doc:`dbus` document for
some recommendations on D-Bus usage)

Upon migration, QEMU will go through the queue of
``org.qemu.VMState1`` D-Bus name owners and query their ``Id``. It
must be unique among the helpers.

It will then save arbitrary data of each Id to be transferred in the
migration stream and restored/loaded at the corresponding destination
helper.

For now, the data amount to be transferred is arbitrarily limited to
1Mb. The state must be saved quickly (a fraction of a second). (D-Bus
imposes a time limit on reply anyway, and migration would fail if data
isn't given quickly enough.)

dbus-vmstate object can be configured with the expected list of
helpers by setting its ``id-list`` property, with a comma-separated
``Id`` list.

Interface
=========

On object path ``/org/qemu/VMState1``, the following
``org.qemu.VMState1`` interface should be implemented:

.. code:: xml

  <interface name="org.qemu.VMState1">
    <property name="Id" type="s" access="read"/>
    <method name="Load">
      <arg type="ay" name="data" direction="in"/>
    </method>
    <method name="Save">
      <arg type="ay" name="data" direction="out"/>
    </method>
  </interface>

"Id" property
-------------

A string that identifies the helper uniquely. (maximum 256 bytes
including terminating NUL byte)

.. note::

   The helper ID namespace is a separate namespace. In particular, it is not
   related to QEMU "id" used in -object/-device objects.

Load(in u8[] bytes) method
--------------------------

The method called on destination with the state to restore.

The helper may be initially started in a waiting state (with
an --incoming argument for example), and it may resume on success.

An error may be returned to the caller.

Save(out u8[] bytes) method
---------------------------

The method called on the source to get the current state to be
migrated. The helper should continue to run normally.

An error may be returned to the caller.