| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
https://bugzilla.redhat.com/show_bug.cgi?id=1578337
Since libvirt 3.8.0 we have 6 events: defined, undefined,
started, stopped, created, deleted. However, the last two were
missing in a string list that translates libvirt events (int)
into human readable strings.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
| |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
|
|
|
|
|
| |
This is particularly useful on operating systems that don't ship
Python as part of the base system (eg. FreeBSD) while still working
just as well as it did before on Linux.
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
In commit a8eba5036cb4b0e2ec827e9e6e019ce70e451377, libvirt added
support for two more details. In python bindings it all worked fine
automagically except an example that was not updated.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1463188
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Sparse streams are not that straight forward to use for the very
first time. Especially the sparseRecvAll() and sparseSendAll()
methods which expects callbacks. What we can do to make it easier
for developers is to have an example where they can take an
inspiration from.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
|
|
|
|
| |
The event test program '--loop' arg is modified to take the name
of an event loop impl to run. eg 'event-test.py --loop asyncio'
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
|
|
|
| |
Use the name 'Poll' instead of 'Pure' for the event loop demo,
since there's now a second pure python loop impl available.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
|
|
|
|
|
| |
In order to test cleanup code paths we must unregister all callbacks
and close the connection on shutdown. Since cleanup happens in the
background, we do a short sleep to allow the main loop to run its
cleanup too.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
| |
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
The pure python event loop impl has to call
libvirt.virEventInvokeFreeCallback
to free the event opaque data from a clean stack context
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
| |
Unfortunately python doesn't generate those.
|
|
|
|
|
|
|
| |
With recent changes there are new events known to libvirt.
Reflect those changes in our event-test.py example script.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Fixes copy-paste typo introduced by commit cb84e36c.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1354271
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
| |
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
|
| |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
|
|
|
|
| |
Add nodestats.py in MANIFEST.in and add a
small description for nodestats.py in README
Signed-off-by: Luyao Huang <lhuang@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So, this is an exercise to show libvirt capabilities. Firstly, for
each host NUMA nodes some statistics are printed out, i.e. total
memory and free memory. Then, for each running domain, that has memory
strictly bound to certain host nodes, a small statistics of how much
memory it takes is printed out too. For instance:
# ./examples/nodestats.py
NUMA stats
NUMA nodes: 0 1 2 3
MemTotal: 3950 3967 3937 3943
MemFree: 66 56 42 41
Domain 'fedora':
Overall memory: 1536 MiB
Domain 'fedora22':
Overall memory: 2048 MiB
Domain 'fedora21':
Overall memory: 1024 MiB nodes 0-1
Node 0: 1024 MiB nodes 0-1
Domain 'gentoo':
Overall memory: 4096 MiB nodes 0-3
Node 0: 1024 MiB nodes 0
Node 1: 1024 MiB nodes 1
Node 2: 1024 MiB nodes 2
Node 3: 1024 MiB nodes 3
We can see 4 host NUMA nodes, all of them having roughly 4GB of RAM.
Yeah, all of them has nearly all the memory consumed. Then, there are
four domains running. For instance, domain 'fedora' has 1.5GB memory
which is not pinned onto any specific host NUMA node. Domain 'gentoo' on
the other hand has 4GB memory and has 4 NUMA nodes which are pinned 1:1
to host nodes.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
This example allows to use the guest agent event and metadata to track
vCPU count set via the guest agent (agent-based onlining/offlining) and
keep it persistent accross domain restarts.
The daemon listens for the agent lifecycle event, and if it's received
it looks into doman's metadata to see whether a desired count was set
and issues the guest agent command.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
examples/Makefile.am:
* Add new file domipaddrs.py
examples/README:
* Add documentation for the python example
libvirt-override-api.xml:
* Add new symbol for virDomainInterfacesAddresses
libvirt-override.c:
* Hand written python api
Example:
$ python examples/domipaddrs.py qemu:///system f18
Interface MAC address Protocol Address
vnet0 52:54:00:20:70:3d ipv4 192.168.105.240/16
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The dhcpleases example had an old usage of print function. The formating
of leases record was also wrong.
The event-test example had an old usage of exceptions.
It's mainly to make examples compatible with python3.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
| |
Also add the example.
|
|
|
|
|
|
| |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1147639
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This API returns a list of DHCP leases for all network interfaces
connected to the given virtual network or limited output just for one
interface if mac is specified.
Example Output:
[{'iface': 'virbr3', 'ipaddr': '192.168.150.181', 'hostname': 'ubuntu14',
'expirytime': 1403737495L, 'prefix': 24, 'clientid': None,
'mac': '52:54:00:e8:73:eb', 'iaid': None, 'type': 0},
{'iface': 'virbr3', 'ipaddr': '2001:db8:ca2:2:1::bd', 'hostname': 'fedora20-test',
'expirytime': 1403738587L, 'prefix': 64, 'clientid': '00:04:b1:d8:86:42:e1:6a:aa:cf:d5:86:94:23:6f:94:04:cd',
'mac': '52:54:00:5b:40:98', 'iaid': '5980312', 'type': 1}]
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update the example to be able to trace all events.
* examples/event-test.py (main): Match full list of domain events.
(myDomainEventIOErrorReasonCallback)
(myDomainEventControlErrorCallback)
(myDomainEventBlockJobCallback, myDomainEventBlockJob2Callback)
(blockJobTypeToString, blockJobStatusToString): New functions.
Signed-off-by: Eric Blake <eblake@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Commit 6ea5be0 added network event callback support, so we might
as well demonstrate that it works by updating our example.
* examples/event-test.py: Add network event, fix typos.
Signed-off-by: Eric Blake <eblake@redhat.com>
|
|
|
|
|
|
|
|
| |
Strings in python3 default to unicode, so when writing to
the self-pipe we must be sure to use bytes by calling the
encode() method.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
|
|
|
| |
The 'print' method must be called as a function in python3,
ie with brackets.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
|
|
| |
We are no longer using automake, so Makefile.am is obsolete
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|