1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

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:
Ján Tomko 2019-12-12 18:17:08 +01:00
parent 1100931f8d
commit 20071c9f99
10 changed files with 28 additions and 78 deletions

View File

@ -2104,11 +2104,6 @@ qemuDomainRebootMonitor(virQEMUDriverPtr driver,
if (virDomainObjCheckActive(vm) < 0)
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);
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorSystemPowerdown(priv->mon);

View File

@ -36,7 +36,7 @@
#include "cpu/cpu_map.h"
#include "virstring.h"
#if WITH_QEMU && WITH_YAJL
#if WITH_QEMU
# include "testutilsqemu.h"
# include "qemumonitortestutils.h"
# define LIBVIRT_QEMU_CAPSPRIV_H_ALLOW
@ -62,7 +62,7 @@ struct data {
int result;
};
#if WITH_QEMU && WITH_YAJL
#if WITH_QEMU
static virQEMUDriver driver;
#endif
@ -465,7 +465,7 @@ typedef enum {
JSON_MODELS_REQUIRED,
} cpuTestCPUIDJson;
#if WITH_QEMU && WITH_YAJL
#if WITH_QEMU
static virQEMUCapsPtr
cpuTestMakeQEMUCaps(const struct data *data)
{
@ -547,7 +547,7 @@ cpuTestGetCPUModels(const struct data *data,
return 0;
}
#else /* if WITH_QEMU && WITH_YAJL */
#else /* if WITH_QEMU */
static int
cpuTestGetCPUModels(const struct data *data,
@ -871,7 +871,7 @@ cpuTestUpdateLive(const void *arg)
}
#if WITH_QEMU && WITH_YAJL
#if WITH_QEMU
static int
cpuTestJSONCPUID(const void *arg)
{
@ -970,7 +970,7 @@ mymain(void)
virDomainCapsCPUModelsPtr ppc_models = NULL;
int ret = 0;
#if WITH_QEMU && WITH_YAJL
#if WITH_QEMU
if (qemuTestDriverInit(&driver) < 0)
return EXIT_FAILURE;
@ -1057,7 +1057,7 @@ mymain(void)
host "/" cpu " (" #models ")", \
host, cpu, models, 0, result)
#if WITH_QEMU && WITH_YAJL
#if WITH_QEMU
# define DO_TEST_JSON(arch, host, json) \
do { \
if (json == JSON_MODELS) { \
@ -1271,7 +1271,7 @@ mymain(void)
DO_TEST_CPUID(VIR_ARCH_X86_64, "Ice-Lake-Server", JSON_MODELS);
cleanup:
#if WITH_QEMU && WITH_YAJL
#if WITH_QEMU
qemuTestDriverFree(&driver);
#endif

View File

@ -1426,11 +1426,6 @@ mymain(void)
{
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)
return EXIT_FAILURE;

View File

@ -18,24 +18,22 @@
#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 "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"
# 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
# include "conf/snapshot_conf_priv.h"
# define VIR_FROM_THIS VIR_FROM_NONE
#define VIR_FROM_THIS VIR_FROM_NONE
VIR_LOG_INIT("tests.storagetest");
@ -733,7 +731,7 @@ mymain(void)
virTestCounterReset("qemu storage source xml->json->xml ");
# define TEST_JSON_FORMAT(tpe, xmlstr) \
#define TEST_JSON_FORMAT(tpe, xmlstr) \
do { \
xmljsonxmldata.type = tpe; \
xmljsonxmldata.xml = xmlstr; \
@ -742,7 +740,7 @@ mymain(void)
ret = -1; \
} 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_FILE, "<source file='/path/to/file'/>\n");
@ -798,7 +796,7 @@ mymain(void)
" <host name='example.com' port='9999'/>\n"
"</source>\n");
# define TEST_DISK_TO_JSON_FULL(nme, fl) \
#define TEST_DISK_TO_JSON_FULL(nme, fl) \
do { \
diskxmljsondata.name = nme; \
diskxmljsondata.props = NULL; \
@ -821,7 +819,7 @@ mymain(void)
testQemuDiskXMLToPropsClear(&diskxmljsondata); \
} 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())) {
ret = -1;
@ -877,7 +875,7 @@ mymain(void)
TEST_DISK_TO_JSON("block-raw-noopts");
TEST_DISK_TO_JSON("block-raw-reservations");
# define TEST_IMAGE_CREATE(testname, testbacking) \
#define TEST_IMAGE_CREATE(testname, testbacking) \
do { \
imagecreatedata.name = testname; \
imagecreatedata.backingname = testbacking; \
@ -912,7 +910,7 @@ mymain(void)
TEST_IMAGE_CREATE("network-ssh-qcow2", NULL);
TEST_IMAGE_CREATE("network-sheepdog-qcow2", NULL);
# define TEST_BITMAP_DETECT(testname) \
#define TEST_BITMAP_DETECT(testname) \
do { \
if (virTestRun("bitmap detect " testname, \
testQemuDetectBitmaps, testname) < 0) \
@ -923,7 +921,7 @@ mymain(void)
TEST_BITMAP_DETECT("synthetic");
TEST_BITMAP_DETECT("snapshots");
# define TEST_BACKUP_BITMAP_CALCULATE(testname, source, incrbackup, named) \
#define TEST_BACKUP_BITMAP_CALCULATE(testname, source, incrbackup, named) \
do { \
backupbitmapcalcdata.name = testname; \
backupbitmapcalcdata.chain = source; \
@ -952,12 +950,4 @@ mymain(void)
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
#else
static int
mymain(void)
{
return EXIT_AM_SKIP;
}
#endif
VIR_TEST_MAIN(mymain)

View File

@ -212,11 +212,6 @@ mymain(void)
{
testQemuData data;
#if !WITH_YAJL
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
return EXIT_AM_SKIP;
#endif
virEventRegisterDefaultImpl();
if (testQemuDataInit(&data) < 0)

View File

@ -201,11 +201,6 @@ mymain(void)
{
testQemuData data;
#if !WITH_YAJL
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
return EXIT_AM_SKIP;
#endif
virEventRegisterDefaultImpl();
if (testQemuDataInit(&data) < 0)

View File

@ -76,11 +76,6 @@ mymain(void)
int ret = 0;
testQemuCommandBuildObjectFromJSONData data1;
#if !WITH_YAJL
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
return EXIT_AM_SKIP;
#endif
virTestCounterReset("testQemuCommandBuildFromJSON");
#define DO_TEST_COMMAND_FROM_JSON(PROPS, ARRAYFUNC, EXPECT) \

View File

@ -599,11 +599,6 @@ mymain(void)
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)
return EXIT_FAILURE;

View File

@ -201,11 +201,6 @@ mymain(void)
virQEMUDriver driver;
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)
return EXIT_FAILURE;

View File

@ -2991,11 +2991,6 @@ mymain(void)
virJSONValuePtr metaschema = 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)
return EXIT_FAILURE;