[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC] QEMU Dbus support - a proposal management API

From: Yuval Kashtan
Subject: [Qemu-devel] [RFC] QEMU Dbus support - a proposal management API
Date: Mon, 10 Dec 2007 10:28:01 +0200

Hello All,
Attached is a proposed patch which adds DBus support to QEMU. DBus is a standard message bus for linux (http://www.freedesktop.org/wiki/Software/dbus )
The idea behind this is to allow for external programs such as controlling GUI or HyperVisors to communicate and control QEMU, in a standard manner. Although it is possible to connect to the monitor, an API is more standard, theres no need to parse texts and error messages, no internationalization problems and in general is a much better idea.

This is done by creating a DBus server from QEMU which raise signals and act upon methods.
Methods mainly implement same logic as the current command line options and monitor does.

How to use:
To enable DBus support you'll have to add --enable-dbus when you execure configure script.
Then when you execute QEMU, you'll have to add -dbus-service <service_name> where service_name follows the DBus naming convention ( xxx.xxx.xxx....)
To support QEMU configuration through DBus,  you'll also have to add -dbus_configuration which will cause QEMU to wait until ConfigDone is called through the DBus interface. this allows external programs time to call DBus methods starting with Config_ which changes configuration (just as the CLI does) thus enabling invocation of QEMU without parameters (beside the DBus ones).
With that, we have implemented a nice python script that reads VM's configuration from INI file.

To compile this you will also have to compile the attached freedesktop.org dsrv library (it is also attach for those who can't handle GIT) from: git://people.freedesktop.org/~shaharf/dsrv

Currently support was added to all important CLI configuration and some online monitor functions (such as connecting and disconnecting usb devices).
configuration methods begins with Config_ prefix and monitor ones with Monitor_.
For a complete list you can just execute qemu and connect with dbus-viewer to see what is supported.

All the dbus handling routines can be found in dbus-monitor.c.
I have two different implementations of this:
1) A single threaded version. which comply to the qemu standard of not opening additional threads.
2) A multi threaded version which open an additional, single, thread which handles all the DBus load. I actually believe this version is better as it allows QEMU to continue execution of guest operations even when there are DBus methods/signals to handle, whereas in the first option, DBus is integrated into QEMU mainloop. Also this makes it possible to monitor even during long operations (like monitoring the progress of savevm)

Please comment both on the idea of management API and the proposed implementation.

Attached are:
RFC-QEMU-Dbus.patch - patch file including all necessary changes to qemu. was made against QEMU HEAD as of 23/9 morning.
RFC-QEMU-Dbus-Interface.xml - the xml description of the DBus interface that I suggest.
dsrv.tar.gz.txt - the dbus server library.

Yuval                        Kashtan,
Qumranet Development Team.

Attachment: RFC-QEMU-DBus.patch
Description: Binary data

Attachment: RFC-QEMU-DBus-Interface.xml
Description: Text Data

Attachment: dsrv.tar.gz.txt
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]