From: Akash Kulhalli Date: Wed, 10 Jun 2026 10:54:14 +0000 (+0530) Subject: qemuhotplugtest: test setvcpus async downscale X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;ds=inline;p=thirdparty%2Flibvirt.git qemuhotplugtest: test setvcpus async downscale Add async unplug coverage for the setvcpus count-based path. The test downscales an x86 domain by multiple hotpluggable vCPU entities, verifying the pending XML before completion, the final XML after DEVICE_DELETED processing, and one vcpu-removed event for each removed vCPU. Signed-off-by: Akash Kulhalli Reviewed-by: Peter Krempa --- diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index d6924202e6..60940a5df7 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -758,7 +758,7 @@ testQemuHotplugCpuAsync(const struct testQemuHotplugCpuAsyncParams *async, } -static int G_GNUC_UNUSED +static int testQemuHotplugCpuGroupAsync(const void *opaque) { return testQemuHotplugCpuAsync(opaque, true); @@ -1180,6 +1180,26 @@ mymain(void) DO_TEST_CPU_INDIVIDUAL_ASYNC("ppc64", "ppc64-modern-individual-del-async", "16-23", "vcpu16", "16-23"); + do { + const char *aliases[] = { "vcpu7", "vcpu6", "vcpu5", "vcpu4" }; + const struct testQemuHotplugCpuAsyncParams async = { + .test = "x86-modern-bulk-downscale-async", + .newcpus = 4, + .conn = conn, + .deviceDeletedAliases = aliases, + .ndeviceDeletedAliases = G_N_ELEMENTS(aliases), + .removedVcpus = "4-7", + .arch = "x86_64", + .capsLatestFiles = capsLatestFiles, + .capsCache = capsCache, + .schemaCache = schemaCache, + }; + + if (virTestRun("hotplug vcpus group async x86-modern-bulk-downscale-async", + testQemuHotplugCpuGroupAsync, &async) < 0) + ret = -1; + } while (0); + qemuTestDriverFree(&driver); virObjectUnref(data.vm); return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/qemuhotplugtestcpus/x86-modern-bulk-downscale-async-domain.xml b/tests/qemuhotplugtestcpus/x86-modern-bulk-downscale-async-domain.xml new file mode 100644 index 0000000000..513735211b --- /dev/null +++ b/tests/qemuhotplugtestcpus/x86-modern-bulk-downscale-async-domain.xml @@ -0,0 +1,42 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 8 + + + + + + + + + + + + hvm + + + + qemu64 + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + + + +