lib: Drop internal virXXXPtr typedefs

Historically, we declared pointer type to our types:

  typedef struct _virXXX virXXX;
  typedef virXXX *virXXXPtr;

But usefulness of such declaration is questionable, at best.
Unfortunately, we can't drop every such declaration - we have to
carry some over, because they are part of public API (e.g.
virDomainPtr). But for internal types - we can do drop them and
use what every other C project uses 'virXXX *'.

This change was generated by a very ugly shell script that
generated sed script which was then called over each file in the
repository. For the shell script refer to the cover letter:

https://listman.redhat.com/archives/libvir-list/2021-March/msg00537.html

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Michal Privoznik
2021-03-11 08:16:13 +01:00
parent c21f066d61
commit c8238579fb
734 changed files with 29338 additions and 30231 deletions

View File

@@ -10,7 +10,7 @@
void
virMacAddrGenerate(const unsigned char prefix[VIR_MAC_PREFIX_BUFLEN],
virMacAddrPtr addr)
virMacAddr *addr)
{
addr->addr[0] = prefix[0];
addr->addr[1] = prefix[1];
@@ -28,7 +28,7 @@ virUUIDGenerate(unsigned char *uuid)
return 0;
}
virCPUDefPtr
virCPUDef *
virCPUProbeHost(virArch arch)
{
return testUtilsHostCpusGetDefForArch(arch);

View File

@@ -42,7 +42,7 @@ opendir(const char *path)
}
void virMacAddrGenerate(const unsigned char prefix[VIR_MAC_PREFIX_BUFLEN],
virMacAddrPtr addr)
virMacAddr *addr)
{
addr->addr[0] = prefix[0];
addr->addr[1] = prefix[1];
@@ -62,7 +62,7 @@ int virNetDevTapCreateInBridgePort(const char *brname G_GNUC_UNUSED,
const virNetDevVPortProfile *virtPortProfile G_GNUC_UNUSED,
const virNetDevVlan *virtVlan G_GNUC_UNUSED,
virTristateBool isolatedPort G_GNUC_UNUSED,
virNetDevCoalescePtr coalesce G_GNUC_UNUSED,
virNetDevCoalesce *coalesce G_GNUC_UNUSED,
unsigned int mtu G_GNUC_UNUSED,
unsigned int *actualMTU G_GNUC_UNUSED,
unsigned int fakeflags G_GNUC_UNUSED)

View File

@@ -429,7 +429,7 @@ static int test12(const void *unused G_GNUC_UNUSED)
*/
static int test13(const void *unused G_GNUC_UNUSED)
{
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
virCommand *cmd = virCommandNew(abs_builddir "/commandhelper");
g_autofree char *outactual = NULL;
const char *outexpect = "BEGIN STDOUT\n"
"Hello World\n"
@@ -467,7 +467,7 @@ static int test13(const void *unused G_GNUC_UNUSED)
*/
static int test14(const void *unused G_GNUC_UNUSED)
{
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
virCommand *cmd = virCommandNew(abs_builddir "/commandhelper");
g_autofree char *outactual = NULL;
const char *outexpect = "BEGIN STDOUT\n"
"Hello World\n"
@@ -646,7 +646,7 @@ static int test17(const void *unused G_GNUC_UNUSED)
*/
static int test18(const void *unused G_GNUC_UNUSED)
{
virCommandPtr cmd = virCommandNewArgList("sleep", "100", NULL);
virCommand *cmd = virCommandNewArgList("sleep", "100", NULL);
g_autofree char *pidfile = virPidFileBuildPath(abs_builddir, "commandhelper");
pid_t pid;
int ret = -1;
@@ -806,7 +806,7 @@ static int
test22(const void *unused G_GNUC_UNUSED)
{
int ret = -1;
virCommandPtr cmd;
virCommand *cmd;
int status = -1;
cmd = virCommandNewArgList("/bin/sh", "-c", "exit 3", NULL);

View File

@@ -56,7 +56,7 @@ struct data {
virArch arch;
const char *host;
const char *name;
virDomainCapsCPUModelsPtr models;
virDomainCapsCPUModels *models;
const char *modelsName;
unsigned int flags;
int result;
@@ -67,13 +67,13 @@ static virQEMUDriver driver;
#endif
static virCPUDefPtr
static virCPUDef *
cpuTestLoadXML(virArch arch, const char *name)
{
char *xml = NULL;
xmlDocPtr doc = NULL;
xmlXPathContextPtr ctxt = NULL;
virCPUDefPtr cpu = NULL;
virCPUDef *cpu = NULL;
xml = g_strdup_printf("%s/cputestdata/%s-%s.xml", abs_srcdir,
virArchToString(arch), name);
@@ -91,7 +91,7 @@ cpuTestLoadXML(virArch arch, const char *name)
}
static virCPUDefPtr *
static virCPUDef **
cpuTestLoadMultiXML(virArch arch,
const char *name,
unsigned int *count)
@@ -100,7 +100,7 @@ cpuTestLoadMultiXML(virArch arch,
xmlDocPtr doc = NULL;
xmlXPathContextPtr ctxt = NULL;
xmlNodePtr *nodes = NULL;
virCPUDefPtr *cpus = NULL;
virCPUDef **cpus = NULL;
int n;
size_t i;
@@ -116,7 +116,7 @@ cpuTestLoadMultiXML(virArch arch,
goto cleanup;
}
cpus = g_new0(virCPUDefPtr, n);
cpus = g_new0(virCPUDef *, n);
for (i = 0; i < n; i++) {
ctxt->node = nodes[i];
@@ -202,8 +202,8 @@ cpuTestCompare(const void *arg)
{
const struct data *data = arg;
int ret = -1;
virCPUDefPtr host = NULL;
virCPUDefPtr cpu = NULL;
virCPUDef *host = NULL;
virCPUDef *cpu = NULL;
virCPUCompareResult result;
if (!(host = cpuTestLoadXML(data->arch, data->host)) ||
@@ -237,8 +237,8 @@ cpuTestGuestCPU(const void *arg)
{
const struct data *data = arg;
int ret = -2;
virCPUDefPtr host = NULL;
virCPUDefPtr cpu = NULL;
virCPUDef *host = NULL;
virCPUDef *cpu = NULL;
virCPUCompareResult cmpResult;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
char *result = NULL;
@@ -302,8 +302,8 @@ cpuTestBaseline(const void *arg)
{
const struct data *data = arg;
int ret = -1;
virCPUDefPtr *cpus = NULL;
virCPUDefPtr baseline = NULL;
virCPUDef **cpus = NULL;
virCPUDef *baseline = NULL;
unsigned int ncpus = 0;
char *result = NULL;
const char *suffix;
@@ -379,9 +379,9 @@ cpuTestUpdate(const void *arg)
{
const struct data *data = arg;
int ret = -1;
virCPUDefPtr host = NULL;
virCPUDefPtr migHost = NULL;
virCPUDefPtr cpu = NULL;
virCPUDef *host = NULL;
virCPUDef *migHost = NULL;
virCPUDef *cpu = NULL;
char *result = NULL;
if (!(host = cpuTestLoadXML(data->arch, data->host)) ||
@@ -412,8 +412,8 @@ cpuTestHasFeature(const void *arg)
{
const struct data *data = arg;
int ret = -1;
virCPUDefPtr host = NULL;
virCPUDataPtr hostData = NULL;
virCPUDef *host = NULL;
virCPUData *hostData = NULL;
int result;
if (!(host = cpuTestLoadXML(data->arch, data->host)))
@@ -469,13 +469,13 @@ typedef enum {
} cpuTestCPUIDJson;
#if WITH_QEMU
static virQEMUCapsPtr
static virQEMUCaps *
cpuTestMakeQEMUCaps(const struct data *data)
{
virQEMUCapsPtr qemuCaps = NULL;
qemuMonitorTestPtr testMon = NULL;
qemuMonitorCPUModelInfoPtr model = NULL;
virCPUDefPtr cpu = NULL;
virQEMUCaps *qemuCaps = NULL;
qemuMonitorTest *testMon = NULL;
qemuMonitorCPUModelInfo *model = NULL;
virCPUDef *cpu = NULL;
bool fail_no_props = true;
char *json = NULL;
@@ -532,9 +532,9 @@ cpuTestMakeQEMUCaps(const struct data *data)
static int
cpuTestGetCPUModels(const struct data *data,
virDomainCapsCPUModelsPtr *models)
virDomainCapsCPUModels **models)
{
virQEMUCapsPtr qemuCaps;
virQEMUCaps *qemuCaps;
*models = NULL;
@@ -556,7 +556,7 @@ cpuTestGetCPUModels(const struct data *data,
static int
cpuTestGetCPUModels(const struct data *data,
virDomainCapsCPUModelsPtr *models)
virDomainCapsCPUModels **models)
{
*models = NULL;
@@ -574,12 +574,12 @@ cpuTestCPUID(bool guest, const void *arg)
{
const struct data *data = arg;
int ret = -1;
virCPUDataPtr hostData = NULL;
virCPUData *hostData = NULL;
char *hostFile = NULL;
char *host = NULL;
virCPUDefPtr cpu = NULL;
virCPUDef *cpu = NULL;
char *result = NULL;
virDomainCapsCPUModelsPtr models = NULL;
virDomainCapsCPUModels *models = NULL;
hostFile = g_strdup_printf("%s/cputestdata/%s-cpuid-%s.xml", abs_srcdir,
virArchToString(data->arch), data->host);
@@ -642,7 +642,7 @@ cpuTestGuestCPUID(const void *arg)
static int
cpuTestCompareSignature(const struct data *data,
virCPUDataPtr hostData)
virCPUData *hostData)
{
g_autofree char *result = NULL;
g_autofree char *sigStr = NULL;
@@ -668,7 +668,7 @@ static int
cpuTestCPUIDSignature(const void *arg)
{
const struct data *data = arg;
virCPUDataPtr hostData = NULL;
virCPUData *hostData = NULL;
char *hostFile = NULL;
char *host = NULL;
int ret = -1;
@@ -692,8 +692,8 @@ cpuTestCPUIDSignature(const void *arg)
static int
cpuTestUpdateLiveCompare(virArch arch,
virCPUDefPtr actual,
virCPUDefPtr expected)
virCPUDef *actual,
virCPUDef *expected)
{
size_t i, j;
int ret = 0;
@@ -710,8 +710,8 @@ cpuTestUpdateLiveCompare(virArch arch,
i = j = 0;
while (i < actual->nfeatures || j < expected->nfeatures) {
virCPUFeatureDefPtr featAct = NULL;
virCPUFeatureDefPtr featExp = NULL;
virCPUFeatureDef *featAct = NULL;
virCPUFeatureDef *featExp = NULL;
int cmp;
if (i < actual->nfeatures)
@@ -784,17 +784,17 @@ cpuTestUpdateLive(const void *arg)
{
const struct data *data = arg;
char *cpuFile = NULL;
virCPUDefPtr cpu = NULL;
virCPUDef *cpu = NULL;
char *enabledFile = NULL;
char *enabled = NULL;
virCPUDataPtr enabledData = NULL;
virCPUData *enabledData = NULL;
char *disabledFile = NULL;
char *disabled = NULL;
virCPUDataPtr disabledData = NULL;
virCPUData *disabledData = NULL;
char *expectedFile = NULL;
virCPUDefPtr expected = NULL;
virDomainCapsCPUModelsPtr hvModels = NULL;
virDomainCapsCPUModelsPtr models = NULL;
virCPUDef *expected = NULL;
virDomainCapsCPUModels *hvModels = NULL;
virDomainCapsCPUModels *models = NULL;
int ret = -1;
cpuFile = g_strdup_printf("cpuid-%s-guest", data->host);
@@ -824,7 +824,7 @@ cpuTestUpdateLive(const void *arg)
* use the CPU model from 'expected'.
*/
if (STRNEQ(cpu->model, expected->model)) {
virDomainCapsCPUModelPtr hvModel;
virDomainCapsCPUModel *hvModel;
char **blockers = NULL;
virDomainCapsCPUUsable usable = VIR_DOMCAPS_CPU_USABLE_UNKNOWN;
int rc;
@@ -881,8 +881,8 @@ static int
cpuTestJSONCPUID(const void *arg)
{
const struct data *data = arg;
virQEMUCapsPtr qemuCaps = NULL;
virCPUDefPtr cpu = NULL;
virQEMUCaps *qemuCaps = NULL;
virCPUDef *cpu = NULL;
char *result = NULL;
int ret = -1;
@@ -914,9 +914,9 @@ static int
cpuTestJSONSignature(const void *arg)
{
const struct data *data = arg;
virQEMUCapsPtr qemuCaps = NULL;
virCPUDataPtr hostData = NULL;
qemuMonitorCPUModelInfoPtr modelInfo;
virQEMUCaps *qemuCaps = NULL;
virCPUData *hostData = NULL;
qemuMonitorCPUModelInfo *modelInfo;
int ret = -1;
if (!(qemuCaps = cpuTestMakeQEMUCaps(data)))
@@ -942,10 +942,10 @@ static const char *models_list[] = { "qemu64", "core2duo", "Nehalem", NULL }
static const char *haswell_list[] = { "SandyBridge", "Haswell", NULL };
static const char *ppc_models_list[] = { "POWER6", "POWER7", "POWER8", NULL };
static virDomainCapsCPUModelsPtr
static virDomainCapsCPUModels *
cpuTestInitModels(const char **list)
{
virDomainCapsCPUModelsPtr cpus;
virDomainCapsCPUModels *cpus;
const char **model;
if (!(cpus = virDomainCapsCPUModelsNew(0)))
@@ -968,11 +968,11 @@ cpuTestInitModels(const char **list)
static int
mymain(void)
{
virDomainCapsCPUModelsPtr model486 = NULL;
virDomainCapsCPUModelsPtr nomodel = NULL;
virDomainCapsCPUModelsPtr models = NULL;
virDomainCapsCPUModelsPtr haswell = NULL;
virDomainCapsCPUModelsPtr ppc_models = NULL;
virDomainCapsCPUModels *model486 = NULL;
virDomainCapsCPUModels *nomodel = NULL;
virDomainCapsCPUModels *models = NULL;
virDomainCapsCPUModels *haswell = NULL;
virDomainCapsCPUModels *ppc_models = NULL;
int ret = 0;
#if WITH_QEMU

View File

@@ -28,7 +28,7 @@
#if WITH_QEMU || WITH_BHYVE
static int G_GNUC_NULL_TERMINATED
fillStringValues(virDomainCapsStringValuesPtr values, ...)
fillStringValues(virDomainCapsStringValues *values, ...)
{
va_list list;
const char *str;
@@ -67,16 +67,16 @@ fakeHostCPU(virArch arch)
}
static int
fillQemuCaps(virDomainCapsPtr domCaps,
fillQemuCaps(virDomainCaps *domCaps,
const char *name,
const char *arch,
const char *machine,
virQEMUDriverConfigPtr cfg)
virQEMUDriverConfig *cfg)
{
int ret = -1;
char *path = NULL;
virQEMUCapsPtr qemuCaps = NULL;
virDomainCapsLoaderPtr loader = &domCaps->os.loader;
virQEMUCaps *qemuCaps = NULL;
virDomainCapsLoader *loader = &domCaps->os.loader;
virDomainVirtType virtType;
if (fakeHostCPU(domCaps->arch) < 0)
@@ -138,12 +138,12 @@ fillQemuCaps(virDomainCapsPtr domCaps,
# include "testutilsxen.h"
static int
fillXenCaps(virDomainCapsPtr domCaps)
fillXenCaps(virDomainCaps *domCaps)
{
virFirmwarePtr *firmwares;
virFirmware **firmwares;
int ret = -1;
firmwares = g_new0(virFirmwarePtr, 2);
firmwares = g_new0(virFirmware *, 2);
firmwares[0] = g_new0(virFirmware, 1);
firmwares[1] = g_new0(virFirmware, 1);
@@ -166,9 +166,9 @@ fillXenCaps(virDomainCapsPtr domCaps)
# include "bhyve/bhyve_capabilities.h"
static int
fillBhyveCaps(virDomainCapsPtr domCaps, unsigned int *bhyve_caps)
fillBhyveCaps(virDomainCaps *domCaps, unsigned int *bhyve_caps)
{
virDomainCapsStringValuesPtr firmwares = NULL;
virDomainCapsStringValues *firmwares = NULL;
int ret = -1;
firmwares = g_new0(virDomainCapsStringValues, 1);
@@ -208,7 +208,7 @@ static int
test_virDomainCapsFormat(const void *opaque)
{
const struct testData *data = opaque;
virDomainCapsPtr domCaps = NULL;
virDomainCaps *domCaps = NULL;
char *path = NULL;
char *domCapsXML = NULL;
int ret = -1;

View File

@@ -29,8 +29,8 @@
VIR_LOG_INIT("tests.domainconftest");
static virCapsPtr caps;
static virDomainXMLOptionPtr xmlopt;
static virCaps *caps;
static virDomainXMLOption *xmlopt;
struct testGetFilesystemData {
const char *filename;
@@ -41,10 +41,10 @@ struct testGetFilesystemData {
static int testGetFilesystem(const void *opaque)
{
int ret = -1;
virDomainDefPtr def = NULL;
virDomainDef *def = NULL;
char *filename = NULL;
const struct testGetFilesystemData *data = opaque;
virDomainFSDefPtr fsdef;
virDomainFSDef *fsdef;
filename = g_strdup_printf("%s/domainconfdata/%s.xml", abs_srcdir,
data->filename);

View File

@@ -12,8 +12,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
static virCapsPtr caps;
static virDomainXMLOptionPtr xmlopt;
static virCaps *caps;
static virDomainXMLOption *xmlopt;
struct testInfo {
const char *name;
@@ -51,10 +51,10 @@ struct testCompareBackupXMLData {
};
static virDomainDiskDefPtr
static virDomainDiskDef *
testCompareBackupXMLGetFakeDomdisk(const char *dst)
{
virDomainDiskDefPtr domdisk = NULL;
virDomainDiskDef *domdisk = NULL;
if (!(domdisk = virDomainDiskDefNew(NULL)))
abort();
@@ -104,7 +104,7 @@ testCompareBackupXML(const void *opaque)
return -1;
fakedef->ndisks = backup->ndisks + 1;
fakedef->disks = g_new0(virDomainDiskDefPtr, fakedef->ndisks);
fakedef->disks = g_new0(virDomainDiskDef *, fakedef->ndisks);
for (i = 0; i < backup->ndisks; i++)
fakedef->disks[i] = testCompareBackupXMLGetFakeDomdisk(backup->disks[i].name);

View File

@@ -19,7 +19,7 @@ testCompareXMLToXMLFiles(const char *xml)
char *xmlData = NULL;
char *actual = NULL;
int ret = -1;
virInterfaceDefPtr dev = NULL;
virInterfaceDef *dev = NULL;
if (virTestLoadFile(xml, &xmlData) < 0)
goto fail;

View File

@@ -41,7 +41,7 @@
# define VIR_FROM_THIS VIR_FROM_LIBXL
static libxlDriverPrivatePtr driver;
static libxlDriverPrivate *driver;
static int
testCompareXMLToDomConfig(const char *xmlfile,
@@ -51,8 +51,8 @@ testCompareXMLToDomConfig(const char *xmlfile,
libxl_domain_config actualconfig;
libxl_domain_config expectconfig;
xentoollog_logger *log = NULL;
virPortAllocatorRangePtr gports = NULL;
virDomainDefPtr vmdef = NULL;
virPortAllocatorRange *gports = NULL;
virDomainDef *vmdef = NULL;
char *actualjson = NULL;
char *tempjson = NULL;
char *expectjson = NULL;

View File

@@ -10,9 +10,9 @@
# define VIR_FROM_THIS VIR_FROM_NONE
static virLXCDriverPtr driver;
static virLXCDriver *driver;
static int testSanitizeDef(virDomainDefPtr vmdef)
static int testSanitizeDef(virDomainDef *vmdef)
{
/* Remove UUID randomness */
if (virUUIDParse("c7a5fdbd-edaf-9455-926a-d65c16db1809", vmdef->uuid) < 0)
@@ -28,7 +28,7 @@ testCompareXMLToConfigFiles(const char *xmlfile,
int ret = -1;
char *config = NULL;
char *actualxml = NULL;
virDomainDefPtr vmdef = NULL;
virDomainDef *vmdef = NULL;
if (virTestLoadFile(configfile, &config) < 0)
goto fail;

View File

@@ -16,7 +16,7 @@
# define VIR_FROM_THIS VIR_FROM_NONE
static virLXCDriverPtr driver;
static virLXCDriver *driver;
struct testInfo {
const char *name;

View File

@@ -17,17 +17,17 @@
static int
testCompareXMLToConfFiles(const char *inxml, const char *outconf,
char *outhostsfile, dnsmasqCapsPtr caps)
char *outhostsfile, dnsmasqCaps *caps)
{
char *confactual = NULL;
char *hostsfileactual = NULL;
int ret = -1;
virNetworkDefPtr def = NULL;
virNetworkObjPtr obj = NULL;
virCommandPtr cmd = NULL;
virNetworkDef *def = NULL;
virNetworkObj *obj = NULL;
virCommand *cmd = NULL;
char *pidfile = NULL;
dnsmasqContext *dctx = NULL;
virNetworkXMLOptionPtr xmlopt = NULL;
virNetworkXMLOption *xmlopt = NULL;
if (!(xmlopt = networkDnsmasqCreateXMLConf()))
goto fail;
@@ -93,7 +93,7 @@ testCompareXMLToConfFiles(const char *inxml, const char *outconf,
typedef struct {
const char *name;
dnsmasqCapsPtr caps;
dnsmasqCaps *caps;
} testInfo;
static int
@@ -122,11 +122,11 @@ static int
mymain(void)
{
int ret = 0;
dnsmasqCapsPtr restricted
dnsmasqCaps *restricted
= dnsmasqCapsNewFromBuffer("Dnsmasq version 2.48", DNSMASQ);
dnsmasqCapsPtr full
dnsmasqCaps *full
= dnsmasqCapsNewFromBuffer("Dnsmasq version 2.63\n--bind-dynamic", DNSMASQ);
dnsmasqCapsPtr dhcpv6
dnsmasqCaps *dhcpv6
= dnsmasqCapsNewFromBuffer("Dnsmasq version 2.64\n--bind-dynamic", DNSMASQ);
#define DO_TEST(xname, xcaps) \

View File

@@ -93,7 +93,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
{
char *actualargv = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
virNetworkDefPtr def = NULL;
virNetworkDef *def = NULL;
int ret = -1;
char *actual;
g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew();

View File

@@ -29,8 +29,8 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml,
char *actual = NULL;
int ret;
testCompareNetXML2XMLResult result = TEST_COMPARE_NET_XML2XML_RESULT_SUCCESS;
virNetworkDefPtr dev = NULL;
virNetworkXMLOptionPtr xmlopt = NULL;
virNetworkDef *dev = NULL;
virNetworkXMLOption *xmlopt = NULL;
if (!(xmlopt = networkDnsmasqCreateXMLConf()))
goto cleanup;

View File

@@ -22,7 +22,7 @@ testCompareXMLToXMLFiles(const char *netxml, const char *updatexml,
char *updateXmlData = NULL;
char *actual = NULL;
int ret = -1;
virNetworkDefPtr def = NULL;
virNetworkDef *def = NULL;
if (virTestLoadFile(updatexml, &updateXmlData) < 0)
goto error;

View File

@@ -52,7 +52,7 @@ testMdevctlStartOrDefine(const char *virt_type,
const char *jsonfile)
{
g_autoptr(virNodeDeviceDef) def = NULL;
virNodeDeviceObjPtr obj = NULL;
virNodeDeviceObj *obj = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
const char *actualCmdline = NULL;
int ret = -1;
@@ -270,7 +270,7 @@ testMdevctlParse(const void *data)
}
static void
nodedevTestDriverFree(virNodeDeviceDriverStatePtr drv)
nodedevTestDriverFree(virNodeDeviceDriverState *drv)
{
if (!drv)
return;
@@ -283,10 +283,10 @@ nodedevTestDriverFree(virNodeDeviceDriverStatePtr drv)
}
/* Add a fake root 'computer' device */
static virNodeDeviceDefPtr
static virNodeDeviceDef *
fakeRootDevice(void)
{
virNodeDeviceDefPtr def = NULL;
virNodeDeviceDef *def = NULL;
def = g_new0(virNodeDeviceDef, 1);
def->caps = g_new0(virNodeDevCapsDef, 1);
@@ -299,11 +299,11 @@ fakeRootDevice(void)
* devices. For our purposes, it only needs to have a name that matches the
* parent of the mdev, and it needs a PCI address
*/
static virNodeDeviceDefPtr
static virNodeDeviceDef *
fakeParentDevice(void)
{
virNodeDeviceDefPtr def = NULL;
virNodeDevCapPCIDevPtr pci_dev;
virNodeDeviceDef *def = NULL;
virNodeDevCapPCIDev *pci_dev;
def = g_new0(virNodeDeviceDef, 1);
def->caps = g_new0(virNodeDevCapsDef, 1);
@@ -322,9 +322,9 @@ fakeParentDevice(void)
}
static int
addDevice(virNodeDeviceDefPtr def)
addDevice(virNodeDeviceDef *def)
{
virNodeDeviceObjPtr obj;
virNodeDeviceObj *obj;
if (!def)
return -1;

View File

@@ -19,8 +19,8 @@ testCompareXMLToXMLFiles(const char *xml)
char *xmlData = NULL;
char *actual = NULL;
int ret = -1;
virNodeDeviceDefPtr dev = NULL;
virNodeDevCapsDefPtr caps;
virNodeDeviceDef *dev = NULL;
virNodeDevCapsDef *caps;
if (virTestLoadFile(xml, &xmlData) < 0)
goto fail;
@@ -30,7 +30,7 @@ testCompareXMLToXMLFiles(const char *xml)
/* Calculate some things that are not read in */
for (caps = dev->caps; caps; caps = caps->next) {
virNodeDevCapDataPtr data = &caps->data;
virNodeDevCapData *data = &caps->data;
if (caps->data.type == VIR_NODE_DEV_CAP_STORAGE) {
if (data->storage.flags & VIR_NODE_DEV_CAP_STORAGE_REMOVABLE) {

View File

@@ -42,11 +42,10 @@
# endif
typedef struct _virNWFilterInst virNWFilterInst;
typedef virNWFilterInst *virNWFilterInstPtr;
struct _virNWFilterInst {
virNWFilterDefPtr *filters;
virNWFilterDef **filters;
size_t nfilters;
virNWFilterRuleInstPtr *rules;
virNWFilterRuleInst **rules;
size_t nrules;
};
@@ -168,7 +167,7 @@ virNWFilterCreateVarsFrom(GHashTable *vars1,
static void
virNWFilterRuleInstFree(virNWFilterRuleInstPtr inst)
virNWFilterRuleInstFree(virNWFilterRuleInst *inst)
{
if (!inst)
return;
@@ -179,7 +178,7 @@ virNWFilterRuleInstFree(virNWFilterRuleInstPtr inst)
static void
virNWFilterInstReset(virNWFilterInstPtr inst)
virNWFilterInstReset(virNWFilterInst *inst)
{
size_t i;
@@ -198,15 +197,15 @@ virNWFilterInstReset(virNWFilterInstPtr inst)
static int
virNWFilterDefToInst(const char *xml,
GHashTable *vars,
virNWFilterInstPtr inst);
virNWFilterInst *inst);
static int
virNWFilterRuleDefToRuleInst(virNWFilterDefPtr def,
virNWFilterRuleDefPtr rule,
virNWFilterRuleDefToRuleInst(virNWFilterDef *def,
virNWFilterRuleDef *rule,
GHashTable *vars,
virNWFilterInstPtr inst)
virNWFilterInst *inst)
{
virNWFilterRuleInstPtr ruleinst;
virNWFilterRuleInst *ruleinst;
int ret = -1;
ruleinst = g_new0(virNWFilterRuleInst, 1);
@@ -234,9 +233,9 @@ virNWFilterRuleDefToRuleInst(virNWFilterDefPtr def,
static int
virNWFilterIncludeDefToRuleInst(virNWFilterIncludeDefPtr inc,
virNWFilterIncludeDefToRuleInst(virNWFilterIncludeDef *inc,
GHashTable *vars,
virNWFilterInstPtr inst)
virNWFilterInst *inst)
{
GHashTable *tmpvars = NULL;
int ret = -1;
@@ -267,11 +266,11 @@ virNWFilterIncludeDefToRuleInst(virNWFilterIncludeDefPtr inc,
static int
virNWFilterDefToInst(const char *xml,
GHashTable *vars,
virNWFilterInstPtr inst)
virNWFilterInst *inst)
{
size_t i;
int ret = -1;
virNWFilterDefPtr def = virNWFilterDefParseFile(xml);
virNWFilterDef *def = virNWFilterDefParseFile(xml);
if (!def)
return -1;
@@ -326,7 +325,7 @@ static int testSetOneParameter(GHashTable *vars,
const char *name,
const char *value)
{
virNWFilterVarValuePtr val;
virNWFilterVarValue *val;
if ((val = virHashLookup(vars, name)) == NULL) {
val = virNWFilterVarValueCreateSimpleCopyValue(value);

View File

@@ -22,7 +22,7 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml,
{
char *actual = NULL;
int ret = -1;
virNWFilterDefPtr dev = NULL;
virNWFilterDef *dev = NULL;
virResetLastError();

View File

@@ -71,7 +71,7 @@ static int
testReadNetworkConf(const void *data G_GNUC_UNUSED)
{
int result = -1;
virDomainDefPtr def = NULL;
virDomainDef *def = NULL;
char *actual = NULL;
const char *expected =
"<domain type='openvz'>\n"

View File

@@ -38,8 +38,8 @@ virQEMUDriver driver;
static int
testQemuAgentSSHKeys(const void *data)
{
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt);
virDomainXMLOption *xmlopt = (virDomainXMLOption *)data;
qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt);
char **keys = NULL;
int nkeys = 0;
int ret = -1;
@@ -116,8 +116,8 @@ testQemuAgentSSHKeys(const void *data)
static int
testQemuAgentFSFreeze(const void *data)
{
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt);
virDomainXMLOption *xmlopt = (virDomainXMLOption *)data;
qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt);
const char *mountpoints[] = {"/fs1", "/fs2", "/fs3", "/fs4", "/fs5"};
int ret = -1;
@@ -168,8 +168,8 @@ testQemuAgentFSFreeze(const void *data)
static int
testQemuAgentFSThaw(const void *data)
{
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt);
virDomainXMLOption *xmlopt = (virDomainXMLOption *)data;
qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt);
int ret = -1;
if (!test)
@@ -218,8 +218,8 @@ testQemuAgentFSThaw(const void *data)
static int
testQemuAgentFSTrim(const void *data)
{
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt);
virDomainXMLOption *xmlopt = (virDomainXMLOption *)data;
qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt);
int ret = -1;
if (!test)
@@ -246,13 +246,13 @@ testQemuAgentFSTrim(const void *data)
static int
testQemuAgentGetFSInfoCommon(virDomainXMLOptionPtr xmlopt,
qemuMonitorTestPtr *test,
virDomainDefPtr *def)
testQemuAgentGetFSInfoCommon(virDomainXMLOption *xmlopt,
qemuMonitorTest **test,
virDomainDef **def)
{
int ret = -1;
g_autofree char *domain_filename = NULL;
qemuMonitorTestPtr ret_test = NULL;
qemuMonitorTest *ret_test = NULL;
g_autoptr(virDomainDef) ret_def = NULL;
if (!test || !def)
@@ -319,10 +319,10 @@ testQemuAgentGetFSInfoCommon(virDomainXMLOptionPtr xmlopt,
static int
testQemuAgentGetFSInfo(const void *data)
{
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
qemuMonitorTestPtr test = NULL;
virDomainDefPtr def = NULL;
qemuAgentFSInfoPtr *info = NULL;
virDomainXMLOption *xmlopt = (virDomainXMLOption *)data;
qemuMonitorTest *test = NULL;
virDomainDef *def = NULL;
qemuAgentFSInfo **info = NULL;
int ret = -1, ninfo = 0, i;
if (testQemuAgentGetFSInfoCommon(xmlopt, &test, &def) < 0)
@@ -421,8 +421,8 @@ testQemuAgentGetFSInfo(const void *data)
static int
testQemuAgentSuspend(const void *data)
{
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt);
virDomainXMLOption *xmlopt = (virDomainXMLOption *)data;
qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt);
int ret = -1;
size_t i;
@@ -471,13 +471,13 @@ struct qemuAgentShutdownTestData {
static int
qemuAgentShutdownTestMonitorHandler(qemuMonitorTestPtr test,
qemuMonitorTestItemPtr item,
qemuAgentShutdownTestMonitorHandler(qemuMonitorTest *test,
qemuMonitorTestItem *item,
const char *cmdstr)
{
struct qemuAgentShutdownTestData *data;
g_autoptr(virJSONValue) val = NULL;
virJSONValuePtr args;
virJSONValue *args;
const char *cmdname;
const char *mode;
int ret = -1;
@@ -531,8 +531,8 @@ qemuAgentShutdownTestMonitorHandler(qemuMonitorTestPtr test,
static int
testQemuAgentShutdown(const void *data)
{
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt);
virDomainXMLOption *xmlopt = (virDomainXMLOption *)data;
qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt);
struct qemuAgentShutdownTestData priv;
int ret = -1;
@@ -651,9 +651,9 @@ static const char testQemuAgentCPUArguments3[] =
static int
testQemuAgentCPU(const void *data)
{
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt);
qemuAgentCPUInfoPtr cpuinfo = NULL;
virDomainXMLOption *xmlopt = (virDomainXMLOption *)data;
qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt);
qemuAgentCPUInfo *cpuinfo = NULL;
int nvcpus;
int ret = -1;
@@ -735,8 +735,8 @@ static const char testQemuAgentArbitraryCommandResponse[] =
static int
testQemuAgentArbitraryCommand(const void *data)
{
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt);
virDomainXMLOption *xmlopt = (virDomainXMLOption *)data;
qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt);
int ret = -1;
g_autofree char *reply = NULL;
@@ -773,8 +773,8 @@ testQemuAgentArbitraryCommand(const void *data)
static int
qemuAgentTimeoutTestMonitorHandler(qemuMonitorTestPtr test G_GNUC_UNUSED,
qemuMonitorTestItemPtr item G_GNUC_UNUSED,
qemuAgentTimeoutTestMonitorHandler(qemuMonitorTest *test G_GNUC_UNUSED,
qemuMonitorTestItem *item G_GNUC_UNUSED,
const char *cmdstr G_GNUC_UNUSED)
{
return 0;
@@ -784,8 +784,8 @@ qemuAgentTimeoutTestMonitorHandler(qemuMonitorTestPtr test G_GNUC_UNUSED,
static int
testQemuAgentTimeout(const void *data)
{
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt);
virDomainXMLOption *xmlopt = (virDomainXMLOption *)data;
qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt);
g_autofree char *reply = NULL;
int ret = -1;
@@ -910,8 +910,8 @@ static const char testQemuAgentGetInterfacesResponse[] =
static int
testQemuAgentGetInterfaces(const void *data)
{
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt);
virDomainXMLOption *xmlopt = (virDomainXMLOption *)data;
qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt);
size_t i;
int ret = -1;
int ifaces_count = 0;
@@ -1059,12 +1059,12 @@ static const char testQemuAgentGetDisksResponse[] =
static int
testQemuAgentGetDisks(const void *data)
{
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt);
virDomainXMLOption *xmlopt = (virDomainXMLOption *)data;
qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt);
size_t i;
int ret = -1;
int disks_count = 0;
qemuAgentDiskInfoPtr *disks = NULL;
qemuAgentDiskInfo **disks = NULL;
if (!test)
return -1;
@@ -1209,8 +1209,8 @@ checkUserInfo(virTypedParameterPtr params,
static int
testQemuAgentUsers(const void *data)
{
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt);
virDomainXMLOption *xmlopt = (virDomainXMLOption *)data;
qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt);
virTypedParameterPtr params = NULL;
int nparams = 0;
int maxparams = 0;
@@ -1309,8 +1309,8 @@ static const char testQemuAgentOSInfoResponse2[] =
static int
testQemuAgentOSInfo(const void *data)
{
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt);
virDomainXMLOption *xmlopt = (virDomainXMLOption *)data;
qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt);
virTypedParameterPtr params = NULL;
int nparams = 0;
int maxparams = 0;
@@ -1413,8 +1413,8 @@ static const char testQemuAgentTimezoneResponse4[] =
static int
testQemuAgentTimezone(const void *data)
{
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt);
virDomainXMLOption *xmlopt = (virDomainXMLOption *)data;
qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt);
int ret = -1;
if (!test)

View File

@@ -45,7 +45,7 @@ struct testBackingXMLjsonXMLdata {
const char *xml;
bool legacy;
GHashTable *schema;
virJSONValuePtr schemaroot;
virJSONValue *schemaroot;
};
static int
@@ -135,7 +135,7 @@ static const char *testJSONtoJSONPath = abs_srcdir "/qemublocktestdata/jsontojso
struct testJSONtoJSONData {
const char *name;
GHashTable *schema;
virJSONValuePtr schemaroot;
virJSONValue *schemaroot;
};
static int
@@ -184,24 +184,24 @@ testJSONtoJSON(const void *args)
struct testQemuDiskXMLToJSONImageData {
virJSONValuePtr formatprops;
virJSONValuePtr storageprops;
virJSONValuePtr storagepropssrc;
virJSONValue *formatprops;
virJSONValue *storageprops;
virJSONValue *storagepropssrc;
char *backingstore;
};
struct testQemuDiskXMLToJSONData {
virQEMUDriverPtr driver;
virQEMUDriver *driver;
GHashTable *schema;
virJSONValuePtr schemaroot;
virJSONValue *schemaroot;
const char *name;
bool fail;
struct testQemuDiskXMLToJSONImageData *images;
size_t nimages;
virQEMUCapsPtr qemuCaps;
virQEMUCaps *qemuCaps;
};
@@ -222,9 +222,9 @@ testQemuDiskXMLToPropsClear(struct testQemuDiskXMLToJSONData *data)
static int
testQemuDiskXMLToJSONFakeSecrets(virStorageSourcePtr src)
testQemuDiskXMLToJSONFakeSecrets(virStorageSource *src)
{
qemuDomainStorageSourcePrivatePtr srcpriv;
qemuDomainStorageSourcePrivate *srcpriv;
if (!src->privateData &&
!(src->privateData = qemuDomainStorageSourcePrivateNew()))
@@ -261,8 +261,8 @@ testQemuDiskXMLToProps(const void *opaque)
{
struct testQemuDiskXMLToJSONData *data = (void *) opaque;
g_autoptr(virDomainDef) vmdef = NULL;
virDomainDiskDefPtr disk = NULL;
virStorageSourcePtr n;
virDomainDiskDef *disk = NULL;
virStorageSource *n;
g_autoptr(virJSONValue) formatProps = NULL;
g_autoptr(virJSONValue) storageProps = NULL;
g_autoptr(virJSONValue) storageSrcOnlyProps = NULL;
@@ -461,24 +461,24 @@ struct testQemuImageCreateData {
const char *name;
const char *backingname;
GHashTable *schema;
virJSONValuePtr schemaroot;
virQEMUDriverPtr driver;
virQEMUCapsPtr qemuCaps;
virJSONValue *schemaroot;
virQEMUDriver *driver;
virQEMUCaps *qemuCaps;
};
static const char *testQemuImageCreatePath = abs_srcdir "/qemublocktestdata/imagecreate/";
static virStorageSourcePtr
static virStorageSource *
testQemuImageCreateLoadDiskXML(const char *name,
virDomainXMLOptionPtr xmlopt)
virDomainXMLOption *xmlopt)
{
virDomainSnapshotDiskDefPtr diskdef = NULL;
virDomainSnapshotDiskDef *diskdef = NULL;
g_autoptr(xmlDoc) doc = NULL;
g_autoptr(xmlXPathContext) ctxt = NULL;
xmlNodePtr node;
g_autofree char *xmlpath = NULL;
virStorageSourcePtr ret = NULL;
virStorageSource *ret = NULL;
xmlpath = g_strdup_printf("%s%s.xml", testQemuImageCreatePath, name);
@@ -589,9 +589,9 @@ static const char *bitmapDetectPrefix = "qemublocktestdata/bitmap/";
static void
testQemuDetectBitmapsWorker(GHashTable *nodedata,
const char *nodename,
virBufferPtr buf)
virBuffer *buf)
{
qemuBlockNamedNodeDataPtr data;
qemuBlockNamedNodeData *data;
size_t i;
if (!(data = virHashLookup(nodedata, nodename)))
@@ -603,7 +603,7 @@ testQemuDetectBitmapsWorker(GHashTable *nodedata,
virBufferAdjustIndent(buf, 1);
for (i = 0; i < data->nbitmaps; i++) {
qemuBlockNamedNodeDataBitmapPtr bitmap = data->bitmaps[i];
qemuBlockNamedNodeDataBitmap *bitmap = data->bitmaps[i];
virBufferAsprintf(buf, "%8s: record:%d busy:%d persist:%d inconsist:%d gran:%llu dirty:%llu\n",
bitmap->name, bitmap->recording, bitmap->busy,
@@ -654,7 +654,7 @@ testQemuDetectBitmaps(const void *opaque)
static void
testQemuBitmapListPrint(const char *title,
GSList *next,
virBufferPtr buf)
virBuffer *buf)
{
if (!next)
return;
@@ -662,16 +662,16 @@ testQemuBitmapListPrint(const char *title,
virBufferAsprintf(buf, "%s\n", title);
for (; next; next = next->next) {
virStorageSourcePtr src = next->data;
virStorageSource *src = next->data;
virBufferAsprintf(buf, "%s\n", src->nodeformat);
}
}
static virStorageSourcePtr
static virStorageSource *
testQemuBackupIncrementalBitmapCalculateGetFakeImage(size_t idx)
{
virStorageSourcePtr ret = virStorageSourceNew();
virStorageSource *ret = virStorageSourceNew();
ret->id = idx;
ret->type = VIR_STORAGE_TYPE_FILE;
@@ -684,11 +684,11 @@ testQemuBackupIncrementalBitmapCalculateGetFakeImage(size_t idx)
}
static virStorageSourcePtr
static virStorageSource *
testQemuBackupIncrementalBitmapCalculateGetFakeChain(void)
{
virStorageSourcePtr ret;
virStorageSourcePtr n;
virStorageSource *ret;
virStorageSource *n;
size_t i;
n = ret = testQemuBackupIncrementalBitmapCalculateGetFakeImage(1);
@@ -702,11 +702,11 @@ testQemuBackupIncrementalBitmapCalculateGetFakeChain(void)
}
static virStorageSourcePtr
testQemuBitmapGetFakeChainEntry(virStorageSourcePtr src,
static virStorageSource *
testQemuBitmapGetFakeChainEntry(virStorageSource *src,
size_t idx)
{
virStorageSourcePtr n;
virStorageSource *n;
for (n = src; n; n = n->backingStore) {
if (n->id == idx)
@@ -721,7 +721,7 @@ static const char *backupDataPrefix = "qemublocktestdata/backupmerge/";
struct testQemuBackupIncrementalBitmapCalculateData {
const char *name;
virStorageSourcePtr chain;
virStorageSource *chain;
const char *incremental;
const char *nodedatafile;
};
@@ -773,7 +773,7 @@ static const char *checkpointDeletePrefix = "qemublocktestdata/checkpointdelete/
struct testQemuCheckpointDeleteData {
const char *name;
virStorageSourcePtr chain;
virStorageSource *chain;
const char *deletebitmap;
const char *nodedatafile;
};
@@ -828,7 +828,7 @@ testQemuCheckpointDelete(const void *opaque)
struct testQemuBlockBitmapValidateData {
const char *name;
const char *bitmapname;
virStorageSourcePtr chain;
virStorageSource *chain;
bool expect;
};
@@ -865,7 +865,7 @@ static const char *blockcopyPrefix = "qemublocktestdata/bitmapblockcopy/";
struct testQemuBlockBitmapBlockcopyData {
const char *name;
bool shallow;
virStorageSourcePtr chain;
virStorageSource *chain;
const char *nodedatafile;
};
@@ -914,9 +914,9 @@ static const char *blockcommitPrefix = "qemublocktestdata/bitmapblockcommit/";
struct testQemuBlockBitmapBlockcommitData {
const char *name;
virStorageSourcePtr top;
virStorageSourcePtr base;
virStorageSourcePtr chain;
virStorageSource *top;
virStorageSource *base;
virStorageSource *chain;
const char *nodedatafile;
};
@@ -979,7 +979,7 @@ mymain(void)
char *capslatest_x86_64 = NULL;
g_autoptr(virQEMUCaps) caps_x86_64 = NULL;
g_autoptr(GHashTable) qmp_schema_x86_64 = NULL;
virJSONValuePtr qmp_schemaroot_x86_64_blockdev_add = NULL;
virJSONValue *qmp_schemaroot_x86_64_blockdev_add = NULL;
g_autoptr(virStorageSource) bitmapSourceChain = NULL;
if (qemuTestDriverInit(&driver) < 0)

View File

@@ -32,7 +32,6 @@
#define VIR_FROM_THIS VIR_FROM_NONE
typedef struct _testQemuData testQemuData;
typedef testQemuData *testQemuDataPtr;
struct _testQemuData {
virQEMUDriver driver;
const char *inputDir;
@@ -46,7 +45,7 @@ struct _testQemuData {
static int
testQemuDataInit(testQemuDataPtr data)
testQemuDataInit(testQemuData *data)
{
if (qemuTestDriverInit(&data->driver) < 0)
return -1;
@@ -60,7 +59,7 @@ testQemuDataInit(testQemuDataPtr data)
static void
testQemuDataReset(testQemuDataPtr data)
testQemuDataReset(testQemuData *data)
{
qemuTestDriverFree(&data->driver);
}
@@ -73,7 +72,7 @@ testQemuCaps(const void *opaque)
testQemuData *data = (void *) opaque;
g_autofree char *repliesFile = NULL;
g_autofree char *capsFile = NULL;
qemuMonitorTestPtr mon = NULL;
qemuMonitorTest *mon = NULL;
g_autoptr(virQEMUCaps) capsActual = NULL;
g_autofree char *binary = NULL;
g_autofree char *actual = NULL;
@@ -176,7 +175,7 @@ doCapsTest(const char *inputDir,
const char *suffix,
void *opaque)
{
testQemuDataPtr data = (testQemuDataPtr) opaque;
testQemuData *data = (testQemuData *) opaque;
g_autofree char *title = NULL;
g_autofree char *copyTitle = NULL;

View File

@@ -27,7 +27,6 @@
typedef struct _testQemuData testQemuData;
typedef testQemuData *testQemuDataPtr;
struct _testQemuData {
const char *inputDir;
const char *outputDir;
@@ -39,7 +38,7 @@ struct _testQemuData {
};
static int
testQemuDataInit(testQemuDataPtr data)
testQemuDataInit(testQemuData *data)
{
data->outputDir = abs_srcdir "/qemucaps2xmloutdata";
@@ -48,10 +47,10 @@ testQemuDataInit(testQemuDataPtr data)
return 0;
}
static virQEMUCapsPtr
static virQEMUCaps *
testQemuGetCaps(char *caps)
{
virQEMUCapsPtr qemuCaps = NULL;
virQEMUCaps *qemuCaps = NULL;
xmlDocPtr xml;
xmlXPathContextPtr ctxt = NULL;
ssize_t i, n;
@@ -91,11 +90,11 @@ testQemuGetCaps(char *caps)
return NULL;
}
static virCapsPtr
static virCaps *
testGetCaps(char *capsData, const testQemuData *data)
{
g_autoptr(virQEMUCaps) qemuCaps = NULL;
virCapsPtr caps = NULL;
virCaps *caps = NULL;
virArch arch = virArchFromString(data->archName);
g_autofree char *binary = NULL;
@@ -166,7 +165,7 @@ doCapsTest(const char *inputDir,
const char *suffix,
void *opaque)
{
testQemuDataPtr data = (testQemuDataPtr) opaque;
testQemuData *data = (testQemuData *) opaque;
g_autofree char *title = NULL;
title = g_strdup_printf("%s (%s)", version, archName);

View File

@@ -45,7 +45,7 @@ int
main(int argc, char **argv)
{
virThread thread;
virQEMUCapsPtr caps;
virQEMUCaps *caps;
virArch host;
virArch guest;
const char *mock = VIR_TEST_MOCK("qemucapsprobe");

View File

@@ -51,12 +51,12 @@ printLineSkipEmpty(const char *line,
}
static int (*realQemuMonitorSend)(qemuMonitorPtr mon,
qemuMonitorMessagePtr msg);
static int (*realQemuMonitorSend)(qemuMonitor *mon,
qemuMonitorMessage *msg);
int
qemuMonitorSend(qemuMonitorPtr mon,
qemuMonitorMessagePtr msg)
qemuMonitorSend(qemuMonitor *mon,
qemuMonitorMessage *msg)
{
char *reformatted;
@@ -79,16 +79,16 @@ qemuMonitorSend(qemuMonitorPtr mon,
}
static int (*realQemuMonitorJSONIOProcessLine)(qemuMonitorPtr mon,
static int (*realQemuMonitorJSONIOProcessLine)(qemuMonitor *mon,
const char *line,
qemuMonitorMessagePtr msg);
qemuMonitorMessage *msg);
int
qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
qemuMonitorJSONIOProcessLine(qemuMonitor *mon,
const char *line,
qemuMonitorMessagePtr msg)
qemuMonitorMessage *msg)
{
virJSONValuePtr value = NULL;
virJSONValue *value = NULL;
char *json = NULL;
int ret;

View File

@@ -37,7 +37,7 @@ static int
testQemuCommandBuildFromJSON(const void *opaque)
{
const testQemuCommandBuildObjectFromJSONData *data = opaque;
virJSONValuePtr val = NULL;
virJSONValue *val = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
char *result = NULL;
int ret = -1;

View File

@@ -26,9 +26,9 @@
#include "virarch.h"
virCPUDefPtr
virCPUDef *
virQEMUCapsProbeHostCPU(virArch hostArch G_GNUC_UNUSED,
virDomainCapsCPUModelsPtr models G_GNUC_UNUSED)
virDomainCapsCPUModels *models G_GNUC_UNUSED)
{
const char *model = getenv("VIR_TEST_MOCK_FAKE_HOST_CPU");

View File

@@ -66,7 +66,7 @@ testCompareXMLToXMLFiles(const char *inxml,
def->parent.parent_name = g_strdup("1525111885");
}
if (flags & TEST_VDA_BITMAP) {
virDomainCheckpointDiskDefPtr disk;
virDomainCheckpointDiskDef *disk;
VIR_EXPAND_N(def->disks, def->ndisks, 1);
disk = &def->disks[0];
@@ -108,7 +108,7 @@ struct testInfo {
static long long mocktime;
static int
testCheckpointPostParse(virDomainMomentDefPtr def)
testCheckpointPostParse(virDomainMomentDef *def)
{
if (!mocktime)
return 0;

View File

@@ -91,7 +91,7 @@ struct testInfo {
static long long mocktime;
static int
testSnapshotPostParse(virDomainMomentDefPtr def)
testSnapshotPostParse(virDomainMomentDef *def)
{
if (!mocktime)
return 0;

View File

@@ -115,9 +115,9 @@ testSupportedFW(const void *opaque)
uint64_t actualInterfaces;
uint64_t expectedInterfaces = 0;
bool actualSecure;
virFirmwarePtr *expFWs = NULL;
virFirmware **expFWs = NULL;
size_t nexpFWs = 0;
virFirmwarePtr *actFWs = NULL;
virFirmware **actFWs = NULL;
size_t nactFWs = 0;
size_t i;
int ret = -1;
@@ -134,7 +134,7 @@ testSupportedFW(const void *opaque)
* Well, some images don't have a NVRAM store. In that case NULL was passed:
* ${FW}:NULL. Now iterate over expected firmwares and fix this. */
for (i = 0; i < nexpFWs; i++) {
virFirmwarePtr tmp = expFWs[i];
virFirmware *tmp = expFWs[i];
if (STREQ(tmp->nvram, "NULL"))
VIR_FREE(tmp->nvram);
@@ -163,8 +163,8 @@ testSupportedFW(const void *opaque)
}
for (i = 0; i < nactFWs; i++) {
virFirmwarePtr actFW = actFWs[i];
virFirmwarePtr expFW = NULL;
virFirmware *actFW = actFWs[i];
virFirmware *expFW = NULL;
if (i >= nexpFWs) {
fprintf(stderr, "Unexpected FW image: %s NVRAM: %s\n",

View File

@@ -41,7 +41,7 @@ init_syms(void)
}
unsigned long long
qemuDomainGetUnplugTimeout(virDomainObjPtr vm)
qemuDomainGetUnplugTimeout(virDomainObj *vm)
{
/* Wait only 100ms for DEVICE_DELETED event. Give a greater
* timeout in case of PSeries guest to be consistent with the
@@ -98,19 +98,19 @@ virFileExists(const char *path)
int
qemuProcessStartManagedPRDaemon(virDomainObjPtr vm G_GNUC_UNUSED)
qemuProcessStartManagedPRDaemon(virDomainObj *vm G_GNUC_UNUSED)
{
return 0;
}
void
qemuProcessKillManagedPRDaemon(virDomainObjPtr vm G_GNUC_UNUSED)
qemuProcessKillManagedPRDaemon(virDomainObj *vm G_GNUC_UNUSED)
{
}
int
qemuInterfaceVDPAConnect(virDomainNetDefPtr net G_GNUC_UNUSED)
qemuInterfaceVDPAConnect(virDomainNetDef *net G_GNUC_UNUSED)
{
/* need a valid fd or sendmsg won't work. Just open /dev/null */
return open("/dev/null", O_RDONLY);

View File

@@ -51,16 +51,16 @@ struct qemuHotplugTestData {
const char *const *mon;
int action;
bool keep;
virDomainObjPtr vm;
virDomainObj *vm;
bool deviceDeletedEvent;
};
static int
qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
virDomainObjPtr *vm,
qemuHotplugCreateObjects(virDomainXMLOption *xmlopt,
virDomainObj **vm,
const char *domxml)
{
qemuDomainObjPrivatePtr priv = NULL;
qemuDomainObjPrivate *priv = NULL;
const unsigned int parseFlags = 0;
if (!(*vm = virDomainObjNew(xmlopt)))
@@ -118,8 +118,8 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
}
static int
testQemuHotplugAttach(virDomainObjPtr vm,
virDomainDeviceDefPtr dev)
testQemuHotplugAttach(virDomainObj *vm,
virDomainDeviceDef *dev)
{
int ret = -1;
@@ -155,8 +155,8 @@ testQemuHotplugAttach(virDomainObjPtr vm,
}
static int
testQemuHotplugDetach(virDomainObjPtr vm,
virDomainDeviceDefPtr dev,
testQemuHotplugDetach(virDomainObj *vm,
virDomainDeviceDef *dev,
bool async)
{
int ret = -1;
@@ -180,8 +180,8 @@ testQemuHotplugDetach(virDomainObjPtr vm,
}
static int
testQemuHotplugUpdate(virDomainObjPtr vm,
virDomainDeviceDefPtr dev)
testQemuHotplugUpdate(virDomainObj *vm,
virDomainDeviceDef *dev)
{
int ret = -1;
@@ -204,7 +204,7 @@ testQemuHotplugUpdate(virDomainObjPtr vm,
}
static int
testQemuHotplugCheckResult(virDomainObjPtr vm,
testQemuHotplugCheckResult(virDomainObj *vm,
const char *expected,
const char *expectedFile,
bool fail)
@@ -248,11 +248,11 @@ testQemuHotplug(const void *data)
bool fail = test->fail;
bool keep = test->keep;
unsigned int device_parse_flags = 0;
virDomainObjPtr vm = NULL;
virDomainDeviceDefPtr dev = NULL;
virDomainObj *vm = NULL;
virDomainDeviceDef *dev = NULL;
g_autoptr(virCaps) caps = NULL;
qemuMonitorTestPtr test_mon = NULL;
qemuDomainObjPrivatePtr priv = NULL;
qemuMonitorTest *test_mon = NULL;
qemuDomainObjPrivate *priv = NULL;
domain_filename = g_strdup_printf("%s/qemuhotplugtestdomains/qemuhotplug-%s.xml",
abs_srcdir, test->domain_filename);
@@ -368,8 +368,8 @@ struct testQemuHotplugCpuData {
char *xml_dom;
virDomainObjPtr vm;
qemuMonitorTestPtr mon;
virDomainObj *vm;
qemuMonitorTest *mon;
bool modern;
};
@@ -377,8 +377,8 @@ struct testQemuHotplugCpuData {
static void
testQemuHotplugCpuDataFree(struct testQemuHotplugCpuData *data)
{
qemuDomainObjPrivatePtr priv;
qemuMonitorPtr mon;
qemuDomainObjPrivate *priv;
qemuMonitor *mon;
if (!data)
return;
@@ -412,8 +412,8 @@ testQemuHotplugCpuPrepare(const char *test,
bool fail,
GHashTable *qmpschema)
{
qemuDomainObjPrivatePtr priv = NULL;
virCapsPtr caps = NULL;
qemuDomainObjPrivate *priv = NULL;
virCaps *caps = NULL;
g_autofree char *prefix = NULL;
struct testQemuHotplugCpuData *data = NULL;

View File

@@ -36,15 +36,15 @@
typedef struct _qemuMigParamsData qemuMigParamsData;
struct _qemuMigParamsData {
virDomainXMLOptionPtr xmlopt;
virDomainXMLOption *xmlopt;
const char *name;
GHashTable *qmpschema;
};
static void
qemuMigParamsTestFormatXML(virBufferPtr buf,
qemuMigrationParamsPtr migParams)
qemuMigParamsTestFormatXML(virBuffer *buf,
qemuMigrationParams *migParams)
{
virBufferAddLit(buf, "<test>\n");
virBufferAdjustIndent(buf, 2);
@@ -96,7 +96,7 @@ qemuMigParamsTestXML(const void *opaque)
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
g_autofree char *replyFile = NULL;
g_autofree char *xmlFile = NULL;
qemuMonitorTestPtr mon = NULL;
qemuMonitorTest *mon = NULL;
g_autoptr(virJSONValue) params = NULL;
g_autoptr(qemuMigrationParams) migParams = NULL;
g_autofree char *actualXML = NULL;
@@ -139,7 +139,7 @@ qemuMigParamsTestJSON(const void *opaque)
const qemuMigParamsData *data = opaque;
g_autofree char *replyFile = NULL;
g_autofree char *jsonFile = NULL;
qemuMonitorTestPtr mon = NULL;
qemuMonitorTest *mon = NULL;
g_autoptr(virJSONValue) paramsIn = NULL;
g_autoptr(virJSONValue) paramsOut = NULL;
g_autoptr(qemuMigrationParams) migParams = NULL;

View File

@@ -58,14 +58,14 @@ tn(const char *str, ...)
struct testQemuMigrationCookieData {
const char *name;
char *inStatus;
virDomainObjPtr vm;
virDomainObj *vm;
unsigned int cookiePopulateFlags;
unsigned int cookieParseFlags;
qemuMigrationParty cookiePopulateParty;
qemuMigrationCookiePtr cookie;
qemuMigrationCookie *cookie;
char *xmlstr;
int xmlstrlen;
@@ -137,7 +137,7 @@ static int
testQemuMigrationCookieParse(const void *opaque)
{
struct testQemuMigrationCookieData *data = (struct testQemuMigrationCookieData *) opaque;
qemuDomainObjPrivatePtr priv = data->vm->privateData;
qemuDomainObjPrivate *priv = data->vm->privateData;
g_auto(virBuffer) actual = VIR_BUFFER_INITIALIZER;
if (!(data->cookie = qemuMigrationCookieParse(&driver,
@@ -318,8 +318,8 @@ testQemuMigrationCookieBlockDirtyBitmaps(const void *opaque)
return -1;
for (next = data->cookie->blockDirtyBitmaps; next; next = next->next) {
qemuMigrationBlockDirtyBitmapsDiskPtr disk = next->data;
qemuMigrationBlockDirtyBitmapsDiskBitmapPtr bitmap = disk->bitmaps->data;
qemuMigrationBlockDirtyBitmapsDisk *disk = next->data;
qemuMigrationBlockDirtyBitmapsDiskBitmap *bitmap = disk->bitmaps->data;
bitmap->persistent = VIR_TRISTATE_BOOL_YES;
}

View File

@@ -39,11 +39,10 @@
#define VIR_FROM_THIS VIR_FROM_NONE
typedef struct _testQemuMonitorJSONSimpleFuncData testQemuMonitorJSONSimpleFuncData;
typedef testQemuMonitorJSONSimpleFuncData *testQemuMonitorJSONSimpleFuncDataPtr;
struct _testQemuMonitorJSONSimpleFuncData {
const char *cmd;
int (* func) (qemuMonitorPtr mon);
virDomainXMLOptionPtr xmlopt;
int (* func) (qemuMonitor *mon);
virDomainXMLOption *xmlopt;
const char *reply;
GHashTable *schema;
bool allowDeprecated;
@@ -52,7 +51,7 @@ struct _testQemuMonitorJSONSimpleFuncData {
typedef struct _testGenericData testGenericData;
struct _testGenericData {
virDomainXMLOptionPtr xmlopt;
virDomainXMLOption *xmlopt;
GHashTable *schema;
};
@@ -153,7 +152,7 @@ static int
testQemuMonitorJSONGetStatus(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
bool running = false;
virDomainPausedReason reason = 0;
g_autoptr(qemuMonitorTest) test = NULL;
@@ -243,7 +242,7 @@ static int
testQemuMonitorJSONGetVersion(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
int ret = -1;
int major;
int minor;
@@ -346,9 +345,9 @@ static int
testQemuMonitorJSONGetMachines(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
int ret = -1;
qemuMonitorMachineInfoPtr *info;
qemuMonitorMachineInfo **info;
int ninfo = 0;
const char *null = NULL;
size_t i;
@@ -429,7 +428,7 @@ static int
testQemuMonitorJSONGetCPUDefinitions(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
g_autoptr(qemuMonitorCPUDefs) defs = NULL;
g_autoptr(qemuMonitorTest) test = NULL;
@@ -502,7 +501,7 @@ static int
testQemuMonitorJSONGetCommands(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
int ret = -1;
char **commands = NULL;
int ncommands = 0;
@@ -567,7 +566,7 @@ static int
testQemuMonitorJSONGetTPMModels(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
int ret = -1;
char **tpmmodels = NULL;
int ntpmmodels = 0;
@@ -617,8 +616,8 @@ testQemuMonitorJSONGetTPMModels(const void *opaque)
struct qemuMonitorJSONTestAttachChardevData {
qemuMonitorTestPtr test;
virDomainChrSourceDefPtr chr;
qemuMonitorTest *test;
virDomainChrSourceDef *chr;
const char *expectPty;
bool fail;
};
@@ -654,10 +653,10 @@ testQemuMonitorJSONAttachChardev(const void *opaque)
static int
qemuMonitorJSONTestAttachOneChardev(virDomainXMLOptionPtr xmlopt,
qemuMonitorJSONTestAttachOneChardev(virDomainXMLOption *xmlopt,
GHashTable *schema,
const char *label,
virDomainChrSourceDefPtr chr,
virDomainChrSourceDef *chr,
const char *expectargs,
const char *reply,
const char *expectPty,
@@ -701,7 +700,7 @@ qemuMonitorJSONTestAttachOneChardev(virDomainXMLOptionPtr xmlopt,
}
static int
qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPtr xmlopt,
qemuMonitorJSONTestAttachChardev(virDomainXMLOption *xmlopt,
GHashTable *schema)
{
virDomainChrSourceDef chr;
@@ -822,7 +821,7 @@ static int
testQemuMonitorJSONDetachChardev(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
@@ -851,9 +850,9 @@ static int
testQemuMonitorJSONGetListPaths(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
int ret = -1;
qemuMonitorJSONListPathPtr *paths;
qemuMonitorJSONListPath **paths;
int npaths = 0;
size_t i;
g_autoptr(qemuMonitorTest) test = NULL;
@@ -929,7 +928,7 @@ static int
testQemuMonitorJSONGetObjectProperty(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
qemuMonitorJSONObjectProperty prop;
g_autoptr(qemuMonitorTest) test = NULL;
@@ -969,7 +968,7 @@ static int
testQemuMonitorJSONSetObjectProperty(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
qemuMonitorJSONObjectProperty prop;
g_autoptr(qemuMonitorTest) test = NULL;
@@ -1018,7 +1017,7 @@ static int
testQemuMonitorJSONGetDeviceAliases(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
int ret = -1;
char **aliases = NULL;
const char **alias;
@@ -1078,7 +1077,7 @@ static int
testQemuMonitorJSONCPU(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
bool running = false;
virDomainPausedReason reason = 0;
g_autoptr(qemuMonitorTest) test = NULL;
@@ -1132,9 +1131,9 @@ testQemuMonitorJSONCPU(const void *opaque)
static int
testQemuMonitorJSONSimpleFunc(const void *opaque)
{
testQemuMonitorJSONSimpleFuncDataPtr data =
(testQemuMonitorJSONSimpleFuncDataPtr) opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
testQemuMonitorJSONSimpleFuncData *data =
(testQemuMonitorJSONSimpleFuncData *) opaque;
virDomainXMLOption *xmlopt = data->xmlopt;
const char *reply = data->reply;
g_autoptr(qemuMonitorTest) test = NULL;
@@ -1158,7 +1157,7 @@ static int \
testQemuMonitorJSON ## funcName(const void *opaque) \
{ \
const testQemuMonitorJSONSimpleFuncData *data = opaque; \
virDomainXMLOptionPtr xmlopt = data->xmlopt; \
virDomainXMLOption *xmlopt = data->xmlopt; \
const char *reply = data->reply; \
g_autoptr(qemuMonitorTest) test = NULL; \
\
@@ -1224,7 +1223,7 @@ static int
testQemuMonitorJSONqemuMonitorJSONNBDServerStart(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
virStorageNetHostDef server_tcp = {
.name = (char *)"localhost",
.port = 12345,
@@ -1271,7 +1270,7 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUsEqual(struct qemuMonitorQueryCpusEntr
static int
testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(qemuMonitorTestPtr test,
testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(qemuMonitorTest *test,
struct qemuMonitorQueryCpusEntry *expect,
bool fast,
size_t num)
@@ -1312,7 +1311,7 @@ static int
testQemuMonitorJSONqemuMonitorJSONQueryCPUs(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
struct qemuMonitorQueryCpusEntry expect_slow[] = {
{0, 17622, (char *) "/machine/unattached/device[0]", true},
{1, 17624, (char *) "/machine/unattached/device[1]", true},
@@ -1378,7 +1377,7 @@ static int
testQemuMonitorJSONqemuMonitorJSONQueryCPUsFast(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
struct qemuMonitorQueryCpusEntry expect_fast[] = {
{0, 17629, (char *) "/machine/unattached/device[0]", false},
{1, 17630, (char *) "/machine/unattached/device[1]", false},
@@ -1418,7 +1417,7 @@ static int
testQemuMonitorJSONqemuMonitorJSONGetBalloonInfo(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
unsigned long long currmem;
g_autoptr(qemuMonitorTest) test = NULL;
@@ -1474,7 +1473,7 @@ static int
testQemuMonitorJSONqemuMonitorJSONGetBlockInfo(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
int ret = -1;
GHashTable *blockDevices = NULL;
GHashTable *expectedBlockDevices = NULL;
@@ -1550,9 +1549,9 @@ static int
testQemuMonitorJSONqemuMonitorJSONGetAllBlockStatsInfo(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
GHashTable *blockstats = NULL;
qemuBlockStatsPtr stats;
qemuBlockStats *stats;
int ret = -1;
g_autoptr(qemuMonitorTest) test = NULL;
@@ -1712,7 +1711,7 @@ static int
testQemuMonitorJSONqemuMonitorJSONGetMigrationCacheSize(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
unsigned long long cacheSize;
g_autoptr(qemuMonitorTest) test = NULL;
@@ -1746,7 +1745,7 @@ static int
testQemuMonitorJSONqemuMonitorJSONGetMigrationStats(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
int ret = -1;
qemuMonitorMigrationStats stats, expectedStats;
char *error = NULL;
@@ -1841,7 +1840,7 @@ static int
testQemuMonitorJSONqemuMonitorJSONGetChardevInfo(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
int ret = -1;
GHashTable *info = NULL;
GHashTable *expectedInfo = NULL;
@@ -1963,7 +1962,7 @@ static int
testQemuMonitorJSONqemuMonitorJSONSetBlockIoThrottle(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
int ret = -1;
virDomainBlockIoTuneInfo info, expectedInfo;
g_autoptr(qemuMonitorTest) test = NULL;
@@ -2017,7 +2016,7 @@ static int
testQemuMonitorJSONqemuMonitorJSONGetTargetArch(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
g_autofree char *arch = NULL;
g_autoptr(qemuMonitorTest) test = NULL;
@@ -2050,7 +2049,7 @@ static int
testQemuMonitorJSONqemuMonitorJSONGetMigrationCapabilities(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
const char *cap;
g_auto(GStrv) caps = NULL;
g_autoptr(virBitmap) bitmap = NULL;
@@ -2099,7 +2098,7 @@ static int
testQemuMonitorJSONqemuMonitorJSONSendKey(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
unsigned int keycodes[] = {43, 26, 46, 32};
g_autoptr(qemuMonitorTest) test = NULL;
@@ -2121,7 +2120,7 @@ static int
testQemuMonitorJSONqemuMonitorJSONSendKeyHoldtime(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
unsigned int keycodes[] = {43, 26, 46, 32};
g_autoptr(qemuMonitorTest) test = NULL;
@@ -2150,7 +2149,7 @@ static int
testQemuMonitorJSONqemuMonitorSupportsActiveCommit(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
const char *error1 =
"{"
" \"error\": {"
@@ -2193,7 +2192,7 @@ static int
testQemuMonitorJSONqemuMonitorJSONGetDumpGuestMemoryCapability(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainXMLOption *xmlopt = data->xmlopt;
int cap;
const char *reply =
"{"
@@ -2231,7 +2230,7 @@ testQemuMonitorJSONqemuMonitorJSONGetDumpGuestMemoryCapability(const void *opaqu
struct testCPUData {
const char *name;
virDomainXMLOptionPtr xmlopt;
virDomainXMLOption *xmlopt;
GHashTable *schema;
};
@@ -2240,7 +2239,7 @@ static int
testQemuMonitorJSONGetCPUData(const void *opaque)
{
const struct testCPUData *data = opaque;
virCPUDataPtr cpuData = NULL;
virCPUData *cpuData = NULL;
char *jsonFile = NULL;
char *dataFile = NULL;
char *jsonStr = NULL;
@@ -2302,8 +2301,8 @@ static int
testQemuMonitorJSONGetNonExistingCPUData(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virCPUDataPtr cpuData = NULL;
virDomainXMLOption *xmlopt = data->xmlopt;
virCPUData *cpuData = NULL;
int rv, ret = -1;
g_autoptr(qemuMonitorTest) test = NULL;
@@ -2345,8 +2344,8 @@ static int
testQemuMonitorJSONGetIOThreads(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
qemuMonitorIOThreadInfoPtr *info;
virDomainXMLOption *xmlopt = data->xmlopt;
qemuMonitorIOThreadInfo **info;
int ninfo = 0;
int ret = -1;
size_t i;
@@ -2414,18 +2413,18 @@ testQemuMonitorJSONGetIOThreads(const void *opaque)
struct testCPUInfoData {
const char *name;
size_t maxvcpus;
virDomainXMLOptionPtr xmlopt;
virDomainXMLOption *xmlopt;
bool fast;
GHashTable *schema;
};
static char *
testQemuMonitorCPUInfoFormat(qemuMonitorCPUInfoPtr vcpus,
testQemuMonitorCPUInfoFormat(qemuMonitorCPUInfo *vcpus,
size_t nvcpus)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
qemuMonitorCPUInfoPtr vcpu;
qemuMonitorCPUInfo *vcpu;
size_t i;
for (i = 0; i < nvcpus; i++) {
@@ -2487,7 +2486,7 @@ static int
testQemuMonitorCPUInfo(const void *opaque)
{
const struct testCPUInfoData *data = opaque;
virDomainObjPtr vm = NULL;
virDomainObj *vm = NULL;
char *queryCpusFile = NULL;
char *queryHotpluggableFile = NULL;
char *dataFile = NULL;
@@ -2495,7 +2494,7 @@ testQemuMonitorCPUInfo(const void *opaque)
char *queryHotpluggableStr = NULL;
char *actual = NULL;
const char *queryCpusFunction;
qemuMonitorCPUInfoPtr vcpus = NULL;
qemuMonitorCPUInfo *vcpus = NULL;
int rc;
int ret = -1;
g_autoptr(qemuMonitorTest) test = NULL;
@@ -2563,9 +2562,9 @@ testBlockNodeNameDetectFormat(void *payload,
const char *name,
void *opaque)
{
qemuBlockNodeNameBackingChainDataPtr entry = payload;
qemuBlockNodeNameBackingChainData *entry = payload;
const char *diskalias = name;
virBufferPtr buf = opaque;
virBuffer *buf = opaque;
virBufferSetIndent(buf, 0);
@@ -2599,8 +2598,8 @@ testBlockNodeNameDetect(const void *opaque)
const char *pathprefix = "qemumonitorjsondata/qemumonitorjson-nodename-";
char *resultFile = NULL;
char *actual = NULL;
virJSONValuePtr namedNodesJson = NULL;
virJSONValuePtr blockstatsJson = NULL;
virJSONValue *namedNodesJson = NULL;
virJSONValue *blockstatsJson = NULL;
GHashTable *nodedata = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
int ret = -1;
@@ -2657,7 +2656,7 @@ static int
testQAPISchemaQuery(const void *opaque)
{
const struct testQAPISchemaData *data = opaque;
virJSONValuePtr replyobj = NULL;
virJSONValue *replyobj = NULL;
int rc;
rc = virQEMUQAPISchemaPathGet(data->query, data->schema, &replyobj);
@@ -2677,8 +2676,8 @@ testQAPISchemaValidate(const void *opaque)
{
const struct testQAPISchemaData *data = opaque;
g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER;
virJSONValuePtr schemaroot;
virJSONValuePtr json = NULL;
virJSONValue *schemaroot;
virJSONValue *json = NULL;
int ret = -1;
if (virQEMUQAPISchemaPathGet(data->query, data->schema, &schemaroot) < 0)
@@ -2724,7 +2723,7 @@ static int
testQAPISchemaObjectDeviceAdd(const void *opaque)
{
GHashTable *schema = (GHashTable *) opaque;
virJSONValuePtr entry;
virJSONValue *entry;
if (virQEMUQAPISchemaPathGet("device_add/arg-type", schema, &entry) < 0) {
fprintf(stderr, "schema for 'device_add' not found\n");
@@ -2745,8 +2744,8 @@ testQAPISchemaObjectDeviceAdd(const void *opaque)
static void
testQueryJobsPrintJob(virBufferPtr buf,
qemuMonitorJobInfoPtr job)
testQueryJobsPrintJob(virBuffer *buf,
qemuMonitorJobInfo *job)
{
virBufferAddLit(buf, "[job]\n");
virBufferAsprintf(buf, "id=%s\n", NULLSTR(job->id));
@@ -2759,7 +2758,7 @@ testQueryJobsPrintJob(virBufferPtr buf,
struct testQueryJobsData {
const char *name;
virDomainXMLOptionPtr xmlopt;
virDomainXMLOption *xmlopt;
};
@@ -2767,12 +2766,12 @@ static int
testQueryJobs(const void *opaque)
{
const struct testQueryJobsData *data = opaque;
qemuMonitorTestPtr test = qemuMonitorTestNewSimple(data->xmlopt);
qemuMonitorTest *test = qemuMonitorTestNewSimple(data->xmlopt);
g_autofree char *filenameJSON = NULL;
g_autofree char *fileJSON = NULL;
g_autofree char *filenameResult = NULL;
g_autofree char *actual = NULL;
qemuMonitorJobInfoPtr *jobs = NULL;
qemuMonitorJobInfo **jobs = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
size_t njobs = 0;
size_t i;
@@ -2923,7 +2922,7 @@ testQemuMonitorJSONqemuMonitorJSONGetCPUModelBaseline(const void *opaque)
g_autoptr(qemuMonitorTest) test = NULL;
g_autoptr(virCPUDef) cpu_a = virCPUDefNew();
g_autoptr(virCPUDef) cpu_b = virCPUDefNew();
qemuMonitorCPUModelInfoPtr baseline = NULL;
qemuMonitorCPUModelInfo *baseline = NULL;
int ret = -1;
if (!(test = qemuMonitorTestNewSchema(data->xmlopt, data->schema)))
@@ -2994,7 +2993,7 @@ mymain(void)
virQEMUDriver driver;
testQemuMonitorJSONSimpleFuncData simpleFunc;
struct testQAPISchemaData qapiData;
virJSONValuePtr metaschema = NULL;
virJSONValue *metaschema = NULL;
char *metaschemastr = NULL;
if (qemuTestDriverInit(&driver) < 0)

View File

@@ -70,26 +70,26 @@ struct _qemuMonitorTest {
size_t outgoingLength;
size_t outgoingCapacity;
virNetSocketPtr server;
virNetSocketPtr client;
virNetSocket *server;
virNetSocket *client;
virEventThread *eventThread;
qemuMonitorPtr mon;
qemuAgentPtr agent;
qemuMonitor *mon;
qemuAgent *agent;
char *tmpdir;
size_t nitems;
qemuMonitorTestItemPtr *items;
qemuMonitorTestItem **items;
virDomainObjPtr vm;
virDomainObj *vm;
GHashTable *qapischema;
};
static void
qemuMonitorTestItemFree(qemuMonitorTestItemPtr item)
qemuMonitorTestItemFree(qemuMonitorTestItem *item)
{
if (!item)
return;
@@ -107,7 +107,7 @@ qemuMonitorTestItemFree(qemuMonitorTestItemPtr item)
* Appends data for a reply to the outgoing buffer
*/
int
qemuMonitorTestAddResponse(qemuMonitorTestPtr test,
qemuMonitorTestAddResponse(qemuMonitorTest *test,
const char *response)
{
size_t want = strlen(response) + 2;
@@ -129,7 +129,7 @@ qemuMonitorTestAddResponse(qemuMonitorTestPtr test,
static int
qemuMonitorTestAddErrorResponseInternal(qemuMonitorTestPtr test,
qemuMonitorTestAddErrorResponseInternal(qemuMonitorTest *test,
const char *usermsg)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
@@ -161,7 +161,7 @@ qemuMonitorTestAddErrorResponseInternal(qemuMonitorTestPtr test,
int
qemuMonitorTestAddInvalidCommandResponse(qemuMonitorTestPtr test,
qemuMonitorTestAddInvalidCommandResponse(qemuMonitorTest *test,
const char *expectedcommand,
const char *actualcommand)
{
@@ -175,7 +175,7 @@ qemuMonitorTestAddInvalidCommandResponse(qemuMonitorTestPtr test,
int G_GNUC_PRINTF(2, 3)
qemuMonitorTestAddErrorResponse(qemuMonitorTestPtr test, const char *errmsg, ...)
qemuMonitorTestAddErrorResponse(qemuMonitorTest *test, const char *errmsg, ...)
{
va_list msgargs;
g_autofree char *msg = NULL;
@@ -222,7 +222,7 @@ qemuMonitorTestErrorInvalidCommand(const char *expectedcommand,
static int
qemuMonitorTestProcessCommand(qemuMonitorTestPtr test,
qemuMonitorTestProcessCommand(qemuMonitorTest *test,
const char *cmdstr)
{
int ret;
@@ -232,7 +232,7 @@ qemuMonitorTestProcessCommand(qemuMonitorTestPtr test,
if (test->nitems == 0) {
qemuMonitorTestError("unexpected command: '%s'", cmdstr);
} else {
qemuMonitorTestItemPtr item = test->items[0];
qemuMonitorTestItem *item = test->items[0];
ret = (item->cb)(test, item, cmdstr);
qemuMonitorTestItemFree(item);
if (VIR_DELETE_ELEMENT(test->items, 0, test->nitems) < 0)
@@ -247,11 +247,11 @@ qemuMonitorTestProcessCommand(qemuMonitorTestPtr test,
* Handles read/write of monitor data on the monitor server side
*/
static void
qemuMonitorTestIO(virNetSocketPtr sock,
qemuMonitorTestIO(virNetSocket *sock,
int events,
void *opaque)
{
qemuMonitorTestPtr test = opaque;
qemuMonitorTest *test = opaque;
bool err = false;
virMutexLock(&test->lock);
@@ -344,7 +344,7 @@ qemuMonitorTestIO(virNetSocketPtr sock,
static void
qemuMonitorTestWorker(void *opaque)
{
qemuMonitorTestPtr test = opaque;
qemuMonitorTest *test = opaque;
virMutexLock(&test->lock);
@@ -376,7 +376,7 @@ qemuMonitorTestFreeTimer(int timer G_GNUC_UNUSED,
void
qemuMonitorTestFree(qemuMonitorTestPtr test)
qemuMonitorTestFree(qemuMonitorTest *test)
{
size_t i;
int timer = -1;
@@ -449,13 +449,13 @@ qemuMonitorTestFree(qemuMonitorTestPtr test)
int
qemuMonitorTestAddHandler(qemuMonitorTestPtr test,
qemuMonitorTestAddHandler(qemuMonitorTest *test,
const char *identifier,
qemuMonitorTestResponseCallback cb,
void *opaque,
virFreeCallback freecb)
{
qemuMonitorTestItemPtr item;
qemuMonitorTestItem *item;
item = g_new0(qemuMonitorTestItem, 1);
@@ -481,14 +481,13 @@ qemuMonitorTestAddHandler(qemuMonitorTestPtr test,
}
void *
qemuMonitorTestItemGetPrivateData(qemuMonitorTestItemPtr item)
qemuMonitorTestItemGetPrivateData(qemuMonitorTestItem *item)
{
return item ? item->opaque : NULL;
}
typedef struct _qemuMonitorTestCommandArgs qemuMonitorTestCommandArgs;
typedef qemuMonitorTestCommandArgs *qemuMonitorTestCommandArgsPtr;
struct _qemuMonitorTestCommandArgs {
char *argname;
char *argval;
@@ -500,7 +499,7 @@ struct qemuMonitorTestHandlerData {
char *cmderr;
char *response;
size_t nargs;
qemuMonitorTestCommandArgsPtr args;
qemuMonitorTestCommandArgs *args;
char *expectArgs;
};
@@ -529,9 +528,9 @@ qemuMonitorTestHandlerDataFree(void *opaque)
/* Returns -1 on error, 0 if validation was successful/not necessary */
static int
qemuMonitorTestProcessCommandDefaultValidate(qemuMonitorTestPtr test,
qemuMonitorTestProcessCommandDefaultValidate(qemuMonitorTest *test,
const char *cmdname,
virJSONValuePtr args)
virJSONValue *args)
{
g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER;
@@ -577,13 +576,13 @@ qemuMonitorTestProcessCommandDefaultValidate(qemuMonitorTestPtr test,
static int
qemuMonitorTestProcessCommandDefault(qemuMonitorTestPtr test,
qemuMonitorTestItemPtr item,
qemuMonitorTestProcessCommandDefault(qemuMonitorTest *test,
qemuMonitorTestItem *item,
const char *cmdstr)
{
struct qemuMonitorTestHandlerData *data = item->opaque;
g_autoptr(virJSONValue) val = NULL;
virJSONValuePtr cmdargs = NULL;
virJSONValue *cmdargs = NULL;
const char *cmdname;
if (!(val = virJSONValueFromString(cmdstr)))
@@ -608,7 +607,7 @@ qemuMonitorTestProcessCommandDefault(qemuMonitorTestPtr test,
int
qemuMonitorTestAddItem(qemuMonitorTestPtr test,
qemuMonitorTestAddItem(qemuMonitorTest *test,
const char *command_name,
const char *response)
{
@@ -627,14 +626,14 @@ qemuMonitorTestAddItem(qemuMonitorTestPtr test,
static int
qemuMonitorTestProcessCommandVerbatim(qemuMonitorTestPtr test,
qemuMonitorTestItemPtr item,
qemuMonitorTestProcessCommandVerbatim(qemuMonitorTest *test,
qemuMonitorTestItem *item,
const char *cmdstr)
{
struct qemuMonitorTestHandlerData *data = item->opaque;
g_autofree char *reformatted = NULL;
g_autoptr(virJSONValue) json = NULL;
virJSONValuePtr cmdargs;
virJSONValue *cmdargs;
const char *cmdname;
int ret = -1;
@@ -681,7 +680,7 @@ qemuMonitorTestProcessCommandVerbatim(qemuMonitorTestPtr test,
* Returns 0 when command was successfully added, -1 on error.
*/
int
qemuMonitorTestAddItemVerbatim(qemuMonitorTestPtr test,
qemuMonitorTestAddItemVerbatim(qemuMonitorTest *test,
const char *command,
const char *cmderr,
const char *response)
@@ -709,12 +708,12 @@ qemuMonitorTestAddItemVerbatim(qemuMonitorTestPtr test,
static int
qemuMonitorTestProcessGuestAgentSync(qemuMonitorTestPtr test,
qemuMonitorTestItemPtr item G_GNUC_UNUSED,
qemuMonitorTestProcessGuestAgentSync(qemuMonitorTest *test,
qemuMonitorTestItem *item G_GNUC_UNUSED,
const char *cmdstr)
{
g_autoptr(virJSONValue) val = NULL;
virJSONValuePtr args;
virJSONValue *args;
unsigned long long id;
const char *cmdname;
g_autofree char *retmsg = NULL;
@@ -754,7 +753,7 @@ qemuMonitorTestProcessGuestAgentSync(qemuMonitorTestPtr test,
int
qemuMonitorTestAddAgentSyncResponse(qemuMonitorTestPtr test)
qemuMonitorTestAddAgentSyncResponse(qemuMonitorTest *test)
{
if (!test->agent) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@@ -770,14 +769,14 @@ qemuMonitorTestAddAgentSyncResponse(qemuMonitorTestPtr test)
static int
qemuMonitorTestProcessCommandWithArgs(qemuMonitorTestPtr test,
qemuMonitorTestItemPtr item,
qemuMonitorTestProcessCommandWithArgs(qemuMonitorTest *test,
qemuMonitorTestItem *item,
const char *cmdstr)
{
struct qemuMonitorTestHandlerData *data = item->opaque;
g_autoptr(virJSONValue) val = NULL;
virJSONValuePtr args;
virJSONValuePtr argobj;
virJSONValue *args;
virJSONValue *argobj;
const char *cmdname;
size_t i;
@@ -803,7 +802,7 @@ qemuMonitorTestProcessCommandWithArgs(qemuMonitorTestPtr test,
/* validate the args */
for (i = 0; i < data->nargs; i++) {
qemuMonitorTestCommandArgsPtr arg = &data->args[i];
qemuMonitorTestCommandArgs *arg = &data->args[i];
g_autofree char *argstr = NULL;
if (!(argobj = virJSONValueObjectGet(args, arg->argname))) {
@@ -837,7 +836,7 @@ qemuMonitorTestProcessCommandWithArgs(qemuMonitorTestPtr test,
/* this allows to add a responder that is able to check
* a (shallow) structure of arguments for a command */
int
qemuMonitorTestAddItemParams(qemuMonitorTestPtr test,
qemuMonitorTestAddItemParams(qemuMonitorTest *test,
const char *cmdname,
const char *response,
...)
@@ -884,13 +883,13 @@ qemuMonitorTestAddItemParams(qemuMonitorTestPtr test,
static int
qemuMonitorTestProcessCommandWithArgStr(qemuMonitorTestPtr test,
qemuMonitorTestItemPtr item,
qemuMonitorTestProcessCommandWithArgStr(qemuMonitorTest *test,
qemuMonitorTestItem *item,
const char *cmdstr)
{
struct qemuMonitorTestHandlerData *data = item->opaque;
g_autoptr(virJSONValue) val = NULL;
virJSONValuePtr args;
virJSONValue *args;
g_autofree char *argstr = NULL;
const char *cmdname;
@@ -944,7 +943,7 @@ qemuMonitorTestProcessCommandWithArgStr(qemuMonitorTestPtr test,
* quotes for simplification of writing the strings into code.
*/
int
qemuMonitorTestAddItemExpect(qemuMonitorTestPtr test,
qemuMonitorTestAddItemExpect(qemuMonitorTest *test,
const char *cmdname,
const char *cmdargs,
bool apostrophe,
@@ -977,16 +976,16 @@ qemuMonitorTestAddItemExpect(qemuMonitorTestPtr test,
static void
qemuMonitorTestEOFNotify(qemuMonitorPtr mon G_GNUC_UNUSED,
virDomainObjPtr vm G_GNUC_UNUSED,
qemuMonitorTestEOFNotify(qemuMonitor *mon G_GNUC_UNUSED,
virDomainObj *vm G_GNUC_UNUSED,
void *opaque G_GNUC_UNUSED)
{
}
static void
qemuMonitorTestErrorNotify(qemuMonitorPtr mon G_GNUC_UNUSED,
virDomainObjPtr vm G_GNUC_UNUSED,
qemuMonitorTestErrorNotify(qemuMonitor *mon G_GNUC_UNUSED,
virDomainObj *vm G_GNUC_UNUSED,
void *opaque G_GNUC_UNUSED)
{
}
@@ -1000,8 +999,8 @@ static qemuMonitorCallbacks qemuMonitorTestCallbacks = {
static void
qemuMonitorTestAgentNotify(qemuAgentPtr agent G_GNUC_UNUSED,
virDomainObjPtr vm G_GNUC_UNUSED)
qemuMonitorTestAgentNotify(qemuAgent *agent G_GNUC_UNUSED,
virDomainObj *vm G_GNUC_UNUSED)
{
}
@@ -1012,12 +1011,12 @@ static qemuAgentCallbacks qemuMonitorTestAgentCallbacks = {
};
static qemuMonitorTestPtr
qemuMonitorCommonTestNew(virDomainXMLOptionPtr xmlopt,
virDomainObjPtr vm,
virDomainChrSourceDefPtr src)
static qemuMonitorTest *
qemuMonitorCommonTestNew(virDomainXMLOption *xmlopt,
virDomainObj *vm,
virDomainChrSourceDef *src)
{
qemuMonitorTestPtr test = NULL;
qemuMonitorTest *test = NULL;
char *path = NULL;
char *tmpdir_template = NULL;
@@ -1077,7 +1076,7 @@ qemuMonitorCommonTestNew(virDomainXMLOptionPtr xmlopt,
static int
qemuMonitorCommonTestInit(qemuMonitorTestPtr test)
qemuMonitorCommonTestInit(qemuMonitorTest *test)
{
int events = VIR_EVENT_HANDLE_READABLE;
@@ -1130,14 +1129,14 @@ qemuMonitorCommonTestInit(qemuMonitorTestPtr test)
/* We skip the normal handshake reply of "{\"execute\":\"qmp_capabilities\"}" */
qemuMonitorTestPtr
qemuMonitorTestNew(virDomainXMLOptionPtr xmlopt,
virDomainObjPtr vm,
virQEMUDriverPtr driver,
qemuMonitorTest *
qemuMonitorTestNew(virDomainXMLOption *xmlopt,
virDomainObj *vm,
virQEMUDriver *driver,
const char *greeting,
GHashTable *schema)
{
qemuMonitorTestPtr test = NULL;
qemuMonitorTest *test = NULL;
virDomainChrSourceDef src;
memset(&src, 0, sizeof(src));
@@ -1193,12 +1192,12 @@ qemuMonitorTestNew(virDomainXMLOptionPtr xmlopt,
*
* Returns the monitor object on success; NULL on error.
*/
qemuMonitorTestPtr
qemuMonitorTest *
qemuMonitorTestNewFromFile(const char *fileName,
virDomainXMLOptionPtr xmlopt,
virDomainXMLOption *xmlopt,
bool simple)
{
qemuMonitorTestPtr test = NULL;
qemuMonitorTest *test = NULL;
g_autofree char *json = NULL;
char *tmp;
char *singleReply;
@@ -1266,7 +1265,7 @@ qemuMonitorTestNewFromFile(const char *fileName,
* to test some negative scenarios which would not use all commands.
*/
void
qemuMonitorTestAllowUnusedCommands(qemuMonitorTestPtr test)
qemuMonitorTestAllowUnusedCommands(qemuMonitorTest *test)
{
test->allowUnusedCommands = true;
}
@@ -1289,7 +1288,7 @@ qemuMonitorTestAllowUnusedCommands(qemuMonitorTestPtr test)
* argument is removed it will still fail validation.
*/
void
qemuMonitorTestSkipDeprecatedValidation(qemuMonitorTestPtr test,
qemuMonitorTestSkipDeprecatedValidation(qemuMonitorTest *test,
bool allowRemoved)
{
test->skipValidationDeprecated = true;
@@ -1298,7 +1297,7 @@ qemuMonitorTestSkipDeprecatedValidation(qemuMonitorTestPtr test,
static int
qemuMonitorTestFullAddItem(qemuMonitorTestPtr test,
qemuMonitorTestFullAddItem(qemuMonitorTest *test,
const char *filename,
const char *command,
const char *response,
@@ -1331,13 +1330,13 @@ qemuMonitorTestFullAddItem(qemuMonitorTestPtr test,
*
* Returns the monitor object on success; NULL on error.
*/
qemuMonitorTestPtr
qemuMonitorTest *
qemuMonitorTestNewFromFileFull(const char *fileName,
virQEMUDriverPtr driver,
virDomainObjPtr vm,
virQEMUDriver *driver,
virDomainObj *vm,
GHashTable *qmpschema)
{
qemuMonitorTestPtr ret = NULL;
qemuMonitorTest *ret = NULL;
g_autofree char *jsonstr = NULL;
char *tmp;
size_t line = 0;
@@ -1413,10 +1412,10 @@ qemuMonitorTestNewFromFileFull(const char *fileName,
}
qemuMonitorTestPtr
qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt)
qemuMonitorTest *
qemuMonitorTestNewAgent(virDomainXMLOption *xmlopt)
{
qemuMonitorTestPtr test = NULL;
qemuMonitorTest *test = NULL;
virDomainChrSourceDef src;
memset(&src, 0, sizeof(src));
@@ -1450,22 +1449,22 @@ qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt)
}
qemuMonitorPtr
qemuMonitorTestGetMonitor(qemuMonitorTestPtr test)
qemuMonitor *
qemuMonitorTestGetMonitor(qemuMonitorTest *test)
{
return test->mon;
}
qemuAgentPtr
qemuMonitorTestGetAgent(qemuMonitorTestPtr test)
qemuAgent *
qemuMonitorTestGetAgent(qemuMonitorTest *test)
{
return test->agent;
}
virDomainObjPtr
qemuMonitorTestGetDomainObj(qemuMonitorTestPtr test)
virDomainObj *
qemuMonitorTestGetDomainObj(qemuMonitorTest *test)
{
return test->vm;
}

View File

@@ -25,53 +25,51 @@
#include "qemu/qemu_agent.h"
typedef struct _qemuMonitorTest qemuMonitorTest;
typedef qemuMonitorTest *qemuMonitorTestPtr;
typedef struct _qemuMonitorTestItem qemuMonitorTestItem;
typedef qemuMonitorTestItem *qemuMonitorTestItemPtr;
typedef int (*qemuMonitorTestResponseCallback)(qemuMonitorTestPtr test,
qemuMonitorTestItemPtr item,
typedef int (*qemuMonitorTestResponseCallback)(qemuMonitorTest *test,
qemuMonitorTestItem *item,
const char *message);
int qemuMonitorTestAddHandler(qemuMonitorTestPtr test,
int qemuMonitorTestAddHandler(qemuMonitorTest *test,
const char *identifier,
qemuMonitorTestResponseCallback cb,
void *opaque,
virFreeCallback freecb);
int qemuMonitorTestAddResponse(qemuMonitorTestPtr test,
int qemuMonitorTestAddResponse(qemuMonitorTest *test,
const char *response);
int qemuMonitorTestAddInvalidCommandResponse(qemuMonitorTestPtr test,
int qemuMonitorTestAddInvalidCommandResponse(qemuMonitorTest *test,
const char *expectedcommand,
const char *actualcommand);
void *qemuMonitorTestItemGetPrivateData(qemuMonitorTestItemPtr item);
void *qemuMonitorTestItemGetPrivateData(qemuMonitorTestItem *item);
int qemuMonitorTestAddErrorResponse(qemuMonitorTestPtr test, const char *errmsg, ...);
int qemuMonitorTestAddErrorResponse(qemuMonitorTest *test, const char *errmsg, ...);
void qemuMonitorTestAllowUnusedCommands(qemuMonitorTestPtr test);
void qemuMonitorTestSkipDeprecatedValidation(qemuMonitorTestPtr test,
void qemuMonitorTestAllowUnusedCommands(qemuMonitorTest *test);
void qemuMonitorTestSkipDeprecatedValidation(qemuMonitorTest *test,
bool allowRemoved);
int qemuMonitorTestAddItem(qemuMonitorTestPtr test,
int qemuMonitorTestAddItem(qemuMonitorTest *test,
const char *command_name,
const char *response);
int qemuMonitorTestAddItemVerbatim(qemuMonitorTestPtr test,
int qemuMonitorTestAddItemVerbatim(qemuMonitorTest *test,
const char *command,
const char *cmderr,
const char *response);
int qemuMonitorTestAddAgentSyncResponse(qemuMonitorTestPtr test);
int qemuMonitorTestAddAgentSyncResponse(qemuMonitorTest *test);
int qemuMonitorTestAddItemParams(qemuMonitorTestPtr test,
int qemuMonitorTestAddItemParams(qemuMonitorTest *test,
const char *cmdname,
const char *response,
...)
G_GNUC_NULL_TERMINATED;
int qemuMonitorTestAddItemExpect(qemuMonitorTestPtr test,
int qemuMonitorTestAddItemExpect(qemuMonitorTest *test,
const char *cmdname,
const char *cmdargs,
bool apostrophe,
@@ -82,27 +80,27 @@ int qemuMonitorTestAddItemExpect(qemuMonitorTestPtr test,
#define qemuMonitorTestNewSchema(xmlopt, schema) \
qemuMonitorTestNew(xmlopt, NULL, NULL, NULL, schema)
qemuMonitorTestPtr qemuMonitorTestNew(virDomainXMLOptionPtr xmlopt,
virDomainObjPtr vm,
virQEMUDriverPtr driver,
qemuMonitorTest *qemuMonitorTestNew(virDomainXMLOption *xmlopt,
virDomainObj *vm,
virQEMUDriver *driver,
const char *greeting,
GHashTable *schema);
qemuMonitorTestPtr qemuMonitorTestNewFromFile(const char *fileName,
virDomainXMLOptionPtr xmlopt,
qemuMonitorTest *qemuMonitorTestNewFromFile(const char *fileName,
virDomainXMLOption *xmlopt,
bool simple);
qemuMonitorTestPtr qemuMonitorTestNewFromFileFull(const char *fileName,
virQEMUDriverPtr driver,
virDomainObjPtr vm,
qemuMonitorTest *qemuMonitorTestNewFromFileFull(const char *fileName,
virQEMUDriver *driver,
virDomainObj *vm,
GHashTable *qmpschema);
qemuMonitorTestPtr qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt);
qemuMonitorTest *qemuMonitorTestNewAgent(virDomainXMLOption *xmlopt);
void qemuMonitorTestFree(qemuMonitorTestPtr test);
void qemuMonitorTestFree(qemuMonitorTest *test);
qemuMonitorPtr qemuMonitorTestGetMonitor(qemuMonitorTestPtr test);
qemuAgentPtr qemuMonitorTestGetAgent(qemuMonitorTestPtr test);
virDomainObjPtr qemuMonitorTestGetDomainObj(qemuMonitorTestPtr test);
qemuMonitor *qemuMonitorTestGetMonitor(qemuMonitorTest *test);
qemuAgent *qemuMonitorTestGetAgent(qemuMonitorTest *test);
virDomainObj *qemuMonitorTestGetDomainObj(qemuMonitorTest *test);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMonitorTest, qemuMonitorTestFree);

View File

@@ -30,17 +30,17 @@
#define VIR_FROM_THIS VIR_FROM_NONE
struct testData {
virQEMUDriverPtr driver;
virQEMUDriver *driver;
const char *file; /* file name to load VM def XML from; qemuxml2argvdata/ */
};
static int
prepareObjects(virQEMUDriverPtr driver,
prepareObjects(virQEMUDriver *driver,
const char *xmlname,
virDomainObjPtr *vm_ret)
virDomainObj **vm_ret)
{
qemuDomainObjPrivatePtr priv;
qemuDomainObjPrivate *priv;
g_autoptr(virDomainObj) vm = NULL;
g_autofree char *filename = NULL;
g_autofree char *domxml = NULL;
@@ -95,8 +95,8 @@ testDomain(const void *opaque)
return -1;
for (i = 0; i < vm->def->ndisks; i++) {
virStorageSourcePtr src = vm->def->disks[i]->src;
virStorageSourcePtr n;
virStorageSource *src = vm->def->disks[i]->src;
virStorageSource *n;
if (!src)
continue;
@@ -136,10 +136,10 @@ static int
mymain(void)
{
virQEMUDriver driver;
virSecurityManagerPtr stack = NULL;
virSecurityManagerPtr dac = NULL;
virSecurityManager *stack = NULL;
virSecurityManager *dac = NULL;
#ifdef WITH_SELINUX
virSecurityManagerPtr selinux = NULL;
virSecurityManager *selinux = NULL;
#endif
int ret = 0;

View File

@@ -19,7 +19,7 @@ static int
testCompareStatusXMLToXMLFiles(const void *opaque)
{
const struct testQemuInfo *data = opaque;
virDomainObjPtr obj = NULL;
virDomainObj *obj = NULL;
g_autofree char *actual = NULL;
int ret = -1;

View File

@@ -81,7 +81,7 @@ virNumaNodeIsAvailable(int node)
}
bool
virNumaNodesetIsAvailable(virBitmapPtr nodeset)
virNumaNodesetIsAvailable(virBitmap *nodeset)
{
ssize_t bit = -1;
@@ -193,12 +193,12 @@ virHostGetDRMRenderNode(void)
return g_strdup("/dev/dri/foo");
}
static void (*real_virCommandPassFD)(virCommandPtr cmd, int fd, unsigned int flags);
static void (*real_virCommandPassFD)(virCommand *cmd, int fd, unsigned int flags);
static const int testCommandPassSafeFDs[] = { 1730, 1731, 1732 };
void
virCommandPassFD(virCommandPtr cmd,
virCommandPassFD(virCommand *cmd,
int fd,
unsigned int flags)
{
@@ -225,8 +225,8 @@ virNetDevOpenvswitchGetVhostuserIfname(const char *path G_GNUC_UNUSED,
}
int
qemuInterfaceOpenVhostNet(virDomainDefPtr def G_GNUC_UNUSED,
virDomainNetDefPtr net,
qemuInterfaceOpenVhostNet(virDomainDef *def G_GNUC_UNUSED,
virDomainNetDef *net,
int *vhostfd,
size_t *vhostfdSize)
{
@@ -285,7 +285,7 @@ virNetDevSetRootQDisc(const char *ifname G_GNUC_UNUSED,
int
qemuInterfaceVDPAConnect(virDomainNetDefPtr net G_GNUC_UNUSED)
qemuInterfaceVDPAConnect(virDomainNetDef *net G_GNUC_UNUSED)
{
if (fcntl(1732, F_GETFD) != -1)
abort();

View File

@@ -281,7 +281,7 @@ static virNWFilterDriver fakeNWFilterDriver = {
static int
testAddCPUModels(virQEMUCapsPtr caps, bool skipLegacy)
testAddCPUModels(virQEMUCaps *caps, bool skipLegacy)
{
virArch arch = virQEMUCapsGetArch(caps);
const char *x86Models[] = {
@@ -354,7 +354,7 @@ testAddCPUModels(virQEMUCapsPtr caps, bool skipLegacy)
static int
testUpdateQEMUCaps(const struct testQemuInfo *info,
virArch arch,
virCapsPtr caps)
virCaps *caps)
{
if (!caps)
return -1;
@@ -392,15 +392,15 @@ testCheckExclusiveFlags(int flags)
}
static virCommandPtr
testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv,
virDomainObjPtr vm,
static virCommand *
testCompareXMLToArgvCreateArgs(virQEMUDriver *drv,
virDomainObj *vm,
const char *migrateURI,
struct testQemuInfo *info,
unsigned int flags,
bool jsonPropsValidation)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
qemuDomainObjPrivate *priv = vm->privateData;
bool enableFips = !!(flags & FLAG_FIPS_HOST);
size_t i;
@@ -409,7 +409,7 @@ testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv,
return NULL;
for (i = 0; i < vm->def->ndisks; i++) {
virDomainDiskDefPtr disk = vm->def->disks[i];
virDomainDiskDef *disk = vm->def->disks[i];
/* host cdrom requires special treatment in qemu, mock it */
if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM &&
@@ -420,7 +420,7 @@ testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv,
}
for (i = 0; i < vm->def->nhostdevs; i++) {
virDomainHostdevDefPtr hostdev = vm->def->hostdevs[i];
virDomainHostdevDef *hostdev = vm->def->hostdevs[i];
if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI &&
@@ -429,7 +429,7 @@ testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv,
}
if (virHostdevIsSCSIDevice(hostdev)) {
virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi;
virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi;
switch ((virDomainHostdevSCSIProtocolType) scsisrc->protocol) {
case VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_NONE:
@@ -448,7 +448,7 @@ testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv,
}
for (i = 0; i < vm->def->nfss; i++) {
virDomainFSDefPtr fs = vm->def->fss[i];
virDomainFSDef *fs = vm->def->fss[i];
char *s;
if (fs->fsdriver != VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS ||
@@ -460,9 +460,9 @@ testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv,
}
if (vm->def->vsock) {
virDomainVsockDefPtr vsock = vm->def->vsock;
qemuDomainVsockPrivatePtr vsockPriv =
(qemuDomainVsockPrivatePtr)vsock->privateData;
virDomainVsockDef *vsock = vm->def->vsock;
qemuDomainVsockPrivate *vsockPriv =
(qemuDomainVsockPrivate *)vsock->privateData;
if (vsock->auto_cid == VIR_TRISTATE_BOOL_YES)
vsock->guest_cid = 42;
@@ -480,10 +480,10 @@ testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv,
}
for (i = 0; i < vm->def->nvideos; i++) {
virDomainVideoDefPtr video = vm->def->videos[i];
virDomainVideoDef *video = vm->def->videos[i];
if (video->backend == VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER) {
qemuDomainVideoPrivatePtr vpriv = QEMU_DOMAIN_VIDEO_PRIVATE(video);
qemuDomainVideoPrivate *vpriv = QEMU_DOMAIN_VIDEO_PRIVATE(video);
vpriv->vhost_user_fd = 1729;
}
@@ -491,11 +491,11 @@ testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv,
if (flags & FLAG_SLIRP_HELPER) {
for (i = 0; i < vm->def->nnets; i++) {
virDomainNetDefPtr net = vm->def->nets[i];
virDomainNetDef *net = vm->def->nets[i];
if (net->type == VIR_DOMAIN_NET_TYPE_USER &&
virQEMUCapsGet(info->qemuCaps, QEMU_CAPS_DBUS_VMSTATE)) {
qemuSlirpPtr slirp = qemuSlirpNew();
qemuSlirp *slirp = qemuSlirpNew();
slirp->fd[0] = 42;
QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp = slirp;
}
@@ -513,14 +513,14 @@ testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv,
static int
testCompareXMLToArgvValidateSchema(virQEMUDriverPtr drv,
testCompareXMLToArgvValidateSchema(virQEMUDriver *drv,
const char *migrateURI,
struct testQemuInfo *info,
unsigned int flags)
{
g_auto(GStrv) args = NULL;
g_autoptr(virDomainObj) vm = NULL;
qemuDomainObjPrivatePtr priv = NULL;
qemuDomainObjPrivate *priv = NULL;
size_t nargs = 0;
size_t i;
GHashTable *schema = NULL;
@@ -638,13 +638,13 @@ testCompareXMLToArgv(const void *data)
unsigned int flags = info->flags;
unsigned int parseFlags = info->parseFlags;
int ret = -1;
virDomainObjPtr vm = NULL;
virDomainObj *vm = NULL;
virDomainChrSourceDef monitor_chr;
g_autoptr(virConnect) conn = NULL;
virError *err = NULL;
char *log = NULL;
g_autoptr(virCommand) cmd = NULL;
qemuDomainObjPrivatePtr priv = NULL;
qemuDomainObjPrivate *priv = NULL;
g_autoptr(xmlDoc) xml = NULL;
g_autoptr(xmlXPathContext) ctxt = NULL;
xmlNodePtr root;

View File

@@ -8,7 +8,7 @@
static int
mymain(void)
{
virSecurityManagerPtr mgr;
virSecurityManager *mgr;
const char *doi, *model;
mgr = virSecurityManagerNew(NULL, "QEMU", VIR_SECURITY_MANAGER_DEFAULT_CONFINED);

View File

@@ -12,7 +12,7 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml)
{
char *actual = NULL;
int ret = -1;
virSecretDefPtr secret = NULL;
virSecretDef *secret = NULL;
if (!(secret = virSecretDefParseFile(inxml)))
goto fail;

View File

@@ -44,7 +44,7 @@ VIR_LOG_INIT("tests.securityselinuxlabeltest");
static virQEMUDriver driver;
static virSecurityManagerPtr mgr;
static virSecurityManager *mgr;
typedef struct testSELinuxFile testSELinuxFile;
@@ -159,11 +159,11 @@ testSELinuxLoadFileList(const char *testname,
}
static virDomainDefPtr
static virDomainDef *
testSELinuxLoadDef(const char *testname)
{
char *xmlfile = NULL;
virDomainDefPtr def = NULL;
virDomainDef *def = NULL;
size_t i;
xmlfile = g_strdup_printf("%s/securityselinuxlabeldata/%s.xml", abs_srcdir,
@@ -282,7 +282,7 @@ testSELinuxLabeling(const void *opaque)
testSELinuxFile *files = NULL;
size_t nfiles = 0;
size_t i;
virDomainDefPtr def = NULL;
virDomainDef *def = NULL;
if (testSELinuxLoadFileList(testname, &files, &nfiles) < 0)
goto cleanup;

View File

@@ -39,7 +39,7 @@
VIR_LOG_INIT("tests.securityselinuxtest");
struct testSELinuxGenLabelData {
virSecurityManagerPtr mgr;
virSecurityManager *mgr;
const char *pidcon;
@@ -59,19 +59,19 @@ struct testSELinuxGenLabelData {
int catMax;
};
static virDomainDefPtr
static virDomainDef *
testBuildDomainDef(bool dynamic,
const char *label,
const char *baselabel)
{
virDomainDefPtr def;
virSecurityLabelDefPtr secdef = NULL;
virDomainDef *def;
virSecurityLabelDef *secdef = NULL;
if (!(def = virDomainDefNew()))
goto error;
def->virtType = VIR_DOMAIN_VIRT_KVM;
def->seclabels = g_new0(virSecurityLabelDefPtr, 1);
def->seclabels = g_new0(virSecurityLabelDef *, 1);
secdef = g_new0(virSecurityLabelDef, 1);
@@ -211,7 +211,7 @@ testSELinuxGenLabel(const void *opaque)
{
const struct testSELinuxGenLabelData *data = opaque;
int ret = -1;
virDomainDefPtr def;
virDomainDef *def;
context_t con = NULL;
context_t imgcon = NULL;
@@ -265,7 +265,7 @@ static int
mymain(void)
{
int ret = 0;
virSecurityManagerPtr mgr;
virSecurityManager *mgr;
if (!(mgr = virSecurityManagerNew("selinux", "QEMU",
VIR_SECURITY_MANAGER_DEFAULT_CONFINED |

View File

@@ -28,11 +28,11 @@
struct test_virStoragePoolCapsFormatData {
const char *filename;
virCapsPtr driverCaps;
virCaps *driverCaps;
};
static void
test_virCapabilitiesAddFullStoragePool(virCapsPtr caps)
test_virCapabilitiesAddFullStoragePool(virCaps *caps)
{
size_t i;
@@ -42,7 +42,7 @@ test_virCapabilitiesAddFullStoragePool(virCapsPtr caps)
static void
test_virCapabilitiesAddFSStoragePool(virCapsPtr caps)
test_virCapabilitiesAddFSStoragePool(virCaps *caps)
{
virCapabilitiesAddStoragePool(caps, VIR_STORAGE_POOL_FS);
}
@@ -53,7 +53,7 @@ test_virStoragePoolCapsFormat(const void *opaque)
{
struct test_virStoragePoolCapsFormatData *data =
(struct test_virStoragePoolCapsFormatData *) opaque;
virCapsPtr driverCaps = data->driverCaps;
virCaps *driverCaps = data->driverCaps;
g_autoptr(virStoragePoolCaps) poolCaps = NULL;
g_autofree char *path = NULL;
g_autofree char *poolCapsXML = NULL;

View File

@@ -23,8 +23,8 @@ testCompareXMLToArgvFiles(bool shouldFail,
const char *cmdline)
{
int ret = -1;
virStoragePoolDefPtr def = NULL;
virStoragePoolObjPtr pool = NULL;
virStoragePoolDef *def = NULL;
virStoragePoolObj *pool = NULL;
const char *defTypeStr;
g_autofree char *actualCmdline = NULL;
g_autofree char *src = NULL;

View File

@@ -13,8 +13,8 @@ const char create_tool[] = "qemu-img";
/* createVol sets this on volume creation */
static void
testSetVolumeType(virStorageVolDefPtr vol,
virStoragePoolDefPtr pool)
testSetVolumeType(virStorageVolDef *vol,
virStoragePoolDef *pool)
{
if (!vol || !pool)
return;
@@ -44,8 +44,8 @@ testCompareXMLToArgvFiles(bool shouldFail,
{
virStorageVolEncryptConvertStep convertStep = VIR_STORAGE_VOL_ENCRYPT_NONE;
int ret = -1;
virStoragePoolDefPtr def = NULL;
virStoragePoolObjPtr obj = NULL;
virStoragePoolDef *def = NULL;
virStoragePoolObj *obj = NULL;
g_autofree char *actualCmdline = NULL;
g_autoptr(virStorageVolDef) vol = NULL;
g_autoptr(virStorageVolDef) inputvol = NULL;

View File

@@ -41,7 +41,7 @@
struct testSysinfoData {
const char *name; /* test name, also base name for result files */
virSysinfoDefPtr (*func)(void); /* sysinfo gathering function */
virSysinfoDef *(*func)(void); /* sysinfo gathering function */
};

View File

@@ -52,8 +52,8 @@ static unsigned int testRegenerate = -1;
static size_t testCounter;
static virBitmapPtr testBitmap;
static virBitmapPtr failedTests;
static virBitmap *testBitmap;
static virBitmap *failedTests;
virArch virTestHostArch = VIR_ARCH_X86_64;
@@ -300,10 +300,10 @@ virTestLoadFilePath(const char *p, ...)
* Constructs the test file path from variable arguments and loads and parses
* the JSON file. 'abs_srcdir' is automatically prepended to the path.
*/
virJSONValuePtr
virJSONValue *
virTestLoadFileJSON(const char *p, ...)
{
virJSONValuePtr ret = NULL;
virJSONValue *ret = NULL;
g_autofree char *jsonstr = NULL;
g_autofree char *path = NULL;
va_list ap;
@@ -649,13 +649,13 @@ struct virtTestLogData {
static struct virtTestLogData testLog = { VIR_BUFFER_INITIALIZER };
static void
virtTestLogOutput(virLogSourcePtr source G_GNUC_UNUSED,
virtTestLogOutput(virLogSource *source G_GNUC_UNUSED,
virLogPriority priority G_GNUC_UNUSED,
const char *filename G_GNUC_UNUSED,
int lineno G_GNUC_UNUSED,
const char *funcname G_GNUC_UNUSED,
const char *timestamp,
virLogMetadataPtr metadata G_GNUC_UNUSED,
struct _virLogMetadata *metadata G_GNUC_UNUSED,
const char *rawstr G_GNUC_UNUSED,
const char *str,
void *data)
@@ -748,8 +748,8 @@ int virTestMain(int argc,
int ret;
char *testRange = NULL;
size_t noutputs = 0;
virLogOutputPtr output = NULL;
virLogOutputPtr *outputs = NULL;
virLogOutput *output = NULL;
virLogOutput **outputs = NULL;
g_autofree char *baseprogname = NULL;
const char *progname;
g_autofree const char **preloads = NULL;
@@ -851,10 +851,11 @@ int virTestMain(int argc,
}
virCapsPtr virTestGenericCapsInit(void)
virCaps *
virTestGenericCapsInit(void)
{
g_autoptr(virCaps) caps = NULL;
virCapsGuestPtr guest;
virCapsGuest *guest;
if ((caps = virCapabilitiesNew(VIR_ARCH_X86_64,
false, false)) == NULL)
@@ -911,11 +912,11 @@ virCapsPtr virTestGenericCapsInit(void)
* Build NUMA topology with cell id starting from (0 + seq)
* for testing
*/
virCapsHostNUMAPtr
virCapsHostNUMA *
virTestCapsBuildNUMATopology(int seq)
{
g_autoptr(virCapsHostNUMA) caps = virCapabilitiesHostNUMANew();
virCapsHostNUMACellCPUPtr cell_cpus = NULL;
virCapsHostNUMACellCPU *cell_cpus = NULL;
int core_id, cell_id;
int id;
@@ -948,7 +949,7 @@ static virDomainDefParserConfig virTestGenericDomainDefParserConfig = {
.features = VIR_DOMAIN_DEF_FEATURE_INDIVIDUAL_VCPUS,
};
virDomainXMLOptionPtr virTestGenericDomainXMLConfInit(void)
virDomainXMLOption *virTestGenericDomainXMLConfInit(void)
{
return virDomainXMLOptionNew(&virTestGenericDomainDefParserConfig,
NULL, NULL, NULL, NULL);
@@ -956,8 +957,8 @@ virDomainXMLOptionPtr virTestGenericDomainXMLConfInit(void)
int
testCompareDomXML2XMLFiles(virCapsPtr caps G_GNUC_UNUSED,
virDomainXMLOptionPtr xmlopt,
testCompareDomXML2XMLFiles(virCaps *caps G_GNUC_UNUSED,
virDomainXMLOption *xmlopt,
const char *infile, const char *outfile, bool live,
unsigned int parseFlags,
testCompareDomXML2XMLResult expectResult)
@@ -965,7 +966,7 @@ testCompareDomXML2XMLFiles(virCapsPtr caps G_GNUC_UNUSED,
g_autofree char *actual = NULL;
int ret = -1;
testCompareDomXML2XMLResult result;
virDomainDefPtr def = NULL;
virDomainDef *def = NULL;
unsigned int parse_flags = live ? 0 : VIR_DOMAIN_DEF_PARSE_INACTIVE;
unsigned int format_flags = VIR_DOMAIN_DEF_FORMAT_SECURE;

View File

@@ -43,7 +43,7 @@ int virTestRun(const char *title,
int virTestLoadFile(const char *file, char **buf);
char *virTestLoadFilePath(const char *p, ...)
G_GNUC_NULL_TERMINATED;
virJSONValuePtr virTestLoadFileJSON(const char *p, ...)
virJSONValue *virTestLoadFileJSON(const char *p, ...)
G_GNUC_NULL_TERMINATED;
int virTestDifference(FILE *stream,
@@ -143,9 +143,9 @@ int virTestMain(int argc,
#define VIR_TEST_MOCK(mock) (abs_builddir "/lib" mock "mock" MOCK_EXT)
virCapsPtr virTestGenericCapsInit(void);
virCapsHostNUMAPtr virTestCapsBuildNUMATopology(int seq);
virDomainXMLOptionPtr virTestGenericDomainXMLConfInit(void);
virCaps *virTestGenericCapsInit(void);
virCapsHostNUMA *virTestCapsBuildNUMATopology(int seq);
virDomainXMLOption *virTestGenericDomainXMLConfInit(void);
typedef enum {
TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS,
@@ -155,8 +155,8 @@ typedef enum {
TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_COMPARE,
} testCompareDomXML2XMLResult;
int testCompareDomXML2XMLFiles(virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
int testCompareDomXML2XMLFiles(virCaps *caps,
virDomainXMLOption *xmlopt,
const char *inxml,
const char *outfile,
bool live,

View File

@@ -138,7 +138,7 @@ static virCPUDef cpuSparcData = {
.threads = 1,
};
static inline virCPUDefPtr
static inline virCPUDef *
testUtilsHostCpusGetDefForModel(const char *model)
{
if (!model)
@@ -158,7 +158,7 @@ testUtilsHostCpusGetDefForModel(const char *model)
return NULL;
}
static inline virCPUDefPtr
static inline virCPUDef *
testUtilsHostCpusGetDefForArch(virArch arch)
{
if (ARCH_IS_X86(arch))

View File

@@ -8,11 +8,11 @@
# define VIR_FROM_THIS VIR_FROM_LXC
virCapsPtr
virCaps *
testLXCCapsInit(void)
{
virCapsPtr caps;
virCapsGuestPtr guest;
virCaps *caps;
virCapsGuest *guest;
if ((caps = virCapabilitiesNew(VIR_ARCH_X86_64,
false, false)) == NULL)
@@ -58,10 +58,10 @@ testLXCCapsInit(void)
}
virLXCDriverPtr
virLXCDriver *
testLXCDriverInit(void)
{
virLXCDriverPtr driver = g_new0(virLXCDriver, 1);
virLXCDriver *driver = g_new0(virLXCDriver, 1);
if (virMutexInit(&driver->lock) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -78,7 +78,7 @@ testLXCDriverInit(void)
void
testLXCDriverFree(virLXCDriverPtr driver)
testLXCDriverFree(virLXCDriver *driver)
{
virObjectUnref(driver->xmlopt);
virObjectUnref(driver->caps);

View File

@@ -23,6 +23,6 @@
#define FAKEDEVDIR0 "/fakedevdir0/bla/fasl"
#define FAKEDEVDIR1 "/fakedevdir1/bla/fasl"
virCapsPtr testLXCCapsInit(void);
virLXCDriverPtr testLXCDriverInit(void);
void testLXCDriverFree(virLXCDriverPtr driver);
virCaps *testLXCCapsInit(void);
virLXCDriver *testLXCDriverInit(void);
void testLXCDriverFree(virLXCDriver *driver);

View File

@@ -16,10 +16,10 @@
# define VIR_FROM_THIS VIR_FROM_QEMU
virCPUDefPtr cpuDefault;
virCPUDefPtr cpuHaswell;
virCPUDefPtr cpuPower8;
virCPUDefPtr cpuPower9;
virCPUDef *cpuDefault;
virCPUDef *cpuHaswell;
virCPUDef *cpuPower8;
virCPUDef *cpuPower9;
static const char *qemu_emulators[VIR_ARCH_LAST] = {
@@ -133,7 +133,7 @@ virFindFileInPath(const char *file)
}
virCapsHostNUMAPtr
virCapsHostNUMA *
virCapabilitiesHostNUMANewHost(void)
{
/*
@@ -145,12 +145,12 @@ virCapabilitiesHostNUMANewHost(void)
static int
testQemuAddGuest(virCapsPtr caps,
testQemuAddGuest(virCaps *caps,
virArch arch)
{
size_t nmachines;
virCapsGuestMachinePtr *machines = NULL;
virCapsGuestPtr guest;
virCapsGuestMachine **machines = NULL;
virCapsGuest *guest;
virArch emu_arch = arch;
if (arch_alias[arch] != VIR_ARCH_NONE)
@@ -213,9 +213,9 @@ testQemuAddGuest(virCapsPtr caps,
}
virCapsPtr testQemuCapsInit(void)
virCaps *testQemuCapsInit(void)
{
virCapsPtr caps;
virCaps *caps;
size_t i;
if (!(caps = virCapabilitiesNew(VIR_ARCH_X86_64, false, false)))
@@ -257,7 +257,7 @@ virCapsPtr testQemuCapsInit(void)
void
qemuTestSetHostArch(virQEMUDriverPtr driver,
qemuTestSetHostArch(virQEMUDriver *driver,
virArch arch)
{
if (arch == VIR_ARCH_NONE)
@@ -271,9 +271,9 @@ qemuTestSetHostArch(virQEMUDriverPtr driver,
void
qemuTestSetHostCPU(virQEMUDriverPtr driver,
qemuTestSetHostCPU(virQEMUDriver *driver,
virArch arch,
virCPUDefPtr cpu)
virCPUDef *cpu)
{
if (!cpu) {
if (ARCH_IS_X86(arch))
@@ -300,11 +300,11 @@ qemuTestSetHostCPU(virQEMUDriverPtr driver,
}
virQEMUCapsPtr
virQEMUCaps *
qemuTestParseCapabilitiesArch(virArch arch,
const char *capsFile)
{
virQEMUCapsPtr qemuCaps = NULL;
virQEMUCaps *qemuCaps = NULL;
g_autofree char *binary = g_strdup_printf("/usr/bin/qemu-system-%s",
virArchToString(arch));
@@ -334,13 +334,13 @@ void qemuTestDriverFree(virQEMUDriver *driver)
virObjectUnref(driver->securityManager);
}
int qemuTestCapsCacheInsert(virFileCachePtr cache,
virQEMUCapsPtr caps)
int qemuTestCapsCacheInsert(virFileCache *cache,
virQEMUCaps *caps)
{
size_t i, j;
for (i = 0; i < G_N_ELEMENTS(qemu_emulators); i++) {
virQEMUCapsPtr tmpCaps;
virQEMUCaps *tmpCaps;
if (qemu_emulators[i] == NULL)
continue;
if (caps) {
@@ -410,7 +410,7 @@ int qemuTestCapsCacheInsert(virFileCachePtr cache,
int qemuTestDriverInit(virQEMUDriver *driver)
{
virSecurityManagerPtr mgr = NULL;
virSecurityManager *mgr = NULL;
char statedir[] = STATEDIRTEMPLATE;
char configdir[] = CONFIGDIRTEMPLATE;
@@ -489,7 +489,7 @@ int qemuTestDriverInit(virQEMUDriver *driver)
}
int
testQemuCapsSetGIC(virQEMUCapsPtr qemuCaps,
testQemuCapsSetGIC(virQEMUCaps *qemuCaps,
int gic)
{
virGICCapability *gicCapabilities = NULL;
@@ -686,7 +686,7 @@ testQemuInfoSetArgs(struct testQemuInfo *info,
{
va_list argptr;
testQemuInfoArgName argname;
virQEMUCapsPtr qemuCaps = NULL;
virQEMUCaps *qemuCaps = NULL;
int gic = GIC_NONE;
char *capsarch = NULL;
char *capsver = NULL;
@@ -774,7 +774,7 @@ testQemuInfoSetArgs(struct testQemuInfo *info,
if (!qemuCaps && capsarch && capsver) {
bool stripmachinealiases = false;
virQEMUCapsPtr cachedcaps = NULL;
virQEMUCaps *cachedcaps = NULL;
info->arch = virArchFromString(capsarch);

View File

@@ -59,7 +59,7 @@ struct testQemuInfo {
char *infile;
char *outfile;
char *errfile;
virQEMUCapsPtr qemuCaps;
virQEMUCaps *qemuCaps;
const char *migrateFrom;
int migrateFd;
unsigned int flags;
@@ -69,30 +69,30 @@ struct testQemuInfo {
GHashTable *qapiSchemaCache;
};
virCapsPtr testQemuCapsInit(void);
virDomainXMLOptionPtr testQemuXMLConfInit(void);
virCaps *testQemuCapsInit(void);
virDomainXMLOption *testQemuXMLConfInit(void);
virQEMUCapsPtr qemuTestParseCapabilitiesArch(virArch arch,
virQEMUCaps *qemuTestParseCapabilitiesArch(virArch arch,
const char *capsFile);
extern virCPUDefPtr cpuDefault;
extern virCPUDefPtr cpuHaswell;
extern virCPUDefPtr cpuPower8;
extern virCPUDefPtr cpuPower9;
extern virCPUDef *cpuDefault;
extern virCPUDef *cpuHaswell;
extern virCPUDef *cpuPower8;
extern virCPUDef *cpuPower9;
void qemuTestSetHostArch(virQEMUDriverPtr driver,
void qemuTestSetHostArch(virQEMUDriver *driver,
virArch arch);
void qemuTestSetHostCPU(virQEMUDriverPtr driver,
void qemuTestSetHostCPU(virQEMUDriver *driver,
virArch arch,
virCPUDefPtr cpu);
virCPUDef *cpu);
int qemuTestDriverInit(virQEMUDriver *driver);
void qemuTestDriverFree(virQEMUDriver *driver);
int qemuTestCapsCacheInsert(virFileCachePtr cache,
virQEMUCapsPtr caps);
int qemuTestCapsCacheInsert(virFileCache *cache,
virQEMUCaps *caps);
int testQemuCapsSetGIC(virQEMUCapsPtr qemuCaps,
int testQemuCapsSetGIC(virQEMUCaps *qemuCaps,
int gic);
char *testQemuGetLatestCapsForArch(const char *arch,

View File

@@ -23,19 +23,19 @@
struct testQEMUSchemaValidateCtxt {
GHashTable *schema;
virBufferPtr debug;
virBuffer *debug;
bool allowDeprecated;
};
static int
testQEMUSchemaValidateRecurse(virJSONValuePtr obj,
virJSONValuePtr root,
testQEMUSchemaValidateRecurse(virJSONValue *obj,
virJSONValue *root,
struct testQEMUSchemaValidateCtxt *ctxt);
static int
testQEMUSchemaValidateBuiltin(virJSONValuePtr obj,
virJSONValuePtr root,
testQEMUSchemaValidateBuiltin(virJSONValue *obj,
virJSONValue *root,
struct testQEMUSchemaValidateCtxt *ctxt)
{
const char *t = virJSONValueObjectGetString(root, "json-type");
@@ -95,18 +95,18 @@ testQEMUSchemaValidateBuiltin(virJSONValuePtr obj,
}
struct testQEMUSchemaValidateObjectMemberData {
virJSONValuePtr rootmembers;
virJSONValue *rootmembers;
struct testQEMUSchemaValidateCtxt *ctxt;
bool missingMandatory;
};
static virJSONValuePtr
static virJSONValue *
testQEMUSchemaStealObjectMemberByName(const char *name,
virJSONValuePtr members)
virJSONValue *members)
{
virJSONValuePtr member;
virJSONValuePtr ret = NULL;
virJSONValue *member;
virJSONValue *ret = NULL;
size_t i;
for (i = 0; i < virJSONValueArraySize(members); i++) {
@@ -124,13 +124,13 @@ testQEMUSchemaStealObjectMemberByName(const char *name,
static int
testQEMUSchemaValidateObjectMember(const char *key,
virJSONValuePtr value,
virJSONValue *value,
void *opaque)
{
struct testQEMUSchemaValidateObjectMemberData *data = opaque;
g_autoptr(virJSONValue) keymember = NULL;
const char *keytype;
virJSONValuePtr keyschema = NULL;
virJSONValue *keyschema = NULL;
int rc;
virBufferStrcat(data->ctxt->debug, key, ": ", NULL);
@@ -159,10 +159,10 @@ testQEMUSchemaValidateObjectMember(const char *key,
static int
testQEMUSchemaValidateObjectMergeVariantMember(size_t pos G_GNUC_UNUSED,
virJSONValuePtr item,
virJSONValue *item,
void *opaque)
{
virJSONValuePtr array = opaque;
virJSONValue *array = opaque;
g_autoptr(virJSONValue) copy = NULL;
if (!(copy = virJSONValueCopy(item)))
@@ -182,17 +182,17 @@ testQEMUSchemaValidateObjectMergeVariantMember(size_t pos G_GNUC_UNUSED,
* 'variants' array from @root.
*/
static int
testQEMUSchemaValidateObjectMergeVariant(virJSONValuePtr root,
testQEMUSchemaValidateObjectMergeVariant(virJSONValue *root,
const char *variantfield,
const char *variantname,
struct testQEMUSchemaValidateCtxt *ctxt)
{
size_t i;
g_autoptr(virJSONValue) variants = NULL;
virJSONValuePtr variant;
virJSONValuePtr variantschema;
virJSONValuePtr variantschemamembers;
virJSONValuePtr rootmembers;
virJSONValue *variant;
virJSONValue *variantschema;
virJSONValue *variantschemamembers;
virJSONValue *rootmembers;
const char *varianttype = NULL;
if (!(variants = virJSONValueObjectStealArray(root, "variants"))) {
@@ -238,7 +238,7 @@ testQEMUSchemaValidateObjectMergeVariant(virJSONValuePtr root,
static int
testQEMUSchemaValidateObjectMandatoryMember(size_t pos G_GNUC_UNUSED,
virJSONValuePtr item,
virJSONValue *item,
void *opaque G_GNUC_UNUSED)
{
struct testQEMUSchemaValidateObjectMemberData *data = opaque;
@@ -254,8 +254,8 @@ testQEMUSchemaValidateObjectMandatoryMember(size_t pos G_GNUC_UNUSED,
static int
testQEMUSchemaValidateObject(virJSONValuePtr obj,
virJSONValuePtr root,
testQEMUSchemaValidateObject(virJSONValue *obj,
virJSONValue *root,
struct testQEMUSchemaValidateCtxt *ctxt)
{
struct testQEMUSchemaValidateObjectMemberData data = { NULL, ctxt, false };
@@ -313,13 +313,13 @@ testQEMUSchemaValidateObject(virJSONValuePtr obj,
static int
testQEMUSchemaValidateEnum(virJSONValuePtr obj,
virJSONValuePtr root,
testQEMUSchemaValidateEnum(virJSONValue *obj,
virJSONValue *root,
struct testQEMUSchemaValidateCtxt *ctxt)
{
const char *objstr;
virJSONValuePtr values = NULL;
virJSONValuePtr value;
virJSONValue *values = NULL;
virJSONValue *value;
size_t i;
if (virJSONValueGetType(obj) != VIR_JSON_TYPE_STRING) {
@@ -351,13 +351,13 @@ testQEMUSchemaValidateEnum(virJSONValuePtr obj,
static int
testQEMUSchemaValidateArray(virJSONValuePtr objs,
virJSONValuePtr root,
testQEMUSchemaValidateArray(virJSONValue *objs,
virJSONValue *root,
struct testQEMUSchemaValidateCtxt *ctxt)
{
const char *elemtypename = virJSONValueObjectGetString(root, "element-type");
virJSONValuePtr elementschema;
virJSONValuePtr obj;
virJSONValue *elementschema;
virJSONValue *obj;
size_t i;
if (virJSONValueGetType(objs) != VIR_JSON_TYPE_ARRAY) {
@@ -389,16 +389,16 @@ testQEMUSchemaValidateArray(virJSONValuePtr objs,
}
static int
testQEMUSchemaValidateAlternate(virJSONValuePtr obj,
virJSONValuePtr root,
testQEMUSchemaValidateAlternate(virJSONValue *obj,
virJSONValue *root,
struct testQEMUSchemaValidateCtxt *ctxt)
{
virJSONValuePtr members;
virJSONValuePtr member;
virJSONValue *members;
virJSONValue *member;
size_t i;
size_t n;
const char *membertype;
virJSONValuePtr memberschema;
virJSONValue *memberschema;
int indent;
int rc;
@@ -446,11 +446,11 @@ testQEMUSchemaValidateAlternate(virJSONValuePtr obj,
static int
testQEMUSchemaValidateDeprecated(virJSONValuePtr root,
testQEMUSchemaValidateDeprecated(virJSONValue *root,
const char *name,
struct testQEMUSchemaValidateCtxt *ctxt)
{
virJSONValuePtr features = virJSONValueObjectGetArray(root, "features");
virJSONValue *features = virJSONValueObjectGetArray(root, "features");
size_t nfeatures;
size_t i;
@@ -460,7 +460,7 @@ testQEMUSchemaValidateDeprecated(virJSONValuePtr root,
nfeatures = virJSONValueArraySize(features);
for (i = 0; i < nfeatures; i++) {
virJSONValuePtr cur = virJSONValueArrayGet(features, i);
virJSONValue *cur = virJSONValueArrayGet(features, i);
const char *curstr;
if (!cur ||
@@ -487,8 +487,8 @@ testQEMUSchemaValidateDeprecated(virJSONValuePtr root,
static int
testQEMUSchemaValidateRecurse(virJSONValuePtr obj,
virJSONValuePtr root,
testQEMUSchemaValidateRecurse(virJSONValue *obj,
virJSONValue *root,
struct testQEMUSchemaValidateCtxt *ctxt)
{
const char *n = virJSONValueObjectGetString(root, "name");
@@ -531,11 +531,11 @@ testQEMUSchemaValidateRecurse(virJSONValuePtr obj,
* @debug is filled with information regarding the validation process
*/
int
testQEMUSchemaValidate(virJSONValuePtr obj,
virJSONValuePtr root,
testQEMUSchemaValidate(virJSONValue *obj,
virJSONValue *root,
GHashTable *schema,
bool allowDeprecated,
virBufferPtr debug)
virBuffer *debug)
{
struct testQEMUSchemaValidateCtxt ctxt = { .schema = schema,
.debug = debug,
@@ -567,19 +567,19 @@ testQEMUSchemaValidate(virJSONValuePtr obj,
*/
int
testQEMUSchemaValidateCommand(const char *command,
virJSONValuePtr arguments,
virJSONValue *arguments,
GHashTable *schema,
bool allowDeprecated,
bool allowRemoved,
virBufferPtr debug)
virBuffer *debug)
{
struct testQEMUSchemaValidateCtxt ctxt = { .schema = schema,
.debug = debug,
.allowDeprecated = allowDeprecated };
g_autofree char *schemapatharguments = g_strdup_printf("%s/arg-type", command);
g_autoptr(virJSONValue) emptyargs = NULL;
virJSONValuePtr schemarootcommand;
virJSONValuePtr schemarootarguments;
virJSONValue *schemarootcommand;
virJSONValue *schemarootarguments;
int rc;
if (virQEMUQAPISchemaPathGet(command, schema, &schemarootcommand) < 0 ||
@@ -629,7 +629,7 @@ testQEMUSchemaValidateCommand(const char *command,
* members.
*/
int
testQEMUSchemaEntryMatchTemplate(virJSONValuePtr schemaentry,
testQEMUSchemaEntryMatchTemplate(virJSONValue *schemaentry,
...)
{
g_autoptr(virJSONValue) members = NULL;
@@ -675,7 +675,7 @@ testQEMUSchemaEntryMatchTemplate(virJSONValuePtr schemaentry,
}
for (i = 0; i < virJSONValueArraySize(members); i++) {
virJSONValuePtr member = virJSONValueArrayGet(members, i);
virJSONValue *member = virJSONValueArrayGet(members, i);
const char *membername = virJSONValueObjectGetString(member, "name");
const char *membertype = virJSONValueObjectGetString(member, "type");
@@ -722,14 +722,14 @@ testQEMUSchemaEntryMatchTemplate(virJSONValuePtr schemaentry,
}
static virJSONValuePtr
static virJSONValue *
testQEMUSchemaLoadReplies(const char *filename)
{
g_autofree char *caps = NULL;
char *schemaReply;
char *end;
g_autoptr(virJSONValue) reply = NULL;
virJSONValuePtr schema = NULL;
virJSONValue *schema = NULL;
if (virTestLoadFile(filename, &caps) < 0)
return NULL;
@@ -767,7 +767,7 @@ testQEMUSchemaLoadReplies(const char *filename)
* Returns the schema data as the qemu monitor would reply from the latest
* replies file used for qemucapabilitiestest for the x86_64 architecture.
*/
virJSONValuePtr
virJSONValue *
testQEMUSchemaGetLatest(const char *arch)
{
g_autofree char *capsLatestFile = NULL;
@@ -786,7 +786,7 @@ testQEMUSchemaGetLatest(const char *arch)
GHashTable *
testQEMUSchemaLoadLatest(const char *arch)
{
virJSONValuePtr schema;
virJSONValue *schema;
if (!(schema = testQEMUSchemaGetLatest(arch)))
return NULL;
@@ -798,7 +798,7 @@ testQEMUSchemaLoadLatest(const char *arch)
GHashTable *
testQEMUSchemaLoad(const char *filename)
{
virJSONValuePtr schema;
virJSONValue *schema;
if (!(schema = testQEMUSchemaLoadReplies(filename)))
return NULL;

View File

@@ -23,26 +23,26 @@
#include "virbuffer.h"
int
testQEMUSchemaValidate(virJSONValuePtr obj,
virJSONValuePtr root,
testQEMUSchemaValidate(virJSONValue *obj,
virJSONValue *root,
GHashTable *schema,
bool allowDeprecated,
virBufferPtr debug);
virBuffer *debug);
int
testQEMUSchemaValidateCommand(const char *command,
virJSONValuePtr arguments,
virJSONValue *arguments,
GHashTable *schema,
bool allowDeprecated,
bool allowRemoved,
virBufferPtr debug);
virBuffer *debug);
int
testQEMUSchemaEntryMatchTemplate(virJSONValuePtr schemaentry,
testQEMUSchemaEntryMatchTemplate(virJSONValue *schemaentry,
...);
virJSONValuePtr
virJSONValue *
testQEMUSchemaGetLatest(const char* arch);
GHashTable *

View File

@@ -8,12 +8,12 @@
#define VIR_FROM_THIS VIR_FROM_LIBXL
static virCapsPtr
static virCaps *
testXLInitCaps(void)
{
virCapsPtr caps;
virCapsGuestPtr guest;
virCapsGuestMachinePtr *machines;
virCaps *caps;
virCapsGuest *guest;
virCapsGuestMachine **machines;
int nmachines;
static const char *const x86_machines[] = {
"xenfv"
@@ -83,9 +83,9 @@ testXLInitCaps(void)
}
libxlDriverPrivatePtr testXLInitDriver(void)
libxlDriverPrivate *testXLInitDriver(void)
{
libxlDriverPrivatePtr driver = g_new0(libxlDriverPrivate, 1);
libxlDriverPrivate *driver = g_new0(libxlDriverPrivate, 1);
if (virMutexInit(&driver->lock) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -110,7 +110,7 @@ libxlDriverPrivatePtr testXLInitDriver(void)
return driver;
}
void testXLFreeDriver(libxlDriverPrivatePtr driver)
void testXLFreeDriver(libxlDriverPrivate *driver)
{
virObjectUnref(driver->config);
virObjectUnref(driver->xmlopt);

View File

@@ -20,8 +20,8 @@
#ifdef WITH_LIBXL
# include "libxl/libxl_conf.h"
libxlDriverPrivatePtr testXLInitDriver(void);
libxlDriverPrivate *testXLInitDriver(void);
void testXLFreeDriver(libxlDriverPrivatePtr driver);
void testXLFreeDriver(libxlDriverPrivate *driver);
#endif /* WITH_LIBXL */

View File

@@ -50,7 +50,7 @@ testCompareXMLtoXMLFiles(const char *xml)
char *actual = NULL;
char *pathResult = NULL;
int ret = -1;
virVBoxSnapshotConfMachinePtr machine = NULL;
virVBoxSnapshotConfMachine *machine = NULL;
pathResult = g_strdup(abs_builddir "/vboxsnapshotxmldata/testResult.vbox");

View File

@@ -32,7 +32,7 @@
VIR_LOG_INIT("tests.authconfigtest");
struct ConfigLookupData {
virAuthConfigPtr config;
virAuthConfig *config;
const char *hostname;
const char *service;
const char *credname;
@@ -82,7 +82,7 @@ mymain(void)
{
int ret = 0;
virAuthConfigPtr config;
virAuthConfig *config;
const char *confdata =
"[credentials-test]\n"

View File

@@ -28,7 +28,7 @@
static int
checkBitmap(virBitmapPtr map,
checkBitmap(virBitmap *map,
const char *expect,
ssize_t expectedSize)
{
@@ -82,7 +82,7 @@ test1(const void *data G_GNUC_UNUSED)
}
static int
testBit(virBitmapPtr bitmap,
testBit(virBitmap *bitmap,
unsigned int start,
unsigned int end,
bool expected)

View File

@@ -18,7 +18,7 @@ struct testBufAddStrData {
static int testBufAutoIndent(const void *data G_GNUC_UNUSED)
{
g_auto(virBuffer) bufinit = VIR_BUFFER_INITIALIZER;
virBufferPtr buf = &bufinit;
virBuffer *buf = &bufinit;
const char expected[] =
" 1\n 2\n 3\n 4\n 5\n 6\n 7\n &amp;\n 8\n 9\n 10\n ' 11'\n";
g_autofree char *result = NULL;
@@ -97,7 +97,7 @@ static int testBufAutoIndent(const void *data G_GNUC_UNUSED)
static int testBufTrim(const void *data G_GNUC_UNUSED)
{
g_auto(virBuffer) bufinit = VIR_BUFFER_INITIALIZER;
virBufferPtr buf = NULL;
virBuffer *buf = NULL;
g_autofree char *result = NULL;
const char *expected = "a,b";

View File

@@ -38,7 +38,7 @@ test_virCapabilities(const void *opaque)
{
struct virCapabilitiesData *data = (struct virCapabilitiesData *) opaque;
const char *archStr = virArchToString(data->arch);
virCapsPtr caps = NULL;
virCaps *caps = NULL;
char *capsXML = NULL;
char *path = NULL;
char *system = NULL;

View File

@@ -33,8 +33,8 @@ static int
test_virCapabilitiesGetCpusForNodemask(const void *data G_GNUC_UNUSED)
{
const char *nodestr = "3,4,5,6";
virBitmapPtr nodemask = NULL;
virBitmapPtr cpumap = NULL;
virBitmap *nodemask = NULL;
virBitmap *cpumap = NULL;
g_autoptr(virCapsHostNUMA) caps = NULL;
int mask_size = 8;
int ret = -1;
@@ -59,14 +59,14 @@ test_virCapabilitiesGetCpusForNodemask(const void *data G_GNUC_UNUSED)
static bool G_GNUC_UNUSED
doCapsExpectFailure(virCapsPtr caps,
doCapsExpectFailure(virCaps *caps,
int ostype,
virArch arch,
int domaintype,
const char *emulator,
const char *machinetype)
{
virCapsDomainDataPtr data = virCapabilitiesDomainDataLookup(caps, ostype,
virCapsDomainData *data = virCapabilitiesDomainDataLookup(caps, ostype,
arch, domaintype, emulator, machinetype);
if (data) {
@@ -78,7 +78,7 @@ doCapsExpectFailure(virCapsPtr caps,
}
static bool G_GNUC_UNUSED
doCapsCompare(virCapsPtr caps,
doCapsCompare(virCaps *caps,
int ostype,
virArch arch,
int domaintype,
@@ -91,7 +91,7 @@ doCapsCompare(virCapsPtr caps,
const char *expect_machinetype)
{
bool ret = false;
virCapsDomainDataPtr data = virCapabilitiesDomainDataLookup(caps, ostype,
virCapsDomainData *data = virCapabilitiesDomainDataLookup(caps, ostype,
arch, domaintype, emulator, machinetype);
if (!data)
@@ -151,7 +151,7 @@ static int
test_virCapsDomainDataLookupQEMU(const void *data G_GNUC_UNUSED)
{
int ret = 0;
virCapsPtr caps = NULL;
virCaps *caps = NULL;
if (!(caps = testQemuCapsInit())) {
ret = -1;
@@ -210,7 +210,7 @@ static int
test_virCapsDomainDataLookupLXC(const void *data G_GNUC_UNUSED)
{
int ret = 0;
virCapsPtr caps = NULL;
virCaps *caps = NULL;
if (!(caps = testLXCCapsInit())) {
ret = -1;

View File

@@ -595,7 +595,7 @@ int open(const char *path, int flags, ...)
}
bool
virCgroupV2DevicesAvailable(virCgroupPtr group G_GNUC_UNUSED)
virCgroupV2DevicesAvailable(virCgroup *group G_GNUC_UNUSED)
{
return true;
}

View File

@@ -37,7 +37,7 @@
VIR_LOG_INIT("tests.cgrouptest");
static int validateCgroup(virCgroupPtr cgroup,
static int validateCgroup(virCgroup *cgroup,
const char **expectMountPoint,
const char **expectLinkPoint,
const char **expectPlacement,

View File

@@ -68,7 +68,7 @@ static int testConfMemoryNoNewline(const void *opaque G_GNUC_UNUSED)
g_autoptr(virConf) conf = virConfReadString(srcdata, 0);
int ret = -1;
virConfValuePtr val;
virConfValue *val;
unsigned long long llvalue;
char *str = NULL;
int uintvalue;

View File

@@ -33,16 +33,15 @@ struct _testFileCacheObj {
char *data;
};
typedef struct _testFileCacheObj testFileCacheObj;
typedef testFileCacheObj *testFileCacheObjPtr;
static virClassPtr testFileCacheObjClass;
static virClass *testFileCacheObjClass;
static void
testFileCacheObjDispose(void *opaque)
{
testFileCacheObjPtr obj = opaque;
testFileCacheObj *obj = opaque;
g_free(obj->data);
}
@@ -60,10 +59,10 @@ testFileCacheObjOnceInit(void)
VIR_ONCE_GLOBAL_INIT(testFileCacheObj);
static testFileCacheObjPtr
static testFileCacheObj *
testFileCacheObjNew(const char *data)
{
testFileCacheObjPtr obj;
testFileCacheObj *obj;
if (testFileCacheObjInitialize() < 0)
return NULL;
@@ -83,15 +82,14 @@ struct _testFileCachePriv {
const char *expectData;
};
typedef struct _testFileCachePriv testFileCachePriv;
typedef testFileCachePriv *testFileCachePrivPtr;
static bool
testFileCacheIsValid(void *data,
void *priv)
{
testFileCachePrivPtr testPriv = priv;
testFileCacheObjPtr obj = data;
testFileCachePriv *testPriv = priv;
testFileCacheObj *obj = data;
return STREQ(testPriv->expectData, obj->data);
}
@@ -101,7 +99,7 @@ static void *
testFileCacheNewData(const char *name G_GNUC_UNUSED,
void *priv)
{
testFileCachePrivPtr testPriv = priv;
testFileCachePriv *testPriv = priv;
return testFileCacheObjNew(testPriv->newData);
}
@@ -113,7 +111,7 @@ testFileCacheLoadFile(const char *filename,
void *priv G_GNUC_UNUSED,
bool *outdated G_GNUC_UNUSED)
{
testFileCacheObjPtr obj;
testFileCacheObj *obj;
char *data;
if (virFileReadAll(filename, 20, &data) < 0)
@@ -131,7 +129,7 @@ testFileCacheSaveFile(void *data G_GNUC_UNUSED,
const char *filename G_GNUC_UNUSED,
void *priv)
{
testFileCachePrivPtr testPriv = priv;
testFileCachePriv *testPriv = priv;
testPriv->dataSaved = true;
@@ -148,14 +146,13 @@ virFileCacheHandlers testFileCacheHandlers = {
struct _testFileCacheData {
virFileCachePtr cache;
virFileCache *cache;
const char *name;
const char *newData;
const char *expectData;
bool expectSave;
};
typedef struct _testFileCacheData testFileCacheData;
typedef testFileCacheData *testFileCacheDataPtr;
static int
@@ -163,8 +160,8 @@ testFileCache(const void *opaque)
{
int ret = -1;
const testFileCacheData *data = opaque;
testFileCacheObjPtr obj = NULL;
testFileCachePrivPtr testPriv = virFileCacheGetPriv(data->cache);
testFileCacheObj *obj = NULL;
testFileCachePriv *testPriv = virFileCacheGetPriv(data->cache);
testPriv->dataSaved = false;
testPriv->newData = data->newData;
@@ -201,7 +198,7 @@ mymain(void)
{
int ret = 0;
testFileCachePriv testPriv = {0};
virFileCachePtr cache = NULL;
virFileCache *cache = NULL;
if (!(cache = virFileCacheNew(abs_srcdir "/virfilecachedata",
"cache", &testFileCacheHandlers)))

View File

@@ -36,7 +36,7 @@
# define VIR_FROM_THIS VIR_FROM_FIREWALL
static bool fwDisabled = true;
static virBufferPtr fwBuf;
static virBuffer *fwBuf;
static bool fwError;
# define TEST_FILTER_TABLE_LIST \
@@ -242,7 +242,7 @@ testFirewallRemoveRule(const void *opaque)
IPTABLES_PATH " -w -A INPUT --source 192.168.122.1 --jump ACCEPT\n"
IPTABLES_PATH " -w -A INPUT --source '!192.168.122.1' --jump REJECT\n";
const struct testFirewallData *data = opaque;
virFirewallRulePtr fwrule;
virFirewallRule *fwrule;
g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew();
fwDisabled = data->fwDisabled;
@@ -907,7 +907,7 @@ testFirewallQueryHook(const char *const*args,
static int
testFirewallQueryCallback(virFirewallPtr fw,
testFirewallQueryCallback(virFirewall *fw,
virFirewallLayer layer,
const char *const *lines,
void *opaque G_GNUC_UNUSED)

View File

@@ -74,7 +74,7 @@ linuxTestCompareFiles(const char *cpuinfofile,
static int
linuxCPUStatsToBuf(virBufferPtr buf,
linuxCPUStatsToBuf(virBuffer *buf,
int cpu,
virNodeCPUStatsPtr param,
size_t nparams)

View File

@@ -57,11 +57,11 @@ static const char *dom_name = "test_domain";
static const unsigned char *uuid =
(unsigned char *)("f92360b0-2541-8791-fb32-d1f838811541");
static int nhostdevs = 3;
static virDomainHostdevDefPtr hostdevs[] = {NULL, NULL, NULL};
static virPCIDevicePtr dev[] = {NULL, NULL, NULL};
static virHostdevManagerPtr mgr;
static virDomainHostdevDef *hostdevs[] = {NULL, NULL, NULL};
static virPCIDevice *dev[] = {NULL, NULL, NULL};
static virHostdevManager *mgr;
static const size_t ndisks = 3;
static virDomainDiskDefPtr disks[] = {NULL, NULL, NULL};
static virDomainDiskDef *disks[] = {NULL, NULL, NULL};
static const char *diskXML[] = {
"<disk type='nvme' device='disk'>"
" <driver name='qemu' type='raw'/>"

View File

@@ -177,7 +177,7 @@ testJSONLookup(const void *data)
{
const struct testInfo *info = data;
g_autoptr(virJSONValue) json = NULL;
virJSONValuePtr value = NULL;
virJSONValue *value = NULL;
g_autofree char *result = NULL;
int rc;
int number;

View File

@@ -32,7 +32,7 @@
# define VIR_FROM_THIS VIR_FROM_NONE
static int
checkOutput(virBufferPtr buf, const char *exp_cmd)
checkOutput(virBuffer *buf, const char *exp_cmd)
{
int ret = -1;
char *actual_cmd = NULL;

View File

@@ -39,7 +39,7 @@ VIR_LOG_INIT("tests.lockspacetest");
static int testLockSpaceCreate(const void *args G_GNUC_UNUSED)
{
virLockSpacePtr lockspace;
virLockSpace *lockspace;
int ret = -1;
rmdir(LOCKSPACE_DIR);
@@ -61,7 +61,7 @@ static int testLockSpaceCreate(const void *args G_GNUC_UNUSED)
static int testLockSpaceResourceLifecycle(const void *args G_GNUC_UNUSED)
{
virLockSpacePtr lockspace;
virLockSpace *lockspace;
int ret = -1;
rmdir(LOCKSPACE_DIR);
@@ -95,7 +95,7 @@ static int testLockSpaceResourceLifecycle(const void *args G_GNUC_UNUSED)
static int testLockSpaceResourceLockExcl(const void *args G_GNUC_UNUSED)
{
virLockSpacePtr lockspace;
virLockSpace *lockspace;
int ret = -1;
rmdir(LOCKSPACE_DIR);
@@ -141,7 +141,7 @@ static int testLockSpaceResourceLockExcl(const void *args G_GNUC_UNUSED)
static int testLockSpaceResourceLockExclAuto(const void *args G_GNUC_UNUSED)
{
virLockSpacePtr lockspace;
virLockSpace *lockspace;
int ret = -1;
rmdir(LOCKSPACE_DIR);
@@ -179,7 +179,7 @@ static int testLockSpaceResourceLockExclAuto(const void *args G_GNUC_UNUSED)
static int testLockSpaceResourceLockShr(const void *args G_GNUC_UNUSED)
{
virLockSpacePtr lockspace;
virLockSpace *lockspace;
int ret = -1;
rmdir(LOCKSPACE_DIR);
@@ -233,7 +233,7 @@ static int testLockSpaceResourceLockShr(const void *args G_GNUC_UNUSED)
static int testLockSpaceResourceLockShrAuto(const void *args G_GNUC_UNUSED)
{
virLockSpacePtr lockspace;
virLockSpace *lockspace;
int ret = -1;
rmdir(LOCKSPACE_DIR);
@@ -293,7 +293,7 @@ static int testLockSpaceResourceLockShrAuto(const void *args G_GNUC_UNUSED)
static int testLockSpaceResourceLockPath(const void *args G_GNUC_UNUSED)
{
virLockSpacePtr lockspace;
virLockSpace *lockspace;
int ret = -1;
rmdir(LOCKSPACE_DIR);

View File

@@ -48,7 +48,7 @@ testLogParseOutputs(const void *opaque)
{
int ret = -1;
int noutputs;
virLogOutputPtr *outputs = NULL;
virLogOutput **outputs = NULL;
const struct testLogData *data = opaque;
noutputs = virLogParseOutputs(data->str, &outputs);
@@ -80,7 +80,7 @@ testLogParseFilters(const void *opaque)
{
int ret = -1;
int nfilters;
virLogFilterPtr *filters = NULL;
virLogFilter **filters = NULL;
const struct testLogData *data = opaque;
nfilters = virLogParseFilters(data->str, &filters);

View File

@@ -27,7 +27,7 @@ struct testData {
const char *file;
const char *domain;
const char * const * macs;
virMacMapPtr mgr;
virMacMap *mgr;
};
@@ -35,7 +35,7 @@ static int
testMACLookup(const void *opaque)
{
const struct testData *data = opaque;
virMacMapPtr mgr = NULL;
virMacMap *mgr = NULL;
GSList *macs;
GSList *next;
size_t i, j;
@@ -88,7 +88,7 @@ static int
testMACRemove(const void *opaque)
{
const struct testData *data = opaque;
virMacMapPtr mgr = NULL;
virMacMap *mgr = NULL;
GSList *macs;
size_t i;
char *file = NULL;
@@ -150,7 +150,7 @@ static int
mymain(void)
{
int ret = 0;
virMacMapPtr mgr = NULL;
virMacMap *mgr = NULL;
#define DO_TEST_BASIC(f, d, ...) \
do { \

View File

@@ -33,7 +33,7 @@ struct testClientPriv {
static void *
testClientNew(virNetServerClientPtr client G_GNUC_UNUSED,
testClientNew(virNetServerClient *client G_GNUC_UNUSED,
void *opaque G_GNUC_UNUSED)
{
struct testClientPriv *priv;
@@ -46,8 +46,8 @@ testClientNew(virNetServerClientPtr client G_GNUC_UNUSED,
}
static virJSONValuePtr
testClientPreExec(virNetServerClientPtr client G_GNUC_UNUSED,
static virJSONValue *
testClientPreExec(virNetServerClient *client G_GNUC_UNUSED,
void *data)
{
struct testClientPriv *priv = data;
@@ -57,8 +57,8 @@ testClientPreExec(virNetServerClientPtr client G_GNUC_UNUSED,
static void *
testClientNewPostExec(virNetServerClientPtr client,
virJSONValuePtr object,
testClientNewPostExec(virNetServerClient *client,
virJSONValue *object,
void *opaque)
{
int magic;
@@ -80,16 +80,16 @@ testClientFree(void *opaque)
}
static virNetServerPtr
static virNetServer *
testCreateServer(const char *server_name, const char *host, int family)
{
virNetServerPtr srv = NULL;
virNetServerServicePtr svc1 = NULL;
virNetServerServicePtr svc2 = NULL;
virNetServerClientPtr cln1 = NULL;
virNetServerClientPtr cln2 = NULL;
virNetSocketPtr sk1 = NULL;
virNetSocketPtr sk2 = NULL;
virNetServer *srv = NULL;
virNetServerService *svc1 = NULL;
virNetServerService *svc2 = NULL;
virNetServerClient *cln1 = NULL;
virNetServerClient *cln2 = NULL;
virNetSocket *sk1 = NULL;
virNetSocket *sk2 = NULL;
int fdclient[2];
if (socketpair(PF_UNIX, SOCK_STREAM, 0, fdclient) < 0) {
@@ -186,9 +186,9 @@ testCreateServer(const char *server_name, const char *host, int family)
static char *testGenerateJSON(const char *server_name)
{
virNetDaemonPtr dmn = NULL;
virNetServerPtr srv = NULL;
virJSONValuePtr json = NULL;
virNetDaemon *dmn = NULL;
virNetServer *srv = NULL;
virJSONValue *json = NULL;
char *jsonstr = NULL;
bool has_ipv4, has_ipv6;
@@ -240,10 +240,10 @@ struct testExecRestartData {
bool pass;
};
static virNetServerPtr
testNewServerPostExecRestart(virNetDaemonPtr dmn G_GNUC_UNUSED,
static virNetServer *
testNewServerPostExecRestart(virNetDaemon *dmn G_GNUC_UNUSED,
const char *name,
virJSONValuePtr object,
virJSONValue *object,
void *opaque)
{
struct testExecRestartData *data = opaque;
@@ -268,12 +268,12 @@ static int testExecRestart(const void *opaque)
{
size_t i;
int ret = -1;
virNetDaemonPtr dmn = NULL;
virNetDaemon *dmn = NULL;
const struct testExecRestartData *data = opaque;
char *infile = NULL, *outfile = NULL;
char *injsonstr = NULL, *outjsonstr = NULL;
virJSONValuePtr injson = NULL;
virJSONValuePtr outjson = NULL;
virJSONValue *injson = NULL;
virJSONValue *outjson = NULL;
int fdclient[2] = { -1, -1 }, fdserver[2] = { -1, -1 };
if (socketpair(PF_UNIX, SOCK_STREAM, 0, fdclient) < 0) {

View File

@@ -33,7 +33,7 @@ VIR_LOG_INIT("tests.netmessagetest");
static int testMessageHeaderEncode(const void *args G_GNUC_UNUSED)
{
virNetMessagePtr msg = virNetMessageNew(true);
virNetMessage *msg = virNetMessageNew(true);
static const char expect[] = {
0x00, 0x00, 0x00, 0x1c, /* Length */
0x11, 0x22, 0x33, 0x44, /* Program */
@@ -86,7 +86,7 @@ static int testMessageHeaderEncode(const void *args G_GNUC_UNUSED)
static int testMessageHeaderDecode(const void *args G_GNUC_UNUSED)
{
virNetMessagePtr msg = virNetMessageNew(true);
virNetMessage *msg = virNetMessageNew(true);
static char input_buf [] = {
0x00, 0x00, 0x00, 0x1c, /* Length */
0x11, 0x22, 0x33, 0x44, /* Program */
@@ -182,7 +182,7 @@ static int testMessageHeaderDecode(const void *args G_GNUC_UNUSED)
static int testMessagePayloadEncode(const void *args G_GNUC_UNUSED)
{
virNetMessageError err;
virNetMessagePtr msg = virNetMessageNew(true);
virNetMessage *msg = virNetMessageNew(true);
int ret = -1;
static const char expect[] = {
0x00, 0x00, 0x00, 0x74, /* Length */
@@ -290,7 +290,7 @@ static int testMessagePayloadEncode(const void *args G_GNUC_UNUSED)
static int testMessagePayloadDecode(const void *args G_GNUC_UNUSED)
{
virNetMessageError err;
virNetMessagePtr msg = virNetMessageNew(true);
virNetMessage *msg = virNetMessageNew(true);
static char input_buffer[] = {
0x00, 0x00, 0x00, 0x74, /* Length */
0x11, 0x22, 0x33, 0x44, /* Program */
@@ -453,7 +453,7 @@ static int testMessagePayloadDecode(const void *args G_GNUC_UNUSED)
static int testMessagePayloadStreamEncode(const void *args G_GNUC_UNUSED)
{
char stream[] = "The quick brown fox jumps over the lazy dog";
virNetMessagePtr msg = virNetMessageNew(true);
virNetMessage *msg = virNetMessageNew(true);
static const char expect[] = {
0x00, 0x00, 0x00, 0x47, /* Length */
0x11, 0x22, 0x33, 0x44, /* Program */

View File

@@ -30,7 +30,7 @@ int virEventAddTimeout(int frequency G_GNUC_UNUSED,
return 0;
}
int virNetSocketGetUNIXIdentity(virNetSocketPtr sock G_GNUC_UNUSED,
int virNetSocketGetUNIXIdentity(virNetSocket *sock G_GNUC_UNUSED,
uid_t *uid,
gid_t *gid,
pid_t *pid,
@@ -53,7 +53,7 @@ char *virGetGroupName(gid_t gid G_GNUC_UNUSED)
return strdup("fictionalusers");
}
int virNetSocketGetSELinuxContext(virNetSocketPtr sock G_GNUC_UNUSED,
int virNetSocketGetSELinuxContext(virNetSocket *sock G_GNUC_UNUSED,
char **context)
{
if (!(*context = strdup("foo_u:bar_r:wizz_t:s0-s0:c0.c1023")))

View File

@@ -27,7 +27,7 @@
#ifndef WIN32
static void *
testClientNew(virNetServerClientPtr client G_GNUC_UNUSED,
testClientNew(virNetServerClient *client G_GNUC_UNUSED,
void *opaque G_GNUC_UNUSED)
{
char *dummy;
@@ -48,8 +48,8 @@ static int testIdentity(const void *opaque G_GNUC_UNUSED)
{
int sv[2];
int ret = -1;
virNetSocketPtr sock = NULL;
virNetServerClientPtr client = NULL;
virNetSocket *sock = NULL;
virNetServerClient *client = NULL;
g_autoptr(virIdentity) ident = NULL;
const char *gotUsername = NULL;
uid_t gotUserID;

View File

@@ -128,7 +128,7 @@ testSocketClient(void *opaque)
{
struct testClientData *data = opaque;
char c;
virNetSocketPtr csock = NULL;
virNetSocket *csock = NULL;
if (data->path) {
if (virNetSocketNewConnectUNIX(data->path, false,
@@ -158,11 +158,11 @@ testSocketClient(void *opaque)
static void
testSocketIncoming(virNetSocketPtr sock,
testSocketIncoming(virNetSocket *sock,
int events G_GNUC_UNUSED,
void *opaque)
{
virNetSocketPtr *retsock = opaque;
virNetSocket **retsock = opaque;
VIR_DEBUG("Incoming sock=%p events=%d", sock, events);
*retsock = sock;
}
@@ -178,10 +178,10 @@ struct testSocketData {
static int
testSocketAccept(const void *opaque)
{
virNetSocketPtr *lsock = NULL; /* Listen socket */
virNetSocket **lsock = NULL; /* Listen socket */
size_t nlsock = 0, i;
virNetSocketPtr ssock = NULL; /* Server socket */
virNetSocketPtr rsock = NULL; /* Incoming client socket */
virNetSocket *ssock = NULL; /* Server socket */
virNetSocket *rsock = NULL; /* Incoming client socket */
const struct testSocketData *data = opaque;
int ret = -1;
char portstr[100];
@@ -195,7 +195,7 @@ testSocketAccept(const void *opaque)
char b = '\0';
if (!data) {
virNetSocketPtr usock;
virNetSocket *usock;
tmpdir = g_mkdtemp(template);
if (tmpdir == NULL) {
VIR_WARN("Failed to create temporary directory");
@@ -206,7 +206,7 @@ testSocketAccept(const void *opaque)
if (virNetSocketNewListenUNIX(path, 0700, -1, getegid(), &usock) < 0)
goto cleanup;
lsock = g_new0(virNetSocketPtr, 1);
lsock = g_new0(virNetSocket *, 1);
lsock[0] = usock;
nlsock = 1;
@@ -307,9 +307,9 @@ testSocketAccept(const void *opaque)
#ifndef WIN32
static int testSocketUNIXAddrs(const void *data G_GNUC_UNUSED)
{
virNetSocketPtr lsock = NULL; /* Listen socket */
virNetSocketPtr ssock = NULL; /* Server socket */
virNetSocketPtr csock = NULL; /* Client socket */
virNetSocket *lsock = NULL; /* Listen socket */
virNetSocket *ssock = NULL; /* Server socket */
virNetSocket *csock = NULL; /* Client socket */
int ret = -1;
char *path = NULL;
@@ -394,11 +394,11 @@ static int testSocketUNIXAddrs(const void *data G_GNUC_UNUSED)
static int testSocketCommandNormal(const void *data G_GNUC_UNUSED)
{
virNetSocketPtr csock = NULL; /* Client socket */
virNetSocket *csock = NULL; /* Client socket */
char buf[100];
size_t i;
int ret = -1;
virCommandPtr cmd = virCommandNewArgList("/bin/cat", "/dev/zero", NULL);
virCommand *cmd = virCommandNewArgList("/bin/cat", "/dev/zero", NULL);
virCommandAddEnvPassCommon(cmd);
if (virNetSocketNewConnectCommand(cmd, &csock) < 0)
@@ -422,10 +422,10 @@ static int testSocketCommandNormal(const void *data G_GNUC_UNUSED)
static int testSocketCommandFail(const void *data G_GNUC_UNUSED)
{
virNetSocketPtr csock = NULL; /* Client socket */
virNetSocket *csock = NULL; /* Client socket */
char buf[100];
int ret = -1;
virCommandPtr cmd = virCommandNewArgList("/bin/cat", "/dev/does-not-exist", NULL);
virCommand *cmd = virCommandNewArgList("/bin/cat", "/dev/does-not-exist", NULL);
virCommandAddEnvPassCommon(cmd);
if (virNetSocketNewConnectCommand(cmd, &csock) < 0)
@@ -462,7 +462,7 @@ struct testSSHData {
static int testSocketSSH(const void *opaque)
{
const struct testSSHData *data = opaque;
virNetSocketPtr csock = NULL; /* Client socket */
virNetSocket *csock = NULL; /* Client socket */
int ret = -1;
char buf[1024];
g_autofree char *command = virNetClientSSHHelperCommand(VIR_NET_CLIENT_PROXY_AUTO,

View File

@@ -53,13 +53,13 @@ struct testTLSContextData {
*
* This code is done when libvirtd starts up, or before
* a libvirt client connects. The test is ensuring that
* the creation of virNetTLSContextPtr fails if we
* the creation of virNetTLSContext *fails if we
* give bogus certs, or succeeds for good certs
*/
static int testTLSContextInit(const void *opaque)
{
struct testTLSContextData *data = (struct testTLSContextData *)opaque;
virNetTLSContextPtr ctxt = NULL;
virNetTLSContext *ctxt = NULL;
int ret = -1;
if (data->isServer) {

View File

@@ -77,10 +77,10 @@ static ssize_t testRead(char *buf, size_t len, void *opaque)
static int testTLSSessionInit(const void *opaque)
{
struct testTLSSessionData *data = (struct testTLSSessionData *)opaque;
virNetTLSContextPtr clientCtxt = NULL;
virNetTLSContextPtr serverCtxt = NULL;
virNetTLSSessionPtr clientSess = NULL;
virNetTLSSessionPtr serverSess = NULL;
virNetTLSContext *clientCtxt = NULL;
virNetTLSContext *serverCtxt = NULL;
virNetTLSSession *clientSess = NULL;
virNetTLSSession *serverSess = NULL;
int ret = -1;
int channel[2];
bool clientShake = false;

View File

@@ -66,7 +66,7 @@ int
virNumaGetMaxNode(void)
{
int ret = -1;
virBitmapPtr map = NULL;
virBitmap *map = NULL;
if (virFileReadValueBitmap(&map, "%s/node/online", SYSFS_SYSTEM_PATH) < 0)
return -1;
@@ -80,7 +80,7 @@ bool
virNumaNodeIsAvailable(int node)
{
bool ret = false;
virBitmapPtr map = NULL;
virBitmap *map = NULL;
if (virFileReadValueBitmap(&map, "%s/node/online", SYSFS_SYSTEM_PATH) < 0)
return false;
@@ -162,7 +162,7 @@ virNumaGetPages(int node,
}
int
virNumaGetNodeCPUs(int node, virBitmapPtr *cpus)
virNumaGetNodeCPUs(int node, virBitmap **cpus)
{
int ret = -1;
char *cpulist = NULL;

View File

@@ -40,7 +40,7 @@ testCompareXMLToXMLFiles(const char *xml)
{
char *actual = NULL;
int ret = -1;
virNWFilterBindingDefPtr dev = NULL;
virNWFilterBindingDef *dev = NULL;
virResetLastError();

View File

@@ -30,7 +30,7 @@
# define VIR_FROM_THIS VIR_FROM_NONE
static int
testVirPCIDeviceCheckDriver(virPCIDevicePtr dev, const char *expected)
testVirPCIDeviceCheckDriver(virPCIDevice *dev, const char *expected)
{
char *path = NULL;
char *driver = NULL;
@@ -58,7 +58,7 @@ static int
testVirPCIDeviceNew(const void *opaque G_GNUC_UNUSED)
{
int ret = -1;
virPCIDevicePtr dev;
virPCIDevice *dev;
const char *devName;
virPCIDeviceAddress devAddr = {.domain = 0, .bus = 0, .slot = 0, .function = 0};
@@ -91,10 +91,10 @@ static int
testVirPCIDeviceDetach(const void *opaque G_GNUC_UNUSED)
{
int ret = -1;
virPCIDevicePtr dev[] = {NULL, NULL, NULL};
virPCIDevice *dev[] = {NULL, NULL, NULL};
size_t i, nDev = G_N_ELEMENTS(dev);
virPCIDeviceListPtr activeDevs = NULL;
virPCIDeviceListPtr inactiveDevs = NULL;
virPCIDeviceList *activeDevs = NULL;
virPCIDeviceList *inactiveDevs = NULL;
int count;
if (!(activeDevs = virPCIDeviceListNew()) ||
@@ -135,10 +135,10 @@ static int
testVirPCIDeviceReset(const void *opaque G_GNUC_UNUSED)
{
int ret = -1;
virPCIDevicePtr dev[] = {NULL, NULL, NULL};
virPCIDevice *dev[] = {NULL, NULL, NULL};
size_t i, nDev = G_N_ELEMENTS(dev);
virPCIDeviceListPtr activeDevs = NULL;
virPCIDeviceListPtr inactiveDevs = NULL;
virPCIDeviceList *activeDevs = NULL;
virPCIDeviceList *inactiveDevs = NULL;
int count;
if (!(activeDevs = virPCIDeviceListNew()) ||
@@ -173,10 +173,10 @@ static int
testVirPCIDeviceReattach(const void *opaque G_GNUC_UNUSED)
{
int ret = -1;
virPCIDevicePtr dev[] = {NULL, NULL, NULL};
virPCIDevice *dev[] = {NULL, NULL, NULL};
size_t i, nDev = G_N_ELEMENTS(dev);
virPCIDeviceListPtr activeDevs = NULL;
virPCIDeviceListPtr inactiveDevs = NULL;
virPCIDeviceList *activeDevs = NULL;
virPCIDeviceList *inactiveDevs = NULL;
int count;
if (!(activeDevs = virPCIDeviceListNew()) ||
@@ -231,7 +231,7 @@ testVirPCIDeviceIsAssignable(const void *opaque)
{
const struct testPCIDevData *data = opaque;
int ret = -1;
virPCIDevicePtr dev;
virPCIDevice *dev;
virPCIDeviceAddress devAddr = {.domain = data->domain, .bus = data->bus,
.slot = data->slot, .function = data->function};
@@ -250,7 +250,7 @@ testVirPCIDeviceDetachSingle(const void *opaque)
{
const struct testPCIDevData *data = opaque;
int ret = -1;
virPCIDevicePtr dev;
virPCIDevice *dev;
virPCIDeviceAddress devAddr = {.domain = data->domain, .bus = data->bus,
.slot = data->slot, .function = data->function};
@@ -274,7 +274,7 @@ testVirPCIDeviceReattachSingle(const void *opaque)
{
const struct testPCIDevData *data = opaque;
int ret = -1;
virPCIDevicePtr dev;
virPCIDevice *dev;
virPCIDeviceAddress devAddr = {.domain = data->domain, .bus = data->bus,
.slot = data->slot, .function = data->function};
@@ -300,7 +300,7 @@ testVirPCIDeviceCheckDriverTest(const void *opaque)
{
const struct testPCIDevData *data = opaque;
int ret = -1;
virPCIDevicePtr dev;
virPCIDevice *dev;
virPCIDeviceAddress devAddr = {.domain = data->domain, .bus = data->bus,
.slot = data->slot, .function = data->function};
@@ -322,7 +322,7 @@ testVirPCIDeviceUnbind(const void *opaque)
{
const struct testPCIDevData *data = opaque;
int ret = -1;
virPCIDevicePtr dev;
virPCIDevice *dev;
virPCIDeviceAddress devAddr = {.domain = data->domain, .bus = data->bus,
.slot = data->slot, .function = data->function};

View File

@@ -38,7 +38,7 @@ VIR_LOG_INIT("tests.portallocatortest");
static int testAllocAll(const void *args G_GNUC_UNUSED)
{
virPortAllocatorRangePtr ports = virPortAllocatorRangeNew("test", 5900, 5909);
virPortAllocatorRange *ports = virPortAllocatorRangeNew("test", 5900, 5909);
int ret = -1;
unsigned short p1 = 0, p2 = 0, p3 = 0, p4 = 0, p5 = 0, p6 = 0, p7 = 0;
@@ -110,7 +110,7 @@ static int testAllocAll(const void *args G_GNUC_UNUSED)
static int testAllocReuse(const void *args G_GNUC_UNUSED)
{
virPortAllocatorRangePtr ports = virPortAllocatorRangeNew("test", 5900, 5910);
virPortAllocatorRange *ports = virPortAllocatorRangeNew("test", 5900, 5910);
int ret = -1;
unsigned short p1 = 0, p2 = 0, p3 = 0, p4 = 0;

View File

@@ -21,10 +21,10 @@ test_virResctrlGetUnused(const void *opaque)
char *system_dir = NULL;
char *resctrl_dir = NULL;
int ret = -1;
virResctrlAllocPtr alloc = NULL;
virResctrlAlloc *alloc = NULL;
char *schemata_str = NULL;
char *schemata_file;
virCapsPtr caps = NULL;
virCaps *caps = NULL;
system_dir = g_strdup_printf("%s/vircaps2xmldata/linux-%s/system", abs_srcdir,
data->filename);

View File

@@ -166,7 +166,7 @@ static int testRotatingFileInitFiles(off_t baseSize,
static int testRotatingFileWriterNew(const void *data G_GNUC_UNUSED)
{
virRotatingFileWriterPtr file;
virRotatingFileWriter *file;
int ret = -1;
char buf[512];
@@ -209,7 +209,7 @@ static int testRotatingFileWriterNew(const void *data G_GNUC_UNUSED)
static int testRotatingFileWriterAppend(const void *data G_GNUC_UNUSED)
{
virRotatingFileWriterPtr file;
virRotatingFileWriter *file;
int ret = -1;
char buf[512];
@@ -252,7 +252,7 @@ static int testRotatingFileWriterAppend(const void *data G_GNUC_UNUSED)
static int testRotatingFileWriterTruncate(const void *data G_GNUC_UNUSED)
{
virRotatingFileWriterPtr file;
virRotatingFileWriter *file;
int ret = -1;
char buf[512];
@@ -295,7 +295,7 @@ static int testRotatingFileWriterTruncate(const void *data G_GNUC_UNUSED)
static int testRotatingFileWriterRolloverNone(const void *data G_GNUC_UNUSED)
{
virRotatingFileWriterPtr file;
virRotatingFileWriter *file;
int ret = -1;
char buf[512];
@@ -338,7 +338,7 @@ static int testRotatingFileWriterRolloverNone(const void *data G_GNUC_UNUSED)
static int testRotatingFileWriterRolloverOne(const void *data G_GNUC_UNUSED)
{
virRotatingFileWriterPtr file;
virRotatingFileWriter *file;
int ret = -1;
char buf[512];
@@ -383,7 +383,7 @@ static int testRotatingFileWriterRolloverOne(const void *data G_GNUC_UNUSED)
static int testRotatingFileWriterRolloverAppend(const void *data G_GNUC_UNUSED)
{
virRotatingFileWriterPtr file;
virRotatingFileWriter *file;
int ret = -1;
char buf[512];
@@ -426,7 +426,7 @@ static int testRotatingFileWriterRolloverAppend(const void *data G_GNUC_UNUSED)
static int testRotatingFileWriterRolloverMany(const void *data G_GNUC_UNUSED)
{
virRotatingFileWriterPtr file;
virRotatingFileWriter *file;
int ret = -1;
char buf[512];
@@ -475,7 +475,7 @@ static int testRotatingFileWriterRolloverMany(const void *data G_GNUC_UNUSED)
static int testRotatingFileWriterRolloverLineBreak(const void *data G_GNUC_UNUSED)
{
virRotatingFileWriterPtr file;
virRotatingFileWriter *file;
int ret = -1;
const char *buf = "The quick brown fox jumps over the lazy dog\n"
"The wizard quickly jinxed the gnomes before they vaporized\n";
@@ -517,7 +517,7 @@ static int testRotatingFileWriterRolloverLineBreak(const void *data G_GNUC_UNUSE
static int testRotatingFileWriterLargeFile(const void *data G_GNUC_UNUSED)
{
virRotatingFileWriterPtr file;
virRotatingFileWriter *file;
int ret = -1;
const char *buf = "The quick brown fox jumps over the lazy dog\n"
"The wizard quickly jinxed the gnomes before they vaporized\n";
@@ -559,7 +559,7 @@ static int testRotatingFileWriterLargeFile(const void *data G_GNUC_UNUSED)
static int testRotatingFileReaderOne(const void *data G_GNUC_UNUSED)
{
virRotatingFileReaderPtr file;
virRotatingFileReader *file;
int ret = -1;
char buf[512];
ssize_t got;
@@ -591,7 +591,7 @@ static int testRotatingFileReaderOne(const void *data G_GNUC_UNUSED)
static int testRotatingFileReaderAll(const void *data G_GNUC_UNUSED)
{
virRotatingFileReaderPtr file;
virRotatingFileReader *file;
int ret = -1;
char buf[768];
ssize_t got;
@@ -623,7 +623,7 @@ static int testRotatingFileReaderAll(const void *data G_GNUC_UNUSED)
static int testRotatingFileReaderPartial(const void *data G_GNUC_UNUSED)
{
virRotatingFileReaderPtr file;
virRotatingFileReader *file;
int ret = -1;
char buf[600];
ssize_t got;
@@ -655,7 +655,7 @@ static int testRotatingFileReaderPartial(const void *data G_GNUC_UNUSED)
static int testRotatingFileReaderSeek(const void *data G_GNUC_UNUSED)
{
virRotatingFileReaderPtr file;
virRotatingFileReader *file;
int ret = -1;
char buf[600];
ssize_t got;

View File

@@ -41,7 +41,7 @@ struct testSchemaEntry {
struct testSchemaData {
virXMLValidatorPtr validator;
virXMLValidator *validator;
const char *xml_path;
};
@@ -65,7 +65,7 @@ testSchemaValidateXML(const void *args)
static int
testSchemaFile(const char *schema,
virXMLValidatorPtr validator,
virXMLValidator *validator,
const char *path)
{
g_autofree char *test_name = NULL;
@@ -82,7 +82,7 @@ testSchemaFile(const char *schema,
static int
testSchemaDir(const char *schema,
virXMLValidatorPtr validator,
virXMLValidator *validator,
const char *dir_path,
const char *filterstr)
{
@@ -150,12 +150,12 @@ testSchemaGrammarReport(const void *opaque)
return 0;
}
static virXMLValidatorPtr
static virXMLValidator *
testSchemaGrammarLoad(const char *schema)
{
g_autofree char *schema_path = NULL;
g_autofree char *testname = NULL;
virXMLValidatorPtr ret;
virXMLValidator *ret;
schema_path = g_strdup_printf("%s/%s", abs_top_srcdir, schema);

View File

@@ -60,12 +60,12 @@ test1(const void *data G_GNUC_UNUSED)
static int
test2(const void *data G_GNUC_UNUSED)
{
virSCSIDeviceListPtr list = NULL;
virSCSIDevicePtr dev = NULL;
virSCSIDevicePtr dev1 = NULL;
virSCSIDeviceList *list = NULL;
virSCSIDevice *dev = NULL;
virSCSIDevice *dev1 = NULL;
bool free_dev = true;
bool free_dev1 = true;
virSCSIDevicePtr tmp = NULL;
virSCSIDevice *tmp = NULL;
char *sgname = NULL;
int ret = -1;

View File

@@ -80,7 +80,7 @@ testCleanupImages(void)
}
static virStorageSourcePtr
static virStorageSource *
testStorageFileGetMetadata(const char *path,
int format,
uid_t uid, gid_t gid)
@@ -269,7 +269,7 @@ static int
testStorageChain(const void *args)
{
const struct testChainData *data = args;
virStorageSourcePtr elt;
virStorageSource *elt;
size_t i = 0;
g_autoptr(virStorageSource) meta = NULL;
@@ -337,14 +337,14 @@ testStorageChain(const void *args)
struct testLookupData
{
virStorageSourcePtr chain;
virStorageSource *chain;
const char *target;
virStorageSourcePtr from;
virStorageSource *from;
const char *name;
unsigned int expIndex;
const char *expResult;
virStorageSourcePtr expMeta;
virStorageSourcePtr expParent;
virStorageSource *expMeta;
virStorageSource *expParent;
};
static int
@@ -352,8 +352,8 @@ testStorageLookup(const void *args)
{
const struct testLookupData *data = args;
int ret = 0;
virStorageSourcePtr result;
virStorageSourcePtr actualParent;
virStorageSource *result;
virStorageSource *actualParent;
result = virStorageSourceChainLookup(data->chain, data->from,
data->name, data->target, &actualParent);
@@ -455,8 +455,8 @@ testPathRelativePrepare(void)
struct testPathRelativeBacking
{
virStorageSourcePtr top;
virStorageSourcePtr base;
virStorageSource *top;
virStorageSource *base;
const char *expect;
};
@@ -548,8 +548,8 @@ mymain(void)
struct testLookupData data2;
struct testPathRelativeBacking data4;
struct testBackingParseData data5;
virStorageSourcePtr chain2; /* short for chain->backingStore */
virStorageSourcePtr chain3; /* short for chain2->backingStore */
virStorageSource *chain2; /* short for chain->backingStore */
virStorageSource *chain3; /* short for chain2->backingStore */
g_autoptr(virCommand) cmd = NULL;
g_autoptr(virStorageSource) chain = NULL;

View File

@@ -495,8 +495,8 @@ static int testPMSupportSystemdNotRunning(const void *opaque)
static int
testActivationCreateFDs(virNetSocketPtr *sockUNIX,
virNetSocketPtr **sockIP,
testActivationCreateFDs(virNetSocket **sockUNIX,
virNetSocket ***sockIP,
size_t *nsockIP)
{
*sockUNIX = NULL;
@@ -526,8 +526,8 @@ testActivationCreateFDs(virNetSocketPtr *sockUNIX,
static int
testActivation(bool useNames)
{
virNetSocketPtr sockUNIX;
virNetSocketPtr *sockIP;
virNetSocket *sockUNIX;
virNetSocket **sockIP;
size_t nsockIP;
int ret = -1;
size_t i;
@@ -624,7 +624,7 @@ testActivation(bool useNames)
static int
testActivationEmpty(const void *opaque G_GNUC_UNUSED)
{
virSystemdActivationPtr act;
virSystemdActivation *act;
g_unsetenv("LISTEN_FDS");

View File

@@ -41,13 +41,13 @@ struct URIParseData {
const char *query;
const char *fragment;
const char *user;
virURIParamPtr params;
virURIParam *params;
};
static int testURIParse(const void *args)
{
int ret = -1;
virURIPtr uri = NULL;
virURI *uri = NULL;
const struct URIParseData *data = args;
char *uristr = NULL;
size_t i;

View File

@@ -45,7 +45,7 @@ struct findTestInfo {
bool expectFailure;
};
static int testDeviceFileActor(virUSBDevicePtr dev,
static int testDeviceFileActor(virUSBDevice *dev,
const char *path,
void *opaque G_GNUC_UNUSED)
{
@@ -69,8 +69,8 @@ static int testDeviceFind(const void *opaque)
{
const struct findTestInfo *info = opaque;
int ret = -1;
virUSBDevicePtr dev = NULL;
virUSBDeviceListPtr devs = NULL;
virUSBDevice *dev = NULL;
virUSBDeviceList *devs = NULL;
int rv = 0;
size_t i, ndevs = 0;
@@ -113,7 +113,7 @@ static int testDeviceFind(const void *opaque)
ndevs = virUSBDeviceListCount(devs);
for (i = 0; i < ndevs; i++) {
virUSBDevicePtr device = virUSBDeviceListGet(devs, i);
virUSBDevice *device = virUSBDeviceListGet(devs, i);
if (virUSBDeviceFileIterate(device, testDeviceFileActor, NULL) < 0)
goto cleanup;
}
@@ -147,9 +147,9 @@ testCheckNdevs(const char* occasion,
static int
testUSBList(const void *opaque G_GNUC_UNUSED)
{
virUSBDeviceListPtr list = NULL;
virUSBDeviceListPtr devlist = NULL;
virUSBDevicePtr dev = NULL;
virUSBDeviceList *list = NULL;
virUSBDeviceList *devlist = NULL;
virUSBDevice *dev = NULL;
int ret = -1;
size_t i, ndevs;

View File

@@ -13,15 +13,15 @@
# define VIR_FROM_THIS VIR_FROM_VMWARE
static virCapsPtr caps;
static virDomainXMLOptionPtr xmlopt;
static virCaps *caps;
static virDomainXMLOption *xmlopt;
static virVMXContext ctx;
static void
testCapsInit(void)
{
virCapsGuestPtr guest = NULL;
virCapsGuest *guest = NULL;
caps = virCapabilitiesNew(VIR_ARCH_I686, true, true);
@@ -71,7 +71,7 @@ testCompareFiles(const char *vmx, const char *xml, bool should_fail_parse)
int ret = -1;
char *vmxData = NULL;
char *formatted = NULL;
virDomainDefPtr def = NULL;
virDomainDef *def = NULL;
if (virTestLoadFile(vmx, &vmxData) < 0)
return -1;

View File

@@ -55,7 +55,7 @@ testVshTableHeader(const void *opaque G_GNUC_UNUSED)
" 1 fedora28 running\n"
" 2 rhel7.5 running\n";
vshTablePtr table = vshTableNew("Id", "Name", "State",
vshTable *table = vshTableNew("Id", "Name", "State",
NULL); //to ask about return
if (!table)
goto cleanup;
@@ -84,7 +84,7 @@ testVshTableRowAppend(const void *opaque G_GNUC_UNUSED)
{
int ret = 0;
vshTablePtr table = vshTableNew("Id", "Name", NULL);
vshTable *table = vshTableNew("Id", "Name", NULL);
if (!table)
goto cleanup;
@@ -126,7 +126,7 @@ testUnicode(const void *opaque G_GNUC_UNUSED)
"-----------------------------------------\n"
" 1 fedora28 running\n"
" 2 つへソrhel7.5つへソ running\n";
vshTablePtr table;
vshTable *table;
table = vshTableNew("Id", "名稱", "государство", NULL);
if (!table)
@@ -158,7 +158,7 @@ testUnicodeArabic(const void *opaque G_GNUC_UNUSED)
"-------------------------------------------------------------------------------------------\n"
" 1 ﻉﺪﻴﻟ ﺎﻠﺜﻘﻴﻟ ﻕﺎﻣ ﻊﻧ, ٣٠ ﻎﻴﻨﻳﺍ ﻮﺘﻧﺎﻤﺗ ﺎﻠﺛﺎﻠﺛ، ﺄﺳﺭ, ﺩﻮﻟ ﺩﻮﻟ. ﺄﻣﺎﻣ ﺎﻧ ﻲﻜﻧ\n"
" ﺺﻔﺣﺓ ﺖﻜﺘﻴﻛﺍً ﻊﻟ, ﺎﻠﺠﻧﻭﺩ ﻭﺎﻠﻌﺗﺍﺩ ﺵﺭ\n";
vshTablePtr table;
vshTable *table;
wchar_t wc;
/* If this char is not classed as printable, the actual
@@ -194,7 +194,7 @@ static int
testUnicodeZeroWidthChar(const void *opaque G_GNUC_UNUSED)
{
int ret = 0;
vshTablePtr table = NULL;
vshTable *table = NULL;
const char *exp =
" I\u200Bd Name \u200BStatus\n"
"--------------------------\n"
@@ -231,7 +231,7 @@ static int
testUnicodeCombiningChar(const void *opaque G_GNUC_UNUSED)
{
int ret = 0;
vshTablePtr table = NULL;
vshTable *table = NULL;
const char *exp =
" Id Náme Ⓢtatus\n"
"--------------------------\n"
@@ -260,7 +260,7 @@ static int
testUnicodeNonPrintableChar(const void *opaque G_GNUC_UNUSED)
{
int ret = 0;
vshTablePtr table = NULL;
vshTable *table = NULL;
const char *exp =
" I\\x09d Name Status\n"
"----------------------------------\n"
@@ -288,9 +288,9 @@ static int
testNTables(const void *opaque G_GNUC_UNUSED)
{
int ret = 0;
vshTablePtr table1 = NULL;
vshTablePtr table2 = NULL;
vshTablePtr table3 = NULL;
vshTable *table1 = NULL;
vshTable *table2 = NULL;
vshTable *table3 = NULL;
const char *exp1 =
" Id Name Status\n"
"--------------------------\n"

Some files were not shown because too many files have changed in this diff Show More