Skip to content
  • Paolo Bonzini's avatar
    libqtest: escape strings in QMP commands, fix leak · 563890c7
    Paolo Bonzini authored
    
    
    libqtest is using g_strdup_printf to format QMP commands, but
    this does not work if the argument strings need to be escaped.
    Instead, use the fancy %-formatting functionality of QObject.
    The only change required in tests is that strings have to be
    formatted as %s, not '%s' or \"%s\".  Luckily this usage of
    parameterized QMP commands is not that frequent.
    
    The leak is in socket_sendf.  Since we are extracting the send
    loop to a new function, fix it now.
    
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    563890c7