1 <?xml version=
"1.0" encoding=
"UTF-8"?>
3 <html xmlns=
"http://www.w3.org/1999/xhtml">
5 <h1>D-Bus API bindings
</h1>
9 <h2><a name=
"description">Description
</a></h2>
12 libvirt-dbus wraps libvirt API to provide a high-level object-oriented
13 API better suited for dbus-based applications.
16 <h2><a name=
"git">GIT source repository
</a></h2>
18 The D-Bus bindings source code is maintained in a
19 <a href=
"https://git-scm.com/">git
</a> repository available on
20 <a href=
"https://libvirt.org/git/">libvirt.org
</a>:
24 git clone https://libvirt.org/git/libvirt-dbus.git
28 They can also be browsed online:
32 <a href=
"https://libvirt.org/git/?p=libvirt-dbus.git">https://libvirt.org/git/?p=libvirt-dbus.git
</a>
35 <h2><a name=
"usage">Usage
</a></h2>
38 libvirt-dbus exports libvirt API using D-Bus objects with methods and
39 properties described by interfaces. Currently only local connection
40 to libvirt is exported and the list of supported drivers depends
41 on the type of the bus connection (session or system).
45 The name of the libvirt-dbus service is
<code>org.libvirt
</code>.
46 libvirt-dbus distributes an interface XML descriptions which can be
47 usually found at
<code>/usr/share/dbus-
1/interfaces/
</code>.
51 By default unprivileged user has access only to the session D-Bus
52 connection. In order to allow specific user
"foo" to access the system
53 D-Bus connection you need to create a file
54 <code>/etc/dbus-
1/system.d/org.libvirt.conf
</code> that contains:
58 <?xml
version=
"1.0"?
>
59 <!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
60 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
64 <policy
user=
"foo">
65 <allow
send_destination=
"org.libvirt"/
>
72 To get a list of supported drivers for the specific bus connection
73 you can run these commands (not all drivers may be available on
78 gdbus introspect --xml --session --dest org.libvirt --object-path /org/libvirt
79 gdbus introspect --xml --system --dest org.libvirt --object-path /org/libvirt
83 Every object is introspectable so you can get a list of available
84 interfaces with methods, signals and properties running this command:
88 gdbus introspect --xml --system --dest org.libvirt --object-path /org/libvirt/QEMU
92 To get a list of domains for specific connection driver you can run
97 gdbus call --system --dest org.libvirt --object-path /org/libvirt/QEMU \
98 --method org.libvirt.Connect.ListDomains
0