[PATCH 01/15] testQemuHotplugCpuPrepare: Allow unused monitor commands only on failure

Peter Krempa pkrempa at redhat.com
Wed Apr 29 18:49:01 UTC 2020


Only tests expected to fail should allow unused commads as the normal
tests will consume all of them.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 tests/qemuhotplugtest.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index 9a215ab303..849e7e7636 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -409,6 +409,7 @@ testQemuHotplugCpuDataFree(struct testQemuHotplugCpuData *data)
 static struct testQemuHotplugCpuData *
 testQemuHotplugCpuPrepare(const char *test,
                           bool modern,
+                          bool fail,
                           virHashTablePtr qmpschema)
 {
     qemuDomainObjPrivatePtr priv = NULL;
@@ -453,7 +454,8 @@ testQemuHotplugCpuPrepare(const char *test,
                                                      &driver, data->vm, qmpschema)))
         goto error;

-    qemuMonitorTestAllowUnusedCommands(data->mon);
+    if (fail)
+        qemuMonitorTestAllowUnusedCommands(data->mon);

     priv->mon = qemuMonitorTestGetMonitor(data->mon);
     virObjectUnlock(priv->mon);
@@ -528,7 +530,7 @@ testQemuHotplugCpuGroup(const void *opaque)
     int rc;

     if (!(data = testQemuHotplugCpuPrepare(params->test, params->modern,
-                                           params->schema)))
+                                           params->fail, params->schema)))
         return -1;

     rc = qemuDomainSetVcpusInternal(&driver, data->vm, data->vm->def,
@@ -565,7 +567,7 @@ testQemuHotplugCpuIndividual(const void *opaque)
     int rc;

     if (!(data = testQemuHotplugCpuPrepare(params->test, params->modern,
-                                           params->schema)))
+                                           params->fail, params->schema)))
         return -1;

     if (virBitmapParse(params->cpumap, &map, 128) < 0)
-- 
2.26.2




More information about the libvir-list mailing list