]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: assume JSON in qemuMonitorTestIO
authorJán Tomko <jtomko@redhat.com>
Fri, 14 Jun 2019 18:39:24 +0000 (20:39 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 20 Jun 2019 10:12:34 +0000 (12:12 +0200)
The QMP monitor only uses a newline to separate lines,
while HMP and the guest agent also use a carriage return.

In preparation to dropping support for testing HMP interaction,
only skip the carriage return if we're dealing with the guest agent,
removing the need to check the 'json' field.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
tests/qemumonitortestutils.c

index 85a2fca659775b3e2d20c0abd3c96f0f16b6f404..b29c6d0f536a1037a93ba56671eb4fc6bce1b846 100644 (file)
@@ -296,7 +296,7 @@ qemuMonitorTestIO(virNetSocketPtr sock,
          */
         t1 = test->incoming;
         while ((t2 = strstr(t1, "\n")) ||
-                (!test->json && (t2 = strstr(t1, "\r")))) {
+                (test->agent && (t2 = strstr(t1, "\r")))) {
             *t2 = '\0';
 
             if (qemuMonitorTestProcessCommand(test, t1) < 0) {