1. 18 5月, 2017 1 次提交
  2. 03 5月, 2017 1 次提交
    • J
      client: Report proper close reason · 42faf316
      Jiri Denemark 提交于
      When we get a POLLHUP or VIR_EVENT_HANDLE_HANGUP event for a client, we
      still want to read from the socket to process any accumulated data. But
      doing so inevitably results in an error and a call to
      virNetClientMarkClose before we get to processing the hangup event (and
      another call to virNetClientMarkClose). However the close reason passed
      to the second virNetClientMarkClose call is ignored because another one
      was already set. We need to pass the correct close reason when marking
      the socket to be closed for the first time.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1373859Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      42faf316
  3. 20 4月, 2017 1 次提交
    • D
      Fix error reporting when poll returns POLLHUP/POLLERR · 234ac4e1
      Daniel P. Berrange 提交于
      In the RPC client event loop code, if poll() returns only a POLLHUP
      or POLLERR status, then we end up reporting a bogus error message:
      
        error: failed to connect to the hypervisor
        error: An error occurred, but the cause is unknown
      
      We do actually report an error, but we virNetClientMarkClose method
      has already captured the error status before we report it, so the
      real error gets thrown away. The key fix is to report the error
      before calling virNetClientMarkClose(). In changing this, we also
      split out reporting of POLLHUP vs POLLERR to make any future bugs
      easier to diagnose.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      234ac4e1
  4. 11 1月, 2017 2 次提交
    • P
      remote: do not check for an existing config dir · 1a5de3fe
      Pino Toscano 提交于
      When composing the path to the default known_hosts file (for the libssh
      and libssh2 drivers), do not check whether the configuration directory
      (determined by virGetUserConfigDirectory()) exists: both the drivers can
      handle non-existing files, and are able to create them (and their
      directories) in that case.
      
      This adds a small behaviour change: before, the key for an unknown host,
      and manually accepted, was saved only if the configuration directory
      existed -- a bit incoherent behaviour though.
      1a5de3fe
    • P
      remote: fix logic for known_hosts and keyfile checks · 45c4a70c
      Pino Toscano 提交于
      If any of them is specified for the libssh and libssh2 drivers, there is
      no need to depend on checks based on other paths: in particular, a
      specified path for known_hosts was ignored if the local config directory
      could not be determined, and the path for keyfile was ignored if the
      home could not be determined.
      
      Instead, lazily determine and use these two paths only in case they are
      needed.
      45c4a70c
  5. 15 11月, 2016 2 次提交
    • P
      remote: expose a new libssh transport · 22eaee8e
      Pino Toscano 提交于
      Implement in virtNetClient and VirNetSocket the needed functions to
      expose a new libssh transport, providing all the options that the
      libssh2 transport supports.
      22eaee8e
    • P
      virnetsocket: improve search for default SSH key · 24ee5dc9
      Pino Toscano 提交于
      Add a couple of helper functions to check whether one of the default
      names of SSH keys (as documented in ssh-keygen(1)) exists, and use them
      to specify a key for the libssh2 transport if none was passed.
      24ee5dc9
  6. 24 6月, 2016 3 次提交
  7. 06 5月, 2016 1 次提交
    • C
      rpc: use virNetMessageClearPayload in client · b6238738
      Cole Robinson 提交于
      This removes the opencoded payload freeing in the client, to use
      the shared virNetMessageClearPayload call. Two changes:
      
      - ClearPayload sets nfds=0, which fixes a potential crash if
        an error path called virNetMessageFree/Clear on the message
        after fds was free'd
      - We drop the inner loop VIR_FORCE_CLOSE... this may mean fds are
        kept open a little bit longer if the call is blocking but in
        practice I don't think it will have any effect
      b6238738
  8. 03 5月, 2016 1 次提交
    • E
      virnetsocket: Provide socket address format in a more standard form · 9b45c9f0
      Erik Skultety 提交于
      Our socket address format is in a rather non-standard format and that is
      because sasl library requires the IP address and service to be delimited by a
      semicolon. The string form is a completely internal matter, however once the
      admin interfaces to retrieve client identity information are merged, we should
      return the socket address string in a common format, e.g. format defined by
      URI rfc-3986, i.e. the IP address and service are delimited by a colon and
      in case of an IPv6 address, square brackets are added:
      
      Examples:
          127.0.0.1:1234
          [::1]:1234
      
      This patch changes our default format to the one described above, while adding
      separate methods to request the non-standard SASL format using semicolon as a
      delimiter.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      9b45c9f0
  9. 29 4月, 2016 1 次提交
    • B
      rpc: Don't leak fd via CreateXMLWithFiles · 5ba48584
      Ben Gray 提交于
      FD passing APIs like CreateXMLWithFiles or OpenGraphicsFD will leak
      file descriptors. The user passes in an fd, which is dup()'d in
      virNetClientProgramCall. The new fd is what is transfered to the
      server virNetClientIOWriteMessage.
      
      Once all the fds have been written though, the parent msg->fds list
      is immediately free'd, so the individual fds are never closed.
      
      This closes each FD as its send to the server, so all fds have been
      closed by the time msg->fds is free'd.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1159766
      5ba48584
  10. 21 4月, 2016 1 次提交
  11. 23 9月, 2015 2 次提交
    • J
      client rpc: Process pending data on error · adf3be57
      Jiri Denemark 提交于
      Even though we hit an error in client's IO loop, we still want to
      process any pending data. So instead of reporting the error right away,
      we can finish the current iteration and report the error once we're done
      with it. Note that the error is stored in client->error by
      virNetClientMarkClose so we don't need to worry about it being reset or
      rewritten by any API we call in the meantime.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      adf3be57
    • J
      client rpc: Report proper error for keepalive disconnections · c91776d5
      Jiri Denemark 提交于
      Whenever a connection was closed due to keepalive timeout, we would log
      a warning but the interrupted API would return rather useless generic
      error:
      
          internal error: received hangup / error event on socket
      
      Let's report a proper keepalive timeout error and make sure it is
      propagated to all pending APIs. The error should be better now:
      
          internal error: connection closed due to keepalive timeout
      
      Based on an old patch from Martin Kletzander.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      c91776d5
  12. 11 6月, 2015 1 次提交
  13. 10 3月, 2015 1 次提交
  14. 08 12月, 2014 1 次提交
  15. 15 11月, 2014 1 次提交
  16. 25 3月, 2014 1 次提交
  17. 20 3月, 2014 1 次提交
    • M
      virNetClientSetTLSSession: Restore original signal mask · 3d4b4f5a
      Michal Privoznik 提交于
      Currently, we use pthread_sigmask(SIG_BLOCK, ...) prior to calling
      poll(). This is okay, as we don't want poll() to be interrupted.
      However, then - immediately as we fall out from the poll() - we try to
      restore the original sigmask - again using SIG_BLOCK. But as the man
      page says, SIG_BLOCK adds signals to the signal mask:
      
      SIG_BLOCK
            The set of blocked signals is the union of the current set and the set argument.
      
      Therefore, when restoring the original mask, we need to completely
      overwrite the one we set earlier and hence we should be using:
      
      SIG_SETMASK
            The set of blocked signals is set to the argument set.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      3d4b4f5a
  18. 18 3月, 2014 3 次提交
  19. 10 3月, 2014 1 次提交
  20. 12 7月, 2013 1 次提交
    • P
      remote: Improve libssh2 password authentication · 273745b4
      Peter Krempa 提交于
      This patch enables the password authentication in the libssh2 connection
      driver. There are a few benefits to this step:
      
      1) Hosts with challenge response authentication will now be supported
      with the libssh2 connection driver.
      
      2) Credential for hosts can now be stored in the authentication
      credential config file
      273745b4
  21. 11 7月, 2013 1 次提交
  22. 10 7月, 2013 1 次提交
  23. 23 5月, 2013 1 次提交
  24. 21 5月, 2013 1 次提交
  25. 20 4月, 2013 1 次提交
    • E
      docs: fix usage of 'onto' · 1bf25ba2
      Eric Blake 提交于
      http://www.uhv.edu/ac/newsletters/writing/grammartip2009.07.01.htm
      (and several other sites) give hints that 'onto' is best used if
      you can also add 'up' just before it and still make sense. In many
      cases in the code base, we really want the two-word form, or even
      a simplification to just 'on' or 'to'.
      
      * docs/hacking.html.in: Use correct 'on to'.
      * python/libvirt-override.c: Likewise.
      * src/lxc/lxc_controller.c: Likewise.
      * src/util/virpci.c: Likewise.
      * daemon/THREADS.txt: Use simpler 'on'.
      * docs/formatdomain.html.in: Better usage.
      * docs/internals/rpc.html.in: Likewise.
      * src/conf/domain_event.c: Likewise.
      * src/rpc/virnetclient.c: Likewise.
      * tests/qemumonitortestutils.c: Likewise.
      * HACKING: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1bf25ba2
  26. 27 3月, 2013 1 次提交
    • J
      rpc: Fix client crash when server drops connection · d8d4aa01
      Jiri Denemark 提交于
      Despite the comment stating virNetClientIncomingEvent handler should
      never be called with either client->haveTheBuck or client->wantClose
      set, there is a sequence of events that may lead to both booleans being
      true when virNetClientIncomingEvent is called. However, when that
      happens, we must not immediately close the socket as there are other
      threads waiting for the buck and they would cause SIGSEGV once they are
      woken up after the socket was closed. Another thing is we should clear
      all remaining calls in the queue after closing the socket.
      
      The situation that can lead to the crash involves three threads, one of
      them running event loop and the other two calling libvirt APIs. The
      event loop thread detects an event on client->sock and calls
      virNetClientIncomingEvent handler. But before the handler gets a chance
      to lock client, the other two threads (T1 and T2) start calling some
      APIs. T1 gets the buck and detects EOF on client->sock while processing
      its RPC call. Since T2 is waiting for its own call, T1 passes the buck
      on to it and unlocks client. But before T2 gets the signal, the event
      loop thread wakes up, does its job and closes client->sock. The crash
      happens when T2 actually wakes up and tries to do its job using a closed
      client->sock.
      d8d4aa01
  27. 14 3月, 2013 1 次提交
    • D
      Re-add DTrace probes on 'dispose' functions · ad9ea4a9
      Daniel P. Berrange 提交于
      When converting to virObject, the probes on the 'Free' functions
      were removed on the basis that there is a probe on virObjectFree
      that suffices. This puts a burden on people writing probe scripts
      to identify which object is being dispose. This adds back probes
      in the 'Dispose' functions and updates the rpc monitor systemtap
      example to use them
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      ad9ea4a9
  28. 21 2月, 2013 1 次提交
  29. 08 2月, 2013 1 次提交
  30. 23 1月, 2013 1 次提交
  31. 22 1月, 2013 1 次提交
  32. 18 1月, 2013 1 次提交
  33. 16 1月, 2013 1 次提交