1. 08 3月, 2016 1 次提交
    • J
      Introduce job completed event · f2893001
      Jiri Denemark 提交于
      The VIR_DOMAIN_EVENT_ID_JOB_COMPLETED event will be triggered once a job
      (such as migration) finishes and it will contain statistics for the job
      as one would get by calling virDomainGetJobStats. Thanks to this event
      it is now possible to get statistics of a completed migration of a
      transient domain on the source host.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      f2893001
  2. 01 3月, 2016 2 次提交
  3. 21 1月, 2016 1 次提交
  4. 15 8月, 2015 1 次提交
  5. 14 8月, 2015 1 次提交
  6. 21 5月, 2015 1 次提交
  7. 28 4月, 2015 1 次提交
  8. 15 4月, 2015 1 次提交
  9. 26 3月, 2015 1 次提交
  10. 18 3月, 2015 1 次提交
  11. 17 3月, 2015 1 次提交
    • N
      domifaddr: Implement the remote protocol · 71546d17
      Nehal J Wani 提交于
      daemon/remote.c
         * Define remoteSerializeDomainInterface, remoteDispatchDomainInterfaceAddresses
      
      src/remote/remote_driver.c
         * Define remoteDomainInterfaceAddresses
      
      src/remote/remote_protocol.x
         * New RPC procedure: REMOTE_PROC_DOMAIN_INTERFACE_ADDRESSES
         * Define structs remote_domain_ip_addr, remote_domain_interface,
           remote_domain_interfaces_addresse_args, remote_domain_interface_addresses_ret
         * Introduce upper bounds (to handle DoS attacks):
           REMOTE_DOMAIN_INTERFACE_MAX = 2048
           REMOTE_DOMAIN_IP_ADDR_MAX = 2048
           Restrictions on the maximum number of aliases per interface were
           removed after kernel v2.0, and theoretically, at present, there
           are no upper limits on number of interfaces per virtual machine
           and on the number of IP addresses per interface.
      
      src/remote_protocol-structs
         * New structs added
      Signed-off-by: NNehal J Wani <nehaljw.kkd1@gmail.com>
      71546d17
  12. 12 3月, 2015 1 次提交
  13. 06 3月, 2015 1 次提交
  14. 13 1月, 2015 1 次提交
    • D
      Add new virDomainDefineXMLFlags public API · 2a5ee954
      Daniel P. Berrange 提交于
      The virDomainDefineXML method is one of the few that still lacks
      an 'unsigned int flags' parameter. This will be needed for adding
      XML validation to this API. virDomainCreateXML fortunately already
      has flags.
      2a5ee954
  15. 24 11月, 2014 2 次提交
  16. 25 9月, 2014 1 次提交
    • M
      Introduce virNodeAllocPages · fa5c5580
      Michal Privoznik 提交于
      A long time ago in a galaxy far, far away it has been decided
      that libvirt will manage not only domains but host as well. And
      with my latest work on qemu driver supporting huge pages, we miss
      the cherry on top: an API to allocate huge pages on the run.
      Currently users are forced to log into the host and adjust the
      huge pages pool themselves.  However, with this API the problem
      is gone - they can both size up and size down the pool.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      fa5c5580
  17. 24 9月, 2014 1 次提交
    • P
      event: introduce new event for tunable values · e4267181
      Pavel Hrdina 提交于
      This new event will use typedParameters to expose what has been actually
      updated and the reason is that we can in the future extend any tunable
      values or add new tunable values. With typedParameters we don't have to
      worry about creating some other events, we will just use this universal
      event to inform user about updates.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      e4267181
  18. 07 9月, 2014 1 次提交
    • E
      blockcopy: remote implementation for new API · 1069e3b9
      Eric Blake 提交于
      Fairly straightforward - I got lucky that the generated functions
      worked out of the box :)
      
      * src/remote/remote_protocol.x (remote_domain_block_copy_args):
      New struct.
      (REMOTE_PROC_DOMAIN_BLOCK_COPY): New RPC.
      * src/remote/remote_driver.c (remote_driver): Wire it up.
      * src/remote_protocol-structs: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1069e3b9
  19. 28 8月, 2014 1 次提交
  20. 27 8月, 2014 1 次提交
  21. 03 7月, 2014 1 次提交
  22. 27 6月, 2014 1 次提交
  23. 24 6月, 2014 2 次提交
    • D
      Change 'interface' to 'iface' in virNetworkDHCPLease · 6512c8b4
      Daniel P. Berrange 提交于
      Variables/fields named 'interface' clash with system
      header symbols on some platforms.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      6512c8b4
    • N
      net-dhcp-leases: Implement the remote protocol · 990c3b65
      Nehal J Wani 提交于
      Implement RPC calls for virNetworkGetDHCPLeases, virNetworkGetDHCPLeasesForMAC
      
      daemon/remote.c
         * Define remoteSerializeNetworkDHCPLeases,
                  remoteDispatchNetworkGetDHCPLeases
         * Define remoteDispatchNetworkGetDHCPLeasesForMAC
         * Define helper function remoteSerializeDHCPLease
      
      src/remote/remote_driver.c
         * Define remoteNetworkGetDHCPLeases
         * Define remoteNetworkGetDHCPLeasesForMAC
         * Define helper function remoteSerializeDHCPLease
      
      src/remote/remote_protocol.x
         * New RPC procedure: REMOTE_PROC_NETWORK_GET_DHCP_LEASES
         * Define structs remote_network_dhcp_leases, remote_network_get_dhcp_leases_args,
                          remote_network_get_dhcp_leases_ret
         * New RPC procedure: REMOTE_PROC_NETWORK_GET_DHCP_LEASES_FOR_MAC
         * Define structs remote_network_dhcp_leases_for_mac, remote_network_get_dhcp_leases_for_mac_args,
                          remote_network_get_dhcp_leases_for_mac_ret
      
      src/remote_protocol-structs
         * New structs added
      
      src/rpc/gendispatch.pl
         * Add exception (s/Dhcp/DHCP) for auto-generating names of the remote functions
           in daemon/remote_dispatch.h
      990c3b65
  24. 19 6月, 2014 2 次提交
    • M
      Introduce virNodeGetFreePages · 34f2d031
      Michal Privoznik 提交于
      The aim of the API is to get information on number of free pages
      on the system. The API behaves similar to the
      virNodeGetCellsFreeMemory(). User passes starting NUMA cell, the
      count of nodes that he's interested in, pages sizes (yes,
      multiple sizes can be queried at once) and the counts are
      returned in an array.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      34f2d031
    • E
      blockjob: use stable disk string in job event · 1bfe73a1
      Eric Blake 提交于
      When the block job event was first added, it was for block pull,
      where the active layer of the disk remains the same name.  It was
      also in a day where we only cared about local files, and so we
      always had a canonical absolute file name.  But two things have
      changed since then: we now have network disks, where determining
      a single absolute string does not really make sense; and we have
      two-phase jobs (copy and active commit) where the name of the
      active layer changes between the first event (ready, on the old
      name) and second (complete, on the pivoted name).
      
      Adam Litke reported that having an unstable string between events
      makes life harder for clients.  Furthermore, all of our API that
      operate on a particular disk of a domain accept multiple strings:
      not only the absolute name of the active layer, but also the
      destination device name (such as 'vda').  As this latter name is
      stable, even for network sources, it serves as a better string
      to supply in block job events.
      
      But backwards-compatibility demands that we should not change the
      name handed to users unless they explicitly request it.  Therefore,
      this patch adds a new event, BLOCK_JOB_2 (alas, I couldn't think of
      any nicer name - but at least Migrate2 and Migrate3 are precedent
      for a number suffix).  We must double up on emitting both old-style
      and new-style events according to what clients have registered for
      (see also how IOError and IOErrorReason emits double events, but
      there the difference was a larger struct rather than changed
      meaning of one of the struct members).
      
      Unfortunately, adding a new event isn't something that can easily
      be broken into pieces, so the commit is rather large.
      
      * include/libvirt/libvirt.h.in (virDomainEventID): Add a new id
      for VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2.
      (virConnectDomainEventBlockJobCallback): Document new semantics.
      * src/conf/domain_event.c (_virDomainEventBlockJob): Rename field,
      to ensure we catch all clients.
      (virDomainEventBlockJobNew): Add parameter.
      (virDomainEventBlockJobDispose)
      (virDomainEventBlockJobNewFromObj)
      (virDomainEventBlockJobNewFromDom)
      (virDomainEventDispatchDefaultFunc): Adjust clients.
      (virDomainEventBlockJob2NewFromObj)
      (virDomainEventBlockJob2NewFromDom): New functions.
      * src/conf/domain_event.h: Add new prototypes.
      * src/libvirt_private.syms (domain_event.h): Export new functions.
      * src/qemu/qemu_driver.c (qemuDomainBlockJobImpl): Generate two
      different events.
      * src/qemu/qemu_process.c (qemuProcessHandleBlockJob): Likewise.
      * src/remote/remote_protocol.x
      (remote_domain_event_block_job_2_msg): New struct.
      (REMOTE_PROC_DOMAIN_EVENT_BLOCK_JOB_2): New RPC.
      * src/remote/remote_driver.c
      (remoteDomainBuildEventBlockJob2): New handler.
      (remoteEvents): Register new event.
      * daemon/remote.c (remoteRelayDomainEventBlockJob2): New handler.
      (domainEventCallbacks): Register new event.
      * tools/virsh-domain.c (vshEventCallbacks): Likewise.
      (vshEventBlockJobPrint): Adjust client.
      * src/remote_protocol-structs: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1bfe73a1
  25. 15 5月, 2014 1 次提交
    • M
      Introduce virDomain{Get,Set}Time APIs · 0abb3693
      Michal Privoznik 提交于
      These APIs allow users to get or set time in a domain, which may come
      handy if the domain has been resumed just recently and NTP is not
      configured or hasn't kicked in yet and the guest is running
      something time critical. In addition, NTP may refuse to re-set the clock
      if the skew is too big.
      
      In addition, new ACL attribute is introduced 'set_time'.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      0abb3693
  26. 07 5月, 2014 1 次提交
  27. 25 3月, 2014 1 次提交
  28. 13 2月, 2014 3 次提交
    • 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: 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
  29. 16 1月, 2014 1 次提交
    • E
      event: wire up RPC for server-side network event filtering · 8d9d098b
      Eric Blake 提交于
      We haven't had a release with network events yet, so we are free
      to fix the RPC so that it actually does what we want.  Doing
      client-side filtering of per-network events is inefficient if a
      connection is only interested in events on a single network out
      of hundreds available on the server.  But to do server-side
      per-network filtering, the server needs to know which network
      to filter on - so we need to pass an optional network over on
      registration.  Furthermore, it is possible to have a client with
      both a global and per-network filter; in the existing code, the
      server sends only one event and the client replicates to both
      callbacks.  But with server-side filtering, the server will send
      the event twice, so we need a way for the client to know which
      callbackID is sending an event, to ensure that the client can
      filter out events from a registration that does not match the
      callbackID from the server.  Likewise, the existing style of
      deregistering by eventID alone is fine; but in the new style,
      we have to remember which callbackID to delete.
      
      This patch fixes the RPC wire definition to contain all the
      needed pieces of information, and hooks into the server and
      client side improvements of the previous patches, in order to
      switch over to full server-side filtering of network events.
      Also, since we fixed this in time, all released versions of
      libvirtd that support network events also support per-network
      filtering, so we can hard-code that assumption into
      network_event.c.
      
      Converting domain events to server-side filtering will require
      the introduction of new RPC numbers, as well as a server
      feature bit that the client can use to tell whether to use
      old-style (server only supports global events) or new-style
      (server supports filtered events), so that is deferred to a
      later set of patches.
      
      * src/conf/network_event.c (virNetworkEventStateRegisterClient):
      Assume server-side filtering.
      * src/remote/remote_protocol.x
      (remote_connect_network_event_register_any_args): Add network
      argument.
      (remote_connect_network_event_register_any_ret): Return callbackID
      instead of count.
      (remote_connect_network_event_deregister_any_args): Pass
      callbackID instead of eventID.
      (remote_connect_network_event_deregister_any_ret): Drop unused
      type.
      (remote_network_event_lifecycle_msg): Add callbackID.
      * daemon/remote.c
      (remoteDispatchConnectNetworkEventDeregisterAny): Drop unused arg,
      and deal with callbackID from client.
      (remoteRelayNetworkEventLifecycle): Pass callbackID.
      (remoteDispatchConnectNetworkEventRegisterAny): Likewise, and
      recognize non-NULL network.
      * src/remote/remote_driver.c
      (remoteConnectNetworkEventRegisterAny): Pass network, and track
      server side id.
      (remoteConnectNetworkEventDeregisterAny): Deregister by callback id.
      (remoteNetworkBuildEventLifecycle): Pass remote id to event queue.
      * src/remote_protocol-structs: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      8d9d098b
  30. 11 12月, 2013 1 次提交
  31. 24 9月, 2013 1 次提交
  32. 18 7月, 2013 2 次提交
  33. 16 7月, 2013 1 次提交