All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amos Kong <akong@redhat.com>
To: qemu-devel <qemu-devel@nongnu.org>, libvir-list@redhat.com
Cc: Osier Yang <jyang@redhat.com>,
	laine@redhat.com, Markus Armbruster <armbru@redhat.com>,
	rjones@redhat.com, anthony@codemonkey.ws, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [resend] fix/re-do query-command-line-options
Date: Mon, 27 Jan 2014 18:24:41 +0800	[thread overview]
Message-ID: <20140127102441.GA6089@amosk.info> (raw)
In-Reply-To: <20131223021900.GA17346@amosk.info>

Hi QEMU/Libvirt list,

When I worked on query-command-line-options, I first used some marcos [1] to
generate two config & option tables. This will cover all the options,
but it returns a string, it's difficult for libvirt to parse and use
it.

| {"execute": "query-config", "arguments" : {"name": "boot"}}
| {"return": {"config": "-boot [order=drives][,once=drives][,menu=on|off]\n
|   ....
|   'rb_timeout': the timeout before guest reboot when boot failed, unit is ms\n"}}


Finally I got a suggestion to read info from new interface (QemuOpts),
We add opts info to vm_config_groups[], query-command-line-options
will visit the array. It doesn't conver all the options, but the
latest options are covered, so this implementation is acceptable.

Problem:
* QemuOpts was designed just for options _have parameter_, some new option
  without parameters is lost in query output (eg: -enable-fips)
* block drive uses three QemuOpts, it's legacy issue. it's fixed by 968854c8.
* QemuOpts of some options aren't updated, it might be difficult to
  updated when we add some new parameters
* other

We discussed to reimplement this command, but it seems DEF maroc is the
only point to cover all the options, all the options are described in
qemu-options.hx

I'm considering to reuse the DEF marocs to generate a table, try to
return the crude info if QemuOpts doesn't cover it.
Or maintain a split array (like vm_config_groups[]), it only contains
the option without parameter (option name & help info).

If you touched some problem of the query-command-line-options, welcome
to reply it, I will try to satisfy your requests.


Thanks, Amos

[1] http://www.redhat.com/archives/libvir-list/2013-January/msg01656.html


|#elif defined(QEMU_OPTIONS_GENERATE_CONFIG)
|
|#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask)    \
|      opt_help,
|
|#define DEFHEADING(text)
|#define ARCHHEADING(text, arch_mask)
|
|#elif defined(QEMU_OPTIONS_GENERATE_NAME)
|
|#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask)    \
|      option,
|
|#define DEFHEADING(text)
|#define ARCHHEADING(text, arch_mask)

    char const *optionstr[] = {
#define QEMU_OPTIONS_GENERATE_NAME
#include "qemu-options-wrapper.h"
    };

    char const *configstr[] = {
#define QEMU_OPTIONS_GENERATE_CONFIG
#include "qemu-options-wrapper.h"
    };

  reply	other threads:[~2014-01-27 10:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-23  2:19 [Qemu-devel] fix/re-do query-command-line-options Amos Kong
2014-01-27 10:24 ` Amos Kong [this message]
2014-01-27 16:27 ` Eric Blake
2014-01-28  9:36 ` Markus Armbruster
2014-01-28 10:01   ` Paolo Bonzini
2014-01-28 11:55     ` Markus Armbruster
2014-01-28 12:05       ` Paolo Bonzini
2014-01-28 13:16         ` Markus Armbruster
2014-01-28 13:35           ` Paolo Bonzini
2014-01-28 14:28             ` Markus Armbruster
2014-01-28 15:33               ` Paolo Bonzini

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=20140127102441.GA6089@amosk.info \
    --to=akong@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=armbru@redhat.com \
    --cc=jyang@redhat.com \
    --cc=laine@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.