mirror of https://gitee.com/openkylin/libvirt.git
Remove redundant usage of WITH_YAJL
As of commit 2a00ef6e71
which
was released in v5.2.0, we require YAJL to build the QEMU driver.
Remove the checks from code that requires the QEMU driver
or checks that also check for WITH_QEMU.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
1100931f8d
commit
20071c9f99
|
@ -2104,11 +2104,6 @@ qemuDomainRebootMonitor(virQEMUDriverPtr driver,
|
||||||
if (virDomainObjCheckActive(vm) < 0)
|
if (virDomainObjCheckActive(vm) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
#if !WITH_YAJL
|
|
||||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
|
||||||
_("ACPI reboot is not supported without the JSON monitor"));
|
|
||||||
goto endjob;
|
|
||||||
#endif
|
|
||||||
qemuDomainSetFakeReboot(driver, vm, isReboot);
|
qemuDomainSetFakeReboot(driver, vm, isReboot);
|
||||||
qemuDomainObjEnterMonitor(driver, vm);
|
qemuDomainObjEnterMonitor(driver, vm);
|
||||||
ret = qemuMonitorSystemPowerdown(priv->mon);
|
ret = qemuMonitorSystemPowerdown(priv->mon);
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include "cpu/cpu_map.h"
|
#include "cpu/cpu_map.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
|
|
||||||
#if WITH_QEMU && WITH_YAJL
|
#if WITH_QEMU
|
||||||
# include "testutilsqemu.h"
|
# include "testutilsqemu.h"
|
||||||
# include "qemumonitortestutils.h"
|
# include "qemumonitortestutils.h"
|
||||||
# define LIBVIRT_QEMU_CAPSPRIV_H_ALLOW
|
# define LIBVIRT_QEMU_CAPSPRIV_H_ALLOW
|
||||||
|
@ -62,7 +62,7 @@ struct data {
|
||||||
int result;
|
int result;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if WITH_QEMU && WITH_YAJL
|
#if WITH_QEMU
|
||||||
static virQEMUDriver driver;
|
static virQEMUDriver driver;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -465,7 +465,7 @@ typedef enum {
|
||||||
JSON_MODELS_REQUIRED,
|
JSON_MODELS_REQUIRED,
|
||||||
} cpuTestCPUIDJson;
|
} cpuTestCPUIDJson;
|
||||||
|
|
||||||
#if WITH_QEMU && WITH_YAJL
|
#if WITH_QEMU
|
||||||
static virQEMUCapsPtr
|
static virQEMUCapsPtr
|
||||||
cpuTestMakeQEMUCaps(const struct data *data)
|
cpuTestMakeQEMUCaps(const struct data *data)
|
||||||
{
|
{
|
||||||
|
@ -547,7 +547,7 @@ cpuTestGetCPUModels(const struct data *data,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* if WITH_QEMU && WITH_YAJL */
|
#else /* if WITH_QEMU */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cpuTestGetCPUModels(const struct data *data,
|
cpuTestGetCPUModels(const struct data *data,
|
||||||
|
@ -871,7 +871,7 @@ cpuTestUpdateLive(const void *arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if WITH_QEMU && WITH_YAJL
|
#if WITH_QEMU
|
||||||
static int
|
static int
|
||||||
cpuTestJSONCPUID(const void *arg)
|
cpuTestJSONCPUID(const void *arg)
|
||||||
{
|
{
|
||||||
|
@ -970,7 +970,7 @@ mymain(void)
|
||||||
virDomainCapsCPUModelsPtr ppc_models = NULL;
|
virDomainCapsCPUModelsPtr ppc_models = NULL;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
#if WITH_QEMU && WITH_YAJL
|
#if WITH_QEMU
|
||||||
if (qemuTestDriverInit(&driver) < 0)
|
if (qemuTestDriverInit(&driver) < 0)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
|
@ -1057,7 +1057,7 @@ mymain(void)
|
||||||
host "/" cpu " (" #models ")", \
|
host "/" cpu " (" #models ")", \
|
||||||
host, cpu, models, 0, result)
|
host, cpu, models, 0, result)
|
||||||
|
|
||||||
#if WITH_QEMU && WITH_YAJL
|
#if WITH_QEMU
|
||||||
# define DO_TEST_JSON(arch, host, json) \
|
# define DO_TEST_JSON(arch, host, json) \
|
||||||
do { \
|
do { \
|
||||||
if (json == JSON_MODELS) { \
|
if (json == JSON_MODELS) { \
|
||||||
|
@ -1271,7 +1271,7 @@ mymain(void)
|
||||||
DO_TEST_CPUID(VIR_ARCH_X86_64, "Ice-Lake-Server", JSON_MODELS);
|
DO_TEST_CPUID(VIR_ARCH_X86_64, "Ice-Lake-Server", JSON_MODELS);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
#if WITH_QEMU && WITH_YAJL
|
#if WITH_QEMU
|
||||||
qemuTestDriverFree(&driver);
|
qemuTestDriverFree(&driver);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1426,11 +1426,6 @@ mymain(void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
#if !WITH_YAJL
|
|
||||||
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
|
|
||||||
return EXIT_AM_SKIP;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (qemuTestDriverInit(&driver) < 0)
|
if (qemuTestDriverInit(&driver) < 0)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
|
|
|
@ -18,24 +18,22 @@
|
||||||
|
|
||||||
|
|
||||||
#include "testutils.h"
|
#include "testutils.h"
|
||||||
|
#include "testutilsqemu.h"
|
||||||
|
#include "testutilsqemuschema.h"
|
||||||
|
#include "virstoragefile.h"
|
||||||
|
#include "virstring.h"
|
||||||
|
#include "virlog.h"
|
||||||
|
#include "qemu/qemu_block.h"
|
||||||
|
#include "qemu/qemu_qapi.h"
|
||||||
|
#include "qemu/qemu_monitor_json.h"
|
||||||
|
#include "qemu/qemu_backup.h"
|
||||||
|
|
||||||
#if WITH_YAJL
|
#include "qemu/qemu_command.h"
|
||||||
# include "testutilsqemu.h"
|
|
||||||
# include "testutilsqemuschema.h"
|
|
||||||
# include "virstoragefile.h"
|
|
||||||
# include "virstring.h"
|
|
||||||
# include "virlog.h"
|
|
||||||
# include "qemu/qemu_block.h"
|
|
||||||
# include "qemu/qemu_qapi.h"
|
|
||||||
# include "qemu/qemu_monitor_json.h"
|
|
||||||
# include "qemu/qemu_backup.h"
|
|
||||||
|
|
||||||
# include "qemu/qemu_command.h"
|
#define LIBVIRT_SNAPSHOT_CONF_PRIV_H_ALLOW
|
||||||
|
#include "conf/snapshot_conf_priv.h"
|
||||||
|
|
||||||
# define LIBVIRT_SNAPSHOT_CONF_PRIV_H_ALLOW
|
#define VIR_FROM_THIS VIR_FROM_NONE
|
||||||
# include "conf/snapshot_conf_priv.h"
|
|
||||||
|
|
||||||
# define VIR_FROM_THIS VIR_FROM_NONE
|
|
||||||
|
|
||||||
VIR_LOG_INIT("tests.storagetest");
|
VIR_LOG_INIT("tests.storagetest");
|
||||||
|
|
||||||
|
@ -733,7 +731,7 @@ mymain(void)
|
||||||
|
|
||||||
virTestCounterReset("qemu storage source xml->json->xml ");
|
virTestCounterReset("qemu storage source xml->json->xml ");
|
||||||
|
|
||||||
# define TEST_JSON_FORMAT(tpe, xmlstr) \
|
#define TEST_JSON_FORMAT(tpe, xmlstr) \
|
||||||
do { \
|
do { \
|
||||||
xmljsonxmldata.type = tpe; \
|
xmljsonxmldata.type = tpe; \
|
||||||
xmljsonxmldata.xml = xmlstr; \
|
xmljsonxmldata.xml = xmlstr; \
|
||||||
|
@ -742,7 +740,7 @@ mymain(void)
|
||||||
ret = -1; \
|
ret = -1; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
# define TEST_JSON_FORMAT_NET(xmlstr) \
|
#define TEST_JSON_FORMAT_NET(xmlstr) \
|
||||||
TEST_JSON_FORMAT(VIR_STORAGE_TYPE_NETWORK, xmlstr)
|
TEST_JSON_FORMAT(VIR_STORAGE_TYPE_NETWORK, xmlstr)
|
||||||
|
|
||||||
TEST_JSON_FORMAT(VIR_STORAGE_TYPE_FILE, "<source file='/path/to/file'/>\n");
|
TEST_JSON_FORMAT(VIR_STORAGE_TYPE_FILE, "<source file='/path/to/file'/>\n");
|
||||||
|
@ -798,7 +796,7 @@ mymain(void)
|
||||||
" <host name='example.com' port='9999'/>\n"
|
" <host name='example.com' port='9999'/>\n"
|
||||||
"</source>\n");
|
"</source>\n");
|
||||||
|
|
||||||
# define TEST_DISK_TO_JSON_FULL(nme, fl) \
|
#define TEST_DISK_TO_JSON_FULL(nme, fl) \
|
||||||
do { \
|
do { \
|
||||||
diskxmljsondata.name = nme; \
|
diskxmljsondata.name = nme; \
|
||||||
diskxmljsondata.props = NULL; \
|
diskxmljsondata.props = NULL; \
|
||||||
|
@ -821,7 +819,7 @@ mymain(void)
|
||||||
testQemuDiskXMLToPropsClear(&diskxmljsondata); \
|
testQemuDiskXMLToPropsClear(&diskxmljsondata); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
# define TEST_DISK_TO_JSON(nme) TEST_DISK_TO_JSON_FULL(nme, false)
|
#define TEST_DISK_TO_JSON(nme) TEST_DISK_TO_JSON_FULL(nme, false)
|
||||||
|
|
||||||
if (!(diskxmljsondata.schema = testQEMUSchemaLoad())) {
|
if (!(diskxmljsondata.schema = testQEMUSchemaLoad())) {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
@ -877,7 +875,7 @@ mymain(void)
|
||||||
TEST_DISK_TO_JSON("block-raw-noopts");
|
TEST_DISK_TO_JSON("block-raw-noopts");
|
||||||
TEST_DISK_TO_JSON("block-raw-reservations");
|
TEST_DISK_TO_JSON("block-raw-reservations");
|
||||||
|
|
||||||
# define TEST_IMAGE_CREATE(testname, testbacking) \
|
#define TEST_IMAGE_CREATE(testname, testbacking) \
|
||||||
do { \
|
do { \
|
||||||
imagecreatedata.name = testname; \
|
imagecreatedata.name = testname; \
|
||||||
imagecreatedata.backingname = testbacking; \
|
imagecreatedata.backingname = testbacking; \
|
||||||
|
@ -912,7 +910,7 @@ mymain(void)
|
||||||
TEST_IMAGE_CREATE("network-ssh-qcow2", NULL);
|
TEST_IMAGE_CREATE("network-ssh-qcow2", NULL);
|
||||||
TEST_IMAGE_CREATE("network-sheepdog-qcow2", NULL);
|
TEST_IMAGE_CREATE("network-sheepdog-qcow2", NULL);
|
||||||
|
|
||||||
# define TEST_BITMAP_DETECT(testname) \
|
#define TEST_BITMAP_DETECT(testname) \
|
||||||
do { \
|
do { \
|
||||||
if (virTestRun("bitmap detect " testname, \
|
if (virTestRun("bitmap detect " testname, \
|
||||||
testQemuDetectBitmaps, testname) < 0) \
|
testQemuDetectBitmaps, testname) < 0) \
|
||||||
|
@ -923,7 +921,7 @@ mymain(void)
|
||||||
TEST_BITMAP_DETECT("synthetic");
|
TEST_BITMAP_DETECT("synthetic");
|
||||||
TEST_BITMAP_DETECT("snapshots");
|
TEST_BITMAP_DETECT("snapshots");
|
||||||
|
|
||||||
# define TEST_BACKUP_BITMAP_CALCULATE(testname, source, incrbackup, named) \
|
#define TEST_BACKUP_BITMAP_CALCULATE(testname, source, incrbackup, named) \
|
||||||
do { \
|
do { \
|
||||||
backupbitmapcalcdata.name = testname; \
|
backupbitmapcalcdata.name = testname; \
|
||||||
backupbitmapcalcdata.chain = source; \
|
backupbitmapcalcdata.chain = source; \
|
||||||
|
@ -952,12 +950,4 @@ mymain(void)
|
||||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
static int
|
|
||||||
mymain(void)
|
|
||||||
{
|
|
||||||
return EXIT_AM_SKIP;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VIR_TEST_MAIN(mymain)
|
VIR_TEST_MAIN(mymain)
|
||||||
|
|
|
@ -212,11 +212,6 @@ mymain(void)
|
||||||
{
|
{
|
||||||
testQemuData data;
|
testQemuData data;
|
||||||
|
|
||||||
#if !WITH_YAJL
|
|
||||||
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
|
|
||||||
return EXIT_AM_SKIP;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
virEventRegisterDefaultImpl();
|
virEventRegisterDefaultImpl();
|
||||||
|
|
||||||
if (testQemuDataInit(&data) < 0)
|
if (testQemuDataInit(&data) < 0)
|
||||||
|
|
|
@ -201,11 +201,6 @@ mymain(void)
|
||||||
{
|
{
|
||||||
testQemuData data;
|
testQemuData data;
|
||||||
|
|
||||||
#if !WITH_YAJL
|
|
||||||
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
|
|
||||||
return EXIT_AM_SKIP;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
virEventRegisterDefaultImpl();
|
virEventRegisterDefaultImpl();
|
||||||
|
|
||||||
if (testQemuDataInit(&data) < 0)
|
if (testQemuDataInit(&data) < 0)
|
||||||
|
|
|
@ -76,11 +76,6 @@ mymain(void)
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
testQemuCommandBuildObjectFromJSONData data1;
|
testQemuCommandBuildObjectFromJSONData data1;
|
||||||
|
|
||||||
#if !WITH_YAJL
|
|
||||||
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
|
|
||||||
return EXIT_AM_SKIP;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
virTestCounterReset("testQemuCommandBuildFromJSON");
|
virTestCounterReset("testQemuCommandBuildFromJSON");
|
||||||
|
|
||||||
#define DO_TEST_COMMAND_FROM_JSON(PROPS, ARRAYFUNC, EXPECT) \
|
#define DO_TEST_COMMAND_FROM_JSON(PROPS, ARRAYFUNC, EXPECT) \
|
||||||
|
|
|
@ -599,11 +599,6 @@ mymain(void)
|
||||||
|
|
||||||
setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1);
|
setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1);
|
||||||
|
|
||||||
#if !WITH_YAJL
|
|
||||||
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
|
|
||||||
return EXIT_AM_SKIP;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (qemuTestDriverInit(&driver) < 0)
|
if (qemuTestDriverInit(&driver) < 0)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
|
|
|
@ -201,11 +201,6 @@ mymain(void)
|
||||||
virQEMUDriver driver;
|
virQEMUDriver driver;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
#if !WITH_YAJL
|
|
||||||
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
|
|
||||||
return EXIT_AM_SKIP;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (qemuTestDriverInit(&driver) < 0)
|
if (qemuTestDriverInit(&driver) < 0)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
|
|
|
@ -2991,11 +2991,6 @@ mymain(void)
|
||||||
virJSONValuePtr metaschema = NULL;
|
virJSONValuePtr metaschema = NULL;
|
||||||
char *metaschemastr = NULL;
|
char *metaschemastr = NULL;
|
||||||
|
|
||||||
#if !WITH_YAJL
|
|
||||||
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
|
|
||||||
return EXIT_AM_SKIP;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (qemuTestDriverInit(&driver) < 0)
|
if (qemuTestDriverInit(&driver) < 0)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue