char *device = NULL;
char *target = NULL;
char *source = NULL;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
if (vshCommandOptBool(cmd, "inactive"))
flags |= VIR_DOMAIN_XML_INACTIVE;
ret = true;
cleanup:
- vshTableFree(table);
VIR_FREE(source);
VIR_FREE(target);
VIR_FREE(device);
int ninterfaces;
xmlNodePtr *interfaces = NULL;
size_t i;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
if (vshCommandOptBool(cmd, "inactive"))
flags |= VIR_DOMAIN_XML_INACTIVE;
ret = true;
cleanup:
- vshTableFree(table);
VIR_FREE(interfaces);
return ret;
}
char id_buf[VIR_INT64_STR_BUFLEN];
unsigned int id;
unsigned int flags = VIR_CONNECT_LIST_DOMAINS_ACTIVE;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
/* construct filter flags */
if (vshCommandOptBool(cmd, "inactive") ||
ret = true;
cleanup:
- vshTableFree(table);
virshDomainListFree(list);
return ret;
}
size_t i;
int ncpus;
bool ret = false;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
if ((ncpus = virshCPUCountCollect(ctl, dom, countFlags, true)) < 0) {
if (ncpus == -1) {
ret = true;
cleanup:
- vshTableFree(table);
VIR_FREE(cpumap);
return ret;
}
virDomainIOThreadInfoPtr *info = NULL;
size_t i;
unsigned int flags = VIR_DOMAIN_AFFECT_CURRENT;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
bool ret = false;
int rc;
for (i = 0; i < niothreads; i++)
virDomainIOThreadInfoFree(info[i]);
VIR_FREE(info);
- vshTableFree(table);
return ret;
}
int rc = -1;
size_t i, j;
virDomainFSInfoPtr *info = NULL;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
size_t ninfos = 0;
bool ret = false;
virDomainFSInfoFree(info[i]);
VIR_FREE(info);
}
- vshTableFree(table);
return ret;
}
struct virshInterfaceList *list = NULL;
size_t i;
bool ret = false;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
VSH_EXCLUSIVE_OPTIONS_VAR(all, inactive);
ret = true;
cleanup:
- vshTableFree(table);
virshInterfaceListFree(list);
return ret;
}
bool optUUID = vshCommandOptBool(cmd, "uuid");
char uuid[VIR_UUID_STRING_BUFLEN];
unsigned int flags = VIR_CONNECT_LIST_NETWORKS_ACTIVE;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
if (vshCommandOptBool(cmd, "inactive"))
flags = VIR_CONNECT_LIST_NETWORKS_INACTIVE;
ret = true;
cleanup:
- vshTableFree(table);
virshNetworkListFree(list);
return ret;
}
size_t i;
unsigned int flags = 0;
virNetworkPtr network = NULL;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
if (vshCommandOptStringReq(ctl, cmd, "mac", &mac) < 0)
return false;
ret = true;
cleanup:
- vshTableFree(table);
if (leases) {
for (i = 0; i < nleases; i++)
virNetworkDHCPLeaseFree(leases[i]);
bool optUUID = vshCommandOptBool(cmd, "uuid");
char uuid[VIR_UUID_STRING_BUFLEN];
unsigned int flags = 0;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
if (optTable + optUUID > 1) {
vshError(ctl, "%s",
ret = true;
cleanup:
- vshTableFree(table);
virshNetworkPortListFree(list);
return ret;
}
char uuid[VIR_UUID_STRING_BUFLEN];
bool ret = false;
struct virshNWFilterList *list = NULL;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
if (!(list = virshNWFilterListCollect(ctl, 0)))
return false;
ret = true;
cleanup:
- vshTableFree(table);
virshNWFilterListFree(list);
return ret;
}
size_t i;
bool ret = false;
struct virshNWFilterBindingList *list = NULL;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
if (!(list = virshNWFilterBindingListCollect(ctl, 0)))
return false;
ret = true;
cleanup:
- vshTableFree(table);
virshNWFilterBindingListFree(list);
return ret;
}
bool inactive, all;
bool uuid = false;
bool name = false;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
inactive = vshCommandOptBool(cmd, "inactive");
all = vshCommandOptBool(cmd, "all");
ret = true;
cleanup:
- vshTableFree(table);
if (list && list->npools) {
for (i = 0; i < list->npools; i++) {
VIR_FREE(poolInfoTexts[i].state);
struct virshSecretList *list = NULL;
bool ret = false;
unsigned int flags = 0;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
if (vshCommandOptBool(cmd, "ephemeral"))
flags |= VIR_CONNECT_LIST_SECRETS_EPHEMERAL;
ret = true;
cleanup:
- vshTableFree(table);
virshSecretListFree(list);
return ret;
}
};
struct volInfoText *volInfoTexts = NULL;
struct virshStorageVolList *list = NULL;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
/* Look up the pool information given to us by the user */
if (!(pool = virshCommandOptPool(ctl, cmd, "pool", NULL)))
ret = true;
cleanup:
- vshTableFree(table);
/* Safely free the memory allocated in this function */
if (list && list->nvols) {
char *uri = NULL;
virAdmServerPtr *srvs = NULL;
vshAdmControl *priv = ctl->privData;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
/* Obtain a list of available servers on the daemon */
if ((nsrvs = virAdmConnectListServers(priv->conn, &srvs, 0)) < 0) {
ret = true;
cleanup:
- vshTableFree(table);
if (srvs) {
for (i = 0; i < nsrvs; i++)
virAdmServerFree(srvs[i]);
virAdmServerPtr srv = NULL;
virAdmClientPtr *clts = NULL;
vshAdmControl *priv = ctl->privData;
- vshTable *table = NULL;
+ g_autoptr(vshTable) table = NULL;
if (vshCommandOptStringReq(ctl, cmd, "server", &srvname) < 0)
return false;
ret = true;
cleanup:
- vshTableFree(table);
if (clts) {
for (i = 0; i < nclts; i++)
virAdmClientFree(clts[i]);