]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemumonitorjsontest: chardev: Remove need to allow unused commands
authorPeter Krempa <pkrempa@redhat.com>
Tue, 8 Feb 2022 15:11:06 +0000 (16:11 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 14 Feb 2022 12:14:00 +0000 (13:14 +0100)
Don't add the command to the test monitor when we don't expect to invoke
it rather than bypassing the test monitor.

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

index 7987182a82bda7e2a4f05acc07e8a6f627f70f23..b7937a60468cad719b370d08a22a2d888f8e044d 100644 (file)
@@ -659,9 +659,8 @@ qemuMonitorJSONTestAttachOneChardev(virDomainXMLOption *xmlopt,
 
     fulllabel = g_strdup_printf("qemuMonitorJSONTestAttachChardev(%s)", label);
 
-    qemuMonitorTestAllowUnusedCommands(test);
-
-    if (qemuMonitorTestAddItemExpect(test, "chardev-add",
+    if (expectargs &&
+        qemuMonitorTestAddItemExpect(test, "chardev-add",
                                      expectargs, true, jsonreply) < 0)
         return -1;
 
@@ -784,10 +783,10 @@ qemuMonitorJSONTestAttachChardev(virDomainXMLOption *xmlopt,
                                     "data':{'type':'vdagent'}}}");
 
     chr = (virDomainChrSourceDef) { .type = VIR_DOMAIN_CHR_TYPE_PIPE };
-    CHECK("pipe", true, "");
+    CHECK("pipe", true, NULL);
 
     chr = (virDomainChrSourceDef) { .type = VIR_DOMAIN_CHR_TYPE_STDIO };
-    CHECK("stdio", true, "");
+    CHECK("stdio", true, NULL);
 #undef CHECK
 
     return ret;