lib: Replace VIR_AUTOSTRINGLIST with GStrv

Glib provides g_auto(GStrv) which is in-place replacement of our
VIR_AUTOSTRINGLIST.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2020-12-01 09:21:32 +01:00
parent b46ec55d53
commit b7d4e6b67e
46 changed files with 116 additions and 116 deletions

View File

@ -985,7 +985,7 @@ virCPUDefCheckFeatures(virCPUDefPtr cpu,
void *opaque,
char ***features)
{
VIR_AUTOSTRINGLIST list = NULL;
g_auto(GStrv) list = NULL;
size_t n = 0;
size_t i;

View File

@ -32553,7 +32553,7 @@ static int
virDomainDiskAddISCSIPoolSourceHost(virStorageSourcePtr src,
virStoragePoolDefPtr pooldef)
{
VIR_AUTOSTRINGLIST tokens = NULL;
g_auto(GStrv) tokens = NULL;
size_t ntokens;
/* Only support one host */

View File

@ -550,7 +550,7 @@ virCPUarmCpuDataFromRegs(virCPUarmData *data)
{
unsigned long cpuid;
unsigned long hwcaps;
VIR_AUTOSTRINGLIST features = NULL;
g_auto(GStrv) features = NULL;
int cpu_feature_index = 0;
size_t i;

View File

@ -370,8 +370,8 @@ static virDomainHostdevDefPtr
xenParsePCI(char *entry)
{
virDomainHostdevDefPtr hostdev = NULL;
VIR_AUTOSTRINGLIST tokens = NULL;
VIR_AUTOSTRINGLIST options = NULL;
g_auto(GStrv) tokens = NULL;
g_auto(GStrv) options = NULL;
size_t ntokens = 0;
size_t nexttoken = 0;
char *str;
@ -482,7 +482,7 @@ xenHandleConfGetValueStringListErrors(int ret)
static int
xenParsePCIList(virConfPtr conf, virDomainDefPtr def)
{
VIR_AUTOSTRINGLIST pcis = NULL;
g_auto(GStrv) pcis = NULL;
char **entries = NULL;
int rc;
@ -709,7 +709,7 @@ xenParseVfb(virConfPtr conf, virDomainDefPtr def)
}
if (!hvm && def->graphics == NULL) { /* New PV guests use this format */
VIR_AUTOSTRINGLIST vfbs = NULL;
g_auto(GStrv) vfbs = NULL;
int rc;
if ((rc = virConfGetValueStringList(conf, "vfb", false, &vfbs)) == 1) {
@ -941,7 +941,7 @@ xenParseSxprChar(const char *value,
static int
xenParseCharDev(virConfPtr conf, virDomainDefPtr def, const char *nativeFormat)
{
VIR_AUTOSTRINGLIST serials = NULL;
g_auto(GStrv) serials = NULL;
virDomainChrDefPtr chr = NULL;
if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) {

View File

@ -1151,7 +1151,7 @@ static int
xenParseXLNamespaceData(virConfPtr conf, virDomainDefPtr def)
{
virConfValuePtr list = virConfGetValue(conf, "device_model_args");
VIR_AUTOSTRINGLIST args = NULL;
g_auto(GStrv) args = NULL;
size_t nargs;
libxlDomainXmlNsDefPtr nsdata = NULL;

View File

@ -1184,7 +1184,7 @@ int virLXCProcessStart(virConnectPtr conn,
size_t i;
g_autofree char *logfile = NULL;
int logfd = -1;
VIR_AUTOSTRINGLIST veths = NULL;
g_auto(GStrv) veths = NULL;
int handshakefds[2] = { -1, -1 };
off_t pos = -1;
char ebuf[1024];

View File

@ -2616,7 +2616,7 @@ virQEMUCapsProbeQMPObjectProperties(virQEMUCapsPtr qemuCaps,
for (i = 0; i < G_N_ELEMENTS(virQEMUCapsObjectProps); i++) {
virQEMUCapsObjectTypeProps *props = virQEMUCapsObjectProps + i;
VIR_AUTOSTRINGLIST values = NULL;
g_auto(GStrv) values = NULL;
int nvalues;
if (props->capsCondition >= 0 &&
@ -2883,7 +2883,7 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon,
/* QEMU 2.11 for Power renamed all CPU models to lower case, we need to
* translate them back to libvirt's upper case model names. */
if (ARCH_IS_PPC64(arch)) {
VIR_AUTOSTRINGLIST libvirtModels = NULL;
g_auto(GStrv) libvirtModels = NULL;
char **name;
if (virCPUGetModels(arch, &libvirtModels) < 0)
@ -5912,7 +5912,7 @@ virQEMUCapsFillDomainCPUCaps(virQEMUCapsPtr qemuCaps,
VIR_CPU_MODE_CUSTOM,
domCaps->machine)) {
const char *forbidden[] = { "host", NULL };
VIR_AUTOSTRINGLIST models = NULL;
g_auto(GStrv) models = NULL;
if (virCPUGetModels(domCaps->arch, &models) >= 0) {
domCaps->cpu.custom = virQEMUCapsGetCPUModels(qemuCaps,

View File

@ -60,7 +60,7 @@ qemuSetupImagePathCgroup(virDomainObjPtr vm,
{
qemuDomainObjPrivatePtr priv = vm->privateData;
int perms = VIR_CGROUP_DEVICE_READ;
VIR_AUTOSTRINGLIST targetPaths = NULL;
g_auto(GStrv) targetPaths = NULL;
size_t i;
int rv;

View File

@ -632,7 +632,7 @@ static int
virQEMUDriverConfigLoadProcessEntry(virQEMUDriverConfigPtr cfg,
virConfPtr conf)
{
VIR_AUTOSTRINGLIST hugetlbfs = NULL;
g_auto(GStrv) hugetlbfs = NULL;
g_autofree char *stdioHandler = NULL;
g_autofree char *corestr = NULL;
size_t i;
@ -825,13 +825,13 @@ virQEMUDriverConfigLoadNVRAMEntry(virQEMUDriverConfigPtr cfg,
virConfPtr conf,
bool privileged)
{
VIR_AUTOSTRINGLIST nvram = NULL;
g_auto(GStrv) nvram = NULL;
size_t i;
if (virConfGetValueStringList(conf, "nvram", false, &nvram) < 0)
return -1;
if (nvram) {
VIR_AUTOSTRINGLIST fwList = NULL;
g_auto(GStrv) fwList = NULL;
virFirmwareFreeList(cfg->firmwares, cfg->nfirmwares);
cfg->firmwares = NULL;
@ -880,8 +880,8 @@ virQEMUDriverConfigLoadSecurityEntry(virQEMUDriverConfigPtr cfg,
virConfPtr conf,
bool privileged)
{
VIR_AUTOSTRINGLIST controllers = NULL;
VIR_AUTOSTRINGLIST namespaces = NULL;
g_auto(GStrv) controllers = NULL;
g_auto(GStrv) namespaces = NULL;
g_autofree char *user = NULL;
g_autofree char *group = NULL;
size_t i, j;

View File

@ -1183,7 +1183,7 @@ qemuFirmwareFetchParsedConfigs(bool privileged,
qemuFirmwarePtr **firmwaresRet,
char ***pathsRet)
{
VIR_AUTOSTRINGLIST paths = NULL;
g_auto(GStrv) paths = NULL;
size_t npaths;
qemuFirmwarePtr *firmwares = NULL;
size_t i;
@ -1218,7 +1218,7 @@ qemuFirmwareFillDomain(virQEMUDriverPtr driver,
virDomainDefPtr def,
unsigned int flags)
{
VIR_AUTOSTRINGLIST paths = NULL;
g_auto(GStrv) paths = NULL;
qemuFirmwarePtr *firmwares = NULL;
ssize_t nfirmwares = 0;
const qemuFirmware *theone = NULL;

View File

@ -7977,7 +7977,7 @@ qemuMonitorJSONGetCPUData(qemuMonitorPtr mon,
virCPUDataPtr data)
{
qemuMonitorJSONObjectProperty prop = { .type = QEMU_MONITOR_OBJECT_PROPERTY_BOOLEAN };
VIR_AUTOSTRINGLIST props = NULL;
g_auto(GStrv) props = NULL;
char **p;
if (qemuMonitorJSONGetCPUProperties(mon, &props) < 0)
@ -8009,7 +8009,7 @@ qemuMonitorJSONGetCPUDataDisabled(qemuMonitorPtr mon,
void *opaque,
virCPUDataPtr data)
{
VIR_AUTOSTRINGLIST props = NULL;
g_auto(GStrv) props = NULL;
char **p;
if (qemuMonitorJSONGetStringListProperty(mon, QOM_CPU_PATH,

View File

@ -247,7 +247,7 @@ qemuDomainSetupDisk(virStorageSourcePtr src,
if (!(tmpPath = virPCIDeviceAddressGetIOMMUGroupDev(&next->nvme->pciAddr)))
return -1;
} else {
VIR_AUTOSTRINGLIST targetPaths = NULL;
g_auto(GStrv) targetPaths = NULL;
if (virStorageSourceIsEmpty(next) ||
!virStorageSourceIsLocalStorage(next)) {
@ -613,7 +613,7 @@ int
qemuDomainBuildNamespace(virQEMUDriverConfigPtr cfg,
virDomainObjPtr vm)
{
VIR_AUTOSTRINGLIST paths = NULL;
g_auto(GStrv) paths = NULL;
if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT)) {
VIR_DEBUG("namespaces disabled for domain %s", vm->def->name);
@ -1335,7 +1335,7 @@ qemuNamespaceUnlinkPaths(virDomainObjPtr vm,
qemuDomainObjPrivatePtr priv = vm->privateData;
virQEMUDriverPtr driver = priv->driver;
g_autoptr(virQEMUDriverConfig) cfg = NULL;
VIR_AUTOSTRINGLIST unlinkPaths = NULL;
g_auto(GStrv) unlinkPaths = NULL;
char **devMountsPath = NULL;
size_t ndevMountsPath = 0;
size_t npaths;
@ -1387,7 +1387,7 @@ int
qemuDomainNamespaceSetupDisk(virDomainObjPtr vm,
virStorageSourcePtr src)
{
VIR_AUTOSTRINGLIST paths = NULL;
g_auto(GStrv) paths = NULL;
if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
return 0;
@ -1431,7 +1431,7 @@ int
qemuDomainNamespaceSetupHostdev(virDomainObjPtr vm,
virDomainHostdevDefPtr hostdev)
{
VIR_AUTOSTRINGLIST paths = NULL;
g_auto(GStrv) paths = NULL;
if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
return 0;
@ -1464,7 +1464,7 @@ int
qemuDomainNamespaceTeardownHostdev(virDomainObjPtr vm,
virDomainHostdevDefPtr hostdev)
{
VIR_AUTOSTRINGLIST paths = NULL;
g_auto(GStrv) paths = NULL;
if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
return 0;
@ -1486,7 +1486,7 @@ int
qemuDomainNamespaceSetupMemory(virDomainObjPtr vm,
virDomainMemoryDefPtr mem)
{
VIR_AUTOSTRINGLIST paths = NULL;
g_auto(GStrv) paths = NULL;
if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
return 0;
@ -1505,7 +1505,7 @@ int
qemuDomainNamespaceTeardownMemory(virDomainObjPtr vm,
virDomainMemoryDefPtr mem)
{
VIR_AUTOSTRINGLIST paths = NULL;
g_auto(GStrv) paths = NULL;
if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
return 0;
@ -1524,7 +1524,7 @@ int
qemuDomainNamespaceSetupChardev(virDomainObjPtr vm,
virDomainChrDefPtr chr)
{
VIR_AUTOSTRINGLIST paths = NULL;
g_auto(GStrv) paths = NULL;
if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
return 0;
@ -1543,7 +1543,7 @@ int
qemuDomainNamespaceTeardownChardev(virDomainObjPtr vm,
virDomainChrDefPtr chr)
{
VIR_AUTOSTRINGLIST paths = NULL;
g_auto(GStrv) paths = NULL;
if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
return 0;
@ -1562,7 +1562,7 @@ int
qemuDomainNamespaceSetupRNG(virDomainObjPtr vm,
virDomainRNGDefPtr rng)
{
VIR_AUTOSTRINGLIST paths = NULL;
g_auto(GStrv) paths = NULL;
if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
return 0;
@ -1581,7 +1581,7 @@ int
qemuDomainNamespaceTeardownRNG(virDomainObjPtr vm,
virDomainRNGDefPtr rng)
{
VIR_AUTOSTRINGLIST paths = NULL;
g_auto(GStrv) paths = NULL;
if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
return 0;
@ -1600,7 +1600,7 @@ int
qemuDomainNamespaceSetupInput(virDomainObjPtr vm,
virDomainInputDefPtr input)
{
VIR_AUTOSTRINGLIST paths = NULL;
g_auto(GStrv) paths = NULL;
if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
return 0;
@ -1618,7 +1618,7 @@ int
qemuDomainNamespaceTeardownInput(virDomainObjPtr vm,
virDomainInputDefPtr input)
{
VIR_AUTOSTRINGLIST paths = NULL;
g_auto(GStrv) paths = NULL;
if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
return 0;

View File

@ -5482,7 +5482,7 @@ qemuProcessStartValidate(virQEMUDriverPtr driver,
if (ARCH_IS_X86(vm->def->os.arch) &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_UNAVAILABLE_FEATURES)) {
VIR_AUTOSTRINGLIST features = NULL;
g_auto(GStrv) features = NULL;
int n;
if ((n = virCPUDefCheckFeatures(vm->def->cpu,
@ -6181,7 +6181,7 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def,
return -1;
if (ARCH_IS_X86(def->os.arch)) {
VIR_AUTOSTRINGLIST features = NULL;
g_auto(GStrv) features = NULL;
if (virQEMUCapsGetCPUFeatures(qemuCaps, def->virtType, false, &features) < 0)
return -1;

View File

@ -432,7 +432,7 @@ virQEMUQAPISchemaPathGet(const char *query,
GHashTable *schema,
virJSONValuePtr *entry)
{
VIR_AUTOSTRINGLIST elems = NULL;
g_auto(GStrv) elems = NULL;
struct virQEMUQAPISchemaTraverseContext ctxt;
const char *cmdname;
int rc;

View File

@ -242,7 +242,7 @@ qemuVhostUserFetchParsedConfigs(bool privileged,
qemuVhostUserPtr **vhostuserRet,
char ***pathsRet)
{
VIR_AUTOSTRINGLIST paths = NULL;
g_auto(GStrv) paths = NULL;
size_t npaths;
qemuVhostUserPtr *vus = NULL;
size_t i;

View File

@ -920,7 +920,7 @@ virNetSocketNewConnectLibSSH2(const char *host,
int ret = -1;
int portN;
VIR_AUTOSTRINGLIST authMethodList = NULL;
g_auto(GStrv) authMethodList = NULL;
char **authMethodNext;
/* port number will be verified while opening the socket */
@ -1052,7 +1052,7 @@ virNetSocketNewConnectLibssh(const char *host,
int ret = -1;
int portN;
VIR_AUTOSTRINGLIST authMethodList = NULL;
g_auto(GStrv) authMethodList = NULL;
char **authMethodNext;
/* port number will be verified while opening the socket */

View File

@ -139,8 +139,8 @@ virStorageBackendSheepdogRefreshAllVol(virStoragePoolObjPtr pool)
{
size_t i;
g_autofree char *output = NULL;
VIR_AUTOSTRINGLIST lines = NULL;
VIR_AUTOSTRINGLIST cells = NULL;
g_auto(GStrv) lines = NULL;
g_auto(GStrv) cells = NULL;
g_autoptr(virCommand) cmd = NULL;
cmd = virCommandNewArgList(SHEEPDOGCLI, "vdi", "list", "-r", NULL);

View File

@ -101,8 +101,8 @@ virStorageBackendZFSParseVol(virStoragePoolObjPtr pool,
bool is_new_vol = false;
virStorageVolDefPtr volume = NULL;
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
VIR_AUTOSTRINGLIST tokens = NULL;
VIR_AUTOSTRINGLIST name_tokens = NULL;
g_auto(GStrv) tokens = NULL;
g_auto(GStrv) name_tokens = NULL;
if (!(tokens = virStringSplitCount(volume_string, "\t", 0, &count)))
return -1;
@ -169,7 +169,7 @@ virStorageBackendZFSFindVols(virStoragePoolObjPtr pool,
{
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
size_t i;
VIR_AUTOSTRINGLIST lines = NULL;
g_auto(GStrv) lines = NULL;
g_autoptr(virCommand) cmd = NULL;
g_autofree char *volumes_list = NULL;
@ -216,9 +216,9 @@ virStorageBackendZFSRefreshPool(virStoragePoolObjPtr pool G_GNUC_UNUSED)
char *zpool_props = NULL;
size_t i;
g_autoptr(virCommand) cmd = NULL;
VIR_AUTOSTRINGLIST lines = NULL;
VIR_AUTOSTRINGLIST tokens = NULL;
VIR_AUTOSTRINGLIST name_tokens = NULL;
g_auto(GStrv) lines = NULL;
g_auto(GStrv) tokens = NULL;
g_auto(GStrv) name_tokens = NULL;
/**
* $ zpool get -Hp health,size,free,allocated test

View File

@ -1140,7 +1140,7 @@ virCgroupEnableMissingControllers(char *path,
virCgroupPtr *group)
{
g_autoptr(virCgroup) parent = NULL;
VIR_AUTOSTRINGLIST tokens = virStringSplit(path, "/", 0);
g_auto(GStrv) tokens = virStringSplit(path, "/", 0);
size_t i;
if (virCgroupNew("/", controllers, &parent) < 0)

View File

@ -3201,7 +3201,7 @@ virCommandRunRegex(virCommandPtr cmd,
int totgroups = 0, ngroup = 0;
char **groups;
g_autofree char *outbuf = NULL;
VIR_AUTOSTRINGLIST lines = NULL;
g_auto(GStrv) lines = NULL;
int ret = -1;
/* Compile all regular expressions */

View File

@ -54,7 +54,7 @@ static int
virDevMapperGetMajor(unsigned int *major)
{
g_autofree char *buf = NULL;
VIR_AUTOSTRINGLIST lines = NULL;
g_auto(GStrv) lines = NULL;
size_t i;
if (!virFileExists(CONTROL_PATH))
@ -223,7 +223,7 @@ virDevMapperGetTargetsImpl(int controlFD,
g_autofree char *buf = NULL;
struct dm_ioctl dm;
struct dm_target_deps *deps = NULL;
VIR_AUTOSTRINGLIST devPaths = NULL;
g_auto(GStrv) devPaths = NULL;
size_t i;
memset(&dm, 0, sizeof(dm));
@ -265,7 +265,7 @@ virDevMapperGetTargetsImpl(int controlFD,
}
for (i = 0; i < deps->count; i++) {
VIR_AUTOSTRINGLIST tmpPaths = NULL;
g_auto(GStrv) tmpPaths = NULL;
if (virDevMapperGetTargetsImpl(controlFD, devPaths[i], &tmpPaths, ttl - 1) < 0)
return -1;

View File

@ -1619,7 +1619,7 @@ char *
virFindFileInPath(const char *file)
{
const char *origpath = NULL;
VIR_AUTOSTRINGLIST paths = NULL;
g_auto(GStrv) paths = NULL;
char **pathiter;
if (file == NULL)

View File

@ -686,7 +686,7 @@ virFirewallApplyRule(virFirewallPtr firewall,
{
g_autofree char *output = NULL;
g_autofree char *str = virFirewallRuleToString(rule);
VIR_AUTOSTRINGLIST lines = NULL;
g_auto(GStrv) lines = NULL;
VIR_INFO("Applying rule '%s'", NULLSTR(str));
if (rule->ignoreErrors)

View File

@ -343,7 +343,7 @@ virHookCall(int driver,
struct dirent *entry;
g_autofree char *path = NULL;
g_autofree char *dir_path = NULL;
VIR_AUTOSTRINGLIST entries = NULL;
g_auto(GStrv) entries = NULL;
const char *drvstr;
const char *opstr;
const char *subopstr;

View File

@ -2112,7 +2112,7 @@ virJSONValueObjectDeflattenWorker(const char *key,
virJSONValuePtr retobj = opaque;
g_autoptr(virJSONValue) newval = NULL;
virJSONValuePtr existobj;
VIR_AUTOSTRINGLIST tokens = NULL;
g_auto(GStrv) tokens = NULL;
size_t ntokens = 0;
/* non-nested keys only need to be copied */

View File

@ -985,7 +985,7 @@ int virProcessGetStartTime(pid_t pid,
int len;
g_autofree char *filename = NULL;
g_autofree char *buf = NULL;
VIR_AUTOSTRINGLIST tokens = NULL;
g_auto(GStrv) tokens = NULL;
filename = g_strdup_printf("/proc/%llu/stat", (long long)pid);

View File

@ -1503,7 +1503,7 @@ virStorageFileParseBackingStoreStr(const char *str,
size_t nstrings;
unsigned int idx = 0;
char *suffix;
VIR_AUTOSTRINGLIST strings = NULL;
g_auto(GStrv) strings = NULL;
*chainIndex = 0;
@ -2778,7 +2778,7 @@ virStorageSourceParseBackingURI(virStorageSourcePtr src,
{
g_autoptr(virURI) uri = NULL;
const char *path = NULL;
VIR_AUTOSTRINGLIST scheme = NULL;
g_auto(GStrv) scheme = NULL;
if (!(uri = virURIParse(uristr))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@ -2880,7 +2880,7 @@ virStorageSourceRBDAddHost(virStorageSourcePtr src,
{
char *port;
size_t skip;
VIR_AUTOSTRINGLIST parts = NULL;
g_auto(GStrv) parts = NULL;
if (VIR_EXPAND_N(src->hosts, src->nhosts, 1) < 0)
return -1;
@ -3220,7 +3220,7 @@ virStorageSourceParseBackingJSONUriCookies(virStorageSourcePtr src,
const char *jsonstr)
{
const char *cookiestr;
VIR_AUTOSTRINGLIST cookies = NULL;
g_auto(GStrv) cookies = NULL;
size_t ncookies = 0;
size_t i;
@ -4512,7 +4512,7 @@ int
virStorageFileCheckCompat(const char *compat)
{
unsigned int result;
VIR_AUTOSTRINGLIST version = NULL;
g_auto(GStrv) version = NULL;
if (!compat)
return 0;

View File

@ -681,7 +681,7 @@ virSystemdActivationInitFromNames(virSystemdActivationPtr act,
int nfds,
const char *fdnames)
{
VIR_AUTOSTRINGLIST fdnamelistptr = NULL;
g_auto(GStrv) fdnamelistptr = NULL;
char **fdnamelist;
size_t nfdnames;
size_t i;

View File

@ -1577,7 +1577,7 @@ virVMXParseConfig(virVMXContext *ctx,
}
if (sched_cpu_affinity != NULL && STRCASENEQ(sched_cpu_affinity, "all")) {
VIR_AUTOSTRINGLIST afflist = NULL;
g_auto(GStrv) afflist = NULL;
char **aff;
size_t naffs;

View File

@ -56,7 +56,7 @@ static int
testFWPrecedence(const void *opaque G_GNUC_UNUSED)
{
g_autofree char *fakehome = NULL;
VIR_AUTOSTRINGLIST fwList = NULL;
g_auto(GStrv) fwList = NULL;
size_t nfwList;
size_t i;
const char *expected[] = {

View File

@ -87,7 +87,7 @@ testDomain(const void *opaque)
{
const struct testData *data = opaque;
g_autoptr(virDomainObj) vm = NULL;
VIR_AUTOSTRINGLIST notRestored = NULL;
g_auto(GStrv) notRestored = NULL;
size_t i;
int ret = -1;

View File

@ -56,7 +56,7 @@ static int
testVUPrecedence(const void *opaque G_GNUC_UNUSED)
{
g_autofree char *fakehome = NULL;
VIR_AUTOSTRINGLIST vuList = NULL;
g_auto(GStrv) vuList = NULL;
size_t nvuList;
size_t i;
const char *expected[] = {

View File

@ -130,7 +130,7 @@ static virStorageVolPtr
fakeStorageVolLookupByName(virStoragePoolPtr pool,
const char *name)
{
VIR_AUTOSTRINGLIST volinfo = NULL;
g_auto(GStrv) volinfo = NULL;
virStorageVolPtr ret = NULL;
if (STREQ(pool->name, "inactive")) {
@ -517,7 +517,7 @@ testCompareXMLToArgvValidateSchema(virQEMUDriverPtr drv,
struct testQemuInfo *info,
unsigned int flags)
{
VIR_AUTOSTRINGLIST args = NULL;
g_auto(GStrv) args = NULL;
g_autoptr(virDomainObj) vm = NULL;
size_t nargs = 0;
size_t i;

View File

@ -102,7 +102,7 @@ VIR_MOCK_WRAP_RET_ARGS(g_dbus_connection_call_sync,
} else if (STREQ(bus_name, VIR_FIREWALL_FIREWALLD_SERVICE) &&
STREQ(method_name, "passthrough")) {
g_autoptr(GVariantIter) iter = NULL;
VIR_AUTOSTRINGLIST args = NULL;
g_auto(GStrv) args = NULL;
size_t nargs = 0;
char *type = NULL;
char *item = NULL;

View File

@ -42,7 +42,7 @@ virshDomainNameCompleter(vshControl *ctl,
int ndomains = 0;
size_t i = 0;
char **ret = NULL;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(VIR_CONNECT_LIST_DOMAINS_ACTIVE |
VIR_CONNECT_LIST_DOMAINS_INACTIVE |
@ -89,7 +89,7 @@ virshDomainUUIDCompleter(vshControl *ctl,
int ndomains = 0;
size_t i = 0;
char **ret = NULL;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(VIR_CONNECT_LIST_DOMAINS_ACTIVE |
VIR_CONNECT_LIST_DOMAINS_INACTIVE |
@ -142,7 +142,7 @@ virshDomainInterfaceCompleter(vshControl *ctl,
g_autofree xmlNodePtr *interfaces = NULL;
size_t i;
unsigned int domainXMLFlags = 0;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(VIRSH_DOMAIN_INTERFACE_COMPLETER_MAC, NULL);
@ -189,7 +189,7 @@ virshDomainDiskTargetCompleter(vshControl *ctl,
g_autofree xmlNodePtr *disks = NULL;
int ndisks;
size_t i;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);
@ -221,7 +221,7 @@ virshDomainEventNameCompleter(vshControl *ctl G_GNUC_UNUSED,
unsigned int flags)
{
size_t i = 0;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);
@ -249,7 +249,7 @@ virshDomainInterfaceStateCompleter(vshControl *ctl,
g_autofree xmlNodePtr *interfaces = NULL;
g_autofree char *xpath = NULL;
g_autofree char *state = NULL;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);
@ -303,7 +303,7 @@ virshDomainDeviceAliasCompleter(vshControl *ctl,
g_autofree xmlNodePtr *aliases = NULL;
size_t i;
unsigned int domainXMLFlags = 0;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);
@ -392,7 +392,7 @@ virshDomainPerfEnableCompleter(vshControl *ctl,
unsigned int flags)
{
size_t i = 0;
VIR_AUTOSTRINGLIST events = NULL;
g_auto(GStrv) events = NULL;
const char *event = NULL;
virCheckFlags(0, NULL);
@ -415,7 +415,7 @@ virshDomainPerfDisableCompleter(vshControl *ctl,
unsigned int flags)
{
size_t i = 0;
VIR_AUTOSTRINGLIST events = NULL;
g_auto(GStrv) events = NULL;
const char *event = NULL;
virCheckFlags(0, NULL);
@ -443,7 +443,7 @@ virshDomainIOThreadIdCompleter(vshControl *ctl,
size_t i;
int rc;
char **ret = NULL;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);
@ -479,7 +479,7 @@ virshDomainVcpuCompleter(vshControl *ctl,
int nvcpus = 0;
unsigned int id;
char **ret = NULL;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);
@ -519,7 +519,7 @@ virshDomainVcpulistCompleter(vshControl *ctl,
xmlXPathContextPtr ctxt = NULL;
int nvcpus = 0;
unsigned int id;
VIR_AUTOSTRINGLIST vcpulist = NULL;
g_auto(GStrv) vcpulist = NULL;
const char *vcpuid = NULL;
char **ret = NULL;
@ -564,7 +564,7 @@ virshDomainCpulistCompleter(vshControl *ctl,
int cpunum;
g_autofree unsigned char *cpumap = NULL;
unsigned int online;
VIR_AUTOSTRINGLIST cpulist = NULL;
g_auto(GStrv) cpulist = NULL;
const char *cpuid = NULL;
virCheckFlags(0, NULL);
@ -596,7 +596,7 @@ virshDomainVcpulistViaAgentCompleter(vshControl *ctl,
unsigned int nparams = 0;
size_t i;
int nvcpus;
VIR_AUTOSTRINGLIST cpulist = NULL;
g_auto(GStrv) cpulist = NULL;
const char *vcpuid = NULL;
char **ret = NULL;
@ -677,7 +677,7 @@ virshDomainConsoleCompleter(vshControl *ctl,
g_autofree xmlNodePtr *parallels = NULL;
size_t i;
size_t offset = 0;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);
@ -722,7 +722,7 @@ virshDomainSignalCompleter(vshControl *ctl G_GNUC_UNUSED,
const vshCmd *cmd G_GNUC_UNUSED,
unsigned int flags)
{
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
size_t i = 0;
virCheckFlags(0, NULL);
@ -743,7 +743,7 @@ virshDomainLifecycleCompleter(vshControl *ctl G_GNUC_UNUSED,
const vshCmd *cmd G_GNUC_UNUSED,
unsigned int flags)
{
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
size_t i = 0;
virCheckFlags(0, NULL);
@ -764,7 +764,7 @@ virshDomainLifecycleActionCompleter(vshControl *ctl G_GNUC_UNUSED,
const vshCmd *cmd G_GNUC_UNUSED,
unsigned int flags)
{
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
size_t i = 0;
virCheckFlags(0, NULL);

View File

@ -63,7 +63,7 @@ virshAllocpagesPagesizeCompleter(vshControl *ctl,
bool cellno = vshCommandOptBool(cmd, "cellno");
g_autofree char *path = NULL;
g_autofree char *cap_xml = NULL;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);
@ -110,7 +110,7 @@ virshCellnoCompleter(vshControl *ctl,
g_autoptr(xmlDoc) doc = NULL;
size_t i = 0;
g_autofree char *cap_xml = NULL;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);
@ -144,7 +144,7 @@ virshNodeCpuCompleter(vshControl *ctl,
unsigned int flags)
{
virshControlPtr priv = ctl->privData;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
size_t i;
int cpunum;
size_t offset = 0;

View File

@ -38,7 +38,7 @@ virshInterfaceStringHelper(vshControl *ctl,
virInterfacePtr *ifaces = NULL;
int nifaces = 0;
size_t i = 0;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(VIR_CONNECT_LIST_INTERFACES_ACTIVE |
VIR_CONNECT_LIST_INTERFACES_INACTIVE,

View File

@ -36,7 +36,7 @@ virshNetworkNameCompleter(vshControl *ctl,
int nnets = 0;
size_t i = 0;
char **ret = NULL;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(VIR_CONNECT_LIST_NETWORKS_INACTIVE |
VIR_CONNECT_LIST_NETWORKS_ACTIVE |
@ -72,7 +72,7 @@ virshNetworkEventNameCompleter(vshControl *ctl G_GNUC_UNUSED,
unsigned int flags)
{
size_t i = 0;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);
@ -145,7 +145,7 @@ virshNetworkUUIDCompleter(vshControl *ctl,
int nnets = 0;
size_t i = 0;
char **ret = NULL;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);
@ -187,7 +187,7 @@ virshNetworkDhcpMacCompleter(vshControl *ctl,
int nleases;
size_t i = 0;
char **ret = NULL;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);

View File

@ -37,7 +37,7 @@ virshNodeDeviceNameCompleter(vshControl *ctl,
int ndevs = 0;
size_t i = 0;
char **ret = NULL;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);
@ -70,7 +70,7 @@ virshNodeDeviceEventNameCompleter(vshControl *ctl G_GNUC_UNUSED,
unsigned int flags)
{
size_t i = 0;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);
@ -88,7 +88,7 @@ virshNodeDeviceCapabilityNameCompleter(vshControl *ctl,
const vshCmd *cmd,
unsigned int flags)
{
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
const char *cap_str = NULL;
size_t i = 0;

View File

@ -35,7 +35,7 @@ virshNWFilterNameCompleter(vshControl *ctl,
int nnwfilters = 0;
size_t i = 0;
char **ret = NULL;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);
@ -72,7 +72,7 @@ virshNWFilterBindingNameCompleter(vshControl *ctl,
int nbindings = 0;
size_t i = 0;
char **ret = NULL;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);

View File

@ -37,7 +37,7 @@ virshStoragePoolNameCompleter(vshControl *ctl,
int npools = 0;
size_t i = 0;
char **ret = NULL;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(VIR_CONNECT_LIST_STORAGE_POOLS_INACTIVE |
VIR_CONNECT_LIST_STORAGE_POOLS_ACTIVE |
@ -73,7 +73,7 @@ virshPoolEventNameCompleter(vshControl *ctl G_GNUC_UNUSED,
unsigned int flags)
{
size_t i = 0;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);
@ -91,7 +91,7 @@ virshPoolTypeCompleter(vshControl *ctl,
const vshCmd *cmd,
unsigned int flags)
{
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
const char *type_str = NULL;
size_t i = 0;

View File

@ -37,7 +37,7 @@ virshSecretUUIDCompleter(vshControl *ctl,
int nsecrets = 0;
size_t i = 0;
char **ret = NULL;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);
@ -73,7 +73,7 @@ virshSecretEventNameCompleter(vshControl *ctl G_GNUC_UNUSED,
unsigned int flags)
{
size_t i;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);

View File

@ -38,7 +38,7 @@ virshSnapshotNameCompleter(vshControl *ctl,
int nsnapshots = 0;
size_t i = 0;
char **ret = NULL;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);

View File

@ -38,7 +38,7 @@ virshStorageVolNameCompleter(vshControl *ctl,
int nvols = 0;
size_t i = 0;
char **ret = NULL;
VIR_AUTOSTRINGLIST tmp = NULL;
g_auto(GStrv) tmp = NULL;
virCheckFlags(0, NULL);

View File

@ -89,8 +89,8 @@ virshCommaStringListComplete(const char *input,
{
const size_t optionsLen = virStringListLength(options);
g_autofree char *inputCopy = NULL;
VIR_AUTOSTRINGLIST inputList = NULL;
VIR_AUTOSTRINGLIST ret = NULL;
g_auto(GStrv) inputList = NULL;
g_auto(GStrv) ret = NULL;
size_t nret = 0;
size_t i;

View File

@ -14288,7 +14288,7 @@ cmdGetUserSSHKeys(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom = NULL;
const char *user;
VIR_AUTOSTRINGLIST keys = NULL;
g_auto(GStrv) keys = NULL;
int nkeys = 0;
size_t i;
const unsigned int flags = 0;
@ -14358,7 +14358,7 @@ cmdSetUserSSHKeys(vshControl *ctl, const vshCmd *cmd)
const char *user;
const char *from;
g_autofree char *buffer = NULL;
VIR_AUTOSTRINGLIST keys = NULL;
g_auto(GStrv) keys = NULL;
int nkeys = 0;
unsigned int flags = 0;
bool ret = false;