mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
tests: qemuhotplug: Use schema testing with qemuMonitorTestNewFromFileFull
Pass in the schema since it works with the 'file' test now. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
1a77e0032b
commit
6f15c82fda
@ -27,6 +27,7 @@
|
|||||||
#include "qemumonitortestutils.h"
|
#include "qemumonitortestutils.h"
|
||||||
#include "testutils.h"
|
#include "testutils.h"
|
||||||
#include "testutilsqemu.h"
|
#include "testutilsqemu.h"
|
||||||
|
#include "testutilsqemuschema.h"
|
||||||
#include "virerror.h"
|
#include "virerror.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "virthread.h"
|
#include "virthread.h"
|
||||||
@ -394,7 +395,8 @@ testQemuHotplugCpuDataFree(struct testQemuHotplugCpuData *data)
|
|||||||
|
|
||||||
static struct testQemuHotplugCpuData *
|
static struct testQemuHotplugCpuData *
|
||||||
testQemuHotplugCpuPrepare(const char *test,
|
testQemuHotplugCpuPrepare(const char *test,
|
||||||
bool modern)
|
bool modern,
|
||||||
|
virHashTablePtr qmpschema)
|
||||||
{
|
{
|
||||||
qemuDomainObjPrivatePtr priv = NULL;
|
qemuDomainObjPrivatePtr priv = NULL;
|
||||||
virCapsPtr caps = NULL;
|
virCapsPtr caps = NULL;
|
||||||
@ -435,7 +437,7 @@ testQemuHotplugCpuPrepare(const char *test,
|
|||||||
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS);
|
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS);
|
||||||
|
|
||||||
if (!(data->mon = qemuMonitorTestNewFromFileFull(data->file_json_monitor,
|
if (!(data->mon = qemuMonitorTestNewFromFileFull(data->file_json_monitor,
|
||||||
&driver, data->vm, NULL)))
|
&driver, data->vm, qmpschema)))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
priv->mon = qemuMonitorTestGetMonitor(data->mon);
|
priv->mon = qemuMonitorTestGetMonitor(data->mon);
|
||||||
@ -499,6 +501,7 @@ struct testQemuHotplugCpuParams {
|
|||||||
bool state;
|
bool state;
|
||||||
bool modern;
|
bool modern;
|
||||||
bool fail;
|
bool fail;
|
||||||
|
virHashTablePtr schema;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -510,7 +513,8 @@ testQemuHotplugCpuGroup(const void *opaque)
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (!(data = testQemuHotplugCpuPrepare(params->test, params->modern)))
|
if (!(data = testQemuHotplugCpuPrepare(params->test, params->modern,
|
||||||
|
params->schema)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
rc = qemuDomainSetVcpusInternal(&driver, data->vm, data->vm->def,
|
rc = qemuDomainSetVcpusInternal(&driver, data->vm, data->vm->def,
|
||||||
@ -546,7 +550,8 @@ testQemuHotplugCpuIndividual(const void *opaque)
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (!(data = testQemuHotplugCpuPrepare(params->test, params->modern)))
|
if (!(data = testQemuHotplugCpuPrepare(params->test, params->modern,
|
||||||
|
params->schema)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virBitmapParse(params->cpumap, &map, 128) < 0)
|
if (virBitmapParse(params->cpumap, &map, 128) < 0)
|
||||||
@ -580,6 +585,7 @@ testQemuHotplugCpuIndividual(const void *opaque)
|
|||||||
static int
|
static int
|
||||||
mymain(void)
|
mymain(void)
|
||||||
{
|
{
|
||||||
|
VIR_AUTOPTR(virHashTable) qmpschema = NULL;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
struct qemuHotplugTestData data = {0};
|
struct qemuHotplugTestData data = {0};
|
||||||
struct testQemuHotplugCpuParams cpudata;
|
struct testQemuHotplugCpuParams cpudata;
|
||||||
@ -604,6 +610,13 @@ mymain(void)
|
|||||||
if (!(driver.domainEventState = virObjectEventStateNew()))
|
if (!(driver.domainEventState = virObjectEventStateNew()))
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
|
if (!(qmpschema = testQEMUSchemaLoad())) {
|
||||||
|
VIR_TEST_VERBOSE("failed to load qapi schema\n");
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
cpudata.schema = qmpschema;
|
||||||
|
|
||||||
driver.lockManager = virLockManagerPluginNew("nop", "qemu",
|
driver.lockManager = virLockManagerPluginNew("nop", "qemu",
|
||||||
driver.config->configBaseDir,
|
driver.config->configBaseDir,
|
||||||
0);
|
0);
|
||||||
|
Loading…
Reference in New Issue
Block a user