diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 8a184d271fea4b2cd1c60560bdcde884ab05df43..5f04b8b6f0d9858cbd8af6d63f2c87387c1a5709 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -112,9 +112,12 @@ testGetStatuXMLPrefixVcpus(virBufferPtr buf, virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); - while ((vcpuid = virBitmapNextSetBit(data->activeVcpus, vcpuid)) >= 0) - virBufferAsprintf(buf, "\n", - vcpuid, vcpuid + 3803519); + /* Make sure we can format the fake vcpu list. The test will fail regardles. */ + if (data->activeVcpus) { + while ((vcpuid = virBitmapNextSetBit(data->activeVcpus, vcpuid)) >= 0) + virBufferAsprintf(buf, "\n", + vcpuid, vcpuid + 3803519); + } virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n");