1. 26 10月, 2018 1 次提交
  2. 16 8月, 2018 2 次提交
    • M
      tests: New helper qtest_qmp_receive_success() · 3cd46d42
      Markus Armbruster 提交于
      Commit b21373d0 copied wait_command() from tests/migration-test.c
      to tests/tpm-util.c.  Replace both copies by new libqtest helper
      qtest_qmp_receive_success().  Also use it to simplify
      qtest_qmp_device_del().
      
      Bonus: gets rid of a non-literal format string.  A step towards
      compile-time format string checking without triggering
      -Wformat-nonliteral.
      
      Cc: Thomas Huth <thuth@redhat.com>
      Cc: Juan Quintela <quintela@redhat.com>
      Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
      Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NJuan Quintela <quintela@redhat.com>
      Reviewed-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20180806065344.7103-17-armbru@redhat.com>
      3cd46d42
    • M
      tests: Clean up string interpolation into QMP input (simple cases) · 015715f5
      Markus Armbruster 提交于
      When you build QMP input manually like this
      
          cmd = g_strdup_printf("{ 'execute': 'migrate',"
                                "'arguments': { 'uri': '%s' } }",
                                uri);
          rsp = qmp(cmd);
          g_free(cmd);
      
      you're responsible for escaping the interpolated values for JSON.  Not
      done here, and therefore works only for sufficiently nice @uri.  For
      instance, if @uri contained a single "'", qobject_from_vjsonf_nofail()
      would abort.  A sufficiently nasty @uri could even inject unwanted
      members into the arguments object.
      
      Leaving interpolation into JSON to qmp() is more robust:
      
          rsp = qmp("{ 'execute': 'migrate', 'arguments': { 'uri': %s } }", uri);
      
      It's also more concise.
      
      Clean up the simple cases where we interpolate exactly a JSON value.
      
      Bonus: gets rid of non-literal format strings.  A step towards
      compile-time format string checking without triggering
      -Wformat-nonliteral.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20180806065344.7103-13-armbru@redhat.com>
      015715f5
  3. 07 6月, 2018 3 次提交
  4. 26 5月, 2018 1 次提交