1. 25 7月, 2018 2 次提交
  2. 23 7月, 2018 1 次提交
    • A
      src: Make virStr*cpy*() functions return an int · 6c0d0210
      Andrea Bolognani 提交于
      Currently, the functions return a pointer to the
      destination buffer on success or NULL on failure.
      
      Not only does this kind of error handling look quite
      alien in the context of libvirt, where most functions
      return zero on success and a negative int on failure,
      but it's also somewhat pointless because unless there's
      been a failure the returned pointer will be the same
      one passed in by the user, thus offering no additional
      value.
      
      Change the functions so that they return an int
      instead.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      6c0d0210
  3. 21 7月, 2018 2 次提交
  4. 26 6月, 2018 2 次提交
  5. 06 6月, 2018 1 次提交
  6. 05 6月, 2018 2 次提交
  7. 16 5月, 2018 1 次提交
  8. 11 5月, 2018 2 次提交
  9. 04 5月, 2018 1 次提交
  10. 18 4月, 2018 2 次提交
  11. 17 4月, 2018 1 次提交
  12. 09 4月, 2018 7 次提交
  13. 06 4月, 2018 1 次提交
    • J
      util: introduce virSocketAddrParseAny · 412afdb8
      Jim Fehlig 提交于
      When preparing for migration, the libxl driver creates a new TCP listen
      socket for the incoming migration by calling virNetSocketNewListenTCP,
      passing the destination host name. virNetSocketNewListenTCP calls
      virSocketAddrParse to check if the host name is a wildcard address, in
      which case it avoids adding the AI_ADDRCONFIG flag to the hints passed to
      getaddrinfo. If the host name is not an IP address, virSocketAddrParse
      reports an error
      
      error : virSocketAddrParseInternal:121 : Cannot parse socket address
      'myhost.example.com': Name or service not known
      
      But virNetSocketNewListenTCP succeeds regardless and the overall migration
      operation succeeds.
      
      Introduce virSocketAddrParseAny and use it when simply testing if a host
      name/addr is parsable.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      412afdb8
  14. 08 3月, 2018 4 次提交
    • D
      rpc: avoid crashing in pre-exec if no workers are present · 86cae503
      Daniel P. Berrangé 提交于
      If max_workers is set to zero, then the worker thread pool won't be
      created, so when serializing state for pre-exec we must set various
      parameters to zero.
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Reviewed-by: NJim Fehlig <jfehlig@suse.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      86cae503
    • D
      rpc: invoke the message dispatch callback with client unlocked · 06e7ebb6
      Daniel P. Berrangé 提交于
      Currently if the virNetServer instance is created with max_workers==0 to
      request a non-threaded dispatch process, we deadlock during dispatch
      
        #0  0x00007fb845f6f42d in __lll_lock_wait () from /lib64/libpthread.so.0
        #1  0x00007fb845f681d3 in pthread_mutex_lock () from /lib64/libpthread.so.0
        #2  0x000055a6628bb305 in virMutexLock (m=<optimized out>) at util/virthread.c:89
        #3  0x000055a6628a984b in virObjectLock (anyobj=<optimized out>) at util/virobject.c:435
        #4  0x000055a66286fcde in virNetServerClientIsAuthenticated (client=client@entry=0x55a663a7b960)
            at rpc/virnetserverclient.c:1565
        #5  0x000055a66286cc17 in virNetServerProgramDispatchCall (msg=0x55a663a7bc50, client=0x55a663a7b960,
            server=0x55a663a77550, prog=0x55a663a78020) at rpc/virnetserverprogram.c:407
        #6  virNetServerProgramDispatch (prog=prog@entry=0x55a663a78020, server=server@entry=0x55a663a77550,
            client=client@entry=0x55a663a7b960, msg=msg@entry=0x55a663a7bc50) at rpc/virnetserverprogram.c:307
        #7  0x000055a662871d56 in virNetServerProcessMsg (msg=0x55a663a7bc50, prog=0x55a663a78020, client=0x55a663a7b960,
            srv=0x55a663a77550) at rpc/virnetserver.c:148
        #8  virNetServerDispatchNewMessage (client=0x55a663a7b960, msg=0x55a663a7bc50, opaque=0x55a663a77550)
            at rpc/virnetserver.c:227
        #9  0x000055a66286e4c0 in virNetServerClientDispatchRead (client=client@entry=0x55a663a7b960)
            at rpc/virnetserverclient.c:1322
        #10 0x000055a66286e813 in virNetServerClientDispatchEvent (sock=<optimized out>, events=1, opaque=0x55a663a7b960)
            at rpc/virnetserverclient.c:1507
        #11 0x000055a662899be0 in virEventPollDispatchHandles (fds=0x55a663a7bdc0, nfds=<optimized out>)
            at util/vireventpoll.c:508
        #12 virEventPollRunOnce () at util/vireventpoll.c:657
        #13 0x000055a6628982f1 in virEventRunDefaultImpl () at util/virevent.c:327
        #14 0x000055a6628716d5 in virNetDaemonRun (dmn=0x55a663a771b0) at rpc/virnetdaemon.c:858
        #15 0x000055a662864c1d in main (argc=<optimized out>,
        #argv=0x7ffd105b4838) at logging/log_daemon.c:1235
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Reviewed-by: NJim Fehlig <jfehlig@suse.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      06e7ebb6
    • D
      rpc: simplify calling convention of virNetServerClientDispatchFunc · c6f1d519
      Daniel P. Berrangé 提交于
      Currently virNetServerClientDispatchFunc implementations are only
      responsible for free'ing the "msg" parameter upon success. Simplify the
      calling convention by making it their unconditional responsibility to
      free the "msg", and close the client if desired.
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Reviewed-by: NJim Fehlig <jfehlig@suse.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      c6f1d519
    • D
      rpc: push ref acquisition into RPC dispatch function · 464889ff
      Daniel P. Berrangé 提交于
      There's no reason why the virNetServerClientDispatchRead method needs to
      acquire an extra reference on the "client" object. An extra reference is
      only needed if the registered dispatch callback is going to keep hold of
      the "client" for work in the background. Thus we can push reference
      acquisition into virNetServerDispatchNewMessage.
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Reviewed-by: NJim Fehlig <jfehlig@suse.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      464889ff
  15. 06 3月, 2018 1 次提交
  16. 22 2月, 2018 1 次提交
  17. 03 2月, 2018 1 次提交
  18. 02 2月, 2018 2 次提交
  19. 31 1月, 2018 5 次提交
  20. 26 1月, 2018 1 次提交
    • D
      rpc: fix race sending and encoding sasl data · 4e13fb02
      Daniel P. Berrange 提交于
      The virNetSocketWriteSASL method has to encode the buffer it is given and then
      write it to the underlying socket. This write is not guaranteed to send the
      full amount of data that was encoded by SASL. We cache the SASL encoded data so
      that on the next invocation of virNetSocketWriteSASL we carry on sending it.
      
      The subtle problem is that the 'len' value passed into virNetSocketWriteSASL on
      the 2nd call may be larger than the original value. So when we've completed
      sending the SASL encoded data we previously cached, we must return the original
      length we encoded, not the new length.
      
      This flaw means we could potentially have been discarded queued data without
      sending it. This would have exhibited itself as a libvirt client never receiving
      the reply to a method it invokes, async events silently going missing, or worse
      stream data silently getting dropped.
      
      For this to be a problem libvirtd would have to be queued data to send to the
      client, while at the same time the TCP socket send buffer is full (due to a very
      slow client). This is quite unlikely so if this bug was ever triggered by a real
      world user it would be almost impossible to reproduce or diagnose, if indeed it
      was ever noticed at all.
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      4e13fb02