1. 19 8月, 2013 8 次提交
    • S
      block/gluster: drop qemu_gluster_aio_flush_cb() · 372835fb
      Stefan Hajnoczi 提交于
      Since .io_flush() is no longer called we do not need
      qemu_gluster_aio_flush_cb() anymore.  It turns out that qemu_aio_count
      is unused now and can be dropped.
      
      Thanks to Bharata B Rao <bharata@linux.vnet.ibm.com> for catching a
      build failure with CONFIG_GLUSTERFS_DISCARD, which has been fixed.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      372835fb
    • S
      block/curl: drop curl_aio_flush() · 0d146022
      Stefan Hajnoczi 提交于
      .io_flush() is no longer called so drop curl_aio_flush().  The acb[]
      array that the function checks is still used in other parts of
      block/curl.c.  Therefore we cannot remove acb[], it is needed.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      0d146022
    • S
      aio: stop using .io_flush() · 164a101f
      Stefan Hajnoczi 提交于
      Now that aio_poll() users check their termination condition themselves,
      it is no longer necessary to call .io_flush() handlers.
      
      The behavior of aio_poll() changes as follows:
      
      1. .io_flush() is no longer invoked and file descriptors are *always*
      monitored.  Previously returning 0 from .io_flush() would skip this file
      descriptor.
      
      Due to this change it is essential to check that requests are pending
      before calling qemu_aio_wait().  Failure to do so means we block, for
      example, waiting for an idle iSCSI socket to become readable when there
      are no requests.  Currently all qemu_aio_wait()/aio_poll() callers check
      before calling.
      
      2. aio_poll() now returns true if progress was made (BH or fd handlers
      executed) and false otherwise.  Previously it would return true whenever
      'busy', which means that .io_flush() returned true.  The 'busy' concept
      no longer exists so just progress is returned.
      
      Due to this change we need to update tests/test-aio.c which asserts
      aio_poll() return values.  Note that QEMU doesn't actually rely on these
      return values so only tests/test-aio.c cares.
      
      Note that ctx->notifier, the EventNotifier fd used for aio_notify(), is
      now handled as a special case.  This is a little ugly but maintains
      aio_poll() semantics, i.e. aio_notify() does not count as 'progress' and
      aio_poll() avoids blocking when the user has not set any fd handlers yet.
      
      Patches after this remove .io_flush() handler code until we can finally
      drop the io_flush arguments to aio_set_fd_handler() and friends.
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      164a101f
    • S
      tests: adjust test-thread-pool to new aio_poll() semantics · 35ecde26
      Stefan Hajnoczi 提交于
      aio_poll(ctx, true) will soon block when fd handlers have been set.
      Previously aio_poll() would return early if all .io_flush() returned
      false.  This means we need to check the equivalent of the .io_flush()
      condition *before* calling aio_poll(ctx, true) to avoid deadlock.
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      35ecde26
    • S
      tests: adjust test-aio to new aio_poll() semantics · 24d1a6d9
      Stefan Hajnoczi 提交于
      aio_poll(ctx, true) will soon block if any fd handlers have been set.
      Previously it would only block when .io_flush() returned true.
      
      This means that callers must check their wait condition *before*
      aio_poll() to avoid deadlock.
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      24d1a6d9
    • S
      dataplane/virtio-blk: check exit conditions before aio_poll() · bf0da4df
      Stefan Hajnoczi 提交于
      Check exit conditions before entering blocking aio_poll().  This is
      mainly for consistency since it's unlikely that we are stopping in the
      first event loop iteration.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      bf0da4df
    • S
      block: stop relying on io_flush() in bdrv_drain_all() · 88266f5a
      Stefan Hajnoczi 提交于
      If a block driver has no file descriptors to monitor but there are still
      active requests, it can return 1 from .io_flush().  This is used to spin
      during synchronous I/O.
      
      Stop relying on .io_flush() and instead check
      QLIST_EMPTY(&bs->tracked_requests) to decide whether there are active
      requests.
      
      This is the first step in removing .io_flush() so that event loops no
      longer need to have the concept of synchronous I/O.  Eventually we may
      be able to kill synchronous I/O completely by running everything in a
      coroutine, but that is future work.
      
      Note this patch moves bs->throttled_reqs initialization to bdrv_new() so
      that bdrv_requests_pending(bs) can safely access it.  In practice bs is
      g_malloc0() so the memory is already zeroed but it's safer to initialize
      the queue properly.
      
      We also need to fix up block/stream.c:close_unused_images() to prevent
      traversing a dangling pointer while it rearranges the backing file
      chain.  This is necessary since the new bdrv_drain_all() traverses the
      backing file chain.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      88266f5a
    • S
      block: ensure bdrv_drain_all() works during bdrv_delete() · e1b5c52e
      Stefan Hajnoczi 提交于
      In bdrv_delete() make sure to call bdrv_make_anon() *after* bdrv_close()
      so that the device is still seen by bdrv_drain_all() when iterating
      bdrv_states.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      e1b5c52e
  2. 16 8月, 2013 2 次提交
  3. 14 8月, 2013 3 次提交
    • A
      mips_malta: do not raise exceptions when accessing invalid memory · cc413a39
      Aurelien Jarno 提交于
      Since commit c658b94f, MIPS raises
      exceptions when accessing invalid memory. This is not the correct
      behaviour for MIPS Malta Core LV, as the GT-64120A system controller
      just ignore undecoded access. This feature is used by the Linux kernel
      to probe for some devices.
      
      Emulate the correct behaviour in QEMU by adding an empty slot covering
      the entire memory space decoded by the GT-64120A.
      Tested-by: NStefan Weil <sw@weilnetz.de>
      Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
      cc413a39
    • M
      block: Dont ignore previously set bdrv_flags · 8b7a5415
      M. Mohan Kumar 提交于
      bdrv_flags is set by bdrv_parse_discard_flags(), but later it is reset
      to zero.
      Signed-off-by: NM. Mohan Kumar <mohan@in.ibm.com>
      Message-id: 1376483201-13466-1-git-send-email-mohan@in.ibm.com
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      8b7a5415
    • J
      qemu-char: fix infinite recursion connecting to monitor pty · 3a3567d3
      James Hogan 提交于
      Since commit bd5c51ee (qemu-char: don't issue CHR_EVENT_OPEN in a BH), an
      infinite recursion occurs when putting the monitor on a pty (-monitor
      pty) and connecting a terminal to the slave port.
      
      This is because of the qemu_chr_be_event(s, CHR_EVENT_OPENED) added to
      qemu_chr_be_generic_open(). This event is captured by monitor_event()
      which prints a welcome message to the character device. The flush of
      that welcome message retriggers another open event in pty_chr_state()
      because it checks s->connected, but only sets it to 1 after calling
      qemu_chr_be_generic_open().
      
      I've fixed this by setting s->connected = 1 before the call to
      qemu_chr_be_generic_open() instead of after, so that the recursive
      pty_chr_state() doesn't call it again.
      
      An example snippet of repeating backtrace:
       ...
       #107486 0x007aec58 in monitor_flush (mon=0xf418b0) at qemu/monitor.c:288
       #107487 0x007aee7c in monitor_puts (mon=0xf418b0, str=0x1176d07 "") at qemu/monitor.c:322
       #107488 0x007aef20 in monitor_vprintf (mon=0xf418b0, fmt=0x8d4820 "QEMU %s monitor - type 'help' for more information\n",
           ap=0x7f432be0) at qemu/monitor.c:339
       #107489 0x007aefac in monitor_printf (mon=0xf418b0, fmt=0x8d4820 "QEMU %s monitor - type 'help' for more information\n")
           at qemu/monitor.c:347
       #107490 0x007ba4bc in monitor_event (opaque=0xf418b0, event=2) at qemu/monitor.c:4699
       #107491 0x00684c28 in qemu_chr_be_event (s=0xf37788, event=2) at qemu/qemu-char.c:108
       #107492 0x00684c70 in qemu_chr_be_generic_open (s=0xf37788) at qemu/qemu-char.c:113
       #107493 0x006880a4 in pty_chr_state (chr=0xf37788, connected=1) at qemu/qemu-char.c:1145
       #107494 0x00687fa4 in pty_chr_update_read_handler (chr=0xf37788) at qemu/qemu-char.c:1121
       #107495 0x00687c9c in pty_chr_write (chr=0xf37788, buf=0x70b3c008 <Address 0x70b3c008 out of bounds>, len=538720)
           at qemu/qemu-char.c:1063
       #107496 0x00684cc4 in qemu_chr_fe_write (s=0xf37788, buf=0x70b3c008 <Address 0x70b3c008 out of bounds>, len=538720)
           at qemu/qemu-char.c:118
       ...
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Tested-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      Message-id: 1375960178-10882-1-git-send-email-james.hogan@imgtec.com
      Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
      Cc: Anthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      3a3567d3
  4. 13 8月, 2013 6 次提交
  5. 12 8月, 2013 21 次提交