• J
    qemu: unescape HMP commands before converting them to json · f27f616f
    Josh Durgin 提交于
    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>
    f27f616f
qemu_monitor.h 20.6 KB