1. 06 9月, 2012 1 次提交
    • O
      python: Expose virStorageListAllStoragePools to python binding · 92785780
      Osier Yang 提交于
      The implementation is done manually as the generator does not support
      wrapping lists of C pointers into Python objects.
      
      python/libvirt-override-api.xml: Document
      python/libvirt-override-virConnect.py: Add listAllStoragePools
      python/libvirt-override.c: Implementation for the wrapper.
      92785780
  2. 14 7月, 2012 1 次提交
    • D
      Define public API for receiving guest memory balloon events · 7ed6d7dd
      Daniel P. Berrange 提交于
      When the guest changes its memory balloon applications may want
      to know what the new value is, without having to periodically
      poll on XML / domain info. Introduce a "balloon change" event
      to let apps see this
      
      * include/libvirt/libvirt.h.in: Define the
        virConnectDomainEventBalloonChangeCallback callback
        and VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE constant
      * python/libvirt-override-virConnect.py,
        python/libvirt-override.c: Wire up helpers for new event
      * daemon/remote.c: Helper for serializing balloon event
      * examples/domain-events/events-c/event-test.c,
        examples/domain-events/events-python/event-test.py: Add
        example of balloon event usage
      * src/conf/domain_event.c, src/conf/domain_event.h: Handling
        of balloon events
      * src/remote/remote_driver.c: Add handler of balloon events
      * src/remote/remote_protocol.x: Define wire protocol for
        balloon events
      * src/remote_protocol-structs: Likewise.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      7ed6d7dd
  3. 19 6月, 2012 1 次提交
    • P
      python: add API exports for virConnectListAllDomains() · bd34cc8c
      Peter Krempa 提交于
      This patch adds export of the new API function
      virConnectListAllDomains() to the libvirt-python bindings. The
      virConnect object now has method "listAllDomains" that takes only the
      flags parameter and returns a python list of virDomain object
      corresponding to virDomainPtrs returned by the underlying api.
      
      The implementation is done manually as the generator does not support
      wrapping list of virDomainPtrs into virDomain objects.
      bd34cc8c
  4. 23 3月, 2012 3 次提交
    • O
      Add support for the suspend event · 487c0633
      Osier Yang 提交于
      This patch introduces a new event type for the QMP event
      SUSPEND:
      
          VIR_DOMAIN_EVENT_ID_PMSUSPEND
      
      The event doesn't take any data, but considering there might
      be reason for wakeup in future, the callback definition is:
      
      typedef void
      (*virConnectDomainEventSuspendCallback)(virConnectPtr conn,
                                              virDomainPtr dom,
                                              int reason,
                                              void *opaque);
      
      "reason" is unused currently, always passes "0".
      487c0633
    • O
      Add support for the wakeup event · 57ddcc23
      Osier Yang 提交于
      This patch introduces a new event type for the QMP event
      WAKEUP:
      
          VIR_DOMAIN_EVENT_ID_PMWAKEUP
      
      The event doesn't take any data, but considering there might
      be reason for wakeup in future, the callback definition is:
      
      typedef void
      (*virConnectDomainEventWakeupCallback)(virConnectPtr conn,
                                             virDomainPtr dom,
                                             int reason,
                                             void *opaque);
      
      "reason" is unused currently, always passes "0".
      57ddcc23
    • O
      Add support for event tray moved of removable disks · a26a1969
      Osier Yang 提交于
      This patch introduces a new event type for the QMP event
      DEVICE_TRAY_MOVED, which occurs when the tray of a removable
      disk is moved (i.e opened or closed):
      
          VIR_DOMAIN_EVENT_ID_TRAY_CHANGE
      
      The event's data includes the device alias and the reason
      for tray status' changing, which indicates why the tray
      status was changed. Thus the callback definition for the event
      is:
      
      enum {
          VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN = 0,
          VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE,
      
      \#ifdef VIR_ENUM_SENTINELS
          VIR_DOMAIN_EVENT_TRAY_CHANGE_LAST
      \#endif
      } virDomainEventTrayChangeReason;
      
      typedef void
      (*virConnectDomainEventTrayChangeCallback)(virConnectPtr conn,
                                                 virDomainPtr dom,
                                                 const char *devAlias,
                                                 int reason,
                                                 void *opaque);
      a26a1969
  5. 25 10月, 2011 1 次提交
    • M
      startupPolicy: Emit event on disk source dropping · baf2ff7e
      Michal Privoznik 提交于
      If a disk source gets dropped because it is not accessible,
      mgmt application might want to be informed about this. Therefore
      we need to emit an event. The event presented in this patch
      is however a bit superset of what written above. The reason is simple:
      an intention to be easily expanded, e.g. on 'user ejected disk
      in guest' events. Therefore, callback gets source string and disk alias
      (which should be unique among a domain) and reason (an integer);
      baf2ff7e
  6. 22 7月, 2011 1 次提交
    • A
      Asynchronous event for BlockJob completion · d489b046
      Adam Litke 提交于
      When an operation started by virDomainBlockPull completes (either with
      success or with failure), raise an event to indicate the final status.
      This API allow users to avoid polling on virDomainGetBlockJobInfo if
      they would prefer to use an event mechanism.
      
      * daemon/remote.c: Dispatch events to client
      * include/libvirt/libvirt.h.in: Define event ID and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle the new event
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for block_stream completion and emit a libvirt block pull event
      * src/remote/remote_driver.c: Receive and dispatch events to application
      * src/remote/remote_protocol.x: Wire protocol definition for the event
      * src/remote_protocol-structs: structure definitions for protocol verification
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for BLOCK_STREAM_COMPLETED event
        from QEMU monitor
      d489b046
  7. 24 6月, 2011 1 次提交
  8. 21 6月, 2011 1 次提交
  9. 15 6月, 2011 1 次提交
    • A
      Asynchronous event for BlockPull completion · 12cd77a0
      Adam Litke 提交于
      When an operation started by virDomainBlockPullAll completes (either with
      success or with failure), raise an event to indicate the final status.  This
      allows an API user to avoid polling on virDomainBlockPullInfo if they would
      prefer to use the event mechanism.
      
      * daemon/remote.c: Dispatch events to client
      * include/libvirt/libvirt.h.in: Define event ID and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle the new event
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for block_stream completion and emit a libvirt block pull event
      * src/remote/remote_driver.c: Receive and dispatch events to application
      * src/remote/remote_protocol.x: Wire protocol definition for the event
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for BLOCK_STREAM_COMPLETED event
        from QEMU monitor
      Signed-off-by: NAdam Litke <agl@us.ibm.com>
      12cd77a0
  10. 24 7月, 2010 1 次提交
    • P
      Fix SEGV on exit after domainEventDeregister() · eac63161
      Philipp Hahn 提交于
      When the last callback is removed using domainEventDeregister(), the
      events dispatcher is deregistered from the C-library, but
      domainEventsCallbacks is still an empty list.
      On shutdown __del__() deregisters the dispatacher again, which SEGVs
      
      	# You need the event-loop implementation from the Python examples;
      	# give the file a name which is importable by Python.
      	ln examples/domain-events/events-python/event-test.py eloop.py
      	python -c 'from eloop import *
      	import sys
      
      	def dump(*args): print " ".join(map(str, args))
      
      	virEventLoopPureStart()
      	c = libvirt.open("xen:///")
      	c.domainEventRegister(dump, None)
      	c.domainEventDeregister(dump)
      	sys.exit(0)'
      
      domainEventDeregister() needs to delete domainEventCallbacks so subsequent
      calls to __del__() and domainEventRegister() choose the right code paths.
      Setting it to None is not enough, since calling domainEventRegiser() again
      would trigger an TypeError.
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      eac63161
  11. 12 7月, 2010 1 次提交
  12. 25 6月, 2010 1 次提交
  13. 30 4月, 2010 1 次提交
    • D
      Add support for another explicit IO error event · 34dcbbb4
      Daniel P. Berrange 提交于
      This introduces a new event type
      
         VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
      
      This event is the same as the previous VIR_DOMAIN_ID_IO_ERROR
      event, but also includes a string describing the cause of
      the event.
      
      Thus there is a new callback definition for this event type
      
      typedef void (*virConnectDomainEventIOErrorReasonCallback)(virConnectPtr conn,
                                                                 virDomainPtr dom,
                                                                 const char *srcPath,
                                                                 const char *devAlias,
                                                                 int action,
                                                                 const char *reason,
                                                                 void *opaque);
      
      This is currently wired up to the QEMU block IO error events
      
      * daemon/remote.c: Dispatch IO error events to client
      * examples/domain-events/events-c/event-test.c: Watch for
        IO error events
      * include/libvirt/libvirt.h.in: Define new IO error event ID
        and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle IO error events
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for block IO errors and emit a libvirt IO error event
      * src/remote/remote_driver.c: Receive and dispatch IO error
        events to application
      * src/remote/remote_protocol.x: Wire protocol definition for
        IO error events
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
        from QEMU monitor
      34dcbbb4
  14. 09 4月, 2010 1 次提交
    • D
      More event callback fixes · 631c4ce8
      Daniel P. Berrange 提交于
      In a couple of cases typos meant we were firing the wrong type
      of event. In the python code my previous commit accidentally
      missed some chunks of the code.
      
      * python/libvirt-override-virConnect.py: Add missing python glue
        accidentally left out of previous commit
      * src/conf/domain_event.c, src/qemu/qemu_monitor_json.c: Fix typos
        in event name / method name to invoke
      631c4ce8
  15. 08 4月, 2010 1 次提交
    • D
      Fix up python bindings for new event callbacks · 6df7d55d
      Daniel P. Berrange 提交于
      The generator was disabled for the new event callbacks, since they
      need to be hand written. This patch  adds the C and python glue to
      expose the new APIs in the python binding. The python example
      program is extended to demonstrate of the code
      
      * python/libvirt-override.c: Registration and dispatch of events
         at the C layer
      * python/libvirt-override-virConnect.py: Python glue for events
      * examples/domain-events/events-python/event-test.py: Demo use
        of new event callbacks
      6df7d55d
  16. 21 9月, 2009 1 次提交
    • D
      Re-arrange python generator to make it clear what's auto-generated · f991a006
      Daniel P. Berrange 提交于
      * README: New file describing what each file is used for
      * livvirt-override.c, libvirt-override.py, libvirt-override-api.xml,
        libvirt-override-virConnect.py: Manually written code overriding
        the generator
      * typewrappers.c, typewrappers.h: Data type wrappers
      * generator.py: Automatically pre-prend contents of libvirt-override.py
        to generated libvirt.py. Output into libvirt.py directly instead of
        libvirtclass.py. Don't generate libvirtclass.txt at all. Write C
        files into libvirt.c/.h directly
      * Makefile.am: Remove rule for creating libvirt.py from libvirt-override.py
        and libvirtclass.py, since generator.py does it directly
      f991a006
  17. 25 11月, 2008 1 次提交
  18. 31 10月, 2008 1 次提交