From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKSd2-0000ed-Qe for qemu-devel@nongnu.org; Tue, 05 Jul 2016 11:51:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKSd0-0006SJ-Sy for qemu-devel@nongnu.org; Tue, 05 Jul 2016 11:51:15 -0400 From: Kevin Wolf Date: Tue, 5 Jul 2016 17:50:10 +0200 Message-Id: <1467733852-27097-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1467733852-27097-1-git-send-email-kwolf@redhat.com> References: <1467733852-27097-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 01/43] qemu-img: fix failed autotests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: "Denis V. Lunev" 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 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 CC: Eric Blake CC: Kevin Wolf CC: Max Reitz Signed-off-by: Kevin Wolf --- 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