Skip to content

Commit d2f2577

Browse files
committed
docs: move D-Bus VMState documentation to source XML
Use the source XML document as single reference, importing its documentation via the dbus-doc directive. Signed-off-by: Marc-André Lureau <[email protected]> Acked-by: Gerd Hoffmann <[email protected]>
1 parent 6153488 commit d2f2577

File tree

2 files changed

+49
-45
lines changed

2 files changed

+49
-45
lines changed

backends/dbus-vmstate1.xml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,50 @@
1-
<?xml version="1.0"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
3+
<!--
4+
org.qemu.VMState1:
5+
6+
This interface must be implemented at the object path
7+
``/org/qemu/VMState1`` to support helper migration.
8+
-->
39
<interface name="org.qemu.VMState1">
10+
11+
<!--
12+
Id:
13+
14+
A string that identifies the helper uniquely. (maximum 256 bytes
15+
including terminating NUL byte)
16+
17+
.. note::
18+
19+
The VMState helper ID namespace is its own namespace. In particular,
20+
it is not related to QEMU "id" used in -object/-device objects.
21+
-->
422
<property name="Id" type="s" access="read"/>
23+
24+
<!--
25+
Load:
26+
@data: data to restore the state.
27+
28+
The method called on destination with the state to restore.
29+
30+
The helper may be initially started in a waiting state (with an
31+
``-incoming`` argument for example), and it may resume on success.
32+
33+
An error may be returned to the caller.
34+
-->
535
<method name="Load">
636
<arg type="ay" name="data" direction="in"/>
737
</method>
38+
39+
<!--
40+
Save:
41+
@data: state data to save for later resume.
42+
43+
The method called on the source to get the current state to be
44+
migrated. The helper should continue to run normally.
45+
46+
An error may be returned to the caller.
47+
-->
848
<method name="Save">
949
<arg type="ay" name="data" direction="out"/>
1050
</method>

docs/interop/dbus-vmstate.rst

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
D-Bus VMState
33
=============
44

5-
Introduction
6-
============
7-
85
The QEMU dbus-vmstate object's aim is to migrate helpers' data running
96
on a QEMU D-Bus bus. (refer to the :doc:`dbus` document for
107
some recommendations on D-Bus usage)
@@ -26,49 +23,16 @@ dbus-vmstate object can be configured with the expected list of
2623
helpers by setting its ``id-list`` property, with a comma-separated
2724
``Id`` list.
2825

29-
Interface
30-
=========
31-
32-
On 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-
50-
A string that identifies the helper uniquely. (maximum 256 bytes
51-
including 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-
58-
Load(in u8[] bytes) method
59-
--------------------------
60-
61-
The method called on destination with the state to restore.
26+
.. only:: sphinx4
6227

63-
The helper may be initially started in a waiting state (with
64-
an --incoming argument for example), and it may resume on success.
28+
.. dbus-doc:: backends/dbus-vmstate1.xml
6529

66-
An error may be returned to the caller.
30+
.. only:: not sphinx4
6731

68-
Save(out u8[] bytes) method
69-
---------------------------
32+
.. warning::
33+
Sphinx 4 is required to build D-Bus documentation.
7034

71-
The method called on the source to get the current state to be
72-
migrated. The helper should continue to run normally.
35+
This is the content of ``backends/dbus-vmstate1.xml``:
7336

74-
An error may be returned to the caller.
37+
.. literalinclude:: ../../backends/dbus-vmstate1.xml
38+
:language: xml

0 commit comments

Comments
 (0)