1. 11 11月, 2016 1 次提交
  2. 31 10月, 2016 3 次提交
  3. 15 8月, 2016 1 次提交
  4. 13 7月, 2016 1 次提交
    • P
      coroutine: move entry argument to qemu_coroutine_create · 0b8b8753
      Paolo Bonzini 提交于
      In practice the entry argument is always known at creation time, and
      it is confusing that sometimes qemu_coroutine_enter is used with a
      non-NULL argument to re-enter a coroutine (this happens in
      block/sheepdog.c and tests/test-coroutine.c).  So pass the opaque value
      at creation time, for consistency with e.g. aio_bh_new.
      
      Mostly done with the following semantic patch:
      
      @ entry1 @
      expression entry, arg, co;
      @@
      - co = qemu_coroutine_create(entry);
      + co = qemu_coroutine_create(entry, arg);
        ...
      - qemu_coroutine_enter(co, arg);
      + qemu_coroutine_enter(co);
      
      @ entry2 @
      expression entry, arg;
      identifier co;
      @@
      - Coroutine *co = qemu_coroutine_create(entry);
      + Coroutine *co = qemu_coroutine_create(entry, arg);
        ...
      - qemu_coroutine_enter(co, arg);
      + qemu_coroutine_enter(co);
      
      @ entry3 @
      expression entry, arg;
      @@
      - qemu_coroutine_enter(qemu_coroutine_create(entry), arg);
      + qemu_coroutine_enter(qemu_coroutine_create(entry, arg));
      
      @ reentry @
      expression co;
      @@
      - qemu_coroutine_enter(co, NULL);
      + qemu_coroutine_enter(co);
      
      except for the aforementioned few places where the semantic patch
      stumbled (as expected) and for test_co_queue, which would otherwise
      produce an uninitialized variable warning.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      0b8b8753
  5. 23 3月, 2016 1 次提交
    • M
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster 提交于
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  6. 20 1月, 2016 1 次提交
  7. 24 10月, 2015 1 次提交
  8. 09 10月, 2015 1 次提交
  9. 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
  10. 23 6月, 2015 1 次提交
  11. 03 10月, 2014 1 次提交
  12. 12 9月, 2014 1 次提交
  13. 16 6月, 2014 2 次提交
  14. 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
  15. 28 5月, 2014 5 次提交
  16. 12 9月, 2013 2 次提交
  17. 19 8月, 2013 2 次提交
  18. 28 6月, 2013 1 次提交
  19. 22 4月, 2013 1 次提交
  20. 19 4月, 2013 2 次提交
  21. 15 4月, 2013 2 次提交