1. 17 1月, 2020 1 次提交
  2. 20 12月, 2019 1 次提交
  3. 10 12月, 2019 2 次提交
  4. 15 11月, 2019 1 次提交
    • J
      Add API to change qemu agent response timeout · 95f5ac9a
      Jonathon Jongsma 提交于
      Some layered products such as oVirt have requested a way to avoid being
      blocked by guest agent commands when querying a loaded vm. For example,
      many guest agent commands are polled periodically to monitor changes,
      and rather than blocking the calling process, they'd prefer to simply
      time out when an agent query is taking too long.
      
      This patch adds a way for the user to specify a custom agent timeout
      that is applied to all agent commands.
      
      One special case to note here is the 'guest-sync' command. 'guest-sync'
      is issued internally prior to calling any other command. (For example,
      when libvirt wants to call 'guest-get-fsinfo', we first call
      'guest-sync' and then call 'guest-get-fsinfo').
      
      Previously, the 'guest-sync' command used a 5-second timeout
      (VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT), whereas the actual command that
      followed always blocked indefinitely
      (VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK). As part of this patch, if a
      custom timeout is specified that is shorter than
      5 seconds,  this new timeout is also used for 'guest-sync'. If there is
      no custom timeout or if the custom timeout is longer than 5 seconds, we
      will continue to use the 5-second timeout.
      Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      95f5ac9a
  5. 14 11月, 2019 1 次提交
  6. 13 11月, 2019 1 次提交
  7. 12 11月, 2019 1 次提交
  8. 21 10月, 2019 2 次提交
  9. 16 10月, 2019 2 次提交
  10. 15 10月, 2019 3 次提交
  11. 19 9月, 2019 1 次提交
  12. 16 9月, 2019 1 次提交
  13. 28 8月, 2019 1 次提交
  14. 27 8月, 2019 1 次提交
  15. 26 8月, 2019 1 次提交
  16. 09 8月, 2019 4 次提交
    • D
      remote: enable connecting to the per-driver daemons · b18c273a
      Daniel P. Berrangé 提交于
      Historically URIs handled by the remote driver will always connect to
      the libvirtd UNIX socket. There will now be one daemon per driver, and
      each of these has its own UNIX sockets to connect to.
      
      It will still be possible to run the traditional monolithic libvirtd
      though, which will have the original UNIX socket path.
      
      In addition there is a virproxyd daemon that doesn't run any drivers,
      but provides proxying for clients accessing libvirt over IP sockets, or
      tunnelling to the legacy libvirtd UNIX socket path.
      
      Finally when running inside a daemon, the remote driver must not reject
      connections unconditionally. For example, the QEMU driver needs to be
      able to connect to the network driver. The remote driver must thus be
      willing to handle connections even when inside the daemon, provided no
      local driver is registered.
      
      This refactoring enables the remote driver to be able to connect to the
      per-driver daemons. The URI parameter "mode" accepts the values "auto",
      "direct" and "legacy" to control which daemons are connected to.
      
      The client side libvirt.conf config file also supports a "remote_mode"
      setting which is used if the URI parameter is not set.
      
      If neither the config file or URI parameter set a mode, then "auto"
      is used, whereby the client looks to see which sockets actually exist
      right now.
      
      The remote driver will only ever spawn the per-driver daemons, or
      the legacy libvirtd. It won't ever try to spawn virtproxyd, as
      that is only there for IP based connectivity, or for access from
      legacy remote clients.
      
      If connecting to a remote host over any kind of ssh tunnel, for now we
      must assume only the legacy socket exists. A future patch will introduce
      a netcat replacement that is tailored for libvirt to make remote
      tunnelling easier.
      
      The configure arg '--with-remote-default-mode=legacy|direct' allows
      packagers to set a default at build time. If not given, it will default
      to legacy mode.
      
      Eventually the default will switch to direct mode. Distros can choose
      to do the switch earlier if desired. The main blocker is testing and
      suitable SELinux/AppArmor policies.
      Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      b18c273a
    • D
      remote: refactor the code for choosing the UNIX socket path · 74695569
      Daniel P. Berrangé 提交于
      The ssh, libssh, libssh2 & unix transports all need to use a UNIX socket
      path, and duplicate some of the same logic for error checking. Pull this
      out into a separate method to increase code sharing.
      Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      74695569
    • D
      remote: use enum helpers for parsing remote driver transport · 8b216749
      Daniel P. Berrangé 提交于
      Instead of open-coding a string -> enum conversion, use the enum helpers
      for the remote driver transport. The old code uses STRCASEEQ, so we must
      force the URI transport to lowercase for sake of back-compatibility.
      Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      8b216749
    • D
      remote: in per-driver daemons ensure that state initialize succeeds · 4ce29411
      Daniel P. Berrangé 提交于
      When running in libvirtd, we are happy for any of the drivers to simply
      skip their initialization in virStateInitialize, as other drivers are
      still potentially useful.
      
      When running in per-driver daemons though, we want the daemon to abort
      startup if the driver cannot initialize itself, as the daemon will be
      useless without it.
      Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      4ce29411
  17. 07 8月, 2019 2 次提交
  18. 27 7月, 2019 1 次提交
  19. 06 7月, 2019 3 次提交
  20. 04 7月, 2019 1 次提交
  21. 21 6月, 2019 2 次提交
    • D
      remote: use VIR_DRV_OPEN_REMOTE_USER in ssh transport checks · 953f046d
      Daniel P. Berrangé 提交于
      We currently refuse to connect to remote libvirtd over SSH if we see the
      path ends in /session. Earlier on though we checked for /session and set
      the VIR_DRV_OPEN_REMOTE_USER flag. There is one subtle distinction
      though with the test driver. All test URIs are marked with this flag,
      regardless of whether the URI indicates a local or remote connection.
      Previously a local connection to the test driver would have used the
      unprivileged libvirtd while a remote connection would have tried the
      privileged libvirtd. With this we are consistent and use the
      unprivileged for both local & remote, if the current user is non-root.
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      953f046d
    • D
      remote: refactor how unprivileged user session connection is identified · 00d17254
      Daniel P. Berrangé 提交于
      Currently the VIR_DRV_OPEN_REMOTE_USER flag is only set when we identify
      that we're connecting to a local libvirtd daemon. We would like to be
      able to set that even if connecting to a remote libvirtd daemon. This
      entails refactoring the conditional check.
      
      One subtle change is that the VIR_DRV_OPEN_REMOTE_USER is now set when
      the test+XXX://  URI is used, even if a servername is present. This has
      no effect in this patch, but will later.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      00d17254
  22. 17 6月, 2019 1 次提交
  23. 14 3月, 2019 1 次提交
  24. 07 3月, 2019 1 次提交
  25. 08 2月, 2019 2 次提交
    • N
      rpc: client stream: dispose private data on stream dispose · fbcb7386
      Nikolay Shirokovskiy 提交于
      If we call virStreamFinish and virStreamAbort from 2 distinct
      threads for example we can have access to freed memory.
      Because when virStreamFinish finishes for example virStreamAbort
      yet to be finished and it access virNetClientStreamPtr object
      in stream->privateData.
      
      Also it does not make sense to clear @driver field. After
      stream is finished/aborted it is better to have appropriate
      error message instead of "unsupported error".
      
      This commit reverts [1] or virNetClientStreamPtr and
      virStreamPtr will never be unrefed due to cyclic dependency.
      Before this patch we don't have leaks because all execution
      paths we call virStreamFinish or virStreamAbort.
      
      [1] 8b6ffe40 : virNetClientStreamNew: Track origin stream
      Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
      fbcb7386
    • N
      rpc: client: incapsulate error checks · ad063f61
      Nikolay Shirokovskiy 提交于
      Checking virNetClientStreamRaiseError without client lock
      is racy which is fixed in [1] for example. Thus let's remove such checks
      when we are sending message to server. And in other cases
      (like virNetClientStreamRecvHole for example) let's move the check
      into client stream code.
      
      virNetClientStreamRecvPacket already have stream lock so we could
      introduce another error checking function like virNetClientStreamRaiseErrorLocked
      but as error is set when both client and stream lock are hold we
      can remove locking from virNetClientStreamRaiseError because all
      callers hold either client or stream lock.
      
      Also let's split virNetClientStreamRaiseErrorLocked into checking
      state function and checking message send status function. They are
      same yet.
      
      [1] 1b6a29c21: rpc: fix race on stream abort/finish and server side abort
      Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      ad063f61
  26. 14 12月, 2018 1 次提交
    • D
      Remove all Author(s): lines from source file headers · 60046283
      Daniel P. Berrangé 提交于
      In many files there are header comments that contain an Author:
      statement, supposedly reflecting who originally wrote the code.
      In a large collaborative project like libvirt, any non-trivial
      file will have been modified by a large number of different
      contributors. IOW, the Author: comments are quickly out of date,
      omitting people who have made significant contribitions.
      
      In some places Author: lines have been added despite the person
      merely being responsible for creating the file by moving existing
      code out of another file. IOW, the Author: lines give an incorrect
      record of authorship.
      
      With this all in mind, the comments are useless as a means to identify
      who to talk to about code in a particular file. Contributors will always
      be better off using 'git log' and 'git blame' if they need to  find the
      author of a particular bit of code.
      
      This commit thus deletes all Author: comments from the source and adds
      a rule to prevent them reappearing.
      
      The Copyright headers are similarly misleading and inaccurate, however,
      we cannot delete these as they have legal meaning, despite being largely
      inaccurate. In addition only the copyright holder is permitted to change
      their respective copyright statement.
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      60046283
  27. 19 11月, 2018 1 次提交
    • J
      lib: Introduce virDomainSetIOThreadParams · ae69bda5
      John Ferlan 提交于
      Create a new API that will allow an adjustment of IOThread
      polling parameters for the specified IOThread. These parameters
      will not be saved in the guest XML. Currently the only parameters
      supported will allow the hypervisor to adjust the parameters used
      to limit and alter the scope of the polling interval. The polling
      interval allows the IOThread to spend more or less time processing
      in the guest.
      
      Based on code originally posted by Pavel Hrdina <phrdina@redhat.com>
      to add virDomainAddIOThreadParams and virDomainModIOThreadParams.
      Modification of those changes to use virDomainSetIOThreadParams
      instead and remove concepts related to saving the data in guest
      XML as well as the way to specifically enable the polling parameters.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      ACKed-by: NMichal Privoznik <mprivozn@redhat.com>
      ae69bda5