1. 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
  2. 11 7月, 2013 1 次提交
  3. 10 7月, 2013 1 次提交
  4. 02 7月, 2013 1 次提交
    • E
      build: avoid build failure without gnutls · 4e6a78e7
      Eric Blake 提交于
      Found while trying to cross-compile to mingw:
      
        CC       libvirt_driver_remote_la-remote_driver.lo
      ../../src/remote/remote_driver.c: In function 'doRemoteOpen':
      ../../src/remote/remote_driver.c:487:23: error: variable 'verify' set but not used [-Werror=unused-but-set-variable]
      
      * src/remote/remote_driver.c (doRemoteOpen): Also ignore 'verify'.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      4e6a78e7
  5. 25 6月, 2013 1 次提交
  6. 14 6月, 2013 2 次提交
    • P
      remote: Fix client crash when URI path is empty when using ssh · 7710d236
      Peter Krempa 提交于
      The parsed path in the URI may be NULL resulting into:
      
        $ virsh -c qemu+ssh:// list
        Segmentation fault (core dumped)
      
      Introduced by 22d81ceb
      7710d236
    • P
      remote: Forbid default "/session" connections when using ssh transport · 22d81ceb
      Peter Krempa 提交于
      Without the socket path explicitly specified, the remote driver tried to
      connect to the "/system" instance socket even if "/session" was
      specified in the uri. With this patch this configuration now produces an
      error.
      
      It is still possible to initiate a session connection with specifying
      the path to the socket manually and also manually starting the session
      daemon. This was also possible prior to this patch,
      
      This is a minimal fix. We may decide to support remote session
      connections using ssh but this will require changes to the remote driver
      code so this fix shouldn't cause regressions in the case we decide to do
      that.
      22d81ceb
  7. 06 6月, 2013 1 次提交
  8. 23 5月, 2013 2 次提交
  9. 21 5月, 2013 1 次提交
  10. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  11. 26 4月, 2013 1 次提交
    • L
      hypervisor api: implement RPC calls for virNodeDeviceDetachFlags · cc875b83
      Laine Stump 提交于
      This requires a custom function for remoteNodeDeviceDetachFlags,
      because it is named *NodeDevice, but it goes through the hypervisor
      driver rather than nodedevice driver, and so it uses privateData
      instead of nodeDevicePrivateData. (It has to go through the hypervisor
      driver, because that is the driver that knows about the backend drivers
      that will perform the pci device assignment).
      cc875b83
  12. 24 4月, 2013 5 次提交
  13. 05 4月, 2013 1 次提交
    • P
      rpc: Fix connection close callback race condition and memory corruption/crash · 8ad126e6
      Peter Krempa 提交于
      The last Viktor's effort to fix the race and memory corruption unfortunately
      wasn't complete in the case the close callback was not registered in an
      connection. At that time, the trail of event's that I'll describe later could
      still happen and corrupt the memory or cause a crash of the client (including
      the daemon in case of a p2p migration).
      
      Consider the following prerequisities and trail of events:
      Let's have a remote connection to a hypervisor that doesn't have a close
      callback registered and the client is using the event loop. The crash happens in
      cooperation of 2 threads. Thread E is the event loop and thread W is the worker
      that does some stuff. R denotes the remote client.
      
      1.) W - The client finishes everything and sheds the last reference on the client
      2.) W - The virObject stuff invokes virConnectDispose that invokes doRemoteClose
      3.) W - the remote close method invokes the REMOTE_PROC_CLOSE RPC method.
      4.) W - The thread is preempted at this point.
      5.) R - The remote side receives the close and closes the socket.
      6.) E - poll() wakes up due to the closed socket and invokes the close callback
      7.) E - The event loop is preempted right before remoteClientCloseFunc is called
      8.) W - The worker now finishes, and frees the conn object.
      9.) E - The remoteClientCloseFunc accesses the now-freed conn object in the
              attempt to retrieve pointer for the real close callback.
      10.) Kaboom, corrupted memory/segfault.
      
      This patch tries to fix this by introducing a new object that survives the
      freeing of the connection object. We can't increase the reference count on the
      connection object itself or the connection would never be closed, as the
      connection is closed only when the reference count reaches zero.
      
      The new object - virConnectCloseCallbackData - is a lockable object that keeps
      the pointers to the real user registered callback and ensures that the
      connection callback is either not called if the connection was already freed or
      that the connection isn't freed while this is being called.
      8ad126e6
  14. 27 3月, 2013 1 次提交
  15. 23 2月, 2013 3 次提交
  16. 12 2月, 2013 1 次提交
    • O
      remote: Wire up the remote protocol · 39758e75
      Osier Yang 提交于
      Like virNodeDeviceCreateXML, virNodeDeviceLookupSCSIHostByWWN
      has to be treated specially when generating the RPC codes. Also
      new rules are added in fixup_name to keep the name SCSIHostByWWN.
      39758e75
  17. 22 1月, 2013 1 次提交
    • J
      remote: Avoid coverity[leaked_storage] message. · 9cc0f8d5
      John Ferlan 提交于
      Upon successful return of virNetClientStreamEventAddCallback() the
      allocated cbdata field will be freed by virNetClientStreamEventRemoveCallback()
      as cbOpaque using the free function remoteStreamCallbackFree().
      9cc0f8d5
  18. 18 1月, 2013 1 次提交
  19. 16 1月, 2013 1 次提交
  20. 14 1月, 2013 2 次提交
  21. 11 1月, 2013 1 次提交
  22. 09 1月, 2013 1 次提交
  23. 08 1月, 2013 1 次提交
  24. 05 1月, 2013 1 次提交
    • J
      api: Add API to tunnel a guest channel via stream · d52add46
      John Eckersberg 提交于
      This patch adds a new API, virDomainOpenChannel, that uses streams to
      connect to a virtio channel on a guest.  This creates a secure
      communication channel between a guest and a libvirt client.
      
      This behaves the same as virDomainOpenConsole, except on channels
      instead of console/serial/parallel devices.
      d52add46
  25. 21 12月, 2012 6 次提交
  26. 06 12月, 2012 1 次提交
    • D
      remote: Avoid the thread race condition · b362938e
      Daniel P. Berrange 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=866524
      
      Since the virConnect object is not locked wholely when doing
      virConenctDispose, a thread can get the lock and thus might
      cause the race.
      
      Detected by valgrind:
      
      ==23687== Invalid read of size 4
      ==23687==    at 0x38BAA091EC: pthread_mutex_lock (pthread_mutex_lock.c:61)
      ==23687==    by 0x3FBA919E36: remoteClientCloseFunc (remote_driver.c:337)
      ==23687==    by 0x3FBA936BF2: virNetClientCloseLocked (virnetclient.c:688)
      ==23687==    by 0x3FBA9390D8: virNetClientIncomingEvent (virnetclient.c:1859)
      ==23687==    by 0x3FBA851AAE: virEventPollRunOnce (event_poll.c:485)
      ==23687==    by 0x3FBA850846: virEventRunDefaultImpl (event.c:247)
      ==23687==    by 0x40CD61: vshEventLoop (virsh.c:2128)
      ==23687==    by 0x3FBA8626F8: virThreadHelper (threads-pthread.c:161)
      ==23687==    by 0x38BAA077F0: start_thread (pthread_create.c:301)
      ==23687==    by 0x33F68E570C: clone (clone.S:115)
      ==23687==  Address 0x4ca94e0 is 144 bytes inside a block of size 312 free'd
      ==23687==    at 0x4A0595D: free (vg_replace_malloc.c:366)
      ==23687==    by 0x3FBA8588B8: virFree (memory.c:309)
      ==23687==    by 0x3FBA86AAFC: virObjectUnref (virobject.c:145)
      ==23687==    by 0x3FBA8EA767: virConnectClose (libvirt.c:1458)
      ==23687==    by 0x40C8B8: vshDeinit (virsh.c:2584)
      ==23687==    by 0x41071E: main (virsh.c:3022)
      
      The above race is caused by the eventLoop thread tries to handle
      the net client event by calling the callback set by:
          virNetClientSetCloseCallback(priv->client,
                                       remoteClientCloseFunc,
                                       conn, NULL);
      
      I.E. remoteClientCloseFunc, which lock/unlock the virConnect object.
      
      This patch is to fix the bug by setting the callback to NULL when
      doRemoteClose.
      b362938e