From: Kevin Wolf <kwolf@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Eric Blake <eblake@redhat.com>,
Ashijeet Acharya <ashijeetacharya@gmail.com>,
pl@kamp.de, qemu-block@nongnu.org, jcody@redhat.com,
qemu-devel@nongnu.org, mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 2/2] qapi: allow blockdev-add for NFS
Date: Wed, 26 Oct 2016 11:04:37 +0200 [thread overview]
Message-ID: <20161026090437.GG4758@noname.str.redhat.com> (raw)
In-Reply-To: <8760ofr2sx.fsf@dusky.pond.sub.org>
Am 26.10.2016 um 09:23 hat Markus Armbruster geschrieben:
> A few drive-by comments...
>
> Eric Blake <eblake@redhat.com> writes:
>
> > On 10/24/2016 02:27 PM, Ashijeet Acharya wrote:
> >> Introduce new object 'BlockdevOptionsNFS' in qapi/block-core.json to
> >> support blockdev-add for NFS network protocol driver. Also make a new
> >> struct NFSServer to support tcp connection.
> >>
> >> Signed-off-by: Ashijeet Acharya <ashijeetacharya@gmail.com>
> >> ---
> >> qapi/block-core.json | 56 ++++++++++++++++++++++++++++++++++++++++++++++++----
> >> 1 file changed, 52 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/qapi/block-core.json b/qapi/block-core.json
> >> index 9d797b8..3ab028d 100644
> >> --- a/qapi/block-core.json
> >> +++ b/qapi/block-core.json
> >> @@ -1714,9 +1714,9 @@
> >> { 'enum': 'BlockdevDriver',
> >> 'data': [ 'archipelago', 'blkdebug', 'blkverify', 'bochs', 'cloop',
> >> 'dmg', 'file', 'ftp', 'ftps', 'gluster', 'host_cdrom',
> >> - 'host_device', 'http', 'https', 'luks', 'null-aio', 'null-co',
> >> - 'parallels', 'qcow', 'qcow2', 'qed', 'quorum', 'raw',
> >> - 'replication', 'tftp', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] }
> >> + 'host_device', 'http', 'https', 'luks', 'nfs', 'null-aio',
> >> + 'null-co', 'parallels', 'qcow', 'qcow2', 'qed', 'quorum', 'raw',
> >> + 'replication', 'tftp', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] }
> >
> > Missing a comment that 'nfs' is since 2.8.
> >
> >> ##
> >> +# @NFSServer
> >> +#
> >> +# Captures the address of the socket
> >> +#
> >> +# @type: transport type used for NFS (only TCP supported)
> >> +#
> >> +# @host: host part of the address
> >> +#
> >> +# Since 2.8
> >> +##
> >> +{ 'struct': 'NFSServer',
> >> + 'data': { 'type': 'str',
> >
> > Please make this an enum, instead of an open-coded string. It's okay if
> > the enum only has one value 'tcp' for now; but using an enum will make
> > it introspectable if we later add a second transport, unlike what we get
> > with an open-coded string.
>
> Yes. When a JSON string has a compile-time fixed set of values, 'str'
> is generally wrong.
>
> > Must 'type' be mandatory if it must always be 'tcp'?
> >
> >> + 'host': 'str' } }
> >> +
> >> +##
> >> +# @BlockdevOptionsNfs
> >> +#
> >> +# Driver specific block device option for NFS
> >> +#
> >> +# @server: host address
> >> +#
> >> +# @path: path of the image on the host
> >> +#
> >> +# @uid: #optional UID value to use when talking to the server
> >> +#
> >> +# @gid: #optional GID value to use when talking to the server
> >
> > Do we want to allow string names in addition to numeric uid/gid values?
> > I'm not sure if NFS has name-based id mapping, but it's food for thought
> > on whether we need to use an alternate type here (alternate between
> > integer id and string name), or leave this as is.
>
> As far as I know, NFS4 supports user and group names. On Linux, see
> rpc.idmapd(8).
>
> How the name support affects C code I can't say. If it's transparent,
> i.e. you simply use local UID/GID, and the mapping happens below the
> hood, then we'd have to translate string values to local UID/GID by the
> usual means. Looks like a minor convenience feature on first glance.
> However, QMP is a *network* protocol. A remote client can't easily do
> this translation.
>
> Consider a GUI like virt-manager: I guess we'd rather support user and
> group names there. But if we do, and QMP doesn't, either virt-manager
> or libvirt need to map to numeric IDs. Easy enough when running on the
> host, probably impractical when not.
>
> If we permit string values, are @uid and @gid still appropriate names?
> The user name is not the user ID, it just maps to it.
I guess we can make it @user and @group now, and then leave it an int
for now so that making it an alternate later is introspectable?
> >> +#
> >> +# @tcp-syncnt: #optional number of SYNs during the session establishment
> >
> > Would tcp-syn-count be any more legible?
Looks good to me.
> We generally write out things in long hand in the QAPI schema.
>
> > What is the default when omitted?
>
> Whenever you write #optional, you must explain the default. When
> the default is a fixed value, specify it. When the system picks a
> default, state that, and think hard about what you need to specify on
> how the system picks.
>
> >> +#
> >> +# @readahead: #optional set the readahead size in bytes
>
> @read-ahead
I think this is generally considered a single word. But @readahead-size.
> > What's the default when omitted?
> >
> >> +#
> >> +# @pagecache: #optional set the pagecache size in bytes
>
> @page-cache
@page-cache-size
> > Default?
> >
> >> +#
> >> +# @debug: #optional set the NFS debug level (max 2)
> >
> > Presumably default 0?
>
> @BlockdevOptionsGluster calls this @debug-level.
I wouldn't mind either way, but if there's precedence, let's do the same
for consistency.
Kevin
next prev parent reply other threads:[~2016-10-26 9:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-24 19:27 [Qemu-devel] [PATCH v2 0/2] block: allow blockdev-add for NFS Ashijeet Acharya
2016-10-24 19:27 ` [Qemu-devel] [PATCH v2 1/2] block/nfs: Introduce runtime_opts in NFS Ashijeet Acharya
2016-10-25 14:02 ` Kevin Wolf
2016-10-25 14:25 ` Peter Lieven
2016-10-24 19:27 ` [Qemu-devel] [PATCH v2 2/2] qapi: allow blockdev-add for NFS Ashijeet Acharya
2016-10-25 14:33 ` Kevin Wolf
2016-10-25 21:16 ` Eric Blake
2016-10-26 7:23 ` Markus Armbruster
2016-10-26 8:06 ` Kevin Wolf
2016-10-26 8:40 ` Markus Armbruster
2016-10-26 8:59 ` Kevin Wolf
2016-10-26 9:04 ` Kevin Wolf [this message]
2016-10-26 9:49 ` Kevin Wolf
2016-10-27 6:45 ` Ashijeet Acharya
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=20161026090437.GG4758@noname.str.redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=ashijeetacharya@gmail.com \
--cc=eblake@redhat.com \
--cc=jcody@redhat.com \
--cc=mreitz@redhat.com \
--cc=pl@kamp.de \
--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).