1. 03 11月, 2010 1 次提交
    • J
      Fix build with polkit 0 · 98b8424e
      Jim Fehlig 提交于
      Commit e8066d53 broke the build with polkit0:
      
      remote.c: In function 'remoteDispatchAuthPolkit':
      remote.c:4177: error: 'rv' undeclared (first use in this function)
      
      Add missing identifier.
      98b8424e
  2. 28 10月, 2010 1 次提交
  3. 26 10月, 2010 1 次提交
    • M
      Fix build for SystemTap 1.0 · cbe719fe
      Matthias Bolte 提交于
      With SystemTap 1.0 a part of the generated macros in probes.h
      expands to:
      
      volatile __typeof__(((name))) arg2 = (name);
      
      GCC reports an 'invalid initialize' error when name has type
      char[]. Therfore, add casts to char* to avoid this.
      cbe719fe
  4. 22 10月, 2010 4 次提交
    • D
      Include socket address in client probe data · 4b16b9c7
      Daniel P. Berrange 提交于
      It is useful to know where the client is connecting from,
      so include the socket address in probe data.
      
      * daemon/libvirtd.h: Use virSocketAddr for storing client
        address and keep printable address handy for logging
      * daemon/libvirtd.c: Include socket address in client
        connect/disconnect probes
      * daemon/probes.d: Add socket address to probes
      * examples/systemtap/client.stp: Print socket address
      * src/util/network.h: Add sockaddr_un to virSocketAddr union
      4b16b9c7
    • D
      Add dtrace static probes in libvirtd · 968eb4e5
      Daniel P. Berrange 提交于
      Adds initial support for dtrace static probes in libvirtd
      daemon, assuming use of systemtap dtrace compat shim on
      Linux. The probes are inserted for network client connect,
      disconnect, TLS handshake states and authentication protocol
      states.
      
      This can be tested by running the xample program and then
      attempting to connect with any libvirt client (virsh,
      virt-manager, etc).
      
       # stap examples/systemtap/client.stp
        Client fd=44 connected readonly=0
        Client fd=44 auth polkit deny pid:24997,uid:500
        Client fd=44 disconnected
        Client fd=46 connected readonly=1
        Client fd=46 auth sasl allow test
        Client fd=46 disconnected
      
      The libvirtd.stp file should also really not be required,
      since it is duplicated info that is already available in
      the main probes.d definition file. A script to autogenerate
      the .stp file is needed, either in libvirtd tree, or better
      as part of systemtap itself.
      
      * Makefile.am: Add examples/systemtap subdir
      * autobuild.sh: Disable dtrace for mingw32
      * configure.ac: Add check for dtrace
      * daemon/.gitignore: Ignore generated dtrace probe file
      * daemon/Makefile.am: Build dtrace probe header & object
        files
      * daemon/libvirtd.stp: SystemTAP convenience probeset
      * daemon/libvirtd.c: Add connect/disconnect & TLS probes
      * daemon/remote.c: Add SASL and PolicyKit auth probes
      * daemon/probes.d: Master probe definition
      * daemon/libvirtd.h: Add convenience macro for probes
        so that compilation is a no-op when dtrace is not available
      * examples/systemtap/Makefile.am, examples/systemtap/client.stp
        Example systemtap script using dtrace probe markers
      * libvirt.spec.in: Enable dtrace on F13/RHEL6
      * mingw32-libvirt.spec.in: Force disable dtrace
      968eb4e5
    • D
      Remove both addrToString methods · 640c5f19
      Daniel P. Berrange 提交于
      The addrToString functionality is now available via the
      virSocketFormatAddrFull method.
      
      * daemon/remote.c, src/remote/remote_driver.c: Remove
        addrToString methods
      640c5f19
    • D
      Remove useless code in error path of getnameinfo() · 9e42b40a
      Daniel P. Berrange 提交于
      If getnameinfo() with NI_NUMERICHOST set fails, there are no
      grounds to expect inet_ntop to succeed, since these calls
      are functionally equivalent. Remove useless inet_ntop code
      in the getnameinfo() error path.
      
      * daemon/remote.c, src/remote/remote_driver.c: Remove
        calls to inet_ntop
      9e42b40a
  5. 20 10月, 2010 3 次提交
    • M
      83e57114
    • M
      Audit VM start/stop/suspend/resume · a8b5f9bd
      Miloslav Trmač 提交于
      Most operations are audited at the libvirtd level; auditing in
      src/libvirt.c would result in two audit entries per operation (one in
      the client, one in libvirtd).
      
      The only exception is a domain stopping of its own will (e.g. because
      the user clicks on "shutdown" inside the interface).  There can often be
      no client connected at the time the domain stops, so libvirtd does not
      have any virConnectPtr object on which to attach an event watch.  This
      patch therefore adds auditing directly inside the qemu driver (other
      drivers are not supported).
      a8b5f9bd
    • E
      vcpu: implement the remote protocol · eb826444
      Eric Blake 提交于
      Done by editing the first three files, then running
      'make -C src rpcgen', then editing src/remote_protocol-structs
      to match.
      
      * daemon/remote.c (remoteDispatchDomainSetVcpusFlags)
      (remoteDispatchDomainGetVcpusFlags): New functions.
      * src/remote/remote_driver.c (remoteDomainSetVcpusFlags)
      (remoteDomainGetVcpusFlags, remote_driver): Client side
      serialization.
      * src/remote/remote_protocol.x
      (remote_domain_set_vcpus_flags_args)
      (remote_domain_get_vcpus_flags_args)
      (remote_domain_get_vcpus_flags_ret)
      (REMOTE_PROC_DOMAIN_SET_VCPUS_FLAGS)
      (REMOTE_PROC_DOMAIN_GET_VCPUS_FLAGS): Define wire format.
      * daemon/remote_dispatch_args.h: Regenerate.
      * daemon/remote_dispatch_prototypes.h: Likewise.
      * daemon/remote_dispatch_table.h: Likewise.
      * src/remote/remote_protocol.c: Likewise.
      * src/remote/remote_protocol.h: Likewise.
      * src/remote_protocol-structs: Likewise.
      eb826444
  6. 13 10月, 2010 1 次提交
  7. 23 9月, 2010 2 次提交
    • D
      Make SASL work over UNIX domain sockets · 3a73eaeb
      Daniel P. Berrange 提交于
      The addrToString methods were not coping with UNIX domain sockets
      which have no normal host+port address. Hardcode special handling
      for these so that SASL routines can work over UNIX sockets. Also
      fix up SSF logic in remote client so that it presumes that a UNIX
      socket is secure
      
      * daemon/remote.c: Fix addrToString for UNIX sockets.
      * src/remote/remote_driver.c: Fix addrToString for UNIX sockets
        and fix SSF logic to work for TLS + UNIX sockets in the same
        manner
      3a73eaeb
    • D
      Refactor some daemon code to facilitate introduction of static probes · e8066d53
      Daniel P. Berrange 提交于
      Refactor some daemon code to facilitate the introductioin of static
      probes, sanitizing function exit paths in many places
      
      * daemon/libvirtd.c: Pass the dname string into remoteCheckDN
        to let caller deal with failure paths. Add separate exit paths
        to remoteCheckCertificate for auth failure vs denial. Merge
        all exit paths in qemudDispatchServer to one cleanup block
      * daemon/remote.c: Add separate exit paths to SASL & PolicyKit
        functions for auth failure vs denial
      e8066d53
  8. 24 7月, 2010 1 次提交
    • C
      Qemu remote protocol. · 337d201e
      Chris Lalancette 提交于
      Since we are adding a new "per-hypervisor" protocol, we
      make it so that the qemu remote protocol uses a new
      PROTOCOL and PROGRAM number.  This allows us to easily
      distinguish it from the normal REMOTE protocol.
      
      This necessitates changing the proc in remote_message_header
      from a "remote_procedure" to an "unsigned", which should
      be the same size (and thus preserve the on-wire protocol).
      
      Changes since v1:
       - Fixed up a couple of script problems in remote_generate_stubs.pl
       - Switch an int flag to a bool in dispatch.c
      
      Changes since v2:
       - None
      
      Changes since v3:
       - Change unsigned proc to signed proc, to conform to spec
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      337d201e
  9. 26 6月, 2010 1 次提交
  10. 17 6月, 2010 1 次提交
    • M
      Add several missing vir*Free calls in libvirtd's remote code · 08d42b52
      Matthias Bolte 提交于
      Justin Clift reported a problem with adding virStoragePoolIsPersistent
      to virsh's pool-info command, resulting in a strange problem. Here's
      an example:
      
          virsh # pool-create-as images_dir3 dir - - - - "/home/images2"
          Pool images_dir3 created
      
          virsh # pool-info images_dir3
          Name:           images_dir3
          UUID:           90301885-94eb-4ca7-14c2-f30b25a29a36
          State:          running
          Capacity:       395.20 GB
          Allocation:     30.88 GB
          Available:      364.33 GB
      
          virsh # pool-destroy images_dir3
          Pool images_dir3 destroyed
      
      At this point the images_dir3 pool should be gone (because it was
      transient) and we should be able to create a new pool with the same name:
      
          virsh # pool-create-as images_dir3 dir - - - - "/home/images2"
          Pool images_dir3 created
      
          virsh # pool-info images_dir3
          Name:           images_dir3
          UUID:           90301885-94eb-4ca7-14c2-f30b25a29a36
          error: Storage pool not found
      
      The new pool got the same UUID as the first one, but we didn't specify
      one. libvirt should have picked a random UUID, but it didn't.
      
      It turned out that virStoragePoolIsPersistent leaks a reference to the
      storage pool object (actually remoteDispatchStoragePoolIsPersistent does).
      As a result, pool-destroy doesn't remove the virStoragePool for the
      "images_dir3" pool from the virConnectPtr's storagePools hash on libvirtd's
      side. Then the second pool-create-as get's the stale virStoragePool object
      associated with the "images_dir3" name. But this object has the old UUID.
      
      This commit ensures that all get_nonnull_* and make_nonnull_* calls for
      libvirt objects are matched properly with vir*Free calls. This fixes the
      reference leaks and the reported problem.
      
      All remoteDispatch*IsActive and remoteDispatch*IsPersistent functions were
      affected. But also remoteDispatchDomainMigrateFinish2 was affected in the
      success path. I wonder why that didn't surface earlier. Probably because
      domainMigrateFinish2 is executed on the destination host and in the common
      case this connection is opened especially for the migration and gets closed
      after the migration is done. So there was no chance to run into a problem
      because of the leaked reference.
      08d42b52
  11. 15 6月, 2010 1 次提交
    • E
      remote: protocol implementation for virDomainCreateWithFlags · 6c83e7ca
      Eric Blake 提交于
      Define the wire format for the new virDomainCreateWithFlags
      API, and implement client and server side of marshaling code.
      
      * daemon/remote.c (remoteDispatchDomainCreateWithFlags): Add
      server side dispatch for virDomainCreateWithFlags.
      * src/remote/remote_driver.c (remoteDomainCreateWithFlags)
      (remote_driver): Client side serialization.
      * src/remote/remote_protocol.x
      (remote_domain_create_with_flags_args)
      (remote_domain_create_with_flags_ret)
      (REMOTE_PROC_DOMAIN_CREATE_WITH_FLAGS): Define wire format.
      * daemon/remote_dispatch_args.h: Regenerate.
      * daemon/remote_dispatch_prototypes.h: Likewise.
      * daemon/remote_dispatch_table.h: Likewise.
      * src/remote/remote_protocol.c: Likewise.
      * src/remote/remote_protocol.h: Likewise.
      * src/remote_protocol-structs: Likewise.
      6c83e7ca
  12. 30 4月, 2010 2 次提交
    • 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
    • D
      Remote protocol impl for virDomainGetBlockInfo · 84a3269a
      Daniel P. Berrange 提交于
      * daemon/remote.c: Server side dispatcher
      * daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h,
        daemon/remote_dispatch_ret.h, daemon/remote_dispatch_table.h: Update
        with new API
      * src/remote/remote_driver.c: Client side dispatcher
      * src/remote/remote_protocol.c, src/remote/remote_protocol.h: Update
      * src/remote/remote_protocol.x: Define new wire protocol
      84a3269a
  13. 24 4月, 2010 1 次提交
    • C
      Fix a memory leak in the snapshot code in libvirtd. · 4aa36a68
      Chris Lalancette 提交于
      While running libvirtd under valgrind and doing some
      snapshot testing I noticed that we would always leak a
      connection reference.  The problem was actually that we
      were leaking a domain reference in the libvirtd remote
      snapshot code, which was in turn causing a leaked
      connection reference.  Fix the situation by explicitly
      taking and dropping a domain reference where we need it.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      4aa36a68
  14. 23 4月, 2010 1 次提交
    • E
      addrToString: give better error message · 3022375d
      Eric Blake 提交于
      The user probably doesn't care what the gai error numbers are, as
      much as what the failed conversion IP address was.
      
      * src/remote/remote_driver.c (addrToString): Mention which address
      could not be converted.
      * daemon/remote.c (addrToString): Likewise.
      3022375d
  15. 05 4月, 2010 1 次提交
  16. 04 4月, 2010 1 次提交
    • D
      Implement remote protocol for managed save · 7a3da17a
      Daniel Veillard 提交于
      * src/remote/remote_protocol.x src/remote/remote_protocol.h
        src/remote/remote_protocol.c src/remote/remote_driver.c: add the entry
        points in the remote driver
      * daemon/remote.c daemon/remote_dispatch_args.h
        daemon/remote_dispatch_prototypes.h daemon/remote_dispatch_table.h:
        and implement the daemon counterpart
      7a3da17a
  17. 27 3月, 2010 1 次提交
  18. 26 3月, 2010 8 次提交
    • 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
      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
  19. 20 3月, 2010 2 次提交
  20. 10 3月, 2010 1 次提交
  21. 03 3月, 2010 2 次提交
    • D
      Remote driver implementation for the virDomainAbortJob APi · b1a7ebfd
      Daniel P. Berrange 提交于
      This defines the wire protocol for the new API
      
      * src/remote/remote_protocol.x: Wire protocol definition
      * src/remote/remote_driver.c,daemon/remote.c: Client and server
        side implementation
      * 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 from remote_protocol.x
      b1a7ebfd
    • D
      Remote driver implmentation of job info API · b85a5340
      Daniel P. Berrange 提交于
      * src/remote/remote_protocol.x: Define wire protocol format
        for virDomainGetJobInfo API
      * src/remote/remote_driver.c, daemon/remote.c: Implement client
        and server marshalling code for virDomainGetJobInfo()
      * daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h
        daemon/remote_dispatch_ret.h, daemon/remote_dispatch_table.h,
        src/remote/remote_protocol.c, src/remote/remote_protocol.h: Rebuild
        files from src/remote/remote_protocol.x
      b85a5340
  22. 12 2月, 2010 1 次提交
  23. 09 2月, 2010 2 次提交