Block patches

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQEcBAABCAAGBQJXPdStAAoJEDuxQgLoOKyt9o4H/A+YhO5+VX5x9Y8B7rAFKa9b
 7jUiYsfuAx7tOIUSZ1lKdiF4wWS+O+cdHSoC0lj4c74tMV9n/Ydj8ypDMy3CElxf
 SJ8MdJOcA8/xHSxZWCxGBDASf0g8cW5ScKz8BnqToNJPnb4moQUU+G/Ocy1Jv14w
 jcY/9OQm1ClQ7RbxKwOTZDeQ/dpNB3zDZ0mo1ZdeGxLgSNdfeUf5ccx+CgvH51Oc
 vTQiqqEQJUxDUU2iRZNMYeZlPA24a1M0ToN3ofmxQlGeObth1H5urUJjJjLhOdSC
 lcIwGUcz1vdWqSGOxVyGZJ3YezlMdfrcxuXi8/Pdr2Oe/1xqPRI76vrr/7V8ckg=
 =KEfY
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'mreitz/tags/pull-block-for-kevin-2016-05-19' into queue-block

Block patches

# gpg: Signature made Thu May 19 16:58:53 2016 CEST using RSA key ID E838ACAD
# gpg: Good signature from "Max Reitz <mreitz@redhat.com>"

* mreitz/tags/pull-block-for-kevin-2016-05-19:
  qemu-iotests: Fix regression in 136 on aio_read invalid
  qemu-iotests: Simplify 109 with unaligned qemu-img compare
  qemu-io: Fix recent UI updates

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Kevin Wolf 2016-05-19 16:59:46 +02:00
commit 7753da2351
4 changed files with 22 additions and 22 deletions

View File

@ -1107,7 +1107,7 @@ static int writev_f(BlockBackend *blk, int argc, char **argv)
int pattern = 0xcd; int pattern = 0xcd;
QEMUIOVector qiov; QEMUIOVector qiov;
while ((c = getopt(argc, argv, "CqP:")) != -1) { while ((c = getopt(argc, argv, "CfqP:")) != -1) {
switch (c) { switch (c) {
case 'C': case 'C':
Cflag = true; Cflag = true;
@ -1274,6 +1274,7 @@ static void aio_read_help(void)
" used to ensure all outstanding aio requests have been completed.\n" " used to ensure all outstanding aio requests have been completed.\n"
" -C, -- report statistics in a machine parsable format\n" " -C, -- report statistics in a machine parsable format\n"
" -P, -- use a pattern to verify read data\n" " -P, -- use a pattern to verify read data\n"
" -i, -- treat request as invalid, for exercising stats\n"
" -v, -- dump buffer to standard output\n" " -v, -- dump buffer to standard output\n"
" -q, -- quiet mode, do not show I/O statistics\n" " -q, -- quiet mode, do not show I/O statistics\n"
"\n"); "\n");
@ -1286,7 +1287,7 @@ static const cmdinfo_t aio_read_cmd = {
.cfunc = aio_read_f, .cfunc = aio_read_f,
.argmin = 2, .argmin = 2,
.argmax = -1, .argmax = -1,
.args = "[-Cqv] [-P pattern] off len [len..]", .args = "[-Ciqv] [-P pattern] off len [len..]",
.oneline = "asynchronously reads a number of bytes", .oneline = "asynchronously reads a number of bytes",
.help = aio_read_help, .help = aio_read_help,
}; };
@ -1297,7 +1298,7 @@ static int aio_read_f(BlockBackend *blk, int argc, char **argv)
struct aio_ctx *ctx = g_new0(struct aio_ctx, 1); struct aio_ctx *ctx = g_new0(struct aio_ctx, 1);
ctx->blk = blk; ctx->blk = blk;
while ((c = getopt(argc, argv, "CP:qv")) != -1) { while ((c = getopt(argc, argv, "CP:iqv")) != -1) {
switch (c) { switch (c) {
case 'C': case 'C':
ctx->Cflag = true; ctx->Cflag = true;
@ -1310,6 +1311,11 @@ static int aio_read_f(BlockBackend *blk, int argc, char **argv)
return 0; return 0;
} }
break; break;
case 'i':
printf("injecting invalid read request\n");
block_acct_invalid(blk_get_stats(blk), BLOCK_ACCT_READ);
g_free(ctx);
return 0;
case 'q': case 'q':
ctx->qflag = true; ctx->qflag = true;
break; break;
@ -1367,6 +1373,7 @@ static void aio_write_help(void)
" -P, -- use different pattern to fill file\n" " -P, -- use different pattern to fill file\n"
" -C, -- report statistics in a machine parsable format\n" " -C, -- report statistics in a machine parsable format\n"
" -f, -- use Force Unit Access semantics\n" " -f, -- use Force Unit Access semantics\n"
" -i, -- treat request as invalid, for exercising stats\n"
" -q, -- quiet mode, do not show I/O statistics\n" " -q, -- quiet mode, do not show I/O statistics\n"
" -u, -- with -z, allow unmapping\n" " -u, -- with -z, allow unmapping\n"
" -z, -- write zeroes using blk_aio_write_zeroes\n" " -z, -- write zeroes using blk_aio_write_zeroes\n"
@ -1380,7 +1387,7 @@ static const cmdinfo_t aio_write_cmd = {
.cfunc = aio_write_f, .cfunc = aio_write_f,
.argmin = 2, .argmin = 2,
.argmax = -1, .argmax = -1,
.args = "[-Cfquz] [-P pattern] off len [len..]", .args = "[-Cfiquz] [-P pattern] off len [len..]",
.oneline = "asynchronously writes a number of bytes", .oneline = "asynchronously writes a number of bytes",
.help = aio_write_help, .help = aio_write_help,
}; };
@ -1393,7 +1400,7 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv)
int flags = 0; int flags = 0;
ctx->blk = blk; ctx->blk = blk;
while ((c = getopt(argc, argv, "CfqP:z")) != -1) { while ((c = getopt(argc, argv, "CfiqP:uz")) != -1) {
switch (c) { switch (c) {
case 'C': case 'C':
ctx->Cflag = true; ctx->Cflag = true;
@ -1414,6 +1421,11 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv)
return 0; return 0;
} }
break; break;
case 'i':
printf("injecting invalid write request\n");
block_acct_invalid(blk_get_stats(blk), BLOCK_ACCT_WRITE);
g_free(ctx);
return 0;
case 'z': case 'z':
ctx->zflag = true; ctx->zflag = true;
break; break;
@ -1436,6 +1448,7 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv)
if ((flags & BDRV_REQ_MAY_UNMAP) && !ctx->zflag) { if ((flags & BDRV_REQ_MAY_UNMAP) && !ctx->zflag) {
printf("-u requires -z to be specified\n"); printf("-u requires -z to be specified\n");
g_free(ctx);
return 0; return 0;
} }

View File

@ -104,8 +104,6 @@ for sample_img in empty.bochs iotest-dirtylog-10G-4M.vhdx parallels-v1 \
$QEMU_IO -c 'read -P 0 0 64k' "$TEST_IMG" | _filter_qemu_io $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" run_qemu "$TEST_IMG" "$TEST_IMG.src" "'format': 'raw'," "BLOCK_JOB_READY"
# qemu-img compare can't handle unaligned file sizes
$QEMU_IMG resize -f raw "$TEST_IMG.src" +0
$QEMU_IMG compare -f raw -F raw "$TEST_IMG" "$TEST_IMG.src" $QEMU_IMG compare -f raw -F raw "$TEST_IMG" "$TEST_IMG.src"
done done

View File

@ -143,7 +143,6 @@ read 65536/65536 bytes at offset 0
{"return": {}} {"return": {}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_READY", "data": {"device": "src", "len": 2560, "offset": 2560, "speed": 0, "type": "mirror"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_READY", "data": {"device": "src", "len": 2560, "offset": 2560, "speed": 0, "type": "mirror"}}
{"return": [{"io-status": "ok", "device": "src", "busy": false, "len": 2560, "offset": 2560, "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} {"return": [{"io-status": "ok", "device": "src", "busy": false, "len": 2560, "offset": 2560, "paused": false, "speed": 0, "ready": true, "type": "mirror"}]}
Image resized.
Warning: Image size mismatch! Warning: Image size mismatch!
Images are identical. Images are identical.
@ -164,7 +163,6 @@ read 65536/65536 bytes at offset 0
{"return": {}} {"return": {}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_READY", "data": {"device": "src", "len": 31457280, "offset": 31457280, "speed": 0, "type": "mirror"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_READY", "data": {"device": "src", "len": 31457280, "offset": 31457280, "speed": 0, "type": "mirror"}}
{"return": [{"io-status": "ok", "device": "src", "busy": false, "len": 31457280, "offset": 31457280, "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} {"return": [{"io-status": "ok", "device": "src", "busy": false, "len": 31457280, "offset": 31457280, "paused": false, "speed": 0, "ready": true, "type": "mirror"}]}
Image resized.
Warning: Image size mismatch! Warning: Image size mismatch!
Images are identical. Images are identical.
@ -185,7 +183,6 @@ read 65536/65536 bytes at offset 0
{"return": {}} {"return": {}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_READY", "data": {"device": "src", "len": 327680, "offset": 327680, "speed": 0, "type": "mirror"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_READY", "data": {"device": "src", "len": 327680, "offset": 327680, "speed": 0, "type": "mirror"}}
{"return": [{"io-status": "ok", "device": "src", "busy": false, "len": 327680, "offset": 327680, "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} {"return": [{"io-status": "ok", "device": "src", "busy": false, "len": 327680, "offset": 327680, "paused": false, "speed": 0, "ready": true, "type": "mirror"}]}
Image resized.
Warning: Image size mismatch! Warning: Image size mismatch!
Images are identical. Images are identical.
@ -206,7 +203,6 @@ read 65536/65536 bytes at offset 0
{"return": {}} {"return": {}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_READY", "data": {"device": "src", "len": 2048, "offset": 2048, "speed": 0, "type": "mirror"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_READY", "data": {"device": "src", "len": 2048, "offset": 2048, "speed": 0, "type": "mirror"}}
{"return": [{"io-status": "ok", "device": "src", "busy": false, "len": 2048, "offset": 2048, "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} {"return": [{"io-status": "ok", "device": "src", "busy": false, "len": 2048, "offset": 2048, "paused": false, "speed": 0, "ready": true, "type": "mirror"}]}
Image resized.
Warning: Image size mismatch! Warning: Image size mismatch!
Images are identical. Images are identical.

View File

@ -226,18 +226,11 @@ sector = "%d"
highest_offset = wr_ops * wr_size highest_offset = wr_ops * wr_size
# Two types of invalid operations: unaligned length and unaligned offset for i in range(invalid_rd_ops):
for i in range(invalid_rd_ops / 2): ops.append("aio_read -i 0 512")
ops.append("aio_read 0 511")
for i in range(invalid_rd_ops / 2, invalid_rd_ops): for i in range(invalid_wr_ops):
ops.append("aio_read 13 512") ops.append("aio_write -i 0 512")
for i in range(invalid_wr_ops / 2):
ops.append("aio_write 0 511")
for i in range(invalid_wr_ops / 2, invalid_wr_ops):
ops.append("aio_write 13 512")
for i in range(failed_rd_ops): for i in range(failed_rd_ops):
ops.append("aio_read %d 512" % bad_offset) ops.append("aio_read %d 512" % bad_offset)