]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
testQemuHotplugCpuPrepare: Allow unused monitor commands only on failure
authorPeter Krempa <pkrempa@redhat.com>
Wed, 29 Apr 2020 16:27:00 +0000 (18:27 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 20 May 2020 06:53:29 +0000 (08:53 +0200)
Only tests expected to fail should allow unused commads as the normal
tests will consume all of them.

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

index cf87de187f152e4fab1c05f94068b2b2e0e1abaa..6f0bc98b43688e59caf9397d1c00dc86ea40386d 100644 (file)
@@ -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)