qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, mitake.hitoshi@lab.ntt.co.jp,
	namei.unix@gmail.com, jcody@redhat.com, kwolf@redhat.com,
	mreitz@redhat.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 for-2.9 4/9] block: Document -drive problematic code and bugs
Date: Thu, 30 Mar 2017 13:00:55 -0500	[thread overview]
Message-ID: <21a9cc9f-03f4-382f-2816-b0c40c9c267a@redhat.com> (raw)
In-Reply-To: <1490895797-29094-5-git-send-email-armbru@redhat.com>

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

On 03/30/2017 12:43 PM, Markus Armbruster wrote:
> -blockdev and blockdev_add convert their arguments via QObject to
> BlockdevOptions for qmp_blockdev_add(), which converts them back to
> QObject, then to a flattened QDict.  The QDict's members are typed
> according to the QAPI schema.
> 
> -drive converts its argument via QemuOpts to a (flat) QDict.  This
> QDict's members are all QString.
> 
> Thus, the QType of a flat QDict member depends on whether it comes
> from -drive or -blockdev/blockdev_add, except when the QAPI type maps
> to QString, which is the case for 'str' and enumeration types.
> 

> +++ b/block/file-posix.c
> @@ -2193,6 +2193,12 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
>      int ret;
>  
>  #if defined(__APPLE__) && defined(__MACH__)
> +    /*
> +     * Caution: while qdict_get_try_str() is fine, getting non-string
> +     * types would require more care.  When @options come from -blockdev
> +     * or blockdev_add, its members are typed according to the QAPI
> +     * schema, but when they come from -drive, they're all QString.
> +     */
>      const char *filename = qdict_get_str(options, "filename");

Comment mentions (via copy-and-past) qdict_get_try_str(), but this
instance uses qdict_get_str().  Doesn't bother me enough to withhold
review if you leave it, though.


> +++ b/block/nfs.c
> @@ -474,6 +474,13 @@ static NFSServer *nfs_config(QDict *options, Error **errp)
>          goto out;
>      }
>  
> +    /*
> +     * Caution: this works only because all scalar members of
> +     * NFSServer are QString in @crumpled_addr.  The visitor expects
> +     * @crumpled_addr to be typed according to the QAPI scherma.  It

s/scherma/schema/

> +     * is when @options come from -blockdev or blockdev_add.  But when
> +     * they come from -drive, they're all QString.
> +     */

With the typo fix,
Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
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: 604 bytes --]

  reply	other threads:[~2017-03-30 18:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30 17:43 [Qemu-devel] [PATCH v3 for-2.9 0/9] Fixes and cleanups around SocketAddress Markus Armbruster
2017-03-30 17:43 ` [Qemu-devel] [PATCH v3 for-2.9 1/9] nbd sockets vnc: Mark problematic address family tests TODO Markus Armbruster
2017-03-30 17:43 ` [Qemu-devel] [PATCH v3 for-2.9 2/9] char: Fix socket with "type": "vsock" address Markus Armbruster
2017-03-31  9:03   ` Stefan Hajnoczi
2017-03-30 17:43 ` [Qemu-devel] [PATCH v3 for-2.9 3/9] io vnc sockets: Clean up SocketAddressKind switches Markus Armbruster
2017-03-30 17:43 ` [Qemu-devel] [PATCH v3 for-2.9 4/9] block: Document -drive problematic code and bugs Markus Armbruster
2017-03-30 18:00   ` Eric Blake [this message]
2017-03-30 18:56     ` Markus Armbruster
2017-03-30 21:29       ` Max Reitz
2017-03-30 17:43 ` [Qemu-devel] [PATCH v3 for-2.9 5/9] gluster: Prepare for SocketAddressFlat extension Markus Armbruster
2017-03-30 17:43 ` [Qemu-devel] [PATCH v3 for-2.9 6/9] qapi-schema: SocketAddressFlat variants 'vsock' and 'fd' Markus Armbruster
2017-03-30 17:43 ` [Qemu-devel] [PATCH v3 for-2.9 7/9] sockets: New helper socket_address_crumple() Markus Armbruster
2017-03-30 18:02   ` Eric Blake
2017-03-30 17:43 ` [Qemu-devel] [PATCH v3 for-2.9 8/9] nbd: Tidy up blockdev-add interface Markus Armbruster
2017-03-30 21:35   ` Max Reitz
2017-03-30 17:43 ` [Qemu-devel] [PATCH v3 for-2.9 9/9] sheepdog: Fix blockdev-add Markus Armbruster
2017-03-30 21:42 ` [Qemu-devel] [PATCH v3 for-2.9 0/9] Fixes and cleanups around SocketAddress Max Reitz

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=21a9cc9f-03f4-382f-2816-b0c40c9c267a@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mitake.hitoshi@lab.ntt.co.jp \
    --cc=mreitz@redhat.com \
    --cc=namei.unix@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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).