]> git.ipfire.org Git - thirdparty/libvirt.git/commit
hellolibvirt: Adjust code to use new APIs
authorJohn Ferlan <jferlan@redhat.com>
Tue, 26 Feb 2013 14:11:10 +0000 (09:11 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 4 Mar 2013 22:36:03 +0000 (17:36 -0500)
commitb421c35c98d3bb7ea02105bc48bf6bad46d5ba04
tree3319b3c7885fb1070aad214ca0080c630db13b5b
parentf7e7429416aa956ad281240a95d29f3a2c6f7e96
hellolibvirt: Adjust code to use new APIs

Change the order of some conditions and use the AllDomains API to get
a list of all the active and defined domains, then use the Active and
Name API's in order to print.

This changes here adjust the output from:

Attempting to connect to hypervisor
Connected to hypervisor at "qemu:///system"
Hypervisor: "QEMU" version: 0.32.656
There are 0 active and 2 inactive domains
Inactive domains:
  foo
  bar
Disconnected from hypervisor

to

Attempting to connect to hypervisor
Connected to hypervisor at "qemu:///system"
Hypervisor: "QEMU" version: 0.32.656
There are 0 active and 2 inactive domains
       foo (non-active)
       bar (non-active)
Disconnected from hypervisor
examples/hellolibvirt/hellolibvirt.c