More block layer patches for 2.7.0-rc2
[Qemu-devel] [PULL 1/4] block/qdev: Let 'drive' property fall back to node name
In reply to Kevin WolfIf a qdev block device is created with an anonymous BlockBackend (i.e. a node name rather than a BB name was given for the drive property), qdev used to return an empty string when the property was read. This patch fixes it to return the node name instead.
--- hw/core/qdev-properties-system.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
hw/core/qdev-properties-system.c +10 -1
@@ -126,7 +126,16 @@ static void release_drive(Object *obj, const char *name, void *opaque)static char *print_drive (void *ptr) { -return g_strdup (blk_name (ptr)); +const char *name; + + name =blk_name (ptr); +if (!*name) { +BlockDriverState *bs =blk_bs (ptr); +if (bs) { + name =bdrv_get_node_name (bs); + } + } +return g_strdup (name); } static void get_drive(Object *obj, Visitor *v, const char *name, void *opaque,
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 3/4] mirror: finish earlier on error
In reply to Kevin WolfFrom: Vladimir Sementsov-Ogievskiy <[email protected]>
Stop to produce new async copy requests from mirror_iteration if critical error (error action = BLOCK_ERROR_ACTION_REPORT) detected.
--- block/mirror.c | 4 ++++ 1 file changed, 4 insertions(+)
block/mirror.c +4 -0
@@ -419,6 +419,10 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s)mirror_wait_for_io (s); } +if (s->ret <0 ) { +return 0 ; + } +mirror_clip_sectors (s, sector_num, &io_sectors);switch (mirror_method) {case MIRROR_METHOD_COPY :
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 2/4] tests: Test blockjob IDs
In reply to Kevin WolfFrom: Alberto Garcia <[email protected]>
Since 7f0317cfc8da6 we have API to specify the ID of block jobs and we also guarantee that they are well-formed and unique.
This patch adds tests to check some common scenarios.
--- tests/Makefile.include | 2 + tests/test-blockjob.c | 147 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 149 insertions(+) create mode 100644 tests/test-blockjob.c
tests/Makefile.include +2 -0
@@ -52,6 +52,7 @@ gcov-files-test-thread-pool-y = thread-pool.c gcov-files-test-hbitmap-y = util/hbitmap.c check-unit-y += tests/test-hbitmap$(EXESUF) gcov-files-test-hbitmap-y = blockjob.c +check-unit-y += tests/test-blockjob$(EXESUF) check-unit-y += tests/test-blockjob-txn$(EXESUF) check-unit-y += tests/test-x86-cpuid$(EXESUF) # all code tested by test-x86-cpuid is inside topology.h
@@ -449,6 +450,7 @@ tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(test-block-obj-y) tests/test-aio$(EXESUF): tests/test-aio.o $(test-block-obj-y) tests/test-rfifolock$(EXESUF): tests/test-rfifolock.o $(test-util-obj-y) tests/test-throttle$(EXESUF): tests/test-throttle.o $(test-block-obj-y) +tests/test-blockjob$(EXESUF): tests/test-blockjob.o $(test-block-obj-y) $(test-util-obj-y) tests/test-blockjob-txn$(EXESUF): tests/test-blockjob-txn.o $(test-block-obj-y) $(test-util-obj-y) tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(test-block-obj-y) tests/test-iov$(EXESUF): tests/test-iov.o $(test-util-obj-y)
tests/test-blockjob.c new file +147 -0
147 lines not on this page · raw message
Signature · 1 line
1.8.3.1
The following changes since commit cf5198d58088e3b416fe517b3946e5120b342761:
Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20160805' into staging (2016-08-08 10:39:18 +0100)
are available in the git repository at:
git://repo.or.cz/qemu/kevin.git tags/for-upstream
for you to fetch changes up to a752e4786c19b0b368f4521a5dcbcce14882c3b1:
iotests: fix 109 (2016-08-08 13:05:43 +0200)
----------------------------------------------------------------
More block layer patches for 2.7.0-rc2
----------------------------------------------------------------
Alberto Garcia (1):
tests: Test blockjob IDs
Kevin Wolf (1):
block/qdev: Let 'drive' property fall back to node name
Vladimir Sementsov-Ogievskiy (2):
mirror: finish earlier on error
iotests: fix 109
block/mirror.c | 4 ++ hw/core/qdev-properties-system.c | 11 ++- tests/Makefile.include | 2 + tests/qemu-iotests/109 | 2 +- tests/qemu-iotests/109.out | 8 +-- tests/qemu-iotests/common.filter | 6 ++ tests/test-blockjob.c | 147 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 174 insertions(+), 6 deletions(-) create mode 100644 tests/test-blockjob.c
[Qemu-devel] [PULL 4/4] iotests: fix 109
From: Vladimir Sementsov-Ogievskiy <[email protected]>
109 iotest is broken for raw after 0965a41e998ab820b5 [mirror: double performance of the bulk stage if the disc is full]
The problem is with finishing block-job with error: before specified patch mirror was not very async and it created one big request at disk start, this request finished with error and qemu produced BLOCK_JOB_COMPLETED with zero progress.
After 0965a41, mirror starts several smaller requests in parallel, when BLOCK_JOB_COMPLETED emited we have some successful non-zero progress.
This patch solves the issue by filtering out progress from 109 test output.
--- tests/qemu-iotests/109 | 2 +- tests/qemu-iotests/109.out | 8 ++++---- tests/qemu-iotests/common.filter | 6 ++++++ 3 files changed, 11 insertions(+), 5 deletions(-)
tests/qemu-iotests/109 +1 -1
@@ -100,7 +100,7 @@ for sample_img in empty.bochs iotest-dirtylog-10G-4M.vhdx parallels-v1 \ _make_test_img 64M bzcat "$SAMPLE_IMG_DIR/$sample_img.bz2" > "$TEST_IMG.src" - run_qemu "$TEST_IMG" "$TEST_IMG.src" "" "BLOCK_JOB_ERROR" + run_qemu "$TEST_IMG" "$TEST_IMG.src" "" "BLOCK_JOB_ERROR" | _filter_block_job_offset $QEMU_IO -c 'read -P 0 0 64k' "$TEST_IMG" | _filter_qemu_io run_qemu "$TEST_IMG" "$TEST_IMG.src" "'format': 'raw'," "BLOCK_JOB_READY"
tests/qemu-iotests/109.out +4 -4
@@ -135,7 +135,7 @@ Automatically detecting the format is dangerous for raw images, write operations Specify the 'raw' format explicitly to remove the restrictions. {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_ERROR", "data": {"device": "src", "operation": "write", "action": "report"}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 2560, "offset": 0, "speed": 0, "type": "mirror", "error": "Operation not permitted"}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 2560, "offset": OFFSET, "speed": 0, "type": "mirror", "error": "Operation not permitted"}} {"return": []} read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -155,7 +155,7 @@ Automatically detecting the format is dangerous for raw images, write operations Specify the 'raw' format explicitly to remove the restrictions. {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_ERROR", "data": {"device": "src", "operation": "write", "action": "report"}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 31457280, "offset": 0, "speed": 0, "type": "mirror", "error": "Operation not permitted"}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 31457280, "offset": OFFSET, "speed": 0, "type": "mirror", "error": "Operation not permitted"}} {"return": []} read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -175,7 +175,7 @@ Automatically detecting the format is dangerous for raw images, write operations Specify the 'raw' format explicitly to remove the restrictions. {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_ERROR", "data": {"device": "src", "operation": "write", "action": "report"}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 327680, "offset": 0, "speed": 0, "type": "mirror", "error": "Operation not permitted"}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 327680, "offset": OFFSET, "speed": 0, "type": "mirror", "error": "Operation not permitted"}} {"return": []} read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -195,7 +195,7 @@ Automatically detecting the format is dangerous for raw images, write operations Specify the 'raw' format explicitly to remove the restrictions. {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_ERROR", "data": {"device": "src", "operation": "write", "action": "report"}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 2048, "offset": 0, "speed": 0, "type": "mirror", "error": "Operation not permitted"}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 2048, "offset": OFFSET, "speed": 0, "type": "mirror", "error": "Operation not permitted"}} {"return": []} read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
tests/qemu-iotests/common.filter +6 -0
@@ -77,6 +77,12 @@ _filter_qmp() -e ' QMP_VERSION' } +# replace block job offset +_filter_block_job_offset() +{ + sed -e 's/, "offset": [0-9]\+,/, "offset": OFFSET,/' +} + # replace driver-specific options in the "Formatting..." line _filter_img_create() {
Signature · 1 line
1.8.3.1
Peter Maydell
AppliedQuoted 7 lines · Kevin Wolf
The following changes since commit
cf5198d58088e3b416fe517b3946e5120b342761:Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20160805' into staging (2016-08-08 10:39:18 +0100)
are available in the git repository at:
Quoted 8 lines
git://repo.or.cz/qemu/kevin.gittags/for-upstreamfor you to fetch changes up to
a752e4786c19b0b368f4521a5dcbcce14882c3b1:iotests: fix 109 (2016-08-08 13:05:43 +0200)
----------------------------------------------------------------
More block layer patches for 2.7.0-rc2
Applied, thanks.
-- PMM