mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-08-04 12:21:57 +03:00
Add support for storage pool refesh callback
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
@ -572,7 +572,6 @@ def storageEventToString(event):
|
||||
"Undefined",
|
||||
"Started",
|
||||
"Stopped",
|
||||
"Refreshed",
|
||||
)
|
||||
return storageEventStrings[event]
|
||||
|
||||
@ -581,6 +580,9 @@ def myStoragePoolEventLifecycleCallback(conn, pool, event, detail, opaque):
|
||||
storageEventToString(event),
|
||||
detail))
|
||||
|
||||
def myStoragePoolEventRefreshCallback(conn, pool, event, detail, opaque):
|
||||
print("myStoragePoolEventRefreshCallback: Storage pool %s" % pool.name())
|
||||
|
||||
##########################################################################
|
||||
# Set up and run the program
|
||||
##########################################################################
|
||||
@ -672,7 +674,9 @@ def main():
|
||||
vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED, myDomainEventDeviceRemovalFailedCallback, None)
|
||||
|
||||
vc.networkEventRegisterAny(None, libvirt.VIR_NETWORK_EVENT_ID_LIFECYCLE, myNetworkEventLifecycleCallback, None)
|
||||
|
||||
vc.storagePoolEventRegisterAny(None, libvirt.VIR_STORAGE_POOL_EVENT_ID_LIFECYCLE, myStoragePoolEventLifecycleCallback, None)
|
||||
vc.storagePoolEventRegisterAny(None, libvirt.VIR_STORAGE_POOL_EVENT_ID_REFRESH, myStoragePoolEventRefreshCallback, None)
|
||||
|
||||
vc.setKeepAlive(5, 3)
|
||||
|
||||
|
Reference in New Issue
Block a user