[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 01/43] qemu-img: fix failed autotests
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 01/43] qemu-img: fix failed autotests |
Date: |
Tue, 5 Jul 2016 17:50:10 +0200 |
From: "Denis V. Lunev" <address@hidden>
There are 9 iotests failed on Ubuntu 15.10 at the moment.
The problem is that options parsing in qemu-img is broken by the
following commit:
commit 10985131e337a0c52c5bd1e191fd7867a6ff8d02
Author: Denis V. Lunev <address@hidden>
Date: Fri Jun 17 17:44:13 2016 +0300
qemu-img: move common options parsing before commands processing
This strange command line reports error
./qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- 1024
qemu-img: Invalid image size specified!
while original code parses it successfully.
The problem is that getopt_long state should be reset. This could be done
using this assignment according to the manual:
optind = 0
Signed-off-by: Denis V. Lunev <address@hidden>
CC: Eric Blake <address@hidden>
CC: Kevin Wolf <address@hidden>
CC: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
qemu-img.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qemu-img.c b/qemu-img.c
index 3322a1e..2351686 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -3866,7 +3866,7 @@ int main(int argc, char **argv)
return 0;
}
argv += optind;
- optind = 1;
+ optind = 0;
if (!trace_init_backends()) {
exit(1);
--
1.8.3.1
- [Qemu-block] [PULL 00/43] Block layer patches, Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 01/43] qemu-img: fix failed autotests,
Kevin Wolf <=
- [Qemu-block] [PULL 03/43] block: Document supported flags during bdrv_aligned_preadv(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 04/43] block: Fix harmless off-by-one in bdrv_aligned_preadv(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 05/43] nbd: Allow larger requests, Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 07/43] iscsi: Advertise realistic limits to block layer, Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 02/43] block: Tighter assertions on bdrv_aligned_pwritev(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 08/43] scsi: Advertise limits by blocksize, not 512, Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 06/43] nbd: Advertise realistic limits to block layer, Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 09/43] block: Give nonzero result to blk_get_max_transfer_length(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 11/43] iscsi: Set request_alignment during .bdrv_refresh_limits(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 10/43] blkdebug: Set request_alignment during .bdrv_refresh_limits(), Kevin Wolf, 2016/07/05