From: Leandro Dorileo <l@dorileo.org>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Peter Lieven <pl@kamp.de>,
Peter Maydell <peter.maydell@linaro.org>,
Fam Zheng <famz@redhat.com>, Stefan Weil <sw@weilnetz.de>,
Michael Tokarev <mjt@tls.msk.ru>,
qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Laszlo Ersek <lersek@redhat.com>
Subject: Re: [Qemu-devel] [PATCH RFC 0/2] qemu-arg: general purpose argument parser
Date: Tue, 11 Mar 2014 14:09:18 +0000 [thread overview]
Message-ID: <20140311140918.GA30837@dorilex> (raw)
In-Reply-To: <20140311110616.GD3215@dhcp-200-207.str.redhat.com>
Hi Kevin,
On Tue, Mar 11, 2014 at 12:06:16PM +0100, Kevin Wolf wrote:
> Am 08.03.2014 um 19:47 hat Leandro Dorileo geschrieben:
> > The following patchset introduces a general purpose argument parser and migrates
> > qemu-img to make use of it. qemu-img is just the first user of it, if we see a
> > good feedback here I move forward and migrate all the other possible users.
>
> I was planning to reply to this in more detail, but it doesn't look like
> I can find the time to do so, so let me just summarise my thoughts
> briefly.
Ok.
>
> I do like the idea of simplifying qemu-img's argument parsing, but we
> shouldn't make the mistake of introducing another option parsing
> infrastructure and end up with three different coexisting models. If we
> were to introduce a new framework, we must make sure that all code is
> converted to it and QemuOpts can be dropped.
Agreed.
>
> Now replacing QemuOpts and all of its users is not something that seems
> to be very productive - it works quite well in those places. So I think
> we should rather extend QemuOpts to work for qemu-img as well.
Indeed, I took some time yesterday to take a deeper look at QemuOpt users,
I saw that converting it all to an entirely new framework would be a massive
task and maybe not worth it. Extending QemuOpts to new needs seems to be a more
reasonable thing.
>
> We would probably need to add a new parser to QemuOpts that parses
> command line options into a QemuOpts, and extend the definition of them
> with a couple of new features that are required there (sub-QemuOpts for
> -o, perhaps enumerations for things like --output=human/json, positional
> parameters).
Ok.
>
> I see that you also fill the values in (global) variables. The existing
> code that converts QemuOpts into C variables are the QAPI visitors. So I
> could imagine that we define all qemu-img options in a JSON schema like
> qapi-schema.json and generate the struct definitions from it. We would
> then end up with something like this, where the code to create a
> QemuImgCreateOptions struct from the QemuOpts would be QAPI generated:
>
> void img_create(QemuImgCreateOptions *options, Error **errp);
Using json descriptors was something I considered after sending the patches
and the feedbacks I already got. That's something that would be useful on
cases of generating different outputs from it, like manpages or even
fragments of it, it would be more flexible as far as I can see.
But yeah, I need to take a look at qapi and see how things work.
>
> Not sure if we really want to go that far, but perhaps it's some food
> for thought.
Yeah, sure.
Regards...
--
Leandro Dorileo
next prev parent reply other threads:[~2014-03-11 14:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-08 18:47 [Qemu-devel] [PATCH RFC 0/2] qemu-arg: general purpose argument parser Leandro Dorileo
2014-03-08 18:47 ` [Qemu-devel] [PATCH RFC 1/2] qemu-arg: introduce a " Leandro Dorileo
2014-03-08 18:47 ` [Qemu-devel] [PATCH RFC 2/2] qemu-img: migrate to use qemu-arg Leandro Dorileo
2014-03-09 7:30 ` Paolo Bonzini
2014-03-09 12:37 ` Leandro Dorileo
2014-03-09 13:03 ` Peter Maydell
2014-03-09 13:35 ` Leandro Dorileo
2014-03-08 18:55 ` [Qemu-devel] [PATCH RFC 0/2] qemu-arg: general purpose argument parser Peter Maydell
2014-03-08 20:28 ` Leandro Dorileo
2014-03-09 16:32 ` Andreas Färber
2014-03-09 21:47 ` Leandro Dorileo
2014-03-11 11:06 ` Kevin Wolf
2014-03-11 14:09 ` Leandro Dorileo [this message]
2014-03-11 15:22 ` Eric Blake
2014-03-16 21:23 ` Leandro Dorileo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140311140918.GA30837@dorilex \
--to=l@dorileo.org \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=lersek@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=pl@kamp.de \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=sw@weilnetz.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).