From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBQwv-00089P-Lg for qemu-devel@nongnu.org; Tue, 22 Dec 2015 12:42:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBQwu-00061s-Gd for qemu-devel@nongnu.org; Tue, 22 Dec 2015 12:42:13 -0500 Date: Tue, 22 Dec 2015 17:42:00 +0000 From: "Daniel P. Berrange" Message-ID: <20151222174159.GM10082@redhat.com> References: <1450782389-17326-1-git-send-email-berrange@redhat.com> <1450782389-17326-8-git-send-email-berrange@redhat.com> <5679897C.7060003@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5679897C.7060003@redhat.com> Subject: Re: [Qemu-devel] [PATCH 7/7] qemu-img: allow specifying image as a set of options args Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Kevin Wolf , qemu-block@nongnu.org, qemu-devel@nongnu.org, Markus Armbruster , Paolo Bonzini , Andreas =?utf-8?Q?F=C3=A4rber?= On Tue, Dec 22, 2015 at 10:33:48AM -0700, Eric Blake wrote: > On 12/22/2015 04:06 AM, Daniel P. Berrange wrote: > > Currently qemu-img allows an image filename to be passed on the > > command line, but does not have a way to set any options except > > the format eg > > > > qemu-img info https://127.0.0.1/images/centos7.iso > > > > This adds a --source arg (that is mutually exclusive with a > > positional filename arg and -f arg) that accepts a full option > > string, as well as the original syntax eg > > > > qemu-img info --source driver=http,url=https://127.0.0.1/images,sslverify=off > [snip] > > Overall, I'm left wondering whether requiring '--source FOO' vs. > positional 'FOO', and manually enforcing mutual exclusion between the > two, is necessary, or if we could stick with positional. But I guess > the main argument is backwards-compatibility: previously, using > 'driver=file,file=/path/to/file' as a filename would try to look in a > relative directory 'driver=file,file=', whereas your proposal of always > using the new '--source' option would make it obvious that we are > expecting to parse a QemuOpts string rather than defaulting to a literal > file name. > > On the other hand, the existing positional parameters have allowed > 'file:file:with_weird_name' to explicitly specify that we want to use > './file:with_weird_name' as a relative file in the current directory > (that is, the first 'file:' prefix is sufficient to avoid any > back-compat issues with any other possible change in interpretation to a > prefix), so on that grounds, I'd argue that adding --source is not > necessary, and we can just require users to write > 'file:$string_that_might_now_be_QemuOpts' anywhere they used to use > '$string_that_might_now_be_QemuOpts'. > > Maybe other block developers have an opinion to offer on whether the > last three patches in this series should be adding a new --source option > as mutually exclusive with positional args, vs. just adding a new > interpretation of the existing mandatory positional arguments? Yep, back compatibility to avoid breaking any existing possible filenames was my main motivation for adding '--source'. I agree it would be nice if we decided that the risk was acceptable based on what you say above, and thus avoid --source, and just extend existing positional args. If block maintainers OK that approach, I'd happily rewrite the last 3 patches in this series in that manner. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|