[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] qemu-iotests: Fix call syntax for qemu-img
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] qemu-iotests: Fix call syntax for qemu-img |
Date: |
Wed, 14 Mar 2012 13:08:36 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1 |
On 03/14/2012 12:57 PM, Stefan Weil wrote:
> qemu-img requires first options, then file name, then size.
>
> GNU getopt also allows options at the end, but POSIX getopt
> doesn't. Try "export POSIXLY_CORRECT=y" to get the POSIX
> behaviour with GNU getopt, too.
That's a heavy sledgehammer, that has the potential to affect a lot of
other programs called alongside qemu-img. Simpler would be to just pass
-- in the command line at the point where you want to force qemu to
treat all further arguments without getopt reordering them, as in:
> # XXX(hch): have global image options?
> - $QEMU_IMG create -f $IMGFMT $TEST_IMG $extra_img_options | \
> + $QEMU_IMG create -f $IMGFMT $extra_img_options $TEST_IMG $image_size | \
$QEMU_IMG -- create -f $IMGFMT $extra_img_options $TEST_IMG $image_size
--
Eric Blake address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature