[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] b35203: qmp-shell: fix nested json regression
From: |
Peter Maydell |
Subject: |
[Qemu-commits] [qemu/qemu] b35203: qmp-shell: fix nested json regression |
Date: |
Tue, 12 Mar 2019 14:05:36 -0700 |
Branch: refs/heads/master
Home: https://github.com/qemu/qemu
Commit: b35203b227261961ff1da9b77b546c1919968bee
https://github.com/qemu/qemu/commit/b35203b227261961ff1da9b77b546c1919968bee
Author: Marc-André Lureau <address@hidden>
Date: 2019-03-11 (Mon, 11 Mar 2019)
Changed paths:
M scripts/qmp/qmp-shell
Log Message:
-----------
qmp-shell: fix nested json regression
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="job0 foo"
options={"driver":"qcow2","size":16384,"file":{"driver":"file","filename":"foo.qcow2"}}'
shlex.split(cmd)
['blockdev-create',
'job-id=job0 foo',
'options={driver:qcow2,size:16384,file:{driver:file,filename:foo.qcow2}}']
Replace with a regexp to split while respecting quoted strings and preserving
quotes:
re.findall(r'''(?:[^\s"']|"(?:\\.|[^"])*"|'(?:\\.|[^'])*')+''', cmd)
['blockdev-create',
'job-id="job0 foo"',
'options={"driver":"qcow2","size":16384,"file":{"driver":"file","filename":"foo.qcow2"}}']
Fixes: fcfab7541 ("qmp-shell: learn to send commands with quoted arguments")
Reported-by: Kashyap Chamarthy <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Tested-by: Kashyap Chamarthy <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
Commit: 9d867123659ac32edd2a0b64cabe2dca544f1d0e
https://github.com/qemu/qemu/commit/9d867123659ac32edd2a0b64cabe2dca544f1d0e
Author: Peter Maydell <address@hidden>
Date: 2019-03-12 (Tue, 12 Mar 2019)
Changed paths:
M scripts/qmp/qmp-shell
Log Message:
-----------
Merge remote-tracking branch 'remotes/ehabkost/tags/python-next-pull-request'
into staging
qmp-shell: fix nested json regression
One small bug fix.
# gpg: Signature made Tue 12 Mar 2019 02:16:24 GMT
# gpg: using RSA key 2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <address@hidden>" [full]
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6
* remotes/ehabkost/tags/python-next-pull-request:
qmp-shell: fix nested json regression
Signed-off-by: Peter Maydell <address@hidden>
Compare: https://github.com/qemu/qemu/compare/cfc3fef6b4e4...9d867123659a
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-commits] [qemu/qemu] b35203: qmp-shell: fix nested json regression,
Peter Maydell <=