qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] f406c0: block: Let bdrv_drain_all() to call a


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] f406c0: block: Let bdrv_drain_all() to call aio_poll() for...
Date: Thu, 25 Jun 2015 06:30:06 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: f406c03c093f1451ac0ba7fde31eeb78e5e5e417
      
https://github.com/qemu/qemu/commit/f406c03c093f1451ac0ba7fde31eeb78e5e5e417
  Author: Alexander Yarygin <address@hidden>
  Date:   2015-06-23 (Tue, 23 Jun 2015)

  Changed paths:
    M block/io.c

  Log Message:
  -----------
  block: Let bdrv_drain_all() to call aio_poll() for each AioContext

After the commit 9b536adc ("block: acquire AioContext in
bdrv_drain_all()") the aio_poll() function got called for every
BlockDriverState, in assumption that every device may have its own
AioContext. If we have thousands of disks attached, there are a lot of
BlockDriverStates but only a few AioContexts, leading to tons of
unnecessary aio_poll() calls.

This patch changes the bdrv_drain_all() function allowing it find shared
AioContexts and to call aio_poll() only for unique ones.

Cc: Christian Borntraeger <address@hidden>
Cc: Cornelia Huck <address@hidden>
Cc: Kevin Wolf <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Cc: Stefan Hajnoczi <address@hidden>
Signed-off-by: Alexander Yarygin <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Tested-by: Christian Borntraeger <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 2f388b93a147258f9dbc83ebe63365edac4aa7a2
      
https://github.com/qemu/qemu/commit/2f388b93a147258f9dbc83ebe63365edac4aa7a2
  Author: Alberto Garcia <address@hidden>
  Date:   2015-06-23 (Tue, 23 Jun 2015)

  Changed paths:
    M block/throttle-groups.c

  Log Message:
  -----------
  throttle: Check current timers before updating any_timer_armed[]

Calling throttle_group_config() cancels all timers from a particular
BlockDriverState, so any_timer_armed[] should be updated accordingly.

However, with the current code it may happen that a timer is armed in
a different BlockDriverState from the same group, so any_timer_armed[]
would be set to false in a situation where there is still a timer
armed.

The consequence is that we might end up with two timers armed. This
should not have any noticeable impact however, since all accesses to
the ThrottleGroup are protected by a lock, and the situation would
become normal again shortly thereafter as soon as all timers have been
fired.

The correct way to solve this is to check that we're actually
cancelling a timer before updating any_timer_armed[].

Signed-off-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 97b0385a346829cf03efe131a26a4b6a4cd0a21f
      
https://github.com/qemu/qemu/commit/97b0385a346829cf03efe131a26a4b6a4cd0a21f
  Author: Alexander Yarygin <address@hidden>
  Date:   2015-06-23 (Tue, 23 Jun 2015)

  Changed paths:
    M block/block-backend.c
    M include/sysemu/block-backend.h

  Log Message:
  -----------
  block-backend: Introduce blk_drain()

This patch introduces the blk_drain() function which allows to replace
blk_drain_all() when only one BlockDriverState needs to be drained.

Cc: Christian Borntraeger <address@hidden>
Cc: Cornelia Huck <address@hidden>
Cc: Kevin Wolf <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Cc: Stefan Hajnoczi <address@hidden>
Signed-off-by: Alexander Yarygin <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Acked-by: Kevin Wolf <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 6e40b3bfc7e82823cf4df5f0bf668f56db41e53a
      
https://github.com/qemu/qemu/commit/6e40b3bfc7e82823cf4df5f0bf668f56db41e53a
  Author: Alexander Yarygin <address@hidden>
  Date:   2015-06-23 (Tue, 23 Jun 2015)

  Changed paths:
    M hw/block/virtio-blk.c

  Log Message:
  -----------
  virtio-blk: Use blk_drain() to drain IO requests

Each call of the virtio_blk_reset() function calls blk_drain_all(),
which works for all existing BlockDriverStates, while draining only
one is needed.

This patch replaces blk_drain_all() by blk_drain() in
virtio_blk_reset(). virtio_blk_data_plane_stop() should be called
after draining because it restores vblk->complete_request.

Cc: "Michael S. Tsirkin" <address@hidden>
Cc: Christian Borntraeger <address@hidden>
Cc: Cornelia Huck <address@hidden>
Cc: Kevin Wolf <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Cc: Stefan Hajnoczi <address@hidden>
Signed-off-by: Alexander Yarygin <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: c6a8c3283f1d53e360073bdb32f87a97e78e2880
      
https://github.com/qemu/qemu/commit/c6a8c3283f1d53e360073bdb32f87a97e78e2880
  Author: Wen Congyang <address@hidden>
  Date:   2015-06-23 (Tue, 23 Jun 2015)

  Changed paths:
    M block.c
    M include/qemu/hbitmap.h
    M tests/test-hbitmap.c
    M util/hbitmap.c

  Log Message:
  -----------
  util/hbitmap: Add an API to reset all set bits in hbitmap

The function bdrv_clear_dirty_bitmap() is updated to use
faster hbitmap_reset_all() call.

Signed-off-by: Wen Congyang <address@hidden>
Signed-off-by: zhanghailiang <address@hidden>
Signed-off-by: Gonglei <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: d5941ddae82a35771656d7e35f64f7f8f19c5627
      
https://github.com/qemu/qemu/commit/d5941ddae82a35771656d7e35f64f7f8f19c5627
  Author: Wolfgang Bumiller <address@hidden>
  Date:   2015-06-23 (Tue, 23 Jun 2015)

  Changed paths:
    M block/vvfat.c
    M qapi/block-core.json

  Log Message:
  -----------
  vvfat: add a label option

Until now the vvfat volume label was hardcoded to be
"QEMU VVFAT", now you can pass a file.label=labelname option
to the -drive to change it.

The FAT structure defines the volume label to be limited to
11 bytes and is filled up spaces when shorter than that. The
trailing spaces however aren't exposed to the user by
operating systems.

[Added missing comment '#' characters in block-core.json to fix build
errors.
--Stefan]

Signed-off-by: Wolfgang Bumiller <address@hidden>
Message-id: address@hidden
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 25940fa7e57ffce9d495b4c2aadc39790535856d
      
https://github.com/qemu/qemu/commit/25940fa7e57ffce9d495b4c2aadc39790535856d
  Author: Lu Lina <address@hidden>
  Date:   2015-06-23 (Tue, 23 Jun 2015)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  nvme: Fix memleak in nvme_dma_read_prp

Signed-off-by: Lu Lina <address@hidden>
Acked-by: Keith Busch <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: b192af8acc597a6e8068873434e56e0c7de1b7d3
      
https://github.com/qemu/qemu/commit/b192af8acc597a6e8068873434e56e0c7de1b7d3
  Author: Dimitris Aragiorgis <address@hidden>
  Date:   2015-06-23 (Tue, 23 Jun 2015)

  Changed paths:
    M block.c
    M block/iscsi.c
    M block/raw-posix.c

  Log Message:
  -----------
  block: Use bdrv_is_sg() everywhere

Instead of checking bs->sg use bdrv_is_sg() consistently throughout
the code.

Signed-off-by: Dimitris Aragiorgis <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 1b6bc94d5d43ff3e39abadae19f2dbcb0954eb93
      
https://github.com/qemu/qemu/commit/1b6bc94d5d43ff3e39abadae19f2dbcb0954eb93
  Author: Dimitris Aragiorgis <address@hidden>
  Date:   2015-06-23 (Tue, 23 Jun 2015)

  Changed paths:
    M block/io.c
    M block/iscsi.c

  Log Message:
  -----------
  Fix migration in case of scsi-generic

During migration, QEMU uses fsync()/fdatasync() on the open file
descriptor for read-write block devices to flush data just before
stopping the VM.

However, fsync() on a scsi-generic device returns -EINVAL which
causes the migration to fail. This patch skips flushing data in case
of an SG device, since submitting SCSI commands directly via an SG
character device (e.g. /dev/sg0) bypasses the page cache completely,
anyway.

Note that fsync() not only flushes the page cache but also the disk
cache. The scsi-generic device never sends flushes, and for
migration it assumes that the same SCSI device is used by the
destination host, so it does not issue any SCSI SYNCHRONIZE CACHE
(10) command.

Finally, remove the bdrv_is_sg() test from iscsi_co_flush() since
this is now redundant (we flush the underlying protocol at the end
of bdrv_co_flush() which, with this patch, we never reach).

Signed-off-by: Dimitris Aragiorgis <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: bcb225550dcc0d6fcef8e97012bae572ba78f73a
      
https://github.com/qemu/qemu/commit/bcb225550dcc0d6fcef8e97012bae572ba78f73a
  Author: Dimitris Aragiorgis <address@hidden>
  Date:   2015-06-23 (Tue, 23 Jun 2015)

  Changed paths:
    M block/raw-posix.c

  Log Message:
  -----------
  raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT

Building the QEMU tools fails if we #define DEBUG_BLOCK inside
block/raw-posix.c. Here instead of adding qemu-log.o in block-obj-y
so that DEBUG_BLOCK_PRINT can be used, we substitute the latter with
a simple DPRINTF() (that does not cause bit-rot).

Signed-off-by: Dimitris Aragiorgis <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: a93a3982a6645463fa822131d38b17284edd5633
      
https://github.com/qemu/qemu/commit/a93a3982a6645463fa822131d38b17284edd5633
  Author: Dimitris Aragiorgis <address@hidden>
  Date:   2015-06-23 (Tue, 23 Jun 2015)

  Changed paths:
    M block/raw-posix.c

  Log Message:
  -----------
  raw-posix: Use DPRINTF for DEBUG_FLOPPY

Get rid of several #ifdef DEBUG_FLOPPY and substitute them with
DPRINTF.

Signed-off-by: Dimitris Aragiorgis <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 3307ed7b3fac5ba99eb3b84904b0b7cdc3592a61
      
https://github.com/qemu/qemu/commit/3307ed7b3fac5ba99eb3b84904b0b7cdc3592a61
  Author: Dimitris Aragiorgis <address@hidden>
  Date:   2015-06-23 (Tue, 23 Jun 2015)

  Changed paths:
    M block/raw-posix.c

  Log Message:
  -----------
  raw-posix: Introduce hdev_is_sg()

Until now, an SG device was identified only by checking if its path
started with "/dev/sg". Then, hdev_open() would set the bs->sg flag
accordingly. The patch relies on the actual properties of the device
instead of the specified file path.

To this end, test for an SG device (e.g. /dev/sg0) by ensuring that
all of the following holds:

 - The specified file name corresponds to a character device
 - The device supports the SG_GET_VERSION_NUM ioctl
 - The device supports the SG_GET_SCSI_ID ioctl

Signed-off-by: Dimitris Aragiorgis <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 6b64640dd25846c4de42aa433db56e0ff975993a
      
https://github.com/qemu/qemu/commit/6b64640dd25846c4de42aa433db56e0ff975993a
  Author: Wen Congyang <address@hidden>
  Date:   2015-06-23 (Tue, 23 Jun 2015)

  Changed paths:
    M include/qemu/iov.h
    M util/iov.c

  Log Message:
  -----------
  iov: don't touch iov in iov_send_recv()

Signed-off-by: Wen Congyang <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: a30c4eb2ce7b2c15ab556be3cfe2340c17271ddd
      
https://github.com/qemu/qemu/commit/a30c4eb2ce7b2c15ab556be3cfe2340c17271ddd
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2015-06-24 (Wed, 24 Jun 2015)

  Changed paths:
    M tests/qemu-iotests/051.out

  Log Message:
  -----------
  qemu-iotests: fix 051.out after qdev error message change

Commit f006cf7fa9a63ba8e4ccf57d46231ce594301727 ("qdev-monitor:
Propagate errors through qdev_device_add()") dropped a meaningless error
message.  This change in output caused qemu-iotests 051 to fail:

   QEMU_PROG: -device ide-drive,drive=disk: Device initialization failed.
  -QEMU_PROG: -device ide-drive,drive=disk: Device 'ide-drive' could not be 
initialized

Update 051.out so the test passes again.

Cc: Markus Armbruster <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden


  Commit: 12048545019cd1d64c8147ea9277648e685fa489
      
https://github.com/qemu/qemu/commit/12048545019cd1d64c8147ea9277648e685fa489
  Author: Gonglei <address@hidden>
  Date:   2015-06-24 (Wed, 24 Jun 2015)

  Changed paths:
    M hw/block/virtio-blk.c

  Log Message:
  -----------
  virito-blk: drop duplicate check

in_num = req->elem.in_num, and req->elem.in_num is
checked in line 489, so the check about in_num variable
is superflous, let's drop it.

Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 58e8b33518fd2bb6dce0ba7b6347c3df85aea3c6
      
https://github.com/qemu/qemu/commit/58e8b33518fd2bb6dce0ba7b6347c3df85aea3c6
  Author: Peter Maydell <address@hidden>
  Date:   2015-06-25 (Thu, 25 Jun 2015)

  Changed paths:
    M block.c
    M block/block-backend.c
    M block/io.c
    M block/iscsi.c
    M block/raw-posix.c
    M block/throttle-groups.c
    M block/vvfat.c
    M hw/block/nvme.c
    M hw/block/virtio-blk.c
    M include/qemu/hbitmap.h
    M include/qemu/iov.h
    M include/sysemu/block-backend.h
    M qapi/block-core.json
    M tests/qemu-iotests/051.out
    M tests/test-hbitmap.c
    M util/hbitmap.c
    M util/iov.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into 
staging

# gpg: Signature made Wed Jun 24 16:27:53 2015 BST using RSA key ID 81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <address@hidden>"
# gpg:                 aka "Stefan Hajnoczi <address@hidden>"

* remotes/stefanha/tags/block-pull-request:
  virito-blk: drop duplicate check
  qemu-iotests: fix 051.out after qdev error message change
  iov: don't touch iov in iov_send_recv()
  raw-posix: Introduce hdev_is_sg()
  raw-posix: Use DPRINTF for DEBUG_FLOPPY
  raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT
  Fix migration in case of scsi-generic
  block: Use bdrv_is_sg() everywhere
  nvme: Fix memleak in nvme_dma_read_prp
  vvfat: add a label option
  util/hbitmap: Add an API to reset all set bits in hbitmap
  virtio-blk: Use blk_drain() to drain IO requests
  block-backend: Introduce blk_drain()
  throttle: Check current timers before updating any_timer_armed[]
  block: Let bdrv_drain_all() to call aio_poll() for each AioContext

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/355df3055444...58e8b33518fd

reply via email to

[Prev in Thread] Current Thread [Next in Thread]