1. 30 3月, 2010 9 次提交
    • L
      Implement XML parser/formatter for "timer" subelement of domain clock · 92a9e5df
      Laine Stump 提交于
      This extension is described in
      
      http://www.redhat.com/archives/libvir-list/2010-March/msg00304.html
      
      Currently all attributes are optional, except name.
      
      * src/conf/domain_conf.h: add data definition for virDomainTimerDef
        and add a list of them to virDomainClockDef
      * src/conf/domain_conf.c: XML parser and formatter for a timer inside a clock
      * src/libvirt_private.syms: add new Timer enum helper functions to symbols
      92a9e5df
    • D
      Fix QEMU cpu affinity at startup to include all threads · 99123ba0
      Daniel P. Berrange 提交于
      The QEMU cpu affinity is used in NUMA scenarios to ensure that
      guest memory is allocated from a specific node. Normally memory
      is allocate on demand in vCPU threads, but when using hugepages
      the initial thread leader allocates memory upfront. libvirt was
      not setting affinity of the thread leader, or I/O threads. This
      patch changes the code to set the process affinity in between
      the fork()/exec() of QEMU. This ensures that every single QEMU
      thread gets the affinity
      
      * src/qemu/qemu_driver.c: Set affinity on entire QEMU process
        at startup
      99123ba0
    • S
      Add dummy nwfilter driver to test driver · 7fb3e43d
      Stefan Berger 提交于
      This patch adds a dummy nwfilter driver to the test driver so that the
      int-overflow test passes without modifications.
      7fb3e43d
    • S
      Fix "make check" run requesting authentication · ad8bf13f
      Stefan Berger 提交于
      This patch fixes the 'make check' runs for me which, under certain
      circumstances and login configurations, did invoke popups requesting
      authentication. I removed the parameter conn from being passed into the
      error reporting function.
      
      * src/conf/nwfilter_conf.h src/conf/nwfilter_conf.c: remove conn from
        error reporting parameters.
      ad8bf13f
    • D
      Add script hook support to the LXC driver · 86415b2d
      Daniel Veillard 提交于
      Right now this implements only 2 basic hooks:
      - before the lxc control process is being launched
      - after the lxc control process is terminated
      the XML description of the domain is passed to the hook script stdin
      /etc/libvirt/hook/lxc
      
      * src/lxc/lxc_driver.c: implement synchronous script hooks for LXC
        at domain startup and end
      86415b2d
    • D
      Add script hook support to the QEmu driver · 668150fc
      Daniel Veillard 提交于
      Right now this implements only 2 basic hooks:
      - before the qemu process is being launched
      - after the qemu process is terminated
      the XML description of the domain is passed to the hook script stdin
      /etc/libvirt/hook/qemu
      
      * src/qemu/qemu_driver.c: implement synchronous script hooks for QEmu
        at domain startup and end
      668150fc
    • D
      Add hook utilities · 2b4e3531
      Daniel Veillard 提交于
      This exports 3 basic routines:
        - virHookInitialize() initializing the hook support by looking for
          scripts availability
        - virHookPresent() used to test if there is a hook for a given driver
        - virHookCall() which actually calls a synchronous script hook with
          the needed parameters
      Note that this doesn't expose any public API except for the locations
      and arguments passed to the scripts
      
      * src/Makefile.am: add the 2 new files
      * src/util/hooks.h src/util/hooks.c: implements the 3 functions
      * src/libvirt_private.syms: export the 3 symbols internally
      * po/POTFILES.in: add src/util/hooks.c to translatables modules
      2b4e3531
    • D
      Add an error module and message for the hooks subsystem · bf735407
      Daniel Veillard 提交于
      * include/libvirt/virterror.h: add VIR_FROM_HOOK and VIR_ERR_HOOK_SCRIPT_FAILED
      * src/util/virterror.c: associated strings
      bf735407
    • D
      Export virPipeReadUntilEOF internally · b3bff954
      Daniel Veillard 提交于
      used to read the data from virExec stdout/err file descriptors
      
      * src/util/util.c src/util/util.h: not static anymore and export it
      * src/libvirt_private.syms: allow access internally
      b3bff954
  2. 27 3月, 2010 18 次提交
    • J
      Introduce UPDATE_CPU flag for virDomainGetXMLDesc · e455b221
      Jiri Denemark 提交于
      This flag is used in migration prepare step to send updated XML
      definition of a guest.
      
      Also ``virsh dumpxml --update-cpu [--inactive] guest'' command can be
      used to see the updated CPU requirements.
      e455b221
    • J
      Helper function for making a copy of virCPUDefPtr · 284805e6
      Jiri Denemark 提交于
      284805e6
    • J
      cpuUpdate() for updating guest CPU according to host CPU · 661ae104
      Jiri Denemark 提交于
      Useful mainly for migration. cpuUpdate changes guest CPU requirements in
      the following way:
      
      - match == "strict" || match == "exact"
          - optional features which are supported by host CPU are changed into
            required features
          - optional features which are not supported by host CPU are disabled
          - all other features remain untouched
      - match == "minimum"
          - match is changed into "exact"
          - optional features and all features not mentioned in guest CPU
            specification which are supported by host CPU become required
            features
          - other optional features are disabled
          - all other features remain untouched
      
      This ensures that no feature will suddenly disappear from the guest
      after migration.
      661ae104
    • J
      Don't replace persistent domain config with migrated config · 59821682
      Jiri Denemark 提交于
      When a domain is defined on host1, migrated to host2 and then migrated
      back to host1, its current configuration would overwrite the libvirtd's
      in-memory copy of persistent configuration of that domain. This is not
      desired as we want to preserve the persistent configuration untouched.
      
      This patch introduces new 'live' parameter to virDomainAssignDef.
      Passing 'true' for 'live' means the configuration passed to
      virDomainAssignDef describes a configuration of live instance of the
      domain. This applies for saved domains which are being restored or for
      incoming domains during migration.
      
      All callers have been changed to pass the appropriate value.
      59821682
    • J
      filter new files through cppi, so syntax-check passes once again · 19a863c4
      Jim Meyering 提交于
      * src/conf/nwfilter_conf.h: Indent cpp directives.
      * src/conf/nwfilter_params.h: Likewise.
      * src/datatypes.h: Likewise.
      * src/nwfilter/nwfilter_driver.h: Likewise.
      * src/nwfilter/nwfilter_ebiptables_driver.h: Likewise.
      * src/nwfilter/nwfilter_gentech_driver.h: Likewise.
      19a863c4
    • D
      Add disk error policy to domain XML · 447c586a
      David Allan 提交于
      * Fixes per feedback from Dan and Daniel
      * Added test datafiles
      * Re-disabled JSON flags
      * Added code to print the error policy attribute when generating XML
      * Re-add empty tag
      447c586a
    • S
      Extensions for iptables rules · 1130085c
      Stefan Berger 提交于
      This patch adds support for L3/L4 filtering using iptables. This adds
      support for 'tcp', 'udp', 'icmp', 'igmp', 'sctp' etc. filtering.
      
      As mentioned in the introduction, a .c file provided by this patch
      is #include'd into a .c file. This will need work, but should be alright
      for review.
      Signed-off-by: NStefan Berger <stefanb@us.ibm.com>
      1130085c
    • S
      Add IPv6 support for the ebtables layer · f85208ee
      Stefan Berger 提交于
      This patch adds IPv6 support for the ebtables layer. Since the parser
      etc. are all parameterized, it was fairly easy to add this...
      Signed-off-by: NStefan Berger <stefanb@us.ibm.com>
      f85208ee
    • S
      Add qemu support · d498175a
      Stefan Berger 提交于
      Add support for Qemu to have firewall rules applied and removed on VM
      startup and shutdown respectively. This  patch also provides support for
      the updating of a filter that causes all VMs that reference the filter
      to have their ebtables/iptables rules updated.
      Signed-off-by: NStefan Berger <stefanb@us.ibm.com>
      d498175a
    • S
      Core driver implementation with ebtables support · 065b6571
      Stefan Berger 提交于
      This patch implements the core driver and provides
      - management functionality for managing the filter XMLs
      - compiling the internal filter representation into ebtables rules
      - applying ebtables rules on a network (tap,macvtap) interface
      - tearing down ebtables rules that were applied on behalf of an
      interface
      - updating of filters while VMs are running and causing the firewalls to
      be rebuilt
      - other bits and pieces
      Signed-off-by: NStefan Berger <stefanb@us.ibm.com>
      065b6571
    • S
      Add XML parser extensions for network filtering · e4e20423
      Stefan Berger 提交于
      This patch adds XML processing for the network filter schema
      and extends the domain XML processing to parse the top level
      referenced filter along with potentially provided parameters
      Signed-off-by: NStefan Berger <stefanb@us.ibm.com>
      Signed-off-by: NGerhard Stenzel <gerhard.stenzel@de.ibm.com>
      e4e20423
    • S
      Definition of the wire format, RPC client & server · 965466c1
      Stefan Berger 提交于
      This patch adds the definition of the wire format for RPC calls
      and implementation of the RPC client & server code
      Signed-off-by: NStefan Berger <stefanb@us.ibm.com>
      965466c1
    • S
      Implementation of the public API · 46e9b0fb
      Stefan Berger 提交于
      This patch adds the implementation of the public API for the network
      filtering (ACL) extensions to libvirt.c .
      Signed-off-by: NStefan Berger <stefanb@us.ibm.com>
      46e9b0fb
    • S
      Add internal API · f0c1c3f8
      Stefan Berger 提交于
      This patch adds the internal API extensions for network filtering (ACL) support.
      Signed-off-by: NStefan Berger <stefanb@us.ibm.com>
      f0c1c3f8
    • S
      Add recursive locks · f895e611
      Stefan Berger 提交于
      This patch adds recursive locks necessary due to the processing of
      network filter XML that can reference other network filters, including
      references that cause looks. Loops in the XML are prevented but their
      detection requires recursive locks.
      Signed-off-by: NStefan Berger <stefanb@us.ibm.com>
      f895e611
    • D
      Fix build break · 67253251
      David Allan 提交于
      * Add types to switch; the switch is only exectuted for known types because of a preceding conditional, so this fix is merely to placate the compiler.
      67253251
    • S
      Use enum of virDomainNetType · 9bcad690
      Stefan Berger 提交于
      To find out where the net type 'direct' needs to be handled I introduced
      the 'enum virDomainNetType' in the virDomainNetDef structure and let the
      compiler tell me where the case statement is missing. Then I added the
      unhandled device statement to the UML driver.
      
      * src/conf/domain_conf.h: change _virDomainNetDef type from int to
        virDomainNetType enum
      * src/conf/domain_conf.c src/lxc/lxc_driver.c src/qemu/qemu_conf.c
        src/uml/uml_conf.c: make sure all enum cases are properly handled
        in switches
      9bcad690
    • D
      Silence cppi syntax-check warning · 67203f67
      Daniel Veillard 提交于
      67203f67
  3. 26 3月, 2010 13 次提交
    • D
      Implement VNC password change in QEMU · ab952024
      Daniel P. Berrange 提交于
      Use the new virDomainUpdateDeviceFlags API to allow the VNC password
      to be changed on the fly
      
      * src/internal.h: Define STREQ_NULLABLE() which is like STREQ()
        but does not crash if either argument is NULL, and treats two
        NULLs as equal.
      * src/libvirt_private.syms: Export virDomainGraphicsTypeToString
      * src/qemu/qemu_driver.c: Support VNC password change on a live
        machine
      * src/qemu/qemu_monitor.c: Disable crazy debugging info. Treat a
        NULL password as "" (empty string), allowing passwords to be
        disabled in the monitor
      ab952024
    • D
      Allow parsing <graphics> in device XML · c85f6413
      Daniel P. Berrange 提交于
      Expand the parser for the standalone <device> XML format to
      allow inclusion of the <graphics> device type
      
      * src/conf/domain_conf.h: Add virDomainGraphicsDef to
        the virDomainDeviceDef struct
      * src/conf/domain_conf.c: Wire up parser for virDomainGraphicsDef
        to virDomainDeviceDefParse method
      c85f6413
    • D
      Implement virDomainUpdateDeviceFlags API in all drivers with media change · 6bb4986b
      Daniel P. Berrange 提交于
      To allow the new virDomainUpdateDeviceFlags() API to be universally
      used with all drivers, this patch adds an impl to all the current
      drivers which support CDROM or Floppy disk media change via the
      current virDomainAttachDeviceFlags API
      
      * src/qemu/qemu_driver.c, src/vbox/vbox_tmpl.c,
        src/xen/proxy_internal.c, src/xen/xen_driver.c,
        src/xen/xend_internal.c: Implement media change via the
        virDomainUpdateDeviceFlags API
      * src/xen/xen_driver.h, src/xen/xen_hypervisor.c,
        src/xen/xen_inotify.c, src/xen/xm_internal.c,
        src/xen/xs_internal.c: Stubs for Xen driver entry points
      6bb4986b
    • D
      Remote protocol impl for virDomainUpdateDeviceFlags · ee9083ab
      Daniel P. Berrange 提交于
      This defines the wire format for the new virDomainUpdateDeviceFlags()
      API, and implements the server & client side of the marshalling code.
      
      * daemon/remote.c: Server side dispatch for virDomainUpdateDeviceFlags
      * src/remote/remote_driver.c: Client side serialization for
        virDomainUpdateDeviceFlags
      * src/remote/remote_protocol.x: Define wire format for
        virDomainUpdateDeviceFlags
      * daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h,
        daemon/remote_dispatch_table.h, src/remote/remote_protocol.c,
        src/remote/remote_protocol.h: Re-generate code
      ee9083ab
    • D
      Introduce a new virDomainUpdateDeviceFlags public API · 46a2ea36
      Daniel P. Berrange 提交于
      The current virDomainAttachDevice API can be (ab)used to change
      the media of an existing CDROM/Floppy device. Going forward there
      will be more devices that can be configured on the fly and overloading
      virDomainAttachDevice for this is not too pleasant. This patch adds
      a new virDomainUpdateDeviceFlags() explicitly just for modifying
      existing devices.
      
      * include/libvirt/libvirt.h.in: Add virDomainUpdateDeviceFlags
      * src/driver.h: Internal API for virDomainUpdateDeviceFlags
      * src/libvirt.c, src/libvirt_public.syms: Glue public API to
        driver API
      * src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
        src/openvz/openvz_driver.c, src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
        src/remote/remote_driver.c, src/test/test_driver.c, src/uml/uml_driver.c,
        src/vbox/vbox_tmpl.c, src/xen/xen_driver.c, src/xenapi/xenapi_driver.c: Add
        stubs for new driver entry point
      46a2ea36
    • 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
      Rename domain lifecycle event message · d51638d0
      Daniel P. Berrange 提交于
      To avoid confusion, rename the current REMOTE_PROC_DOMAIN_EVENT
      message to REMOTE_PROC_DOMAIN_EVENT_LIFECYCLE. This does not
      cause ABI problems, since the names are only relevant at the source
      code level. On the wire they encoding is a plain integer whose
      value does not change
      
      * src/remote/remote_protocol.x: Rename REMOTE_PROC_DOMAIN_EVENT
        to REMOTE_PROC_DOMAIN_EVENT_LIFECYCLE.
      * daemon/remote.c, src/remote/remote_driver.c: Update code for
        renamed event
      d51638d0
    • D
      Remote driver & daemon impl of new event API · 097e07a6
      Daniel P. Berrange 提交于
      This wires up the remote driver to handle the new events APIs.
      The public API allows an application to request a callback filters
      events to a specific domain object, and register multiple callbacks
      for the same event type. On the wire there are two strategies for
      this
      
       - Register multiple callbacks with the remote daemon, each
         with filtering as needed
       - Register only one callback per event type, with no filtering
      
      Both approaches have potential inefficiency. In the first scheme,
      the same event gets sent over the wire many times if multiple
      callbacks are registered. With the second scheme, unneccessary
      events get sent over the wire if a per-domain filter is set on
      the client. The second scheme is far easier to implement though,
      so this patch takes that approach.
      
      * daemon/dispatch.h: Don't export remoteRelayDomainEvent since it
        is no longer needed for unregistering callbacks, instead the
        unique callback ID is used
      * daemon/libvirtd.c, daemon/libvirtd.h: Track and unregister
        callbacks based on callback ID, instead of function pointer
      * daemon/remote.c: Switch over to using virConnectDomainEventRegisterAny
        instead of legacy virConnectDomainEventRegister function. Refactor
        remoteDispatchDomainEventSend() to cope with arbitrary event types
      * src/driver.h, src/driver.c: Move verify() call into source file
        instead of header, to avoid polluting the global namespace with
        the verify function name
      * src/remote/remote_driver.c: Implement new APIs for event
        registration. Refactor processCallDispatchMessage() to cope
        with arbitrary incoming event types. Merge remoteDomainQueueEvent()
        into processCallDispatchMessage() to avoid duplication of code.
        Rename remoteDomainReadEvent() to remoteDomainReadEventLifecycle()
      * src/remote/remote_protocol.x: Define wire format for the new
        virConnectDomainEventRegisterAny and virConnectDomainEventDeregisterAny
        functions
      097e07a6
    • D
      Support new event register/deregister APis in all drivers except remote · cef0967e
      Daniel P. Berrange 提交于
      The libvirtd daemon impl will need to switch over to using the
      new event APIs. To make this simpler, ensure all drivers currently
      providing events support both the new APIs and old APIs.
      
      * src/lxc/lxc_driver.c, src/qemu/qemu_driver.c, src/test/test_driver.c,
        src/vbox/vbox_tmpl.c, src/xen/xen_driver.c: Implement the new
        virConnectDomainEvent(Dereg|Reg)isterAny driver entry points
      cef0967e