Re: [Qemu-devel] [PATCH] qmp-shell: fix nested json regression

2019-03-11 Thread Eduardo Habkost
On Sat, Mar 09, 2019 at 10:01:58AM +0100, Markus Armbruster wrote: > John Snow writes: > > > On 2/5/19 8:49 AM, Marc-André Lureau wrote: > >> Commit fcfab7541 ("qmp-shell: learn to send commands with quoted > >> arguments") introduces the usage of Python 'shlex' to handle quoted > >> arguments, b

Re: [Qemu-devel] [PATCH] qmp-shell: fix nested json regression

2019-03-09 Thread Markus Armbruster
John Snow writes: > On 2/5/19 8:49 AM, Marc-André Lureau wrote: >> Commit fcfab7541 ("qmp-shell: learn to send commands with quoted >> arguments") introduces the usage of Python 'shlex' to handle quoted >> arguments, but it accidentally broke generation of nested JSON >> structs. >> >> shlex dro

Re: [Qemu-devel] [PATCH] qmp-shell: fix nested json regression

2019-03-08 Thread John Snow
On 2/5/19 8:49 AM, Marc-André Lureau wrote: > Commit fcfab7541 ("qmp-shell: learn to send commands with quoted > arguments") introduces the usage of Python 'shlex' to handle quoted > arguments, but it accidentally broke generation of nested JSON > structs. > > shlex drops quotes, which breaks p

Re: [Qemu-devel] [PATCH] qmp-shell: fix nested json regression

2019-02-06 Thread Kashyap Chamarthy
On Wed, Feb 06, 2019 at 11:48:51AM +0100, Kashyap Chamarthy wrote: > On Tue, Feb 05, 2019 at 08:44:12PM -0500, John Snow wrote: > > On 2/5/19 8:49 AM, Marc-André Lureau wrote: [...] > > > < command-name > [ arg-name1=arg1 ] ... [ arg-nameN=argN ] > > > """ > > > -cmd

Re: [Qemu-devel] [PATCH] qmp-shell: fix nested json regression

2019-02-06 Thread Kashyap Chamarthy
On Tue, Feb 05, 2019 at 08:44:12PM -0500, John Snow wrote: > On 2/5/19 8:49 AM, Marc-André Lureau wrote: [...] > > Replace with a regexp to split while respecting quoted strings and > > preserving quotes: > > > > re.findall(r'''(?:[^\s"']|"(?:\\.|[^"])*"|'(?:\\.|[^'])*')+''', cmd) > > ['blockde

Re: [Qemu-devel] [PATCH] qmp-shell: fix nested json regression

2019-02-05 Thread John Snow
On 2/5/19 8:49 AM, Marc-André Lureau wrote: > Commit fcfab7541 ("qmp-shell: learn to send commands with quoted > arguments") introduces the usage of Python 'shlex' to handle quoted > arguments, but it accidentally broke generation of nested JSON > structs. > > shlex drops quotes, which breaks p

[Qemu-devel] [PATCH] qmp-shell: fix nested json regression

2019-02-05 Thread Marc-André Lureau
Commit fcfab7541 ("qmp-shell: learn to send commands with quoted arguments") introduces the usage of Python 'shlex' to handle quoted arguments, but it accidentally broke generation of nested JSON structs. shlex drops quotes, which breaks parsing of the nested struct. cmd='blockdev-create job-id="