qemu: unescape HMP commands before converting them to json
QMP commands don't need to be escaped since converting them to json also escapes special characters. When a QMP command fails, however, libvirt falls back to HMP commands. These fallback functions (qemuMonitorText*) do their own escaping, and pass the result directly to qemuMonitorHMPCommandWithFd. If the monitor is in json mode, these pre-escaped commands will be escaped again when converted to json, which can result in the wrong arguments being sent. For example, a filename test\file would be sent in json as test\\file. This prevented attaching an image file with a " or \ in its name in qemu 1.0.50, and also broke rbd attachment (which uses backslashes to escape some internal arguments.) Reported-by: NMasuko Tomoya <tomoya.masuko@gmail.com> Signed-off-by: NJosh Durgin <josh.durgin@dreamhost.com> Signed-off-by: NEric Blake <eblake@redhat.com>
Showing
tests/qemumonitortest.c
0 → 100644
想要评论请 注册 或 登录