From e6f837f611524e315c8f1b2ad735c56521458fa3 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 8 Feb 2022 16:11:06 +0100 Subject: [PATCH] qemumonitorjsontest: chardev: Remove need to allow unused commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ján Tomko --- tests/qemumonitorjsontest.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 7987182a82..b7937a6046 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -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;