qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,
	qemu-devel@nongnu.org, Wenchao Xia <xiawenc@linux.vnet.ibm.com>,
	imain@redhat.com, Stefan Hajnoczi <stefanha@redhat.com>,
	pbonzini@redhat.com, dietmar@proxmox.com
Subject: Re: [Qemu-devel] [PATCH v2 2/3] block: add block-backup QMP command
Date: Mon, 13 May 2013 08:14:12 -0600	[thread overview]
Message-ID: <5190F534.40806@redhat.com> (raw)
In-Reply-To: <20130513091858.54c4e4e6@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1919 bytes --]

On 05/13/2013 07:18 AM, Luiz Capitulino wrote:
>>>> Luiz, any idea how to do something like this, a QAPI enum with values
>>>> that are determined at runtime? Especially with respect to the coming
>>>> schema introspection?
>>>
>>> Or maybe we make the 'enum' list ALL possible types, but then add a
>>> query-* command that returns an array of only those enum values that are
>>> supported.  Introspection would see all types, but the query command
>>> would be the useful variant that is runtime-dependent.
> 
> Agreed. This is a capability, and we're adding query- commands to query
> capabilities.
> 
>> Then is there any advantage in making it an enum in the first place?
> 
> Eric is in a better position to answer this, but the fact that this can
> be queried isn't a strong pro for having it?

Hmm, you raise an interesting point - if we have a query-block-formats
command that returns an array of strings, then keep 'str' everywhere
else a format is required, that is no different for what is sent over
the wire compared to a query-block-formats that returns an array of
'BlockFormat' enum values, with the enum showing all possible formats
(even if support wasn't compiled in), and with 'BlockFormat' everywhere
else.  Introspection-wise, you'd have to know that you call
query-block-formats instead of introspecting on the type of the format
argument, but information-wise, there's no loss of details if the query-
command provides the runtime list, and the remaining commands stick with
'str'.  I still think an enum is a bit nicer from the type-safety
aspect, but I'm finding it hard to envision any scenario where libvirt
would have to resort to introspection if we have a query-block-formats
in place, and thus am not opposed to your idea of avoiding the enum.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

  reply	other threads:[~2013-05-13 14:14 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-29  7:42 [Qemu-devel] [PATCH v2 0/3] block: block-backup live backup command Stefan Hajnoczi
2013-04-29  7:42 ` [Qemu-devel] [PATCH v2 1/3] block: add basic backup support to block driver Stefan Hajnoczi
2013-05-08 12:39   ` Kevin Wolf
2013-05-08 15:43     ` Paolo Bonzini
2013-05-14  8:51     ` Stefan Hajnoczi
2013-05-14 13:24     ` Stefan Hajnoczi
2013-05-14 13:43       ` Kevin Wolf
2013-05-14 15:12         ` Stefan Hajnoczi
2013-05-30  3:37   ` Fam Zheng
2013-05-30 12:27     ` Stefan Hajnoczi
2013-04-29  7:42 ` [Qemu-devel] [PATCH v2 2/3] block: add block-backup QMP command Stefan Hajnoczi
2013-05-08 12:49   ` Kevin Wolf
2013-05-11  3:34     ` Eric Blake
2013-05-11  8:02       ` Paolo Bonzini
2013-05-13  8:23       ` Kevin Wolf
2013-05-14  8:44     ` Stefan Hajnoczi
2013-05-11  4:02   ` Eric Blake
2013-05-13  8:28     ` Kevin Wolf
2013-05-13 12:56       ` Eric Blake
2013-05-13 13:09         ` Kevin Wolf
2013-05-13 13:18           ` Luiz Capitulino
2013-05-13 14:14             ` Eric Blake [this message]
2013-05-13 14:27               ` Kevin Wolf
2013-05-13 14:50                 ` Eric Blake
2013-05-14  2:18                   ` Wenchao Xia
2013-05-14  8:48     ` Stefan Hajnoczi
2013-04-29  7:42 ` [Qemu-devel] [PATCH v2 3/3] qemu-iotests: add 054 block-backup test case Stefan Hajnoczi

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=5190F534.40806@redhat.com \
    --to=eblake@redhat.com \
    --cc=dietmar@proxmox.com \
    --cc=famz@redhat.com \
    --cc=imain@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=xiawenc@linux.vnet.ibm.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 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).