The application exposes core areas of functionality via a DBus service allowing external applications to display dialogs / windows relating to guest machines.

Interface description

The service is intended to run on the session bus, and when launched will register a well known bus name of 'com.redhat.virt.manager'. Within this service, a single object is to be exported under the path of '/com/redhat/virt/manager'.

This object implements a single interface 'com.redhat.virt.manager' which contains the following methods. The uri parameter refers to a hypervisor connection URI, as passed to the virConnectOpen method. For local Xen machines it should simply be the string Xen:

Example usage from shell

To display the performance window for a local Xen domain with a UUID of '349025e8-ad34-34ff-239a-12ae095249f3', one would use the dbus-send command as follows:

  # First ensure the application is running
  $ dbus-send --session --dest="org.freedesktop.DBus" \
              "/org/freedesktop/DBus" \
              "org.freedesktop.DBus.StartServiceByName" \
              "string:com.redhat.virt.manager" \
              "int32:0"

  # Now call the show_domain_performance method
  $dbus-send --session --dest="com.redhat.virt.manager" \
             "com.redhat.virt.manager.show_domain_performance" \
             "string:Xen" \
             "string:349025e8-ad34-34ff-239a-12ae095249f3"

Example usage from python

The code snippet below shows how to accomplish same task using the Python DBus client APIs

  import dbus

  bus = dbus.SessionBus()

  bus_object = bus.get_object("org.freedesktop.DBus", "/org/freedesktop/DBus")
  bus_iface = dbus.Interface(bus_object, "org.freedesktop.DBus")
  bus_iface.StartServiceByName("com.redhat.virt.manager", 0)


  virt_object = bus.get_object("com.redhat.virt.manager",
                               "/com/redhat/virt/manager")
  virt_iface = dbus.Interface(virt_object, "com.redhat.virt.manager")
  virt_iface.show_domain_performance("Xen", "349025e8-ad34-34ff-239a-12ae095249f3")