Skip to content
Snippets Groups Projects
  1. May 23, 2014
  2. Feb 21, 2013
  3. Dec 19, 2012
  4. Oct 30, 2012
    • Paolo Bonzini's avatar
      aio: introduce AioContext, move bottom halves there · f627aab1
      Paolo Bonzini authored
      
      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: default avatarPaolo Bonzini <pbonzini@redhat.com>
      f627aab1
  5. Sep 17, 2012
    • David Gibson's avatar
      qemu-char: BUGFIX, don't call FD_ISSET with negative fd · bbdd2ad0
      David Gibson authored
      
      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: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
      bbdd2ad0
  6. Aug 21, 2012
    • Alexey Kardashevskiy's avatar
      eventfd: making it thread safe · 55ce75fa
      Alexey Kardashevskiy authored
      
      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: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
      55ce75fa
  7. May 01, 2012
  8. Oct 21, 2011
  9. Sep 08, 2011
  10. Sep 01, 2011
    • Anthony Liguori's avatar
      main: switch qemu_set_fd_handler to g_io_add_watch · 4d88a2ac
      Anthony Liguori authored
      
      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: default avatarAnthony Liguori <aliguori@us.ibm.com>
      4d88a2ac
  11. Aug 21, 2011
  12. Mar 29, 2011
Loading