On 05/30/2012 04:04 PM, Jonathan Daugherty wrote:
Hi,
I've written a patch to include inactive domains in the guest table
available via the libvirt-snmp subagent. This makes it possible to
start domains via SNMP (a state transition which AFAICT was previously
impossible, because inactive domains never appeared in the SNMP
result).
Sounds like a worthwhile change at the high level.
The code now collects the IDs of running domains along with the names
of declared (but not running) domains and normalizes them into a list
of domain pointers, which is then processed by the preexisting SNMP
container row allocation code. The change was fairly straightforward,
but certainly there might be Good Reasons it wasn't already
implemented.
Even better would be to require libvirt 0.9.13 and use the proposed
virConnectListAllDomains() API to get all domains in one shot, as the
approach you have used is inherently racy due to the flaws in the older
APIs (which reminds me, Peter is still working on posting a v2 of that
series).
- This will be a breaking change for anyone who assumes that the
old
behavior is still in place (i.e., that the guest table only
includes non-shutdown domains). However, it might not be *that*
bad because the domain rows already included a 'state' that one
could already filter on.
I'm not familiar enough with libvirt-snmp to say whether this is
important, or to even know how the current bindings work. Is this
something where you might be better served by instead adding new
libvirt-snmp bindings to the existing virConnectListDefinedDomains and
upcoming virConnectListAllDomains, instead of changing the behavior of
the existing query method which is currently bound to virConnectListDomains?
Please let me know if there is anything further I need to do to make
the patch acceptable.
I'll have to defer that to people more familiar with libvirt-snmp.
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org