1. 22 4月, 2016 1 次提交
  2. 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
  3. 05 2月, 2016 1 次提交
    • P
      all: Clean up includes · d38ea87a
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1454089805-5470-16-git-send-email-peter.maydell@linaro.org
      d38ea87a
  4. 24 10月, 2015 1 次提交
  5. 08 9月, 2015 1 次提交
    • F
      iohandler: Use aio API · f3926945
      Fam Zheng 提交于
      iohandler.c shares the same interface with aio, but with duplicated
      code. It's better to rebase iohandler, also because that aio is a
      more friendly interface to multi-threads.
      
      Create a global AioContext instance and let its GSource handle the
      iohandler events.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Message-Id: <1441596538-4412-1-git-send-email-famz@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f3926945
  6. 12 6月, 2015 2 次提交
  7. 24 5月, 2014 1 次提交
  8. 22 2月, 2013 1 次提交
  9. 19 12月, 2012 3 次提交
  10. 30 10月, 2012 1 次提交
    • P
      aio: introduce AioContext, move bottom halves there · f627aab1
      Paolo Bonzini 提交于
      Start introducing AioContext, which will let us remove globals from
      aio.c/async.c, and introduce multiple I/O threads.
      
      The bottom half functions now take an additional AioContext argument.
      A bottom half is created with a specific AioContext that remains the
      same throughout the lifetime.  qemu_bh_new is just a wrapper that
      uses a global context.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f627aab1
  11. 17 9月, 2012 1 次提交
    • D
      qemu-char: BUGFIX, don't call FD_ISSET with negative fd · bbdd2ad0
      David Gibson 提交于
      tcp_chr_connect(), unlike for example udp_chr_update_read_handler() does
      not check if the fd it is using is valid (>= 0) before passing it to
      qemu_set_fd_handler2().  If using e.g. a TCP serial port, which is not
      initially connected, this can result in -1 being passed to FD_ISSET, which
      has undefined behaviour.  On x86 it seems to harmlessly return 0, but on
      PowerPC, it causes a fortify buffer overflow error to be thrown.
      
      This patch fixes this by putting an extra test in tcp_chr_connect(), and
      also adds an assert qemu_set_fd_handler2() to catch other such errors on
      all platforms, rather than just some.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      bbdd2ad0
  12. 22 8月, 2012 1 次提交
    • A
      eventfd: making it thread safe · 55ce75fa
      Alexey Kardashevskiy 提交于
      QEMU uses IO handlers to run select() in the main loop.
      The handlers list is managed by qemu_set_fd_handler() helper
      which works fine when called from the main thread as it is
      called when select() is not waiting.
      
      However IO handlers list can be changed in the thread other than
      the main one doing os_host_main_loop_wait(), for example, as a result
      of a hypercall which changes PCI config space (VFIO on POWER is the case)
      and enables/disabled MSI/MSIX which closes/creates eventfd handles.
      As the main loop should be waiting on the newly created eventfds,
      it has to be restarted.
      
      The patch adds the qemu_notify_event() call to interrupt select()
      to make main_loop() restart select() with the updated IO handlers
      list.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      55ce75fa
  13. 01 5月, 2012 1 次提交
  14. 22 10月, 2011 2 次提交
  15. 08 9月, 2011 1 次提交
  16. 02 9月, 2011 1 次提交
    • A
      main: switch qemu_set_fd_handler to g_io_add_watch · 4d88a2ac
      Anthony Liguori 提交于
      This patch changes qemu_set_fd_handler to be implemented in terms of
      g_io_add_watch().  The semantics are a bit different so some glue is required.
      
      qemu_set_fd_handler2 is much harder to convert because of its use of polling.
      
      The glib main loop has the major of advantage of having a proven thread safe
      architecture.  By using the glib main loop instead of our own, it will allow us
      to eventually introduce multiple I/O threads.
      
      I'm pretty sure that this will work on Win32, but I would appreciate some help
      testing.  I think the semantics of g_io_channel_unix_new() are really just tied
      to the notion of a "unix fd" and not necessarily unix itself.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      4d88a2ac
  17. 21 8月, 2011 1 次提交
  18. 29 3月, 2011 2 次提交