1. 28 7月, 2015 1 次提交
    • R
      block/ssh: Avoid segfault if inet_connect doesn't set errno. · 325e3904
      Richard W.M. Jones 提交于
      On some (but not all) systems:
      
        $ qemu-img create -f qcow2 overlay -b ssh://xen/
        Segmentation fault
      
      It turns out this happens when inet_connect returns -1 in the
      following code, but errno == 0.
      
        s->sock = inet_connect(s->hostport, errp);
        if (s->sock < 0) {
            ret = -errno;
            goto err;
        }
      
      In the test case above, no host called "xen" exists, so getaddrinfo fails.
      
      On Fedora 22, getaddrinfo happens to set errno = ENOENT (although it
      is *not* documented to do that), so it doesn't segfault.
      
      On RHEL 7, errno is not set by the failing getaddrinfo, so ret =
      -errno = 0, so the caller doesn't know there was an error and
      continues with a half-initialized BDRVSSHState struct, and everything
      goes south from there, eventually resulting in a segfault.
      
      Fix this by setting ret to -EIO (same as block/nbd.c and
      block/sheepdog.c).  The real error is saved in the Error** errp
      struct, so it is printed correctly:
      
        $ ./qemu-img create -f qcow2 overlay -b ssh://xen/
        qemu-img: overlay: address resolution failed for xen:22: No address associated with hostname
      Signed-off-by: NRichard W.M. Jones <rjones@redhat.com>
      Reported-by: Jun Li
      BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1147343Signed-off-by: NJeff Cody <jcody@redhat.com>
      325e3904
  2. 23 6月, 2015 1 次提交
  3. 03 10月, 2014 1 次提交
  4. 12 9月, 2014 1 次提交
  5. 16 6月, 2014 2 次提交
  6. 04 6月, 2014 1 次提交
    • S
      ssh: use BlockDriverState's AioContext · 2af0b200
      Stefan Hajnoczi 提交于
      Drop the assumption that we're using the main AioContext.  Use
      bdrv_get_aio_context() to register fd handlers in the right AioContext
      for this BlockDriverState.
      
      The .bdrv_detach_aio_context() and .bdrv_attach_aio_context() interfaces
      are not needed since no fd handlers, timers, or BHs stay registered when
      requests have been drained.
      
      For now this doesn't make much difference but will allow ssh to work in
      IOThread instances in the future.
      Acked-by: NRichard W.M. Jones <rjones@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      2af0b200
  7. 28 5月, 2014 5 次提交
  8. 12 9月, 2013 2 次提交
  9. 19 8月, 2013 2 次提交
  10. 28 6月, 2013 1 次提交
  11. 22 4月, 2013 1 次提交
  12. 19 4月, 2013 2 次提交
  13. 15 4月, 2013 2 次提交