1. 13 2月, 2014 6 次提交
    • E
      event: pass reason for PM events · 6831c1d3
      Eric Blake 提交于
      Commit 57ddcc23 (v0.9.11) introduced the pmwakeup event, with
      an optional 'reason' field reserved for possible future expansion.
      But it failed to wire the field through RPC, so even if we do
      add a reason in the future, we will be unable to get it back
      to the user.
      
      Worse, commit 7ba5defb (v1.0.0) repeated the same mistake with
      the pmsuspend_disk event.
      
      As long as we are adding new RPC calls, we might as well fix
      the events to actually match the signature so that we don't have
      to add yet another RPC in the future if we do decide to start
      using the reason field.
      
      * src/remote/remote_protocol.x
      (remote_domain_event_callback_pmwakeup_msg)
      (remote_domain_event_callback_pmsuspend_msg)
      (remote_domain_event_callback_pmsuspend_disk_msg): Add reason
      field.
      * daemon/remote.c (remoteRelayDomainEventPMWakeup)
      (remoteRelayDomainEventPMSuspend)
      (remoteRelayDomainEventPMSuspendDisk): Pass reason to client.
      * src/conf/domain_event.h (virDomainEventPMWakeupNewFromDom)
      (virDomainEventPMSuspendNewFromDom)
      (virDomainEventPMSuspendDiskNewFromDom): Require additional
      parameter.
      * src/conf/domain_event.c (virDomainEventPMClass): New class.
      (virDomainEventPMDispose): New function.
      (virDomainEventPMWakeupNew*, virDomainEventPMSuspendNew*)
      (virDomainEventPMSuspendDiskNew*)
      (virDomainEventDispatchDefaultFunc): Use new class.
      * src/remote/remote_driver.c (remoteDomainBuildEvent*PM*): Pass
      reason through.
      * src/remote_protocol-structs: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6831c1d3
    • E
      event: convert remaining domain events to new style · 158795d2
      Eric Blake 提交于
      Following the patterns established by lifecycle events, this
      creates all the new RPC calls needed to pass callback IDs
      for every domain event, and changes the limits in client and
      server codes to use modern style when possible.
      
      I've tested all combinations: both 'old client and new server'
      and 'new client and old server' continue to work with the old
      RPCs, and 'new client and new server' benefit from server-side
      filtering with the new RPCs.
      
      * src/remote/remote_protocol.x (REMOTE_PROC_DOMAIN_EVENT_*): Add
      REMOTE_PROC_DOMAIN_EVENT_CALLBACK_* counterparts.
      * daemon/remote.c (remoteRelayDomainEvent*): Send callbackID via
      newer RPC when used with new-style registration.
      (remoteDispatchConnectDomainEventCallbackRegisterAny): Extend to
      cover all domain events.
      * src/remote/remote_driver.c (remoteDomainBuildEvent*): Add new
      Callback and Helper functions.
      (remoteEvents): Match order of RPC numbers, register new handlers.
      (remoteConnectDomainEventRegisterAny)
      (remoteConnectDomainEventDeregisterAny): Extend to cover all
      domain events.
      * src/remote_protocol-structs: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      158795d2
    • E
      event: client RPC protocol tweaks for domain lifecycle events · 355ea626
      Eric Blake 提交于
      The counterpart to the server RPC additions; here, a single
      function can serve both old and new calls, while incoming
      events must be serviced by two different functions.  Again,
      some wise choices in our XDR made it easier to share code
      managing similar events.
      
      While this only supports lifecycle events, it covers the
      harder part of how Register and RegisterAny interact; the
      remaining 15 events will be a mechanical change in a later
      patch.  For Register, we now have a callbackID locally for
      more efficient cleanup if the RPC fails; we also prefer to
      use the newer RPC where we know it is supported (the older
      RPC must be used if we don't know if RegisterAny is
      supported).
      
      * src/remote/remote_driver.c (remoteEvents): Register new RPC
      event handler.
      (remoteDomainBuildEventLifecycle): Move guts...
      (remoteDomainBuildEventLifecycleHelper): ...here.
      (remoteDomainBuildEventCallbackLifecycle): New function.
      (remoteConnectDomainEventRegister)
      (remoteConnectDomainEventDeregister)
      (remoteConnectDomainEventRegisterAny)
      (remoteConnectDomainEventDeregisterAny): Use new RPC when supported.
      355ea626
    • E
      event: prepare client to track domain callbackID · caaf6ba1
      Eric Blake 提交于
      We want to convert over to server-side events, even for older
      APIs.  To do that, the client side of the remote driver wants
      to distinguish between legacy virConnectDomainEventRegister and
      normal virConnectDomainEventRegisterAny, while knowing the
      client callbackID and the server's serverID for both types of
      registration.  The client also needs to probe whether the
      server supports server-side filtering.  However, for ease of
      review, we don't actually use the new RPCs until a later patch.
      
      * src/conf/object_event_private.h (virObjectEventStateCallbackID):
      Add parameter.
      * src/conf/object_event.c (virObjectEventCallbackListAddID)
      (virObjectEventStateRegisterID): Separate legacy from callbackID.
      (virObjectEventStateCallbackID): Pass through parameter.
      (virObjectEventCallbackLookup): Let legacy and global domain
      lifecycle events share a common remoteID.
      * src/conf/network_event.c (virNetworkEventStateRegisterID):
      Update caller.
      * src/conf/domain_event.c (virDomainEventStateRegister)
      (virDomainEventStateRegisterID, virDomainEventStateDeregister):
      Likewise.
      (virDomainEventStateRegisterClient)
      (virDomainEventStateCallbackID): Implement new functions.
      * src/conf/domain_event.h (virDomainEventStateRegisterClient)
      (virDomainEventStateCallbackID): New prototypes.
      * src/remote/remote_driver.c (private_data): Add field.
      (doRemoteOpen): Probe server feature.
      (remoteConnectDomainEventRegister)
      (remoteConnectDomainEventRegisterAny): Use new function.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      caaf6ba1
    • E
      event: server RPC protocol tweaks for domain lifecycle events · 03722957
      Eric Blake 提交于
      This patch adds some new RPC call numbers, but for ease of review,
      they sit idle until a later patch adds the client counterpart to
      drive the new RPCs.  Also for ease of review, I limited this patch
      to just the lifecycle event; although converting the remaining
      15 domain events will be quite mechanical.  On the server side,
      we have to have a function per RPC call, largely with duplicated
      bodies (the key difference being that we store in our callback
      opaque pointer whether events should be fired with old or new
      style); meanwhile, a single function can drive multiple RPC
      messages.  With a strategic choice of XDR struct layout, we can
      make the event generation code for both styles fairly compact.
      
      I debated about adding a tri-state witness variable per
      connection (values 'unknown', 'legacy', 'modern').  It would start
      as 'unknown', move to 'legacy' if any RPC call is made to a legacy
      event call, and move to 'modern' if the feature probe is made;
      then the event code could issue an error if the witness state is
      incorrect (a legacy RPC call while in 'modern', a modern RPC call
      while in 'unknown' or 'legacy', and a feature probe while in
      'legacy' or 'modern').  But while it might prevent odd behavior
      caused by protocol fuzzing, I don't see that it would prevent
      any security holes, so I considered it bloat.
      
      Note that sticking @acl markers on the new RPCs generates unused
      functions in access/viraccessapicheck.c, because there is no new
      API call that needs to use the new checks; however, having a
      consistent .x file is worth the dead code.
      
      * src/libvirt_internal.h (VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK):
      New feature.
      * src/remote/remote_protocol.x
      (REMOTE_PROC_CONNECT_DOMAIN_EVENT_CALLBACK_REGISTER_ANY)
      (REMOTE_PROC_CONNECT_DOMAIN_EVENT_CALLBACK_DEREGISTER_ANY)
      (REMOTE_PROC_DOMAIN_EVENT_CALLBACK_LIFECYCLE): New RPCs.
      * daemon/remote.c (daemonClientCallback): Add field.
      (remoteDispatchConnectDomainEventCallbackRegisterAny)
      (remoteDispatchConnectDomainEventCallbackDeregisterAny): New
      functions.
      (remoteDispatchConnectDomainEventRegisterAny)
      (remoteDispatchConnectDomainEventDeregisterAny): Mark legacy use.
      (remoteRelayDomainEventLifecycle): Change message based on legacy
      or new use.
      (remoteDispatchConnectSupportsFeature): Advertise new feature.
      * src/remote_protocol-structs: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      03722957
    • E
      event: dynamically manage server-side RPC domain events · 047fd2e8
      Eric Blake 提交于
      This patch continues the earlier conversion made for network
      events, with a goal of introducing server-side event filtering
      in a later patch.  Actual behavior is unchanged without
      further RPC changes.
      
      * daemon/libvirtd.h (daemonClientPrivate): Alter the tracking of
      domain events.
      * daemon/remote.c (remoteClientInitHook, remoteClientFreeFunc)
      (remoteRelayDomainEvent*)
      (remoteDispatchConnectDomainEventRegister)
      (remoteDispatchConnectDomainEventRegisterAny): Track domain
      callbacks dynamically.
      047fd2e8
  2. 12 2月, 2014 10 次提交
  3. 11 2月, 2014 14 次提交
  4. 10 2月, 2014 5 次提交
    • P
      qemu: Use correct permissions when determining the image chain · 9bf629ab
      Peter Krempa 提交于
      The code took into account only the global permissions. The domains now
      support per-vm DAC labels and per-image DAC labels. Use the most
      specific label available.
      9bf629ab
    • M
      networkStartNetwork: Be more verbose · e209c077
      Michal Privoznik 提交于
      The lack of debug printings might be frustrating in the future.
      Moreover, this function doesn't follow the usual pattern we have in the
      rest of the code:
      
        int ret = -1;
        /* do some work */
        ret = 0;
      cleanup:
        /* some cleanup work */
        return ret;
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      e209c077
    • P
      qemu: hyperv: Add support for timer enlightenments · 600bca59
      Peter Krempa 提交于
      Add a new <timer> for the HyperV reference time counter enlightenment
      and the iTSC reference page for Windows guests.
      
      This feature provides a paravirtual approach to track timer events for
      the guest (similar to kvmclock) with the option to use real hardware
      clock on systems with a iTSC with compensation across various hosts.
      600bca59
    • P
      conf: Enforce supported options for certain timers · 8ffaa42d
      Peter Krempa 提交于
      According to the documentation various timer options are only supported
      by certain timer types. Add a post parse check to verify that the user
      didn't specify invalid options.
      
      Also fix the qemu command line parsing function to set correct default
      values for the kvmclock timer so that it passes the new check.
      8ffaa42d
    • P
      schema: Fix guest timer specification schema according to the docs · bbd392ff
      Peter Krempa 提交于
      According to the documentation describing various tunables for domain
      timers not all the fields are supported by all the driver types. Express
      these in the RNG:
      
      - rtc, platform: Only these support the "track" attribute.
      - tsc: only one to support "frequency" and "mode" attributes
      - hpet, pit: tickpolicy/catchup attribute/element
      - kvmclock: no extra attributes are supported
      
      Additionally the attributes of the <catchup> element for
      tickpolicy='catchup' are optional according to the parsing code. Express
      this in the XML and fix a spurious space added while formatting the
      <catchup> element and add tests for it.
      bbd392ff
  5. 08 2月, 2014 1 次提交
  6. 07 2月, 2014 4 次提交