Skip to content
Permalink
Browse files

event-test: support node device update callback

  • Loading branch information
JGulic authored and crobinso committed Aug 17, 2016
1 parent 5016603 commit 0b050dd015a9bf09000c17bd0eb0c868b75bec6e
Showing with 4 additions and 0 deletions.
  1. +4 −0 examples/event-test.py
@@ -597,6 +597,9 @@ def myNodeDeviceEventLifecycleCallback(conn, dev, event, detail, opaque):
nodeDeviceEventToString(event),
detail))

def myNodeDeviceEventUpdateCallback(conn, dev, opaque):
print("myNodeDeviceEventUpdateCallback: Node device %s" % dev.name())

##########################################################################
# Set up and run the program
##########################################################################
@@ -693,6 +696,7 @@ def exit():
vc.storagePoolEventRegisterAny(None, libvirt.VIR_STORAGE_POOL_EVENT_ID_REFRESH, myStoragePoolEventRefreshCallback, None)

vc.nodeDeviceEventRegisterAny(None, libvirt.VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE, myNodeDeviceEventLifecycleCallback, None)
vc.nodeDeviceEventRegisterAny(None, libvirt.VIR_NODE_DEVICE_EVENT_ID_UPDATE, myNodeDeviceEventUpdateCallback, None)

vc.setKeepAlive(5, 3)

0 comments on commit 0b050dd

Please sign in to comment.
You can’t perform that action at this time.