From: Greg Kurz <groug@kaod.org>
To: Eric Blake <eblake@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Thomas Huth <thuth@redhat.com>,
qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 4/6] fsdev: Error out when unsupported option is passed
Date: Thu, 9 May 2019 15:22:58 +0200 [thread overview]
Message-ID: <20190509152258.6641d94b@bahia.lan> (raw)
In-Reply-To: <4a0a2977-0afd-557a-d6a5-251495cd17b0@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1968 bytes --]
On Wed, 8 May 2019 11:23:46 -0500
Eric Blake <eblake@redhat.com> wrote:
> On 5/7/19 3:45 AM, Greg Kurz wrote:
> > Each fsdriver only supports a subset of the options that can be passed
> > to -fsdev. Unsupported options are simply ignored. This could cause the
> > user to erroneously think QEMU has a bug.
> >
> > Enforce strict checking of supported options for all fsdrivers. This
> > shouldn't impact libvirt, since it doesn't know about he synth and
>
> s/he/the/
>
> > proxy fsdrivers.
> >
> > Signed-off-by: Greg Kurz <groug@kaod.org>
> > ---
> > fsdev/qemu-fsdev.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++--
> > 1 file changed, 71 insertions(+), 3 deletions(-)
> >
>
> >
> > +#define COMMON_FS_DRIVER_OPTIONS "id", "fsdriver", "readonly"
> > +
> > static FsDriverTable FsDrivers[] = {
> > - { .name = "local", .ops = &local_ops},
> > - { .name = "synth", .ops = &synth_ops},
> > - { .name = "proxy", .ops = &proxy_ops},
> > + {
> > + .name = "local",
> > + .ops = &local_ops,
> > + .opts = (const char * []) {
> > + COMMON_FS_DRIVER_OPTIONS,
> > + "security_model",
>
>
> > +static int validate_opt(void *opaque, const char *name, const char *value,
> > + Error **errp)
> > +{
> > + FsDriverTable *drv = opaque;
> > + const char **opt;
> > +
> > + for (opt = drv->opts; *opt; opt++) {
> > + if (!strcmp(*opt, name)) {
> > + return 0;
> > + }
> > + }
> > +
> > + error_setg(errp, "'%s' is invalid for fsdriver '%s'", name, drv->name);
> > + return -1;
> > +}
>
> When we ever reach command-line QAPIfication, this might go away. In the
> meantime, this is an improvement.
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
>
Fixed the typo in the changelog and applied to https://github.com/gkurz/qemu/commits/9p-next
Cheers,
--
Greg
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-05-09 13:25 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-07 8:44 [Qemu-devel] [PATCH 0/6] fsdev/virtfs: Assorted cleanups and fixes Greg Kurz
2019-05-07 8:44 ` [Qemu-devel] [PATCH 1/6] fsdev: Drop unused extern declaration Greg Kurz
2019-05-07 10:15 ` Thomas Huth
2019-05-09 13:20 ` Greg Kurz
2019-05-07 8:44 ` [Qemu-devel] [PATCH 2/6] fsdev: Drop unused opaque field Greg Kurz
2019-05-07 10:24 ` Thomas Huth
2019-05-09 13:21 ` Greg Kurz
2019-05-07 8:45 ` [Qemu-devel] [PATCH 3/6] fsdev: Move some types definition to qemu-fsdev.c Greg Kurz
2019-05-08 8:28 ` Thomas Huth
2019-05-09 13:21 ` Greg Kurz
2019-05-07 8:45 ` [Qemu-devel] [PATCH 4/6] fsdev: Error out when unsupported option is passed Greg Kurz
2019-05-08 16:23 ` Eric Blake
2019-05-09 13:22 ` Greg Kurz [this message]
2019-05-07 8:45 ` [Qemu-devel] [PATCH 5/6] vl: Deprecate -virtfs_synth Greg Kurz
2019-05-08 8:26 ` Thomas Huth
2019-05-08 8:55 ` Greg Kurz
2019-05-07 8:45 ` [Qemu-devel] [PATCH 6/6] virtfs: Fix documentation of -fsdev and -virtfs Greg Kurz
2019-05-08 15:54 ` Thomas Huth
2019-05-09 13:18 ` Greg Kurz
2019-05-13 8:39 ` Thomas Huth
2019-05-13 9:34 ` Greg Kurz
2019-05-13 9:47 ` Thomas Huth
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=20190509152258.6641d94b@bahia.lan \
--to=groug@kaod.org \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@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.