From: Walker, Benjamin <benjamin.walker at intel.com>
To: spdk@lists.01.org
Subject: Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK
Date: Fri, 02 Feb 2018 17:48:33 +0000 [thread overview]
Message-ID: <1517593711.2371.30.camel@intel.com> (raw)
In-Reply-To: 6c5f58f0-0dec-b9d8-c8e5-38f17dadeb38@intel.com
[-- Attachment #1: Type: text/plain, Size: 2719 bytes --]
On Fri, 2018-02-02 at 10:24 -0700, Daniel Verkamp wrote:
> I agree that we definitely want to be able to have comments in the
> configuration file.
>
> We already have support for (non-standard) JavaScript-style // and /* */
> comments in our JSON parser; it just needs to be enabled with the
> SPDK_JSON_PARSE_FLAG_ALLOW_COMMENTS flag.
>
> However, if we make the config file parser an external Python tool, we would
> probably need something like JSON-minify to remove the comments first (or a
> JSON parser that has non-standard comment support).
I think the top level object should be a JSON list which contains the already-
defined RPC calls. The 'id' and 'jsonrpc' fields can be omitted and
automatically inserted by the config file parser. JavaScript-style comments
should be allowed, which can be removed using JSON-minify. I'm glad this is the
consensus that's emerging - it should make this really easy to use.
> I like the idea of having an external tool (possibly written in Python) that
> loads the JSON config file and sends RPC requests one at a time through the
> existing JSON-RPC interface; that keeps the SPDK library code modifications to
> a minimum.
I agree with this one. Let's just write a simple Python script that loads the
config file (json.loads), then iterates through the list of RPC commands and
sends them one by one using the regular interface.
On Fri, 2018-02-02 at 01:22 +0000, 松本周平 / MATSUMOTO,SHUUHEI wrote:
> We should keep the current config file implementation for compatibility?
> Or is it OK to replace the whole to the new one once everything is prepared?
We need to have some level of backward compatibility, at least for a full
release cycle, in my opinion. I see two options:
1) Leave the current config file parsing in our code. Add the ability to dump
JSON-RPC config files in response to SIGUSR (which is planned anyway). If the
user passes a config file on the command line, print out a big deprecation
warning, but otherwise continue. This gives users the ability to load up their
old configuration file, then dump the new JSON-RPC format. After a release
cycle, we can delete support for parsing the old config file. At that point, if
someone needs to use an old config file they can always go back to the release
that supported both formats and use it as a converter.
2) Write a Python script that converts the old config format into the new JSON
format. This allows us to delete the current config parsing code immediately and
provide the conversion utility with every release going forward. My only concern
with this approach is it may not be trivial to do the conversion, but I could be
wrong.
next reply other threads:[~2018-02-02 17:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-02 17:48 Walker, Benjamin [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-02-13 7:00 [SPDK] About dump/load (or export/edit/import) JSON file by SPDK
2018-02-13 2:15
2018-02-09 19:48 Wodkowski, PawelX
2018-02-05 9:04
2018-02-02 17:24 Daniel Verkamp
2018-02-02 16:25 Harris, James R
2018-02-02 14:19 Wodkowski, PawelX
2018-02-02 9:04
2018-02-02 1:22
2018-02-02 1:12
2018-02-01 21:00 Harris, James R
2018-02-01 9:05
2018-02-01 1:13
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=1517593711.2371.30.camel@intel.com \
--to=spdk@lists.01.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 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.