* [Qemu-devel] [PULL 00/15] Block patches
@ 2011-04-07 14:49 Kevin Wolf
2011-04-07 15:44 ` Anthony Liguori
0 siblings, 1 reply; 26+ messages in thread
From: Kevin Wolf @ 2011-04-07 14:49 UTC (permalink / raw)
To: anthony; +Cc: kwolf, qemu-devel
The following changes since commit 3b8e6a2db1946b5f21e69fde31b39f43367f1928:
exec: Handle registrations of the entire address space (2011-04-07 10:53:41 +0200)
are available in the git repository at:
git://repo.or.cz/qemu/kevin.git for-anthony
Avishay Traeger (1):
Fix integer overflow in block migration bandwidth calculation
Christoph Hellwig (1):
virtio-blk: fail unaligned requests
Feiran Zheng (1):
hw/xen_disk: ioreq not finished on error
Isaku Yamahata (1):
ide: consolidate drive_get(IF_IDE)
Jason Wang (1):
floppy: save and restore DIR register
Jes Sorensen (1):
qemu-img: Initial progress printing support
Kevin Wolf (1):
qemu-img rebase: Fix segfault if backing file can't be opened
Michael Tokarev (1):
exit if -drive specified is invalid instead of ignoring the "wrong" -drive
Nick Thomas (4):
NBD library: whitespace changes
Set errno=ENOTSUP for attempts to use UNIX sockets on Windows platforms
NBD: Use qemu_socket functions to open TCP and UNIX sockets
NBD device: Separate out parsing configuration and opening sockets.
Ryan Harper (1):
Do not delete BlockDriverState when deleting the drive
Stefan Hajnoczi (2):
trace: Trace bdrv_set_locked()
block: Do not cache device size for removable media
Makefile.objs | 4 +-
block-migration.c | 2 +-
block.c | 28 +-
block.h | 1 +
block/nbd.c | 157 ++++++---
blockdev.c | 25 +-
hw/fdc.c | 51 +++-
hw/ide.h | 3 +
hw/ide/core.c | 14 +
hw/mips_fulong2e.c | 9 +-
hw/mips_malta.c | 10 +-
hw/mips_r4k.c | 10 +-
hw/pc_piix.c | 10 +-
hw/ppc_newworld.c | 11 +-
hw/ppc_oldworld.c | 11 +-
hw/ppc_prep.c | 10 +-
hw/sun4u.c | 9 +-
hw/virtio-blk.c | 8 +
hw/xen_disk.c | 10 +-
nbd.c | 993 +++++++++++++++++++++++-----------------------------
nbd.h | 9 +-
qemu-common.h | 4 +
qemu-img-cmds.hx | 4 +-
qemu-img.c | 46 +++-
qemu-progress.c | 89 +++++
qemu-sockets.c | 4 +
trace-events | 1 +
vl.c | 4 +-
28 files changed, 825 insertions(+), 712 deletions(-)
create mode 100644 qemu-progress.c
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PULL 00/15] Block patches
2011-04-07 14:49 Kevin Wolf
@ 2011-04-07 15:44 ` Anthony Liguori
0 siblings, 0 replies; 26+ messages in thread
From: Anthony Liguori @ 2011-04-07 15:44 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel
On 04/07/2011 09:49 AM, Kevin Wolf wrote:
> The following changes since commit 3b8e6a2db1946b5f21e69fde31b39f43367f1928:
>
> exec: Handle registrations of the entire address space (2011-04-07 10:53:41 +0200)
Pulled. Thanks.
Regards,
Anthony Liguori
> are available in the git repository at:
> git://repo.or.cz/qemu/kevin.git for-anthony
>
> Avishay Traeger (1):
> Fix integer overflow in block migration bandwidth calculation
>
> Christoph Hellwig (1):
> virtio-blk: fail unaligned requests
>
> Feiran Zheng (1):
> hw/xen_disk: ioreq not finished on error
>
> Isaku Yamahata (1):
> ide: consolidate drive_get(IF_IDE)
>
> Jason Wang (1):
> floppy: save and restore DIR register
>
> Jes Sorensen (1):
> qemu-img: Initial progress printing support
>
> Kevin Wolf (1):
> qemu-img rebase: Fix segfault if backing file can't be opened
>
> Michael Tokarev (1):
> exit if -drive specified is invalid instead of ignoring the "wrong" -drive
>
> Nick Thomas (4):
> NBD library: whitespace changes
> Set errno=ENOTSUP for attempts to use UNIX sockets on Windows platforms
> NBD: Use qemu_socket functions to open TCP and UNIX sockets
> NBD device: Separate out parsing configuration and opening sockets.
>
> Ryan Harper (1):
> Do not delete BlockDriverState when deleting the drive
>
> Stefan Hajnoczi (2):
> trace: Trace bdrv_set_locked()
> block: Do not cache device size for removable media
>
> Makefile.objs | 4 +-
> block-migration.c | 2 +-
> block.c | 28 +-
> block.h | 1 +
> block/nbd.c | 157 ++++++---
> blockdev.c | 25 +-
> hw/fdc.c | 51 +++-
> hw/ide.h | 3 +
> hw/ide/core.c | 14 +
> hw/mips_fulong2e.c | 9 +-
> hw/mips_malta.c | 10 +-
> hw/mips_r4k.c | 10 +-
> hw/pc_piix.c | 10 +-
> hw/ppc_newworld.c | 11 +-
> hw/ppc_oldworld.c | 11 +-
> hw/ppc_prep.c | 10 +-
> hw/sun4u.c | 9 +-
> hw/virtio-blk.c | 8 +
> hw/xen_disk.c | 10 +-
> nbd.c | 993 +++++++++++++++++++++++-----------------------------
> nbd.h | 9 +-
> qemu-common.h | 4 +
> qemu-img-cmds.hx | 4 +-
> qemu-img.c | 46 +++-
> qemu-progress.c | 89 +++++
> qemu-sockets.c | 4 +
> trace-events | 1 +
> vl.c | 4 +-
> 28 files changed, 825 insertions(+), 712 deletions(-)
> create mode 100644 qemu-progress.c
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 00/15] Block patches
@ 2012-02-10 12:47 Kevin Wolf
2012-02-15 10:14 ` Kevin Wolf
2012-02-16 0:31 ` Anthony Liguori
0 siblings, 2 replies; 26+ messages in thread
From: Kevin Wolf @ 2012-02-10 12:47 UTC (permalink / raw)
To: anthony; +Cc: kwolf, qemu-devel
The following changes since commit 57c83dacfe179bf061b8fa79d9553ebabe4d2ff4:
make: Remove duplicate use of GLIB_CFLAGS (2012-02-09 20:44:38 +0400)
are available in the git repository at:
git://repo.or.cz/qemu/kevin.git for-anthony
Alexander Graf (2):
AHCI: Fix port reset race
AHCI: Masking of IRQs actually masks them
Charles Arnold (1):
vpc: Add support for Fixed Disk type
Dong Xu Wang (1):
rewrite QEMU_BUILD_BUG_ON
Kevin Wolf (3):
vpc: Round up image size during fixed image creation
qcow2: Update whole header at once
qcow2: Keep unknown header extension when rewriting header
MORITA Kazutaka (1):
sheepdog: fix co_recv coroutine context
Ronnie Sahlberg (1):
iSCSI: add configuration variables for iSCSI
Stefan Hajnoczi (6):
cutils: extract buffer_is_zero() from qemu-img.c
block: add .bdrv_co_write_zeroes() interface
block: perform zero-detection during copy-on-read
qed: replace is_write with flags field
qed: add .bdrv_co_write_zeroes() support
qemu-io: add write -z option for bdrv_co_write_zeroes
block.c | 67 +++++++++++--
block.h | 8 ++
block/iscsi.c | 139 +++++++++++++++++++++++++--
block/qcow2.c | 194 ++++++++++++++++++++++++++------------
block/qcow2.h | 9 ++
block/qed.c | 125 +++++++++++++++++++++---
block/qed.h | 7 +-
block/sheepdog.c | 3 +
block/vpc.c | 282 ++++++++++++++++++++++++++++++++++++-----------------
block_int.h | 8 ++
compiler.h | 4 +-
cutils.c | 35 +++++++
hw/ide/ahci.c | 7 ++
qemu-common.h | 2 +
qemu-config.c | 27 +++++
qemu-doc.texi | 54 ++++++++++-
qemu-img.c | 46 ++--------
qemu-io.c | 77 +++++++++++++--
qemu-options.hx | 16 +++-
trace-events | 3 +-
vl.c | 8 ++
21 files changed, 881 insertions(+), 240 deletions(-)
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PULL 00/15] Block patches
2012-02-10 12:47 Kevin Wolf
@ 2012-02-15 10:14 ` Kevin Wolf
2012-02-16 0:31 ` Anthony Liguori
1 sibling, 0 replies; 26+ messages in thread
From: Kevin Wolf @ 2012-02-15 10:14 UTC (permalink / raw)
To: anthony; +Cc: Kevin Wolf, qemu-devel
Am 10.02.2012 13:47, schrieb Kevin Wolf:
> The following changes since commit 57c83dacfe179bf061b8fa79d9553ebabe4d2ff4:
>
> make: Remove duplicate use of GLIB_CFLAGS (2012-02-09 20:44:38 +0400)
>
> are available in the git repository at:
> git://repo.or.cz/qemu/kevin.git for-anthony
>
> Alexander Graf (2):
> AHCI: Fix port reset race
> AHCI: Masking of IRQs actually masks them
>
> Charles Arnold (1):
> vpc: Add support for Fixed Disk type
>
> Dong Xu Wang (1):
> rewrite QEMU_BUILD_BUG_ON
>
> Kevin Wolf (3):
> vpc: Round up image size during fixed image creation
> qcow2: Update whole header at once
> qcow2: Keep unknown header extension when rewriting header
>
> MORITA Kazutaka (1):
> sheepdog: fix co_recv coroutine context
>
> Ronnie Sahlberg (1):
> iSCSI: add configuration variables for iSCSI
>
> Stefan Hajnoczi (6):
> cutils: extract buffer_is_zero() from qemu-img.c
> block: add .bdrv_co_write_zeroes() interface
> block: perform zero-detection during copy-on-read
> qed: replace is_write with flags field
> qed: add .bdrv_co_write_zeroes() support
> qemu-io: add write -z option for bdrv_co_write_zeroes
>
> block.c | 67 +++++++++++--
> block.h | 8 ++
> block/iscsi.c | 139 +++++++++++++++++++++++++--
> block/qcow2.c | 194 ++++++++++++++++++++++++++------------
> block/qcow2.h | 9 ++
> block/qed.c | 125 +++++++++++++++++++++---
> block/qed.h | 7 +-
> block/sheepdog.c | 3 +
> block/vpc.c | 282 ++++++++++++++++++++++++++++++++++++-----------------
> block_int.h | 8 ++
> compiler.h | 4 +-
> cutils.c | 35 +++++++
> hw/ide/ahci.c | 7 ++
> qemu-common.h | 2 +
> qemu-config.c | 27 +++++
> qemu-doc.texi | 54 ++++++++++-
> qemu-img.c | 46 ++--------
> qemu-io.c | 77 +++++++++++++--
> qemu-options.hx | 16 +++-
> trace-events | 3 +-
> vl.c | 8 ++
> 21 files changed, 881 insertions(+), 240 deletions(-)
>
Ping?
Kevin
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PULL 00/15] Block patches
2012-02-10 12:47 Kevin Wolf
2012-02-15 10:14 ` Kevin Wolf
@ 2012-02-16 0:31 ` Anthony Liguori
1 sibling, 0 replies; 26+ messages in thread
From: Anthony Liguori @ 2012-02-16 0:31 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel
On 02/10/2012 06:47 AM, Kevin Wolf wrote:
> The following changes since commit 57c83dacfe179bf061b8fa79d9553ebabe4d2ff4:
>
> make: Remove duplicate use of GLIB_CFLAGS (2012-02-09 20:44:38 +0400)
Pulled. Thanks.
Regards,
Anthony Liguori
>
> are available in the git repository at:
> git://repo.or.cz/qemu/kevin.git for-anthony
>
> Alexander Graf (2):
> AHCI: Fix port reset race
> AHCI: Masking of IRQs actually masks them
>
> Charles Arnold (1):
> vpc: Add support for Fixed Disk type
>
> Dong Xu Wang (1):
> rewrite QEMU_BUILD_BUG_ON
>
> Kevin Wolf (3):
> vpc: Round up image size during fixed image creation
> qcow2: Update whole header at once
> qcow2: Keep unknown header extension when rewriting header
>
> MORITA Kazutaka (1):
> sheepdog: fix co_recv coroutine context
>
> Ronnie Sahlberg (1):
> iSCSI: add configuration variables for iSCSI
>
> Stefan Hajnoczi (6):
> cutils: extract buffer_is_zero() from qemu-img.c
> block: add .bdrv_co_write_zeroes() interface
> block: perform zero-detection during copy-on-read
> qed: replace is_write with flags field
> qed: add .bdrv_co_write_zeroes() support
> qemu-io: add write -z option for bdrv_co_write_zeroes
>
> block.c | 67 +++++++++++--
> block.h | 8 ++
> block/iscsi.c | 139 +++++++++++++++++++++++++--
> block/qcow2.c | 194 ++++++++++++++++++++++++++------------
> block/qcow2.h | 9 ++
> block/qed.c | 125 +++++++++++++++++++++---
> block/qed.h | 7 +-
> block/sheepdog.c | 3 +
> block/vpc.c | 282 ++++++++++++++++++++++++++++++++++++-----------------
> block_int.h | 8 ++
> compiler.h | 4 +-
> cutils.c | 35 +++++++
> hw/ide/ahci.c | 7 ++
> qemu-common.h | 2 +
> qemu-config.c | 27 +++++
> qemu-doc.texi | 54 ++++++++++-
> qemu-img.c | 46 ++--------
> qemu-io.c | 77 +++++++++++++--
> qemu-options.hx | 16 +++-
> trace-events | 3 +-
> vl.c | 8 ++
> 21 files changed, 881 insertions(+), 240 deletions(-)
>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 00/15] Block patches
@ 2013-05-03 11:52 Stefan Hajnoczi
0 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2013-05-03 11:52 UTC (permalink / raw)
To: qemu-devel; +Cc: Anthony Liguori, Stefan Hajnoczi
Details on the patches:
1. Fam Zheng's VMDK zeroed-grain GTEs implements zero cluster support in
VMDK. We need this to correctly read files containing zero clusters -
it's essentially a bugfix.
2. Jeff Cody's VHDX series implements read-only support for the new Hyper-V
image format. The series has been on the list for a while and stripped
down to make it mergable for QEMU 1.5. Not all image files are supported
yet but this already allows for new v2v migrations.
3. Kevin Wolf's qmp_block_resize error clarification.
4. My NBD fix for new Linux nbd drivers that can send >1 MB requests.
The following changes since commit 8ca27ce2e1150486ea2db4116a03706b28294f16:
Merge remote-tracking branch 'afaerber/qom-cpu' into staging (2013-05-02 10:57:01 -0500)
are available in the git repository at:
git://github.com/stefanha/qemu.git block
for you to fetch changes up to 86abefd61e23325162e59e5bfb8f0346eda62541:
qemu-iotests: Filter out 'adapter_type' (2013-05-03 13:06:22 +0200)
----------------------------------------------------------------
Fam Zheng (8):
vmdk: named return code.
vmdk: add support for “zeroed‐grain” GTE
vmdk: Add option to create zeroed-grain image
vmdk: change magic number to macro
vmdk: store fields of VmdkMetaData in cpu endian
vmdk: add bdrv_co_write_zeroes
qemu-iotests: Filter out vmdk creation options
qemu-iotests: Filter out 'adapter_type'
Jeff Cody (4):
qemu: add castagnoli crc32c checksum algorithm
block: vhdx header for the QEMU support of VHDX images
block: initial VHDX driver support framework - supports open and probe
block: add read-only support to VHDX image format.
Kevin Wolf (1):
blockdev: Replace "undefined error" in qmp_block_resize
Stefan Hajnoczi (2):
nbd: use g_slice_new() instead of a freelist
nbd: support large NBD requests
block/Makefile.objs | 1 +
block/vhdx.c | 972 +++++++++++++++++++++++++++++++++++++++++++
block/vhdx.h | 325 +++++++++++++++
block/vmdk.c | 208 ++++++---
blockdev.c | 6 +-
include/block/nbd.h | 3 +-
include/qemu/crc32c.h | 35 ++
nbd.c | 36 +-
tests/qemu-iotests/common.rc | 3 +
util/Makefile.objs | 1 +
util/crc32c.c | 115 +++++
11 files changed, 1618 insertions(+), 87 deletions(-)
create mode 100644 block/vhdx.c
create mode 100644 block/vhdx.h
create mode 100644 include/qemu/crc32c.h
create mode 100644 util/crc32c.c
--
1.8.1.4
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 00/15] Block patches
@ 2015-06-24 15:27 Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 01/15] block: Let bdrv_drain_all() to call aio_poll() for each AioContext Stefan Hajnoczi
` (15 more replies)
0 siblings, 16 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2015-06-24 15:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Peter Maydell, Stefan Hajnoczi
The following changes since commit a3206972a9eab65ec8e8f9ae320ad628ba4b58f1:
Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2015-06-22' into staging (2015-06-23 10:38:00 +0100)
are available in the git repository at:
git://github.com/stefanha/qemu.git tags/block-pull-request
for you to fetch changes up to 12048545019cd1d64c8147ea9277648e685fa489:
virito-blk: drop duplicate check (2015-06-24 16:16:04 +0100)
----------------------------------------------------------------
----------------------------------------------------------------
Alberto Garcia (1):
throttle: Check current timers before updating any_timer_armed[]
Alexander Yarygin (3):
block: Let bdrv_drain_all() to call aio_poll() for each AioContext
block-backend: Introduce blk_drain()
virtio-blk: Use blk_drain() to drain IO requests
Dimitris Aragiorgis (5):
block: Use bdrv_is_sg() everywhere
Fix migration in case of scsi-generic
raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT
raw-posix: Use DPRINTF for DEBUG_FLOPPY
raw-posix: Introduce hdev_is_sg()
Gonglei (1):
virito-blk: drop duplicate check
Lu Lina (1):
nvme: Fix memleak in nvme_dma_read_prp
Stefan Hajnoczi (1):
qemu-iotests: fix 051.out after qdev error message change
Wen Congyang (2):
util/hbitmap: Add an API to reset all set bits in hbitmap
iov: don't touch iov in iov_send_recv()
Wolfgang Bumiller (1):
vvfat: add a label option
block.c | 8 ++--
block/block-backend.c | 5 +++
block/io.c | 45 +++++++++++++--------
block/iscsi.c | 4 --
block/raw-posix.c | 91 ++++++++++++++++++++++++------------------
block/throttle-groups.c | 9 ++++-
block/vvfat.c | 25 ++++++++++--
hw/block/nvme.c | 1 +
hw/block/virtio-blk.c | 18 +++++----
include/qemu/hbitmap.h | 8 ++++
include/qemu/iov.h | 2 +-
include/sysemu/block-backend.h | 1 +
qapi/block-core.json | 6 ++-
tests/qemu-iotests/051.out | 8 ----
tests/test-hbitmap.c | 38 ++++++++++++++++++
util/hbitmap.c | 13 ++++++
util/iov.c | 14 ++++++-
17 files changed, 210 insertions(+), 86 deletions(-)
--
2.4.3
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 01/15] block: Let bdrv_drain_all() to call aio_poll() for each AioContext
2015-06-24 15:27 [Qemu-devel] [PULL 00/15] Block patches Stefan Hajnoczi
@ 2015-06-24 15:27 ` Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 02/15] throttle: Check current timers before updating any_timer_armed[] Stefan Hajnoczi
` (14 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2015-06-24 15:27 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Peter Maydell, Alexander Yarygin,
Christian Borntraeger, Stefan Hajnoczi, Cornelia Huck,
Paolo Bonzini
From: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
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 <borntraeger@de.ibm.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 1433936297-7098-4-git-send-email-yarygin@linux.vnet.ibm.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
block/io.c | 42 ++++++++++++++++++++++++++----------------
1 file changed, 26 insertions(+), 16 deletions(-)
diff --git a/block/io.c b/block/io.c
index 9cc729b..43f85ab 100644
--- a/block/io.c
+++ b/block/io.c
@@ -233,17 +233,6 @@ static bool bdrv_requests_pending(BlockDriverState *bs)
return false;
}
-static bool bdrv_drain_one(BlockDriverState *bs)
-{
- bool bs_busy;
-
- bdrv_flush_io_queue(bs);
- bdrv_start_throttled_reqs(bs);
- bs_busy = bdrv_requests_pending(bs);
- bs_busy |= aio_poll(bdrv_get_aio_context(bs), bs_busy);
- return bs_busy;
-}
-
/*
* Wait for pending requests to complete on a single BlockDriverState subtree
*
@@ -256,8 +245,13 @@ static bool bdrv_drain_one(BlockDriverState *bs)
*/
void bdrv_drain(BlockDriverState *bs)
{
- while (bdrv_drain_one(bs)) {
+ bool busy = true;
+
+ while (busy) {
/* Keep iterating */
+ bdrv_flush_io_queue(bs);
+ busy = bdrv_requests_pending(bs);
+ busy |= aio_poll(bdrv_get_aio_context(bs), busy);
}
}
@@ -278,6 +272,7 @@ void bdrv_drain_all(void)
/* Always run first iteration so any pending completion BHs run */
bool busy = true;
BlockDriverState *bs = NULL;
+ GSList *aio_ctxs = NULL, *ctx;
while ((bs = bdrv_next(bs))) {
AioContext *aio_context = bdrv_get_aio_context(bs);
@@ -287,17 +282,30 @@ void bdrv_drain_all(void)
block_job_pause(bs->job);
}
aio_context_release(aio_context);
+
+ if (!aio_ctxs || !g_slist_find(aio_ctxs, aio_context)) {
+ aio_ctxs = g_slist_prepend(aio_ctxs, aio_context);
+ }
}
while (busy) {
busy = false;
- bs = NULL;
- while ((bs = bdrv_next(bs))) {
- AioContext *aio_context = bdrv_get_aio_context(bs);
+ for (ctx = aio_ctxs; ctx != NULL; ctx = ctx->next) {
+ AioContext *aio_context = ctx->data;
+ bs = NULL;
aio_context_acquire(aio_context);
- busy |= bdrv_drain_one(bs);
+ while ((bs = bdrv_next(bs))) {
+ if (aio_context == bdrv_get_aio_context(bs)) {
+ bdrv_flush_io_queue(bs);
+ if (bdrv_requests_pending(bs)) {
+ busy = true;
+ aio_poll(aio_context, busy);
+ }
+ }
+ }
+ busy |= aio_poll(aio_context, false);
aio_context_release(aio_context);
}
}
@@ -312,6 +320,7 @@ void bdrv_drain_all(void)
}
aio_context_release(aio_context);
}
+ g_slist_free(aio_ctxs);
}
/**
@@ -2562,4 +2571,5 @@ void bdrv_flush_io_queue(BlockDriverState *bs)
} else if (bs->file) {
bdrv_flush_io_queue(bs->file);
}
+ bdrv_start_throttled_reqs(bs);
}
--
2.4.3
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 02/15] throttle: Check current timers before updating any_timer_armed[]
2015-06-24 15:27 [Qemu-devel] [PULL 00/15] Block patches Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 01/15] block: Let bdrv_drain_all() to call aio_poll() for each AioContext Stefan Hajnoczi
@ 2015-06-24 15:27 ` Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 03/15] block-backend: Introduce blk_drain() Stefan Hajnoczi
` (13 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2015-06-24 15:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Peter Maydell, Alberto Garcia, Stefan Hajnoczi
From: Alberto Garcia <berto@igalia.com>
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 <berto@igalia.com>
Message-id: 1434382875-3998-1-git-send-email-berto@igalia.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
block/throttle-groups.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/block/throttle-groups.c b/block/throttle-groups.c
index efc462f..1abc6fc 100644
--- a/block/throttle-groups.c
+++ b/block/throttle-groups.c
@@ -324,9 +324,14 @@ void throttle_group_config(BlockDriverState *bs, ThrottleConfig *cfg)
ThrottleState *ts = bs->throttle_state;
ThrottleGroup *tg = container_of(ts, ThrottleGroup, ts);
qemu_mutex_lock(&tg->lock);
- throttle_config(ts, tt, cfg);
/* throttle_config() cancels the timers */
- tg->any_timer_armed[0] = tg->any_timer_armed[1] = false;
+ if (timer_pending(tt->timers[0])) {
+ tg->any_timer_armed[0] = false;
+ }
+ if (timer_pending(tt->timers[1])) {
+ tg->any_timer_armed[1] = false;
+ }
+ throttle_config(ts, tt, cfg);
qemu_mutex_unlock(&tg->lock);
}
--
2.4.3
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 03/15] block-backend: Introduce blk_drain()
2015-06-24 15:27 [Qemu-devel] [PULL 00/15] Block patches Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 01/15] block: Let bdrv_drain_all() to call aio_poll() for each AioContext Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 02/15] throttle: Check current timers before updating any_timer_armed[] Stefan Hajnoczi
@ 2015-06-24 15:27 ` Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 04/15] virtio-blk: Use blk_drain() to drain IO requests Stefan Hajnoczi
` (12 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2015-06-24 15:27 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Peter Maydell, Alexander Yarygin,
Christian Borntraeger, Stefan Hajnoczi, Cornelia Huck,
Paolo Bonzini
From: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
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 <borntraeger@de.ibm.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 1434537440-28236-2-git-send-email-yarygin@linux.vnet.ibm.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
block/block-backend.c | 5 +++++
include/sysemu/block-backend.h | 1 +
2 files changed, 6 insertions(+)
diff --git a/block/block-backend.c b/block/block-backend.c
index 93e46f3..aee8a12 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -700,6 +700,11 @@ int blk_flush_all(void)
return bdrv_flush_all();
}
+void blk_drain(BlockBackend *blk)
+{
+ bdrv_drain(blk->bs);
+}
+
void blk_drain_all(void)
{
bdrv_drain_all();
diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h
index b4a4d5e..8fc960f 100644
--- a/include/sysemu/block-backend.h
+++ b/include/sysemu/block-backend.h
@@ -118,6 +118,7 @@ int blk_co_discard(BlockBackend *blk, int64_t sector_num, int nb_sectors);
int blk_co_flush(BlockBackend *blk);
int blk_flush(BlockBackend *blk);
int blk_flush_all(void);
+void blk_drain(BlockBackend *blk);
void blk_drain_all(void);
BlockdevOnError blk_get_on_error(BlockBackend *blk, bool is_read);
BlockErrorAction blk_get_error_action(BlockBackend *blk, bool is_read,
--
2.4.3
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 04/15] virtio-blk: Use blk_drain() to drain IO requests
2015-06-24 15:27 [Qemu-devel] [PULL 00/15] Block patches Stefan Hajnoczi
` (2 preceding siblings ...)
2015-06-24 15:27 ` [Qemu-devel] [PULL 03/15] block-backend: Introduce blk_drain() Stefan Hajnoczi
@ 2015-06-24 15:27 ` Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 05/15] util/hbitmap: Add an API to reset all set bits in hbitmap Stefan Hajnoczi
` (11 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2015-06-24 15:27 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Peter Maydell, Michael S. Tsirkin, Alexander Yarygin,
Christian Borntraeger, Stefan Hajnoczi, Cornelia Huck,
Paolo Bonzini
From: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
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" <mst@redhat.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Message-id: 1434537440-28236-3-git-send-email-yarygin@linux.vnet.ibm.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
hw/block/virtio-blk.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index cd539aa..bbb1fc1 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -651,16 +651,21 @@ static void virtio_blk_dma_restart_cb(void *opaque, int running,
static void virtio_blk_reset(VirtIODevice *vdev)
{
VirtIOBlock *s = VIRTIO_BLK(vdev);
-
- if (s->dataplane) {
- virtio_blk_data_plane_stop(s->dataplane);
- }
+ AioContext *ctx;
/*
* This should cancel pending requests, but can't do nicely until there
* are per-device request lists.
*/
- blk_drain_all();
+ ctx = blk_get_aio_context(s->blk);
+ aio_context_acquire(ctx);
+ blk_drain(s->blk);
+
+ if (s->dataplane) {
+ virtio_blk_data_plane_stop(s->dataplane);
+ }
+ aio_context_release(ctx);
+
blk_set_enable_write_cache(s->blk, s->original_wce);
}
--
2.4.3
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 05/15] util/hbitmap: Add an API to reset all set bits in hbitmap
2015-06-24 15:27 [Qemu-devel] [PULL 00/15] Block patches Stefan Hajnoczi
` (3 preceding siblings ...)
2015-06-24 15:27 ` [Qemu-devel] [PULL 04/15] virtio-blk: Use blk_drain() to drain IO requests Stefan Hajnoczi
@ 2015-06-24 15:27 ` Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 06/15] vvfat: add a label option Stefan Hajnoczi
` (10 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2015-06-24 15:27 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Peter Maydell, zhanghailiang, Gonglei,
Stefan Hajnoczi
From: Wen Congyang <wency@cn.fujitsu.com>
The function bdrv_clear_dirty_bitmap() is updated to use
faster hbitmap_reset_all() call.
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: 555E868A.60506@cn.fujitsu.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
block.c | 2 +-
include/qemu/hbitmap.h | 8 ++++++++
tests/test-hbitmap.c | 38 ++++++++++++++++++++++++++++++++++++++
util/hbitmap.c | 13 +++++++++++++
4 files changed, 60 insertions(+), 1 deletion(-)
diff --git a/block.c b/block.c
index e2e33fd..7168575 100644
--- a/block.c
+++ b/block.c
@@ -3513,7 +3513,7 @@ void bdrv_reset_dirty_bitmap(BdrvDirtyBitmap *bitmap,
void bdrv_clear_dirty_bitmap(BdrvDirtyBitmap *bitmap)
{
assert(bdrv_dirty_bitmap_enabled(bitmap));
- hbitmap_reset(bitmap->bitmap, 0, bitmap->size);
+ hbitmap_reset_all(bitmap->bitmap);
}
void bdrv_set_dirty(BlockDriverState *bs, int64_t cur_sector,
diff --git a/include/qemu/hbitmap.h b/include/qemu/hbitmap.h
index f0a85f8..bb94a00 100644
--- a/include/qemu/hbitmap.h
+++ b/include/qemu/hbitmap.h
@@ -132,6 +132,14 @@ void hbitmap_set(HBitmap *hb, uint64_t start, uint64_t count);
void hbitmap_reset(HBitmap *hb, uint64_t start, uint64_t count);
/**
+ * hbitmap_reset_all:
+ * @hb: HBitmap to operate on.
+ *
+ * Reset all bits in an HBitmap.
+ */
+void hbitmap_reset_all(HBitmap *hb);
+
+/**
* hbitmap_get:
* @hb: HBitmap to operate on.
* @item: Bit to query (0-based).
diff --git a/tests/test-hbitmap.c b/tests/test-hbitmap.c
index 9f41b5f..161eeb4 100644
--- a/tests/test-hbitmap.c
+++ b/tests/test-hbitmap.c
@@ -184,6 +184,23 @@ static void hbitmap_test_reset(TestHBitmapData *data,
}
}
+static void hbitmap_test_reset_all(TestHBitmapData *data)
+{
+ size_t n;
+
+ hbitmap_reset_all(data->hb);
+
+ n = (data->size + BITS_PER_LONG - 1) / BITS_PER_LONG;
+ if (n == 0) {
+ n = 1;
+ }
+ memset(data->bits, 0, n * sizeof(unsigned long));
+
+ if (data->granularity == 0) {
+ hbitmap_test_check(data, 0);
+ }
+}
+
static void hbitmap_test_check_get(TestHBitmapData *data)
{
uint64_t count = 0;
@@ -364,6 +381,26 @@ static void test_hbitmap_reset(TestHBitmapData *data,
hbitmap_test_set(data, L3 / 2, L3);
}
+static void test_hbitmap_reset_all(TestHBitmapData *data,
+ const void *unused)
+{
+ hbitmap_test_init(data, L3 * 2, 0);
+ hbitmap_test_set(data, L1 - 1, L1 + 2);
+ hbitmap_test_reset_all(data);
+ hbitmap_test_set(data, 0, L1 * 3);
+ hbitmap_test_reset_all(data);
+ hbitmap_test_set(data, L2, L1);
+ hbitmap_test_reset_all(data);
+ hbitmap_test_set(data, L2, L3 - L2 + 1);
+ hbitmap_test_reset_all(data);
+ hbitmap_test_set(data, L3 - 1, 3);
+ hbitmap_test_reset_all(data);
+ hbitmap_test_set(data, 0, L3 * 2);
+ hbitmap_test_reset_all(data);
+ hbitmap_test_set(data, L3 / 2, L3);
+ hbitmap_test_reset_all(data);
+}
+
static void test_hbitmap_granularity(TestHBitmapData *data,
const void *unused)
{
@@ -627,6 +664,7 @@ int main(int argc, char **argv)
hbitmap_test_add("/hbitmap/set/overlap", test_hbitmap_set_overlap);
hbitmap_test_add("/hbitmap/reset/empty", test_hbitmap_reset_empty);
hbitmap_test_add("/hbitmap/reset/general", test_hbitmap_reset);
+ hbitmap_test_add("/hbitmap/reset/all", test_hbitmap_reset_all);
hbitmap_test_add("/hbitmap/granularity", test_hbitmap_granularity);
hbitmap_test_add("/hbitmap/truncate/nop", test_hbitmap_truncate_nop);
diff --git a/util/hbitmap.c b/util/hbitmap.c
index a10c7ae..50b888f 100644
--- a/util/hbitmap.c
+++ b/util/hbitmap.c
@@ -356,6 +356,19 @@ void hbitmap_reset(HBitmap *hb, uint64_t start, uint64_t count)
hb_reset_between(hb, HBITMAP_LEVELS - 1, start, last);
}
+void hbitmap_reset_all(HBitmap *hb)
+{
+ unsigned int i;
+
+ /* Same as hbitmap_alloc() except for memset() instead of malloc() */
+ for (i = HBITMAP_LEVELS; --i >= 1; ) {
+ memset(hb->levels[i], 0, hb->sizes[i] * sizeof(unsigned long));
+ }
+
+ hb->levels[0][0] = 1UL << (BITS_PER_LONG - 1);
+ hb->count = 0;
+}
+
bool hbitmap_get(const HBitmap *hb, uint64_t item)
{
/* Compute position and bit in the last layer. */
--
2.4.3
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 06/15] vvfat: add a label option
2015-06-24 15:27 [Qemu-devel] [PULL 00/15] Block patches Stefan Hajnoczi
` (4 preceding siblings ...)
2015-06-24 15:27 ` [Qemu-devel] [PULL 05/15] util/hbitmap: Add an API to reset all set bits in hbitmap Stefan Hajnoczi
@ 2015-06-24 15:27 ` Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 07/15] nvme: Fix memleak in nvme_dma_read_prp Stefan Hajnoczi
` (9 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2015-06-24 15:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Peter Maydell, Stefan Hajnoczi, Wolfgang Bumiller
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
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 <w.bumiller@proxmox.com>
Message-id: 1434706529-13895-2-git-send-email-w.bumiller@proxmox.com
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
block/vvfat.c | 25 ++++++++++++++++++++++---
qapi/block-core.json | 6 +++++-
2 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/block/vvfat.c b/block/vvfat.c
index c35550c..2068697 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -323,6 +323,7 @@ typedef struct BDRVVVFATState {
int fat_type; /* 16 or 32 */
array_t fat,directory,mapping;
+ char volume_label[11];
unsigned int cluster_size;
unsigned int sectors_per_cluster;
@@ -860,7 +861,7 @@ static int init_directories(BDRVVVFATState* s,
{
direntry_t* entry=array_get_next(&(s->directory));
entry->attributes=0x28; /* archive | volume label */
- memcpy(entry->name, "QEMU VVFAT ", sizeof(entry->name));
+ memcpy(entry->name, s->volume_label, sizeof(entry->name));
}
/* Now build FAT, and write back information into directory */
@@ -969,7 +970,8 @@ static int init_directories(BDRVVVFATState* s,
bootsector->u.fat16.signature=0x29;
bootsector->u.fat16.id=cpu_to_le32(0xfabe1afd);
- memcpy(bootsector->u.fat16.volume_label,"QEMU VVFAT ",11);
+ memcpy(bootsector->u.fat16.volume_label, s->volume_label,
+ sizeof(bootsector->u.fat16.volume_label));
memcpy(bootsector->fat_type,(s->fat_type==12?"FAT12 ":s->fat_type==16?"FAT16 ":"FAT32 "),8);
bootsector->magic[0]=0x55; bootsector->magic[1]=0xaa;
@@ -1009,6 +1011,11 @@ static QemuOptsList runtime_opts = {
.help = "Create a floppy rather than a hard disk image",
},
{
+ .name = "label",
+ .type = QEMU_OPT_STRING,
+ .help = "Use a volume label other than QEMU VVFAT",
+ },
+ {
.name = "rw",
.type = QEMU_OPT_BOOL,
.help = "Make the image writable",
@@ -1070,7 +1077,7 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
BDRVVVFATState *s = bs->opaque;
int cyls, heads, secs;
bool floppy;
- const char *dirname;
+ const char *dirname, *label;
QemuOpts *opts;
Error *local_err = NULL;
int ret;
@@ -1097,6 +1104,18 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
s->fat_type = qemu_opt_get_number(opts, "fat-type", 0);
floppy = qemu_opt_get_bool(opts, "floppy", false);
+ memset(s->volume_label, ' ', sizeof(s->volume_label));
+ label = qemu_opt_get(opts, "label");
+ if (label) {
+ size_t label_length = strlen(label);
+ if (label_length > 11) {
+ error_setg(errp, "vvfat label cannot be longer than 11 bytes");
+ ret = -EINVAL;
+ goto fail;
+ }
+ memcpy(s->volume_label, label, label_length);
+ }
+
if (floppy) {
/* 1.44MB or 2.88MB floppy. 2.88MB can be FAT12 (default) or FAT16. */
if (!s->fat_type) {
diff --git a/qapi/block-core.json b/qapi/block-core.json
index afa9d3d..766d690 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1453,13 +1453,17 @@
# @fat-type: #optional FAT type: 12, 16 or 32
# @floppy: #optional whether to export a floppy image (true) or
# partitioned hard disk (false; default)
+# @label: #optional set the volume label, limited to 11 bytes. FAT16 and
+# FAT32 traditionally have some restrictions on labels, which are
+# ignored by most operating systems. Defaults to "QEMU VVFAT".
+# (since 2.4)
# @rw: #optional whether to allow write operations (default: false)
#
# Since: 1.7
##
{ 'struct': 'BlockdevOptionsVVFAT',
'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
- '*rw': 'bool' } }
+ '*label': 'str', '*rw': 'bool' } }
##
# @BlockdevOptionsGenericFormat
--
2.4.3
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 07/15] nvme: Fix memleak in nvme_dma_read_prp
2015-06-24 15:27 [Qemu-devel] [PULL 00/15] Block patches Stefan Hajnoczi
` (5 preceding siblings ...)
2015-06-24 15:27 ` [Qemu-devel] [PULL 06/15] vvfat: add a label option Stefan Hajnoczi
@ 2015-06-24 15:27 ` Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 08/15] block: Use bdrv_is_sg() everywhere Stefan Hajnoczi
` (8 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2015-06-24 15:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Peter Maydell, Stefan Hajnoczi, Lu Lina
From: Lu Lina <lina.lulina@huawei.com>
Signed-off-by: Lu Lina <lina.lulina@huawei.com>
Acked-by: Keith Busch <keith.busch@intel.com>
Message-id: 1434695254-69808-1-git-send-email-kathy.wangting@huawei.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
hw/block/nvme.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 4b6d5e6..c6a6a0e 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -154,6 +154,7 @@ static uint16_t nvme_dma_read_prp(NvmeCtrl *n, uint8_t *ptr, uint32_t len,
qemu_sglist_destroy(&qsg);
return NVME_INVALID_FIELD | NVME_DNR;
}
+ qemu_sglist_destroy(&qsg);
return NVME_SUCCESS;
}
--
2.4.3
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 08/15] block: Use bdrv_is_sg() everywhere
2015-06-24 15:27 [Qemu-devel] [PULL 00/15] Block patches Stefan Hajnoczi
` (6 preceding siblings ...)
2015-06-24 15:27 ` [Qemu-devel] [PULL 07/15] nvme: Fix memleak in nvme_dma_read_prp Stefan Hajnoczi
@ 2015-06-24 15:27 ` Stefan Hajnoczi
2015-06-24 15:28 ` [Qemu-devel] [PULL 09/15] Fix migration in case of scsi-generic Stefan Hajnoczi
` (7 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2015-06-24 15:27 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Peter Maydell, Dimitris Aragiorgis, Stefan Hajnoczi
From: Dimitris Aragiorgis <dimara@arrikto.com>
Instead of checking bs->sg use bdrv_is_sg() consistently throughout
the code.
Signed-off-by: Dimitris Aragiorgis <dimara@arrikto.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1435056300-14924-2-git-send-email-dimara@arrikto.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
block.c | 6 +++---
block/iscsi.c | 2 +-
block/raw-posix.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/block.c b/block.c
index 7168575..81233be 100644
--- a/block.c
+++ b/block.c
@@ -585,7 +585,7 @@ static int find_image_format(BlockDriverState *bs, const char *filename,
int ret = 0;
/* Return the raw BlockDriver * to scsi-generic devices or empty drives */
- if (bs->sg || !bdrv_is_inserted(bs) || bdrv_getlength(bs) == 0) {
+ if (bdrv_is_sg(bs) || !bdrv_is_inserted(bs) || bdrv_getlength(bs) == 0) {
*pdrv = &bdrv_raw;
return ret;
}
@@ -617,7 +617,7 @@ static int refresh_total_sectors(BlockDriverState *bs, int64_t hint)
BlockDriver *drv = bs->drv;
/* Do not attempt drv->bdrv_getlength() on scsi-generic devices */
- if (bs->sg)
+ if (bdrv_is_sg(bs))
return 0;
/* query actual device if possible, otherwise just trust the hint */
@@ -948,7 +948,7 @@ static int bdrv_open_common(BlockDriverState *bs, BlockDriverState *file,
assert(bdrv_opt_mem_align(bs) != 0);
assert(bdrv_min_mem_align(bs) != 0);
- assert((bs->request_alignment != 0) || bs->sg);
+ assert((bs->request_alignment != 0) || bdrv_is_sg(bs));
qemu_opts_del(opts);
return 0;
diff --git a/block/iscsi.c b/block/iscsi.c
index 5f7b60c..aff8198 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -628,7 +628,7 @@ static int coroutine_fn iscsi_co_flush(BlockDriverState *bs)
IscsiLun *iscsilun = bs->opaque;
struct IscsiTask iTask;
- if (bs->sg) {
+ if (bdrv_is_sg(bs)) {
return 0;
}
diff --git a/block/raw-posix.c b/block/raw-posix.c
index a967464..b2097fc 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -305,9 +305,9 @@ static void raw_probe_alignment(BlockDriverState *bs, int fd, Error **errp)
char *buf;
size_t max_align = MAX(MAX_BLOCKSIZE, getpagesize());
- /* For /dev/sg devices the alignment is not really used.
+ /* For SCSI generic devices the alignment is not really used.
With buffered I/O, we don't have any restrictions. */
- if (bs->sg || !s->needs_alignment) {
+ if (bdrv_is_sg(bs) || !s->needs_alignment) {
bs->request_alignment = 1;
s->buf_align = 1;
return;
--
2.4.3
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 09/15] Fix migration in case of scsi-generic
2015-06-24 15:27 [Qemu-devel] [PULL 00/15] Block patches Stefan Hajnoczi
` (7 preceding siblings ...)
2015-06-24 15:27 ` [Qemu-devel] [PULL 08/15] block: Use bdrv_is_sg() everywhere Stefan Hajnoczi
@ 2015-06-24 15:28 ` Stefan Hajnoczi
2015-06-24 15:28 ` [Qemu-devel] [PULL 10/15] raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT Stefan Hajnoczi
` (6 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2015-06-24 15:28 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Peter Maydell, Dimitris Aragiorgis, Stefan Hajnoczi
From: Dimitris Aragiorgis <dimara@arrikto.com>
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 <dimara@arrikto.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1435056300-14924-3-git-send-email-dimara@arrikto.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
block/io.c | 3 ++-
block/iscsi.c | 4 ----
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/block/io.c b/block/io.c
index 43f85ab..e295992 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2265,7 +2265,8 @@ int coroutine_fn bdrv_co_flush(BlockDriverState *bs)
{
int ret;
- if (!bs || !bdrv_is_inserted(bs) || bdrv_is_read_only(bs)) {
+ if (!bs || !bdrv_is_inserted(bs) || bdrv_is_read_only(bs) ||
+ bdrv_is_sg(bs)) {
return 0;
}
diff --git a/block/iscsi.c b/block/iscsi.c
index aff8198..49cee4d 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -628,10 +628,6 @@ static int coroutine_fn iscsi_co_flush(BlockDriverState *bs)
IscsiLun *iscsilun = bs->opaque;
struct IscsiTask iTask;
- if (bdrv_is_sg(bs)) {
- return 0;
- }
-
if (!iscsilun->force_next_flush) {
return 0;
}
--
2.4.3
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 10/15] raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT
2015-06-24 15:27 [Qemu-devel] [PULL 00/15] Block patches Stefan Hajnoczi
` (8 preceding siblings ...)
2015-06-24 15:28 ` [Qemu-devel] [PULL 09/15] Fix migration in case of scsi-generic Stefan Hajnoczi
@ 2015-06-24 15:28 ` Stefan Hajnoczi
2015-06-24 15:28 ` [Qemu-devel] [PULL 11/15] raw-posix: Use DPRINTF for DEBUG_FLOPPY Stefan Hajnoczi
` (5 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2015-06-24 15:28 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Peter Maydell, Dimitris Aragiorgis, Stefan Hajnoczi
From: Dimitris Aragiorgis <dimara@arrikto.com>
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 <dimara@arrikto.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1435056300-14924-4-git-send-email-dimara@arrikto.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
block/raw-posix.c | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/block/raw-posix.c b/block/raw-posix.c
index b2097fc..23c4577 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -99,12 +99,18 @@
//#define DEBUG_FLOPPY
//#define DEBUG_BLOCK
-#if defined(DEBUG_BLOCK)
-#define DEBUG_BLOCK_PRINT(formatCstr, ...) do { if (qemu_log_enabled()) \
- { qemu_log(formatCstr, ## __VA_ARGS__); qemu_log_flush(); } } while (0)
+
+#ifdef DEBUG_BLOCK
+# define DEBUG_BLOCK_PRINT 1
#else
-#define DEBUG_BLOCK_PRINT(formatCstr, ...)
+# define DEBUG_BLOCK_PRINT 0
#endif
+#define DPRINTF(fmt, ...) \
+do { \
+ if (DEBUG_BLOCK_PRINT) { \
+ printf(fmt, ## __VA_ARGS__); \
+ } \
+} while (0)
/* OS X does not have O_DSYNC */
#ifndef O_DSYNC
@@ -1020,6 +1026,7 @@ static ssize_t handle_aiocb_rw(RawPosixAIOData *aiocb)
static int xfs_write_zeroes(BDRVRawState *s, int64_t offset, uint64_t bytes)
{
struct xfs_flock64 fl;
+ int err;
memset(&fl, 0, sizeof(fl));
fl.l_whence = SEEK_SET;
@@ -1027,8 +1034,9 @@ static int xfs_write_zeroes(BDRVRawState *s, int64_t offset, uint64_t bytes)
fl.l_len = bytes;
if (xfsctl(NULL, s->fd, XFS_IOC_ZERO_RANGE, &fl) < 0) {
- DEBUG_BLOCK_PRINT("cannot write zero range (%s)\n", strerror(errno));
- return -errno;
+ err = errno;
+ DPRINTF("cannot write zero range (%s)\n", strerror(errno));
+ return -err;
}
return 0;
@@ -1037,6 +1045,7 @@ static int xfs_write_zeroes(BDRVRawState *s, int64_t offset, uint64_t bytes)
static int xfs_discard(BDRVRawState *s, int64_t offset, uint64_t bytes)
{
struct xfs_flock64 fl;
+ int err;
memset(&fl, 0, sizeof(fl));
fl.l_whence = SEEK_SET;
@@ -1044,8 +1053,9 @@ static int xfs_discard(BDRVRawState *s, int64_t offset, uint64_t bytes)
fl.l_len = bytes;
if (xfsctl(NULL, s->fd, XFS_IOC_UNRESVSP64, &fl) < 0) {
- DEBUG_BLOCK_PRINT("cannot punch hole (%s)\n", strerror(errno));
- return -errno;
+ err = errno;
+ DPRINTF("cannot punch hole (%s)\n", strerror(errno));
+ return -err;
}
return 0;
--
2.4.3
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 11/15] raw-posix: Use DPRINTF for DEBUG_FLOPPY
2015-06-24 15:27 [Qemu-devel] [PULL 00/15] Block patches Stefan Hajnoczi
` (9 preceding siblings ...)
2015-06-24 15:28 ` [Qemu-devel] [PULL 10/15] raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT Stefan Hajnoczi
@ 2015-06-24 15:28 ` Stefan Hajnoczi
2015-06-24 15:28 ` [Qemu-devel] [PULL 12/15] raw-posix: Introduce hdev_is_sg() Stefan Hajnoczi
` (4 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2015-06-24 15:28 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Peter Maydell, Dimitris Aragiorgis, Stefan Hajnoczi
From: Dimitris Aragiorgis <dimara@arrikto.com>
Get rid of several #ifdef DEBUG_FLOPPY and substitute them with
DPRINTF.
Signed-off-by: Dimitris Aragiorgis <dimara@arrikto.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1435056300-14924-5-git-send-email-dimara@arrikto.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
block/raw-posix.c | 22 +++++-----------------
1 file changed, 5 insertions(+), 17 deletions(-)
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 23c4577..57a243f 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -96,8 +96,6 @@
#include <xfs/xfs.h>
#endif
-//#define DEBUG_FLOPPY
-
//#define DEBUG_BLOCK
#ifdef DEBUG_BLOCK
@@ -2172,16 +2170,12 @@ static int fd_open(BlockDriverState *bs)
(qemu_clock_get_ns(QEMU_CLOCK_REALTIME) - s->fd_open_time) >= FD_OPEN_TIMEOUT) {
qemu_close(s->fd);
s->fd = -1;
-#ifdef DEBUG_FLOPPY
- printf("Floppy closed\n");
-#endif
+ DPRINTF("Floppy closed\n");
}
if (s->fd < 0) {
if (s->fd_got_error &&
(qemu_clock_get_ns(QEMU_CLOCK_REALTIME) - s->fd_error_time) < FD_OPEN_TIMEOUT) {
-#ifdef DEBUG_FLOPPY
- printf("No floppy (open delayed)\n");
-#endif
+ DPRINTF("No floppy (open delayed)\n");
return -EIO;
}
s->fd = qemu_open(bs->filename, s->open_flags & ~O_NONBLOCK);
@@ -2190,14 +2184,10 @@ static int fd_open(BlockDriverState *bs)
s->fd_got_error = 1;
if (last_media_present)
s->fd_media_changed = 1;
-#ifdef DEBUG_FLOPPY
- printf("No floppy\n");
-#endif
+ DPRINTF("No floppy\n");
return -EIO;
}
-#ifdef DEBUG_FLOPPY
- printf("Floppy opened\n");
-#endif
+ DPRINTF("Floppy opened\n");
}
if (!last_media_present)
s->fd_media_changed = 1;
@@ -2465,9 +2455,7 @@ static int floppy_media_changed(BlockDriverState *bs)
fd_open(bs);
ret = s->fd_media_changed;
s->fd_media_changed = 0;
-#ifdef DEBUG_FLOPPY
- printf("Floppy changed=%d\n", ret);
-#endif
+ DPRINTF("Floppy changed=%d\n", ret);
return ret;
}
--
2.4.3
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 12/15] raw-posix: Introduce hdev_is_sg()
2015-06-24 15:27 [Qemu-devel] [PULL 00/15] Block patches Stefan Hajnoczi
` (10 preceding siblings ...)
2015-06-24 15:28 ` [Qemu-devel] [PULL 11/15] raw-posix: Use DPRINTF for DEBUG_FLOPPY Stefan Hajnoczi
@ 2015-06-24 15:28 ` Stefan Hajnoczi
2015-06-24 15:28 ` [Qemu-devel] [PULL 13/15] iov: don't touch iov in iov_send_recv() Stefan Hajnoczi
` (3 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2015-06-24 15:28 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Peter Maydell, Dimitris Aragiorgis, Stefan Hajnoczi
From: Dimitris Aragiorgis <dimara@arrikto.com>
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 <dimara@arrikto.com>
Message-id: 1435056300-14924-6-git-send-email-dimara@arrikto.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
block/raw-posix.c | 39 ++++++++++++++++++++++++++++-----------
1 file changed, 28 insertions(+), 11 deletions(-)
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 57a243f..cbe6574 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -59,6 +59,7 @@
#include <linux/fd.h>
#include <linux/fs.h>
#include <linux/hdreg.h>
+#include <scsi/sg.h>
#ifdef __s390__
#include <asm/dasd.h>
#endif
@@ -2086,15 +2087,38 @@ static void hdev_parse_filename(const char *filename, QDict *options,
qdict_put_obj(options, "filename", QOBJECT(qstring_from_str(filename)));
}
+static bool hdev_is_sg(BlockDriverState *bs)
+{
+
+#if defined(__linux__)
+
+ struct stat st;
+ struct sg_scsi_id scsiid;
+ int sg_version;
+
+ if (stat(bs->filename, &st) >= 0 && S_ISCHR(st.st_mode) &&
+ !bdrv_ioctl(bs, SG_GET_VERSION_NUM, &sg_version) &&
+ !bdrv_ioctl(bs, SG_GET_SCSI_ID, &scsiid)) {
+ DPRINTF("SG device found: type=%d, version=%d\n",
+ scsiid.scsi_type, sg_version);
+ return true;
+ }
+
+#endif
+
+ return false;
+}
+
static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
BDRVRawState *s = bs->opaque;
Error *local_err = NULL;
int ret;
+
+#if defined(__APPLE__) && defined(__MACH__)
const char *filename = qdict_get_str(options, "filename");
-#if defined(__APPLE__) && defined(__MACH__)
if (strstart(filename, "/dev/cdrom", NULL)) {
kern_return_t kernResult;
io_iterator_t mediaIterator;
@@ -2123,16 +2147,6 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
#endif
s->type = FTYPE_FILE;
-#if defined(__linux__)
- {
- char resolved_path[ MAXPATHLEN ], *temp;
-
- temp = realpath(filename, resolved_path);
- if (temp && strstart(temp, "/dev/sg", NULL)) {
- bs->sg = 1;
- }
- }
-#endif
ret = raw_open_common(bs, options, flags, 0, &local_err);
if (ret < 0) {
@@ -2142,6 +2156,9 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
return ret;
}
+ /* Since this does ioctl the device must be already opened */
+ bs->sg = hdev_is_sg(bs);
+
if (flags & BDRV_O_RDWR) {
ret = check_hdev_writable(s);
if (ret < 0) {
--
2.4.3
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 13/15] iov: don't touch iov in iov_send_recv()
2015-06-24 15:27 [Qemu-devel] [PULL 00/15] Block patches Stefan Hajnoczi
` (11 preceding siblings ...)
2015-06-24 15:28 ` [Qemu-devel] [PULL 12/15] raw-posix: Introduce hdev_is_sg() Stefan Hajnoczi
@ 2015-06-24 15:28 ` Stefan Hajnoczi
2015-06-24 15:28 ` [Qemu-devel] [PULL 14/15] qemu-iotests: fix 051.out after qdev error message change Stefan Hajnoczi
` (2 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2015-06-24 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Peter Maydell, Stefan Hajnoczi
From: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Message-id: 555D39D2.4000705@cn.fujitsu.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
include/qemu/iov.h | 2 +-
util/iov.c | 14 +++++++++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/include/qemu/iov.h b/include/qemu/iov.h
index 68d25f2..569b2c2 100644
--- a/include/qemu/iov.h
+++ b/include/qemu/iov.h
@@ -75,7 +75,7 @@ size_t iov_memset(const struct iovec *iov, const unsigned int iov_cnt,
* For iov_send_recv() _whole_ area being sent or received
* should be within the iovec, not only beginning of it.
*/
-ssize_t iov_send_recv(int sockfd, struct iovec *iov, unsigned iov_cnt,
+ssize_t iov_send_recv(int sockfd, const struct iovec *iov, unsigned iov_cnt,
size_t offset, size_t bytes, bool do_send);
#define iov_recv(sockfd, iov, iov_cnt, offset, bytes) \
iov_send_recv(sockfd, iov, iov_cnt, offset, bytes, false)
diff --git a/util/iov.c b/util/iov.c
index 2fb18e6..a0d5934 100644
--- a/util/iov.c
+++ b/util/iov.c
@@ -133,7 +133,7 @@ do_send_recv(int sockfd, struct iovec *iov, unsigned iov_cnt, bool do_send)
#endif
}
-ssize_t iov_send_recv(int sockfd, struct iovec *iov, unsigned iov_cnt,
+ssize_t iov_send_recv(int sockfd, const struct iovec *_iov, unsigned iov_cnt,
size_t offset, size_t bytes,
bool do_send)
{
@@ -141,6 +141,16 @@ ssize_t iov_send_recv(int sockfd, struct iovec *iov, unsigned iov_cnt,
ssize_t ret;
size_t orig_len, tail;
unsigned niov;
+ struct iovec *local_iov, *iov;
+
+ if (bytes <= 0) {
+ return 0;
+ }
+
+ local_iov = g_new0(struct iovec, iov_cnt);
+ iov_copy(local_iov, iov_cnt, _iov, iov_cnt, offset, bytes);
+ offset = 0;
+ iov = local_iov;
while (bytes > 0) {
/* Find the start position, skipping `offset' bytes:
@@ -187,6 +197,7 @@ ssize_t iov_send_recv(int sockfd, struct iovec *iov, unsigned iov_cnt,
if (ret < 0) {
assert(errno != EINTR);
+ g_free(local_iov);
if (errno == EAGAIN && total > 0) {
return total;
}
@@ -205,6 +216,7 @@ ssize_t iov_send_recv(int sockfd, struct iovec *iov, unsigned iov_cnt,
bytes -= ret;
}
+ g_free(local_iov);
return total;
}
--
2.4.3
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 14/15] qemu-iotests: fix 051.out after qdev error message change
2015-06-24 15:27 [Qemu-devel] [PULL 00/15] Block patches Stefan Hajnoczi
` (12 preceding siblings ...)
2015-06-24 15:28 ` [Qemu-devel] [PULL 13/15] iov: don't touch iov in iov_send_recv() Stefan Hajnoczi
@ 2015-06-24 15:28 ` Stefan Hajnoczi
2015-06-24 15:28 ` [Qemu-devel] [PULL 15/15] virito-blk: drop duplicate check Stefan Hajnoczi
2015-06-25 13:03 ` [Qemu-devel] [PULL 00/15] Block patches Peter Maydell
15 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2015-06-24 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Peter Maydell, Markus Armbruster, Stefan Hajnoczi
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 <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 1435071369-30936-1-git-send-email-stefanha@redhat.com
---
tests/qemu-iotests/051.out | 8 --------
1 file changed, 8 deletions(-)
diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out
index 652dd63..23c2823 100644
--- a/tests/qemu-iotests/051.out
+++ b/tests/qemu-iotests/051.out
@@ -52,7 +52,6 @@ QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2: Cannot specif
Testing: -device virtio-scsi-pci -device scsi-hd
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device scsi-hd: drive property not set
-QEMU_PROG: -device scsi-hd: Device 'scsi-hd' could not be initialized
=== Overriding backing file ===
@@ -128,7 +127,6 @@ QEMU_PROG: Initialization of device ide-hd failed: Device initialization failed.
Testing: -drive if=virtio
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -drive if=virtio: Device needs media, but drive is empty
-QEMU_PROG: -drive if=virtio: Device 'virtio-blk-pci' could not be initialized
Testing: -drive if=scsi
QEMU X.Y.Z monitor - type 'help' for more information
@@ -146,23 +144,19 @@ Testing: -drive if=none,id=disk -device ide-drive,drive=disk
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device ide-drive,drive=disk: Device needs media, but drive is empty
QEMU_PROG: -device ide-drive,drive=disk: Device initialization failed.
-QEMU_PROG: -device ide-drive,drive=disk: Device 'ide-drive' could not be initialized
Testing: -drive if=none,id=disk -device ide-hd,drive=disk
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device ide-hd,drive=disk: Device needs media, but drive is empty
QEMU_PROG: -device ide-hd,drive=disk: Device initialization failed.
-QEMU_PROG: -device ide-hd,drive=disk: Device 'ide-hd' could not be initialized
Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device scsi-disk,drive=disk: Device needs media, but drive is empty
-QEMU_PROG: -device scsi-disk,drive=disk: Device 'scsi-disk' could not be initialized
Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device scsi-hd,drive=disk: Device needs media, but drive is empty
-QEMU_PROG: -device scsi-hd,drive=disk: Device 'scsi-hd' could not be initialized
=== Read-only ===
@@ -204,13 +198,11 @@ Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-dr
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device ide-drive,drive=disk: Can't use a read-only drive
QEMU_PROG: -device ide-drive,drive=disk: Device initialization failed.
-QEMU_PROG: -device ide-drive,drive=disk: Device 'ide-drive' could not be initialized
Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-hd,drive=disk
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device ide-hd,drive=disk: Can't use a read-only drive
QEMU_PROG: -device ide-hd,drive=disk: Device initialization failed.
-QEMU_PROG: -device ide-hd,drive=disk: Device 'ide-hd' could not be initialized
Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk
QEMU X.Y.Z monitor - type 'help' for more information
--
2.4.3
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 15/15] virito-blk: drop duplicate check
2015-06-24 15:27 [Qemu-devel] [PULL 00/15] Block patches Stefan Hajnoczi
` (13 preceding siblings ...)
2015-06-24 15:28 ` [Qemu-devel] [PULL 14/15] qemu-iotests: fix 051.out after qdev error message change Stefan Hajnoczi
@ 2015-06-24 15:28 ` Stefan Hajnoczi
2015-06-25 13:03 ` [Qemu-devel] [PULL 00/15] Block patches Peter Maydell
15 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2015-06-24 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Peter Maydell, Gonglei, Stefan Hajnoczi
From: Gonglei <arei.gonglei@huawei.com>
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 <arei.gonglei@huawei.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 1435138164-11728-1-git-send-email-arei.gonglei@huawei.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
hw/block/virtio-blk.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index bbb1fc1..6aefda4 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -499,8 +499,7 @@ void virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
iov_discard_front(&iov, &out_num, sizeof(req->out));
- if (in_num < 1 ||
- in_iov[in_num - 1].iov_len < sizeof(struct virtio_blk_inhdr)) {
+ if (in_iov[in_num - 1].iov_len < sizeof(struct virtio_blk_inhdr)) {
error_report("virtio-blk request inhdr too short");
exit(1);
}
--
2.4.3
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PULL 00/15] Block patches
2015-06-24 15:27 [Qemu-devel] [PULL 00/15] Block patches Stefan Hajnoczi
` (14 preceding siblings ...)
2015-06-24 15:28 ` [Qemu-devel] [PULL 15/15] virito-blk: drop duplicate check Stefan Hajnoczi
@ 2015-06-25 13:03 ` Peter Maydell
15 siblings, 0 replies; 26+ messages in thread
From: Peter Maydell @ 2015-06-25 13:03 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Kevin Wolf, QEMU Developers
On 24 June 2015 at 16:27, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit a3206972a9eab65ec8e8f9ae320ad628ba4b58f1:
>
> Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2015-06-22' into staging (2015-06-23 10:38:00 +0100)
>
> are available in the git repository at:
>
> git://github.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to 12048545019cd1d64c8147ea9277648e685fa489:
>
> virito-blk: drop duplicate check (2015-06-24 16:16:04 +0100)
>
> ----------------------------------------------------------------
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Qemu-devel] [PULL 00/15] Block patches
@ 2019-08-27 18:22 Max Reitz
2019-09-03 8:39 ` Peter Maydell
0 siblings, 1 reply; 26+ messages in thread
From: Max Reitz @ 2019-08-27 18:22 UTC (permalink / raw)
To: qemu-block; +Cc: Peter Maydell, qemu-devel, Max Reitz
The following changes since commit 23919ddfd56135cad3cb468a8f54d5a595f024f4:
Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20190827' into staging (2019-08-27 15:52:36 +0100)
are available in the Git repository at:
https://github.com/XanClic/qemu.git tags/pull-block-2019-08-27
for you to fetch changes up to bb043c056cffcc2f3ce88bfdaf2e76e455c09e2c:
iotests: Unify cache mode quoting (2019-08-27 19:48:44 +0200)
----------------------------------------------------------------
Block patches:
- qemu-io now accepts a file to read a write pattern from
- Ensure that raw files have their first block allocated so we can probe
the O_DIRECT alignment if necessary
- Various fixes
----------------------------------------------------------------
Denis Plotnikov (1):
qemu-io: add pattern file for write command
Max Reitz (7):
iotests: Fix _filter_img_create()
vmdk: Use bdrv_dirname() for relative extent paths
iotests: Keep testing broken relative extent paths
vmdk: Reject invalid compressed writes
iotests: Disable broken streamOptimized tests
iotests: Disable 110 for vmdk.twoGbMaxExtentSparse
iotests: Disable 126 for flat vmdk subformats
Nir Soffer (3):
block: posix: Always allocate the first block
iotests: Test allocate_first_block() with O_DIRECT
iotests: Unify cache mode quoting
Stefan Hajnoczi (1):
file-posix: fix request_alignment typo
Thomas Huth (2):
iotests: Check for enabled drivers before testing them
tests/check-block: Skip iotests when sanitizers are enabled
Vladimir Sementsov-Ogievskiy (1):
block: fix permission update in bdrv_replace_node
block.c | 5 +-
block/file-posix.c | 53 +++++++++-
block/vmdk.c | 64 ++++++++----
qemu-io-cmds.c | 99 +++++++++++++++++--
tests/check-block.sh | 5 +
tests/qemu-iotests/002 | 1 +
tests/qemu-iotests/003 | 1 +
tests/qemu-iotests/005 | 3 +-
tests/qemu-iotests/009 | 1 +
tests/qemu-iotests/010 | 1 +
tests/qemu-iotests/011 | 1 +
tests/qemu-iotests/017 | 3 +-
tests/qemu-iotests/018 | 3 +-
tests/qemu-iotests/019 | 3 +-
tests/qemu-iotests/020 | 3 +-
tests/qemu-iotests/026 | 4 +-
tests/qemu-iotests/027 | 1 +
tests/qemu-iotests/032 | 1 +
tests/qemu-iotests/033 | 1 +
tests/qemu-iotests/034 | 3 +-
tests/qemu-iotests/037 | 3 +-
tests/qemu-iotests/039 | 4 +-
tests/qemu-iotests/052 | 2 +-
tests/qemu-iotests/059 | 34 ++++++-
tests/qemu-iotests/059.out | 26 +++--
tests/qemu-iotests/063 | 3 +-
tests/qemu-iotests/071 | 1 +
tests/qemu-iotests/072 | 1 +
tests/qemu-iotests/081 | 4 +-
tests/qemu-iotests/091 | 4 +-
tests/qemu-iotests/099 | 1 +
tests/qemu-iotests/105 | 3 +-
tests/qemu-iotests/110 | 3 +-
tests/qemu-iotests/120 | 1 +
tests/qemu-iotests/126 | 2 +
tests/qemu-iotests/{150.out => 150.out.qcow2} | 0
tests/qemu-iotests/150.out.raw | 12 +++
tests/qemu-iotests/162 | 4 +-
tests/qemu-iotests/175 | 47 +++++++--
tests/qemu-iotests/175.out | 16 ++-
tests/qemu-iotests/178.out.qcow2 | 4 +-
tests/qemu-iotests/184 | 1 +
tests/qemu-iotests/186 | 1 +
tests/qemu-iotests/197 | 1 +
tests/qemu-iotests/215 | 1 +
tests/qemu-iotests/221.out | 12 ++-
tests/qemu-iotests/251 | 1 +
tests/qemu-iotests/253.out | 12 ++-
tests/qemu-iotests/common.filter | 4 +-
tests/qemu-iotests/common.rc | 14 +++
50 files changed, 391 insertions(+), 87 deletions(-)
rename tests/qemu-iotests/{150.out => 150.out.qcow2} (100%)
create mode 100644 tests/qemu-iotests/150.out.raw
--
2.21.0
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PULL 00/15] Block patches
2019-08-27 18:22 Max Reitz
@ 2019-09-03 8:39 ` Peter Maydell
2019-09-03 12:50 ` Max Reitz
0 siblings, 1 reply; 26+ messages in thread
From: Peter Maydell @ 2019-09-03 8:39 UTC (permalink / raw)
To: Max Reitz; +Cc: QEMU Developers, Qemu-block
On Tue, 27 Aug 2019 at 19:23, Max Reitz <mreitz@redhat.com> wrote:
>
> The following changes since commit 23919ddfd56135cad3cb468a8f54d5a595f024f4:
>
> Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20190827' into staging (2019-08-27 15:52:36 +0100)
>
> are available in the Git repository at:
>
> https://github.com/XanClic/qemu.git tags/pull-block-2019-08-27
>
> for you to fetch changes up to bb043c056cffcc2f3ce88bfdaf2e76e455c09e2c:
>
> iotests: Unify cache mode quoting (2019-08-27 19:48:44 +0200)
>
> ----------------------------------------------------------------
> Block patches:
> - qemu-io now accepts a file to read a write pattern from
> - Ensure that raw files have their first block allocated so we can probe
> the O_DIRECT alignment if necessary
> - Various fixes
Fails make check running the iotests (on some platforms,
including x86-64 Linux):
Not run: 220
Failures: 071 099 120 184 186
Failed 5 of 105 tests
/home/petmay01/linaro/qemu-for-merges/tests/Makefile.include:1100:
recipe for target 'check-tests/check-block.sh' failed
The printed diff output for the failures generally looks like:
--- /home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/071.out
2018-12-19 15:31:00.523062228 +0000
+++ /home/petmay01/linaro/qemu-for-merges/build/all/tests/qemu-iotests/071.out.bad
2019-09-03 09:01:43.665180692 +0100
@@ -1,4 +1,5 @@
QA output created by 071
+Unable to init server: Could not connect: Connection refused
thanks
-- PMM
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PULL 00/15] Block patches
2019-09-03 8:39 ` Peter Maydell
@ 2019-09-03 12:50 ` Max Reitz
0 siblings, 0 replies; 26+ messages in thread
From: Max Reitz @ 2019-09-03 12:50 UTC (permalink / raw)
To: Peter Maydell; +Cc: QEMU Developers, Qemu-block
[-- Attachment #1.1: Type: text/plain, Size: 1867 bytes --]
On 03.09.19 10:39, Peter Maydell wrote:
> On Tue, 27 Aug 2019 at 19:23, Max Reitz <mreitz@redhat.com> wrote:
>>
>> The following changes since commit 23919ddfd56135cad3cb468a8f54d5a595f024f4:
>>
>> Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20190827' into staging (2019-08-27 15:52:36 +0100)
>>
>> are available in the Git repository at:
>>
>> https://github.com/XanClic/qemu.git tags/pull-block-2019-08-27
>>
>> for you to fetch changes up to bb043c056cffcc2f3ce88bfdaf2e76e455c09e2c:
>>
>> iotests: Unify cache mode quoting (2019-08-27 19:48:44 +0200)
>>
>> ----------------------------------------------------------------
>> Block patches:
>> - qemu-io now accepts a file to read a write pattern from
>> - Ensure that raw files have their first block allocated so we can probe
>> the O_DIRECT alignment if necessary
>> - Various fixes
>
> Fails make check running the iotests (on some platforms,
> including x86-64 Linux):
>
> Not run: 220
> Failures: 071 099 120 184 186
> Failed 5 of 105 tests
> /home/petmay01/linaro/qemu-for-merges/tests/Makefile.include:1100:
> recipe for target 'check-tests/check-block.sh' failed
>
> The printed diff output for the failures generally looks like:
> --- /home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/071.out
> 2018-12-19 15:31:00.523062228 +0000
> +++ /home/petmay01/linaro/qemu-for-merges/build/all/tests/qemu-iotests/071.out.bad
> 2019-09-03 09:01:43.665180692 +0100
> @@ -1,4 +1,5 @@
> QA output created by 071
> +Unable to init server: Could not connect: Connection refused
OK, I think I know which patch is to blame. (The problem is probably
that you don’t have a $DISPLAY on your test machine. Neither had I
until a couple of weeks ago.,,)
(Well, I personally blame adding the iotests to make check, but, well.)
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2019-09-03 12:51 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-24 15:27 [Qemu-devel] [PULL 00/15] Block patches Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 01/15] block: Let bdrv_drain_all() to call aio_poll() for each AioContext Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 02/15] throttle: Check current timers before updating any_timer_armed[] Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 03/15] block-backend: Introduce blk_drain() Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 04/15] virtio-blk: Use blk_drain() to drain IO requests Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 05/15] util/hbitmap: Add an API to reset all set bits in hbitmap Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 06/15] vvfat: add a label option Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 07/15] nvme: Fix memleak in nvme_dma_read_prp Stefan Hajnoczi
2015-06-24 15:27 ` [Qemu-devel] [PULL 08/15] block: Use bdrv_is_sg() everywhere Stefan Hajnoczi
2015-06-24 15:28 ` [Qemu-devel] [PULL 09/15] Fix migration in case of scsi-generic Stefan Hajnoczi
2015-06-24 15:28 ` [Qemu-devel] [PULL 10/15] raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT Stefan Hajnoczi
2015-06-24 15:28 ` [Qemu-devel] [PULL 11/15] raw-posix: Use DPRINTF for DEBUG_FLOPPY Stefan Hajnoczi
2015-06-24 15:28 ` [Qemu-devel] [PULL 12/15] raw-posix: Introduce hdev_is_sg() Stefan Hajnoczi
2015-06-24 15:28 ` [Qemu-devel] [PULL 13/15] iov: don't touch iov in iov_send_recv() Stefan Hajnoczi
2015-06-24 15:28 ` [Qemu-devel] [PULL 14/15] qemu-iotests: fix 051.out after qdev error message change Stefan Hajnoczi
2015-06-24 15:28 ` [Qemu-devel] [PULL 15/15] virito-blk: drop duplicate check Stefan Hajnoczi
2015-06-25 13:03 ` [Qemu-devel] [PULL 00/15] Block patches Peter Maydell
-- strict thread matches above, loose matches on Subject: below --
2019-08-27 18:22 Max Reitz
2019-09-03 8:39 ` Peter Maydell
2019-09-03 12:50 ` Max Reitz
2013-05-03 11:52 Stefan Hajnoczi
2012-02-10 12:47 Kevin Wolf
2012-02-15 10:14 ` Kevin Wolf
2012-02-16 0:31 ` Anthony Liguori
2011-04-07 14:49 Kevin Wolf
2011-04-07 15:44 ` Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).