1. 26 4月, 2011 1 次提交
  2. 17 4月, 2011 1 次提交
  3. 09 12月, 2010 1 次提交
  4. 14 5月, 2010 1 次提交
  5. 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
  6. 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
  7. 07 4月, 2010 1 次提交
    • J
      domain_event.c: don't deref NULL on an OOM error path · 3c8877e7
      Jim Meyering 提交于
      * src/conf/domain_event.c (virDomainEventGraphicsNewFromDom):
      Return NULL when handling out-of-memory error, rather than
      falling through with ev=NULL and then assigning to ev->member.
      (virDomainEventGraphicsNewFromObj): Likewise.
      3c8877e7
  8. 06 4月, 2010 1 次提交
  9. 26 3月, 2010 8 次提交
    • D
      Add domain events for graphics network clients · 987e31ed
      Daniel P. Berrange 提交于
      This introduces a new event type
      
         VIR_DOMAIN_EVENT_ID_GRAPHICS
      
      The same event can be emitted in 3 scenarios
      
        typedef enum {
            VIR_DOMAIN_EVENT_GRAPHICS_CONNECT = 0,
            VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE,
            VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT,
        } virDomainEventGraphicsPhase;
      
      Connect/disconnect are triggered at socket accept/close.
      The initialize phase is immediately after the protocol
      setup and authentication has completed. ie when the
      client is authorized and about to start interacting with
      the graphical desktop
      
      This event comes with *a lot* of potential information
      
       - IP address, port & address family of client
       - IP address, port & address family of server
       - Authentication scheme (arbitrary string)
       - Authenticated subject identity. A subject may have
         multiple identities with some authentication schemes.
         For example, vencrypt+sasl results in a x509dname
         and saslUsername identities.
      
      This results in a very complicated callback :-(
      
         typedef enum {
            VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4,
            VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6,
         } virDomainEventGraphicsAddressType;
      
         struct _virDomainEventGraphicsAddress {
             int family;
             const char *node;
             const char *service;
         };
         typedef struct _virDomainEventGraphicsAddress virDomainEventGraphicsAddress;
         typedef virDomainEventGraphicsAddress *virDomainEventGraphicsAddressPtr;
      
         struct _virDomainEventGraphicsSubject {
            int nidentity;
            struct {
                const char *type;
                const char *name;
            } *identities;
         };
         typedef struct _virDomainEventGraphicsSubject virDomainEventGraphicsSubject;
         typedef virDomainEventGraphicsSubject *virDomainEventGraphicsSubjectPtr;
      
         typedef void (*virConnectDomainEventGraphicsCallback)(virConnectPtr conn,
                                                               virDomainPtr dom,
                                                               int phase,
                                                               virDomainEventGraphicsAddressPtr local,
                                                               virDomainEventGraphicsAddressPtr remote,
                                                               const char *authScheme,
                                                               virDomainEventGraphicsSubjectPtr subject,
                                                               void *opaque);
      
      The wire protocol is similarly complex
      
         struct remote_domain_event_graphics_address {
           int family;
           remote_nonnull_string node;
           remote_nonnull_string service;
         };
      
         const REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX = 20;
      
         struct remote_domain_event_graphics_identity {
           remote_nonnull_string type;
           remote_nonnull_string name;
         };
      
         struct remote_domain_event_graphics_msg {
           remote_nonnull_domain dom;
           int phase;
           remote_domain_event_graphics_address local;
           remote_domain_event_graphics_address remote;
           remote_nonnull_string authScheme;
           remote_domain_event_graphics_identity subject<REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX>;
         };
      
      This is currently implemented in QEMU for the VNC graphics
      protocol, but designed to be usable with SPICE graphics in
      the future too.
      
      * daemon/remote.c: Dispatch graphics events to client
      * examples/domain-events/events-c/event-test.c: Watch for
        graphics events
      * include/libvirt/libvirt.h.in: Define new graphics event ID
        and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle graphics events
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for VNC events and emit a libvirt graphics event
      * src/remote/remote_driver.c: Receive and dispatch graphics
        events to application
      * src/remote/remote_protocol.x: Wire protocol definition for
        graphics events
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for VNC_CONNECTED,
        VNC_INITIALIZED & VNC_DISCONNETED events from QEMU monitor
      987e31ed
    • D
      Add support for an explicit IO error event · 71d793fa
      Daniel P. Berrange 提交于
      This introduces a new event type
      
         VIR_DOMAIN_EVENT_ID_IO_ERROR
      
      This event includes the action that is about to be taken
      as a result of the watchdog triggering
      
        typedef enum {
           VIR_DOMAIN_EVENT_IO_ERROR_NONE = 0,
           VIR_DOMAIN_EVENT_IO_ERROR_PAUSE,
           VIR_DOMAIN_EVENT_IO_ERROR_REPORT,
        } virDomainEventIOErrorAction;
      
      In addition it has the source path of the disk that had the
      error and its unique device alias. It does not include the
      target device name (/dev/sda), since this would preclude
      triggering IO errors from other file backed devices (eg
      serial ports connected to a file)
      
      Thus there is a new callback definition for this event type
      
      typedef void (*virConnectDomainEventIOErrorCallback)(virConnectPtr conn,
                                                           virDomainPtr dom,
                                                           const char *srcPath,
                                                           const char *devAlias,
                                                           int action,
                                                           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
      71d793fa
    • D
      Add support for an explicit watchdog event · c5728cd6
      Daniel P. Berrange 提交于
      This introduces a new event type
      
         VIR_DOMAIN_EVENT_ID_WATCHDOG
      
      This event includes the action that is about to be taken
      as a result of the watchdog triggering
      
       typedef enum {
           VIR_DOMAIN_EVENT_WATCHDOG_NONE = 0,
           VIR_DOMAIN_EVENT_WATCHDOG_PAUSE,
           VIR_DOMAIN_EVENT_WATCHDOG_RESET,
           VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF,
           VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN,
           VIR_DOMAIN_EVENT_WATCHDOG_DEBUG,
       } virDomainEventWatchdogAction;
      
      Thus there is a new callback definition for this event type
      
       typedef void (*virConnectDomainEventWatchdogCallback)(virConnectPtr conn,
                                                             virDomainPtr dom,
                                                             int action,
                                                             void *opaque);
      
      * daemon/remote.c: Dispatch watchdog events to client
      * examples/domain-events/events-c/event-test.c: Watch for
        watchdog events
      * include/libvirt/libvirt.h.in: Define new watchdg event ID
        and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle watchdog events
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for watchdogs and emit a libvirt watchdog event
      * src/remote/remote_driver.c: Receive and dispatch watchdog
        events to application
      * src/remote/remote_protocol.x: Wire protocol definition for
        watchdog events
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for WATCHDOG event
        from QEMU monitor
      c5728cd6
    • D
      Add support for an explicit RTC change event · 32e6ac9c
      Daniel P. Berrange 提交于
      This introduces a new event type
      
         VIR_DOMAIN_EVENT_ID_RTC_CHANGE
      
      This event includes the new UTC offset measured in seconds.
      Thus there is a new callback definition for this event type
      
       typedef void (*virConnectDomainEventRTCChangeCallback)(virConnectPtr conn,
                                                              virDomainPtr dom,
                                                              long long utcoffset,
                                                              void *opaque);
      
      If the guest XML configuration for the <clock> is set to
      offset='variable', then the XML will automatically be
      updated with the new UTC offset value. This ensures that
      during migration/save/restore the new offset is preserved.
      
      * daemon/remote.c: Dispatch RTC change events to client
      * examples/domain-events/events-c/event-test.c: Watch for
        RTC change events
      * include/libvirt/libvirt.h.in: Define new RTC change event ID
        and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle RTC change events
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for RTC changes and emit a libvirt RTC change event
      * src/remote/remote_driver.c: Receive and dispatch RTC change
        events to application
      * src/remote/remote_protocol.x: Wire protocol definition for
        RTC change events
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for RTC_CHANGE event
        from QEMU monitor
      32e6ac9c
    • D
      Add support for an explicit guest reboot event · 86132734
      Daniel P. Berrange 提交于
      The reboot event is not a normal lifecycle event, since the
      virtual machine on the host does not change state. Rather the
      guest OS is resetting the virtual CPUs. ie, the QEMU process
      does not restart. Thus, this does not belong in the current
      lifecycle events callback.
      
      This introduces a new event type
      
          VIR_DOMAIN_EVENT_ID_REBOOT
      
      It takes no parameters, besides the virDomainPtr, so it can
      use the generic callback signature.
      
      * daemon/remote.c: Dispatch reboot events to client
      * examples/domain-events/events-c/event-test.c: Watch for
        reboot events
      * include/libvirt/libvirt.h.in: Define new reboot event ID
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle reboot events
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for reboots and emit a libvirt reboot event
      * src/remote/remote_driver.c: Receive and dispatch reboot
        events to application
      * src/remote/remote_protocol.x: Wire protocol definition for
        reboot events
      86132734
    • D
      Add new internal domain events APIs for handling other event types · b7d4c300
      Daniel P. Berrange 提交于
      The current internal domain events API tracks callbacks based on
      the function pointer, and only supports lifecycle events. This
      adds new internal APIs for registering callbacks for other event
      types. These new APIs are postfixed with the word 'ID' to indicate
      that they operated based on event ID, instead of hardcoded to
      lifecycle events
      
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Add new APIs for handling callbacks
        for non-lifecycle events
      b7d4c300
    • D
      Refactor domain events to handle multiple event types · 747c5363
      Daniel P. Berrange 提交于
      The internal domain events APIs are designed to handle the lifecycle
      events. This needs to be refactored to allow arbitrary new event
      types to be handled.
      
       * The signature of virDomainEventDispatchFunc changes to use
         virConnectDomainEventGenericCallback instead of the lifecycle
         event specific virConnectDomainEventCallback
       * Every registered callback gains a unique ID to allow its
         removal based on ID, instead of function pointer
       * Every registered callback gains an 'eventID' to allow callbacks
         for different types of events to be distinguished
       * virDomainEventDispatch is adapted to filter out callbacks
         whose eventID does not match the eventID of the event being
         dispatched
       * virDomainEventDispatch is adapted to filter based on the
         domain name and uuid, if this filter is set for a callback.
       * virDomainEvent type/detail fields are moved into a union to
         allow different data fields for other types of events to be
         added later
      
      * src/conf/domain_event.h, src/conf/domain_event.c: Refactor
        to allow handling of different types of events
      * src/lxc/lxc_driver.c, src/qemu/qemu_driver.c,
        src/remote/remote_driver.c, src/test/test_driver.c,
        src/xen/xen_driver.c: Change dispatch function signature
        to use virConnectDomainEventGenericCallback
      747c5363
    • D
      Make internal domain events struct definitions private · ea7dc337
      Daniel P. Berrange 提交于
      The virtual box driver was directly accesing the domain events
      structs instead of using the APIs provided. To prevent this kind
      of abuse, make the struct definitions private, forcing use of the
      internal APIs. This requires adding one extra internal API.
      
      * src/conf/domain_event.h, src/conf/domain_event.c: Move
        virDomainEventCallback and virDomainEvent structs into
        the source file instead of header
      * src/vbox/vbox_tmpl.c: Use official APIs for dispatching domain
        events instead of accessing structs directly.
      ea7dc337
  10. 08 3月, 2010 1 次提交
    • E
      build: consistently use C99 varargs macros · 2e56fb2b
      Eric Blake 提交于
      Prior to this patch, there was an inconsistent mix between GNU and C99.
      
      For consistency, and potential portability to other compilers, stick
      with the C99 vararg macro syntax.
      
      * src/conf/cpu_conf.c (virCPUReportError): Use C99 rather than GNU
        vararg macro syntax.
      * src/conf/domain_conf.c (virDomainReportError): Likewise.
      * src/conf/domain_event.c (eventReportError): Likewise.
      * src/conf/interface_conf.c (virInterfaceReportError): Likewise.
      * src/conf/network_conf.c (virNetworkReportError): Likewise.
      * src/conf/node_device_conf.h (virNodeDeviceReportError): Likewise.
      * src/conf/secret_conf.h (virSecretReportError): Likewise.
      * src/conf/storage_conf.h (virStorageReportError): Likewise.
      * src/esx/esx_device_monitor.c (ESX_ERROR): Use C99 rather than
        GNU vararg macro syntax.
      * src/esx/esx_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_interface_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_network_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_secret_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_storage_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_util.c (ESX_ERROR): Likewise.
      * src/esx/esx_vi.c (ESX_VI_ERROR): Likewise.
      * src/esx/esx_vi_methods.c (ESX_VI_ERROR): Likewise.
      * src/esx/esx_vi_types.c (ESX_VI_ERROR): Likewise.
      * src/esx/esx_vmx.c (ESX_ERROR): Likewise.
      * src/util/hostusb.c (usbReportError): Use C99 rather than GNU
        vararg macro syntax.
      * src/util/json.c (virJSONError): Likewise.
      * src/util/macvtap.c (ReportError): Likewise.
      * src/util/pci.c (pciReportError): Likewise.
      * src/util/stats_linux.c (virStatsError): Likewise.
      * src/util/util.c (virUtilError): Likewise.
      * src/util/xml.c (virXMLError): Likewise.
      * src/xen/proxy_internal.c (virProxyError): Use C99 rather than
        GNU vararg macro syntax.
      * src/xen/sexpr.c (virSexprError): Likewise.
      * src/xen/xen_driver.c (xenUnifiedError): Likewise.
      * src/xen/xen_hypervisor.c (virXenError): Likewise.
      * src/xen/xen_inotify.c (virXenInotifyError): Likewise.
      * src/xen/xend_internal.c (virXendError): Likewise.
      * src/xen/xm_internal.c (xenXMError): Likewise.
      * src/xen/xs_internal.c (virXenStoreError): Likewise.
      * src/cpu/cpu.h (virCPUReportError): Use C99 rather than GNU
        vararg macro syntax.
      * src/datatypes.c (virLibConnError): Likewise.
      * src/interface/netcf_driver.c (interfaceReportError): Likewise.
      * src/libvirt.c (virLibStreamError): Likewise.
      * src/lxc/lxc_conf.h (lxcError): Likewise.
      * src/network/bridge_driver.c (networkReportError): Likewise.
      * src/nodeinfo.c (nodeReportError): Likewise.
      * src/opennebula/one_conf.h (oneError): Likewise.
      * src/openvz/openvz_conf.h (openvzError): Likewise.
      * src/phyp/phyp_driver.c (PHYP_ERROR): Likewise.
      * src/qemu/qemu_conf.h (qemuReportError): Likewise.
      * src/remote/remote_driver.c (errorf): Likewise.
      * src/security/security_driver.h (virSecurityReportError): Likewise.
      * src/test/test_driver.c (testError): Likewise.
      * src/uml/uml_conf.h (umlReportError): Likewise.
      * src/vbox/vbox_driver.c (vboxError): Likewise.
      * src/vbox/vbox_tmpl.c (vboxError): Likewise.
      2e56fb2b
  11. 09 2月, 2010 1 次提交
  12. 14 1月, 2010 1 次提交
  13. 21 9月, 2009 1 次提交
    • D
      Move all XML configuration handling to src/conf/ · e0a48c99
      Daniel P. Berrange 提交于
      * src/capabilities.c, src/capabilities.h, src/domain_conf.c,
        src/domain_conf.h, src/domain_event.c, src/domain_event.h,
        src/interface_conf.c, src/interface_conf.h,
        src/network_conf.c, src/network_conf.h, src/node_device_conf.c,
        src/node_device_conf.h, src/secret_conf.c, src/secret_conf.h,
        src/storage_conf.c, src/storage_conf.h, src/storage_encryption_conf.c,
        src/storage_encryption_conf.h: Move to src/conf/
      * src/Makefile.am: Add -Isrc/conf to the individual build targets
        which need to use XML config APIs. Remove LIBXML_CFLAGS, LIBSSH2_CFLAGS
        and SELINUX_CFLAGS from global INCLUDES and only have them in build
        targets which actually need them.  Create a libvirt_conf.la
        convenience library for all config parsers
      * src/hostusb.h: Remove bogus include of domain_conf.h
      * tests/Makefile.am: Add -Isrc/conf. Remove bogus -I$builddir/src
        since it never has any generated header files
      * daemon/Makefile.am: Add -Isrc/conf
      * proxy/Makefile.am: Add -Isrc/conf and cope with renamed files
      * src/hash.c: Remove bogus include of libxml/threads.h
      e0a48c99
  14. 17 8月, 2009 1 次提交
    • D
      Fix LXC driver crash when kernel doesn't support clone · e403f8d4
      Daniel P. Berrange 提交于
      * src/domain_conf.c: Make virDomainObjListFree a no-op if list
        is NULL
      * src/domain_event.c: make virDomainEventCallbackListFree a no-op
        if event list is NULL
      * src/lxc_driver.c: Log a message if LXC driver does not startup
        due to lacking kernel support
      e403f8d4
  15. 05 12月, 2008 1 次提交
  16. 21 11月, 2008 1 次提交
  17. 19 11月, 2008 1 次提交
  18. 18 11月, 2008 1 次提交
  19. 07 11月, 2008 1 次提交
    • D
      add new logging module, and move existing definitions there · df93e1ee
      Daniel Veillard 提交于
      * src/logging.c src/logging.h proxy/Makefile.am proxy/libvirt_proxy.c
        src/Makefile.am src/cgroup.c src/datatypes.c src/domain_event.c
        src/internal.h src/libvirt.c src/lxc_container.c src/lxc_controller.c
        src/lxc_driver.c src/proxy_internal.c src/qemu_driver.c
        src/remote_internal.c src/storage_backend_disk.c src/util.c
        src/veth.c src/xen_internal.c src/xen_unified.c src/xend_internal.c:
        add new logging module, and move existing definitions there
      Daniel
      df93e1ee
  20. 05 11月, 2008 1 次提交