]> xenbits.xensource.com Git - libvirt.git/commit
qemuMonitorTestProcessCommandDefaultValidate: Output validator output to stderr
authorPeter Krempa <pkrempa@redhat.com>
Wed, 1 Apr 2020 10:28:17 +0000 (12:28 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 3 Apr 2020 07:36:20 +0000 (09:36 +0200)
commit5a13eb165559039bda2c1e0e4149dba0e0af820e
tree5e7f96a1019c5f4d55b5dc38fe8571a517479e43
parent203e802d889d5f2798bbd561e5654ed29d3e2be6
qemuMonitorTestProcessCommandDefaultValidate: Output validator output to stderr

Trying to squeeze the validator output into the monitor reply message
doesn't make sense and doesn't work well as it's not well formed JSON:

54) qemuMonitorJSONAddNetdev                                          ... libvirt:  error : internal error: cannot parse json { "error":  { "desc": "failed to validate arguments of 'netdev_add' against QAPI schema: {
   ERROR: variant 'test' for discriminator 'type' not found
",    "class": "UnexpectedCommand" } }: lexical error: invalid character inside string.
          ev_add' against QAPI schema: {    ERROR: variant 'test' for
                     (right here) ------^
FAILED

Output it to stderr if requested and just note that schema validation
failed in the error message:

54) qemuMonitorJSONAddNetdev                                          ...
failed to validate arguments of 'netdev_add' against QAPI schema
args:
{
  "id": "net0",
  "type": "test"
}

validator output:
 {
   ERROR: variant 'test' for discriminator 'type' not found

libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'netdev_add': failed to validate arguments of 'netdev_add' against QAPI schema (to see debug output use VIR_TEST_DEBUG=2)
FAILED

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemumonitortestutils.c