NBD patches for 2019-05-07
The following changes since commit 19eb2d4e736dc895f31fbd6b520e514f10cc08e0:
Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging (2019-05-07 10:43:32 +0100)
are available in the Git repository at:
https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2019-05-07
for you to fetch changes up to 8fabb8be37775ebb32b0d78bc7be815a29b8a107:
iotests: Make 182 do without device_add (2019-05-07 09:43:42 -0500)
----------------------------------------------------------------
nbd patches for 2019-05-07
- iotest improvements
----------------------------------------------------------------
Eric Blake (1):
iotests: Tweak 221 sizing for different hole granularities
Max Reitz (3):
qemu-nbd: Look up flag names in array
iotests: Fix 233 for ports other than 10809
iotests: Make 182 do without device_add
Thomas Huth (1):
tests/qemu-iotests: Fix more reference output files due to recent qemu-io change
include/block/nbd.h | 38 ++++++++++++++++++-------- qemu-nbd.c | 46 ++++++++++++------------------- tests/qemu-iotests/059.out | 8 +++--- tests/qemu-iotests/083.out | 68 +++++++++++++++++++++++----------------------- tests/qemu-iotests/092.out | 24 ++++++++-------- tests/qemu-iotests/182 | 22 +++++++++++---- tests/qemu-iotests/182.out | 1 + tests/qemu-iotests/221 | 10 +++---- tests/qemu-iotests/221.out | 20 +++++++------- tests/qemu-iotests/233 | 6 ++-- tests/qemu-iotests/233.out | 4 +-- 11 files changed, 132 insertions(+), 115 deletions(-)
Signature · 1 line
2.20.1
[Qemu-devel] [PULL 2/5] iotests: Fix 233 for ports other than 10809
From: Max Reitz <[email protected]>
233 generally filters the port, but in two cases does not. If some other concurrently running application has already taken port 10809, this will result in an output mismatch. Fix this by applying the filter in these two cases, too.
Message-Id: <[email protected]>
--- tests/qemu-iotests/233 | 6 ++++-- tests/qemu-iotests/233.out | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
tests/qemu-iotests/233 +4 -2
@@ -139,11 +139,13 @@ nbd_server_start_tcp_socket \ $QEMU_IMG info --image-opts \ --object tls-creds-x509,dir=${tls_dir}/client1,endpoint=client,id=tls0 \ - driver=nbd,host=$nbd_tcp_addr,port=$nbd_tcp_port,tls-creds=tls0 + driver=nbd,host=$nbd_tcp_addr,port=$nbd_tcp_port,tls-creds=tls0 \ + 2>&1 | sed "s/$nbd_tcp_port/PORT/g" $QEMU_IMG info --image-opts \ --object tls-creds-x509,dir=${tls_dir}/client3,endpoint=client,id=tls0 \ - driver=nbd,host=$nbd_tcp_addr,port=$nbd_tcp_port,tls-creds=tls0 + driver=nbd,host=$nbd_tcp_addr,port=$nbd_tcp_port,tls-creds=tls0 \ + 2>&1 | sed "s/$nbd_tcp_port/PORT/g" echo echo "== final server log =="
tests/qemu-iotests/233.out +2 -2
@@ -57,8 +57,8 @@ read 1048576/1048576 bytes at offset 1048576 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) == check TLS with authorization == -qemu-img: Could not open 'driver=nbd,host=127.0.0.1,port=10809,tls-creds=tls0': Failed to read option reply: Cannot read from TLS channel: Software caused connection abort -qemu-img: Could not open 'driver=nbd,host=127.0.0.1,port=10809,tls-creds=tls0': Failed to read option reply: Cannot read from TLS channel: Software caused connection abort +qemu-img: Could not open 'driver=nbd,host=127.0.0.1,port=PORT,tls-creds=tls0': Failed to read option reply: Cannot read from TLS channel: Software caused connection abort +qemu-img: Could not open 'driver=nbd,host=127.0.0.1,port=PORT,tls-creds=tls0': Failed to read option reply: Cannot read from TLS channel: Software caused connection abort == final server log == qemu-nbd: option negotiation failed: Verify failed: No certificate was found.
Signature · 1 line
2.20.1
[Qemu-devel] [PULL 1/5] qemu-nbd: Look up flag names in array
In reply to Eric BlakeFrom: Max Reitz <[email protected]>
The existing code to convert flag bits into strings looks a bit strange now, and if we ever add more flags, it will look even stranger. Prevent that from happening by making it look up the flag names in an array.
Message-Id: <[email protected]>
--- include/block/nbd.h | 38 +++++++++++++++++++++++++------------ qemu-nbd.c | 46 +++++++++++++++++---------------------------- 2 files changed, 43 insertions(+), 41 deletions(-)
include/block/nbd.h +26 -12
@@ -127,18 +127,32 @@ typedef struct NBDExtent {/* Transmission (export) flags: sent from server to client during handshake, but describe what will happen during transmission */ -#define NBD_FLAG_HAS_FLAGS (1 << 0)/* Flags are there */ -#define NBD_FLAG_READ_ONLY (1 << 1)/* Device is read-only */ -#define NBD_FLAG_SEND_FLUSH (1 << 2)/* Send FLUSH */ -#define NBD_FLAG_SEND_FUA (1 << 3)/* Send FUA (Force Unit Access) */ -#define NBD_FLAG_ROTATIONAL (1 << 4)/* Use elevator algorithm - -rotational media */ -#define NBD_FLAG_SEND_TRIM (1 << 5)/* Send TRIM (discard) */ -#define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6)/* Send WRITE_ZEROES */ -#define NBD_FLAG_SEND_DF (1 << 7)/* Send DF (Do not Fragment) */ -#define NBD_FLAG_CAN_MULTI_CONN (1 << 8)/* Multi-client cache consistent */ -#define NBD_FLAG_SEND_RESIZE (1 << 9)/* Send resize */ -#define NBD_FLAG_SEND_CACHE (1 << 10)/* Send CACHE (prefetch) */ +enum { +NBD_FLAG_HAS_FLAGS_BIT =0 ,/* Flags are there */ +NBD_FLAG_READ_ONLY_BIT =1 ,/* Device is read-only */ +NBD_FLAG_SEND_FLUSH_BIT =2 ,/* Send FLUSH */ +NBD_FLAG_SEND_FUA_BIT =3 ,/* Send FUA (Force Unit Access) */ +NBD_FLAG_ROTATIONAL_BIT =4 ,/* Use elevator algorithm - +rotational media */ +NBD_FLAG_SEND_TRIM_BIT =5 ,/* Send TRIM (discard) */ +NBD_FLAG_SEND_WRITE_ZEROES_BIT =6 ,/* Send WRITE_ZEROES */ +NBD_FLAG_SEND_DF_BIT =7 ,/* Send DF (Do not Fragment) */ +NBD_FLAG_CAN_MULTI_CONN_BIT =8 ,/* Multi-client cache consistent */ +NBD_FLAG_SEND_RESIZE_BIT =9 ,/* Send resize */ +NBD_FLAG_SEND_CACHE_BIT =10 ,/* Send CACHE (prefetch) */ +}; + +#define NBD_FLAG_HAS_FLAGS (1 << NBD_FLAG_HAS_FLAGS_BIT) +#define NBD_FLAG_READ_ONLY (1 << NBD_FLAG_READ_ONLY_BIT) +#define NBD_FLAG_SEND_FLUSH (1 << NBD_FLAG_SEND_FLUSH_BIT) +#define NBD_FLAG_SEND_FUA (1 << NBD_FLAG_SEND_FUA_BIT) +#define NBD_FLAG_ROTATIONAL (1 << NBD_FLAG_ROTATIONAL_BIT) +#define NBD_FLAG_SEND_TRIM (1 << NBD_FLAG_SEND_TRIM_BIT) +#define NBD_FLAG_SEND_WRITE_ZEROES (1 << NBD_FLAG_SEND_WRITE_ZEROES_BIT) +#define NBD_FLAG_SEND_DF (1 << NBD_FLAG_SEND_DF_BIT) +#define NBD_FLAG_CAN_MULTI_CONN (1 << NBD_FLAG_CAN_MULTI_CONN_BIT) +#define NBD_FLAG_SEND_RESIZE (1 << NBD_FLAG_SEND_RESIZE_BIT) +#define NBD_FLAG_SEND_CACHE (1 << NBD_FLAG_SEND_CACHE_BIT)/* New-style handshake (global) flags, sent from server to client, and control what will happen during handshake phase. */
qemu-nbd.c +17 -29
54 lines not on this page · raw message
Signature · 1 line
2.20.1
[Qemu-devel] [PULL 5/5] iotests: Make 182 do without device_add
In reply to Eric BlakeFrom: Max Reitz <[email protected]>
182 fails if qemu has no support for hotplugging of a virtio-blk device. Using an NBD server instead works just as well for the test, even on qemus without hotplugging support.
Message-Id: <[email protected]>
--- tests/qemu-iotests/182 | 22 +++++++++++++++++----- tests/qemu-iotests/182.out | 1 + 2 files changed, 18 insertions(+), 5 deletions(-)
tests/qemu-iotests/182 +17 -5
@@ -31,6 +31,7 @@ _cleanup() { _cleanup_test_img rm -f "$TEST_IMG.overlay" + rm -f "$TEST_DIR/nbd.socket" } trap "_cleanup; exit \$status" 0 1 2 3 15
@@ -126,15 +127,26 @@ success_or_failure=y _send_qemu_cmd $QEMU_HANDLE \ 'return' \ 'error' -# Now we attach the image to a virtio-blk device. This device does -# require some permissions (at least WRITE and READ_CONSISTENT), so if +# Start an NBD server to which we can attach node1 +success_or_failure=y _send_qemu_cmd $QEMU_HANDLE \ + "{'execute': 'nbd-server-start', + 'arguments': { + 'addr': { + 'type': 'unix', + 'data': { + 'path': '$TEST_DIR/nbd.socket' + } } } }" \ + 'return' \ + 'error' + +# Now we attach the image to the NBD server. This server does require +# some permissions (at least WRITE and READ_CONSISTENT), so if # reopening node0 unshared any (which it should not have), this will # fail (but it should not). success_or_failure=y _send_qemu_cmd $QEMU_HANDLE \ - "{'execute': 'device_add', + "{'execute': 'nbd-server-add', 'arguments': { - 'driver': 'virtio-blk', - 'drive': 'node1' + 'device': 'node1' } }" \ 'return' \ 'error'
tests/qemu-iotests/182.out +1 -0
@@ -14,4 +14,5 @@ Formatting 'TEST_DIR/t.qcow2.overlay', fmt=qcow2 size=197120 backing_file=TEST_D {"return": {}} {"return": {}} {"return": {}} +{"return": {}} *** done
Signature · 1 line
2.20.1
[Qemu-devel] [PULL 4/5] iotests: Tweak 221 sizing for different hole granularities
In reply to Eric BlakeFor some particular configurations of ext4, sizing an image to 84 sectors + 1 byte causes test failures when the size of the hole is rounded to a 4k alignment. Let's instead size things to 128 sectors + 1 byte, as the 64k boundary is more likely to work with various hole granularities.
Message-Id: <[email protected]>
--- tests/qemu-iotests/221 | 10 +++++----- tests/qemu-iotests/221.out | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-)
tests/qemu-iotests/221 +5 -5
@@ -2,7 +2,7 @@ # # Test qemu-img vs. unaligned images # -# Copyright (C) 2018 Red Hat, Inc. +# Copyright (C) 2018-2019 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by
@@ -41,16 +41,16 @@ echo echo "=== Check mapping of unaligned raw image ===" echo -_make_test_img 43009 # qemu-img create rounds size up +_make_test_img 65537 # qemu-img create rounds size up $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map -truncate --size=43009 "$TEST_IMG" # so we resize it and check again +truncate --size=65537 "$TEST_IMG" # so we resize it and check again $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map -$QEMU_IO -c 'w 43008 1' "$TEST_IMG" | _filter_qemu_io # writing also rounds up +$QEMU_IO -c 'w 65536 1' "$TEST_IMG" | _filter_qemu_io # writing also rounds up $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map -truncate --size=43009 "$TEST_IMG" # so we resize it and check again +truncate --size=65537 "$TEST_IMG" # so we resize it and check again $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map # success, all done
tests/qemu-iotests/221.out +10 -10
@@ -2,15 +2,15 @@ QA output created by 221 === Check mapping of unaligned raw image === -Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=43009 -[{ "start": 0, "length": 43520, "depth": 0, "zero": true, "data": false, "offset": OFFSET}] -[{ "start": 0, "length": 43520, "depth": 0, "zero": true, "data": false, "offset": OFFSET}] -wrote 1/1 bytes at offset 43008 +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=65537 +[{ "start": 0, "length": 66048, "depth": 0, "zero": true, "data": false, "offset": OFFSET}] +[{ "start": 0, "length": 66048, "depth": 0, "zero": true, "data": false, "offset": OFFSET}] +wrote 1/1 bytes at offset 65536 1 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -[{ "start": 0, "length": 40960, "depth": 0, "zero": true, "data": false, "offset": OFFSET}, -{ "start": 40960, "length": 2049, "depth": 0, "zero": false, "data": true, "offset": OFFSET}, -{ "start": 43009, "length": 511, "depth": 0, "zero": true, "data": false, "offset": OFFSET}] -[{ "start": 0, "length": 40960, "depth": 0, "zero": true, "data": false, "offset": OFFSET}, -{ "start": 40960, "length": 2049, "depth": 0, "zero": false, "data": true, "offset": OFFSET}, -{ "start": 43009, "length": 511, "depth": 0, "zero": true, "data": false, "offset": OFFSET}] +[{ "start": 0, "length": 65536, "depth": 0, "zero": true, "data": false, "offset": OFFSET}, +{ "start": 65536, "length": 1, "depth": 0, "zero": false, "data": true, "offset": OFFSET}, +{ "start": 65537, "length": 511, "depth": 0, "zero": true, "data": false, "offset": OFFSET}] +[{ "start": 0, "length": 65536, "depth": 0, "zero": true, "data": false, "offset": OFFSET}, +{ "start": 65536, "length": 1, "depth": 0, "zero": false, "data": true, "offset": OFFSET}, +{ "start": 65537, "length": 511, "depth": 0, "zero": true, "data": false, "offset": OFFSET}] *** done
Signature · 1 line
2.20.1
[Qemu-devel] [PULL 3/5] tests/qemu-iotests: Fix more reference output files due to recent qemu-io change
In reply to Eric BlakeFrom: Thomas Huth <[email protected]>
The output of qemu-io changed recently - most tests have been fixed in commit 36b9986b08787019ef42 ("tests/qemu-iotests: Fix output of qemu-io related tests") already, but a qcow1, vmdk, and nbd test were still missing.
Message-Id: <[email protected]>
--- tests/qemu-iotests/059.out | 8 ++--- tests/qemu-iotests/083.out | 68 +++++++++++++++++++------------------- tests/qemu-iotests/092.out | 24 +++++++------- 3 files changed, 50 insertions(+), 50 deletions(-)
tests/qemu-iotests/059.out +4 -4
@@ -2,15 +2,15 @@ QA output created by 059 === Testing invalid granularity === Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 -can't open device TEST_DIR/t.vmdk: Invalid granularity, image may be corrupt +qemu-io: can't open device TEST_DIR/t.vmdk: Invalid granularity, image may be corrupt === Testing too big L2 table size === Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 -can't open device TEST_DIR/t.vmdk: L2 table size too big +qemu-io: can't open device TEST_DIR/t.vmdk: L2 table size too big === Testing too big L1 table size === Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 -can't open device TEST_DIR/t.vmdk: L1 size too big +qemu-io: can't open device TEST_DIR/t.vmdk: L1 size too big === Testing monolithicFlat creation and opening === Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2147483648 subformat=monolithicFlat
@@ -2050,7 +2050,7 @@ wrote 512/512 bytes at offset 10240 === Testing monolithicFlat with internally generated JSON file name === Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 subformat=monolithicFlat -can't open: Cannot use relative extent paths with VMDK descriptor file 'json:{"image": {"driver": "file", "filename": "TEST_DIR/t.IMGFMT"}, "driver": "blkdebug", "inject-error.0.event": "read_aio"}' +qemu-io: can't open: Cannot use relative extent paths with VMDK descriptor file 'json:{"image": {"driver": "file", "filename": "TEST_DIR/t.IMGFMT"}, "driver": "blkdebug", "inject-error.0.event": "read_aio"}' === Testing version 3 === image: TEST_DIR/iotest-version3.IMGFMT
tests/qemu-iotests/083.out +34 -34
188 lines not on this page · raw message
tests/qemu-iotests/092.out +12 -12
@@ -2,25 +2,25 @@ QA output created by 092 == Invalid cluster size == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 -can't open device TEST_DIR/t.qcow: Cluster size must be between 512 and 64k -can't open device TEST_DIR/t.qcow: Cluster size must be between 512 and 64k -can't open device TEST_DIR/t.qcow: Cluster size must be between 512 and 64k -can't open device TEST_DIR/t.qcow: Cluster size must be between 512 and 64k +qemu-io: can't open device TEST_DIR/t.qcow: Cluster size must be between 512 and 64k +qemu-io: can't open device TEST_DIR/t.qcow: Cluster size must be between 512 and 64k +qemu-io: can't open device TEST_DIR/t.qcow: Cluster size must be between 512 and 64k +qemu-io: can't open device TEST_DIR/t.qcow: Cluster size must be between 512 and 64k == Invalid L2 table size == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 -can't open device TEST_DIR/t.qcow: L2 table size must be between 512 and 64k -can't open device TEST_DIR/t.qcow: L2 table size must be between 512 and 64k -can't open device TEST_DIR/t.qcow: L2 table size must be between 512 and 64k -can't open device TEST_DIR/t.qcow: L2 table size must be between 512 and 64k +qemu-io: can't open device TEST_DIR/t.qcow: L2 table size must be between 512 and 64k +qemu-io: can't open device TEST_DIR/t.qcow: L2 table size must be between 512 and 64k +qemu-io: can't open device TEST_DIR/t.qcow: L2 table size must be between 512 and 64k +qemu-io: can't open device TEST_DIR/t.qcow: L2 table size must be between 512 and 64k == Invalid size == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 -can't open device TEST_DIR/t.qcow: Image too large -can't open device TEST_DIR/t.qcow: Image too large +qemu-io: can't open device TEST_DIR/t.qcow: Image too large +qemu-io: can't open device TEST_DIR/t.qcow: Image too large == Invalid backing file length == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 -can't open device TEST_DIR/t.qcow: Backing file name too long -can't open device TEST_DIR/t.qcow: Backing file name too long +qemu-io: can't open device TEST_DIR/t.qcow: Backing file name too long +qemu-io: can't open device TEST_DIR/t.qcow: Backing file name too long *** done
Signature · 1 line
2.20.1
Peter Maydell
AppliedQuoted 9 lines · Eric Blake
The following changes since commit
19eb2d4e736dc895f31fbd6b520e514f10cc08e0:Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging (2019-05-07 10:43:32 +0100)
are available in the Git repository at:
https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2019-05-07
Quoted 9 lines
for you to fetch changes up to
8fabb8be37775ebb32b0d78bc7be815a29b8a107:iotests: Make 182 do without
device_add(2019-05-07 09:43:42 -0500)----------------------------------------------------------------
nbd patches for 2019-05-07- iotest improvements
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/4.1
for any user-visible changes.
-- PMM