virBhyveLoadDriverConfig(virBhyveDriverConfigPtr cfg,
const char *filename)
{
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
if (access(filename, R_OK) == -1) {
VIR_INFO("Could not read bhyve config file %s", filename);
void *parseOpaque,
unsigned int flags)
{
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
g_autofree char *schema = NULL;
if (!virXMLNodeNameEqual(root, "domaincheckpoint")) {
{
int maxvcpus = virDomainDefGetVcpusMax(def);
size_t i;
- VIR_AUTOPTR(virBitmap) allcpumap = NULL;
+ g_autoptr(virBitmap) allcpumap = NULL;
if (hostcpus < 0)
return -1;
size_t i;
ssize_t nxt = -1;
virDomainIOThreadIDDefPtr iothrid = NULL;
- VIR_AUTOPTR(virBitmap) thrmap = NULL;
+ g_autoptr(virBitmap) thrmap = NULL;
/* Same value (either 0 or some number), then we have none to fill in or
* the iothreadid array was filled from the XML
int auth_secret_usage = -1;
xmlNodePtr cur;
virDomainHostdevSubsysSCSIiSCSIPtr iscsisrc = &def->u.iscsi;
- VIR_AUTOPTR(virStorageAuthDef) authdef = NULL;
+ g_autoptr(virStorageAuthDef) authdef = NULL;
/* For the purposes of command line creation, this needs to look
* like a disk storage source */
VIR_XPATH_NODE_AUTORESTORE(ctxt);
bool source = false;
virStorageEncryptionPtr encryption = NULL;
- VIR_AUTOPTR(virStorageAuthDef) authdef = NULL;
+ g_autoptr(virStorageAuthDef) authdef = NULL;
g_autofree char *tmp = NULL;
g_autofree char *snapshot = NULL;
g_autofree char *rawio = NULL;
void *parseOpaque,
unsigned int flags)
{
- VIR_AUTOPTR(xmlDoc) xml = NULL;
+ g_autoptr(xmlDoc) xml = NULL;
xmlNodePtr node;
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
g_autofree virDomainDeviceDefPtr dev = NULL;
char *netprefix;
virDomainXMLOptionPtr xmlopt,
unsigned int flags)
{
- VIR_AUTOPTR(xmlDoc) xml = NULL;
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlDoc) xml = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
virSecurityLabelDefPtr *seclabels = NULL;
size_t nseclabels = 0;
virDomainIOThreadIDDefPtr iothrid;
unsigned int iothreadid;
g_autofree char *tmp = NULL;
- VIR_AUTOPTR(virBitmap) cpumask = NULL;
+ g_autoptr(virBitmap) cpumask = NULL;
if (!(tmp = virXMLPropString(node, "iothread"))) {
virReportError(VIR_ERR_XML_ERROR, "%s",
{
virBitmapPtr ret = NULL;
g_autofree char *tmp = NULL;
- VIR_AUTOPTR(virBitmap) def = NULL;
+ g_autoptr(virBitmap) def = NULL;
if (!(tmp = virXMLPropString(node, "cpuset"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virDomainThreadSchedParamPtr sched = NULL;
virProcessSchedPolicy policy = 0;
int priority = 0;
- VIR_AUTOPTR(virBitmap) map = NULL;
+ g_autoptr(virBitmap) map = NULL;
if (!(map = virDomainSchedulerParse(node, name, &policy, &priority)))
return -1;
ssize_t i = 0;
int n;
int ret = -1;
- VIR_AUTOPTR(virBitmap) vcpus = NULL;
+ g_autoptr(virBitmap) vcpus = NULL;
g_autofree xmlNodePtr *nodes = NULL;
VIR_AUTOUNREF(virResctrlAllocPtr) alloc = NULL;
{
VIR_XPATH_NODE_AUTORESTORE(ctxt);
virDomainResctrlDefPtr resctrl = NULL;
- VIR_AUTOPTR(virBitmap) vcpus = NULL;
+ g_autoptr(virBitmap) vcpus = NULL;
g_autofree xmlNodePtr *nodes = NULL;
VIR_AUTOUNREF(virResctrlAllocPtr) alloc = NULL;
ssize_t i = 0;
void *parseOpaque,
unsigned int flags)
{
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
- VIR_AUTOPTR(virDomainDef) def = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
+ g_autoptr(virDomainDef) def = NULL;
if (!(ctxt = virXMLXPathContextNew(xml)))
return NULL;
virDomainXMLOptionPtr xmlopt,
unsigned int flags)
{
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
if (!virXMLNodeNameEqual(root, "domstatus")) {
virReportError(VIR_ERR_XML_ERROR,
virDomainNetDefToNetworkPort(virDomainDefPtr dom,
virDomainNetDefPtr iface)
{
- VIR_AUTOPTR(virNetworkPortDef) port = NULL;
+ g_autoptr(virNetworkPortDef) port = NULL;
if (iface->type != VIR_DOMAIN_NET_TYPE_NETWORK) {
virReportError(VIR_ERR_INTERNAL_ERROR,
virDomainNetDefPtr iface)
{
virDomainActualNetDefPtr actual;
- VIR_AUTOPTR(virNetworkPortDef) port = NULL;
+ g_autoptr(virNetworkPortDef) port = NULL;
if (!iface->data.network.actual) {
virReportError(VIR_ERR_INTERNAL_ERROR,
{
virErrorPtr save_err;
VIR_AUTOUNREF(virNetworkPtr) net = NULL;
- VIR_AUTOPTR(virNetworkPortDef) portdef = NULL;
+ g_autoptr(virNetworkPortDef) portdef = NULL;
VIR_AUTOUNREF(virNetworkPortPtr) port = NULL;
g_autofree char *portxml = NULL;
virDomainDiskTranslateSourcePool(virDomainDiskDefPtr def)
{
virStorageVolInfo info;
- VIR_AUTOPTR(virStoragePoolDef) pooldef = NULL;
+ g_autoptr(virStoragePoolDef) pooldef = NULL;
g_autofree char *poolxml = NULL;
VIR_AUTOUNREF(virConnectPtr) conn = NULL;
VIR_AUTOUNREF(virStoragePoolPtr) pool = NULL;
virInterfaceDefParseNode(xmlDocPtr xml,
xmlNodePtr root)
{
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
if (!virXMLNodeNameEqual(root, "interface")) {
virReportError(VIR_ERR_XML_ERROR,
xmlNodePtr root,
virNetworkXMLOptionPtr xmlopt)
{
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
if (!virXMLNodeNameEqual(root, "network")) {
virReportError(VIR_ERR_XML_ERROR,
const char *xml,
unsigned int flags) /* virNetworkUpdateFlags */
{
- VIR_AUTOPTR(xmlDoc) doc = NULL;
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlDoc) doc = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
if (!(doc = virXMLParseStringCtxt(xml, _("network_update_xml"), &ctxt)))
return -1;
int create,
const char *virt_type)
{
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
if (!virXMLNodeNameEqual(root, "device")) {
virReportError(VIR_ERR_XML_ERROR,
virNWFilterDefParseNode(xmlDocPtr xml,
xmlNodePtr root)
{
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
if (STRNEQ((const char *)root->name, "filter")) {
virReportError(VIR_ERR_XML_ERROR,
static virSecretDefPtr
secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root)
{
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
- VIR_AUTOPTR(virSecretDef) def = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
+ g_autoptr(virSecretDef) def = NULL;
g_autofree char *prop = NULL;
g_autofree char *uuidstr = NULL;
bool *current,
unsigned int flags)
{
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
if (!virXMLNodeNameEqual(root, "domainsnapshot")) {
virReportError(VIR_ERR_XML_ERROR, "%s", _("domainsnapshot"));
size_t i;
virStoragePoolOptionsPtr options;
int n;
- VIR_AUTOPTR(virStorageAuthDef) authdef = NULL;
+ g_autoptr(virStorageAuthDef) authdef = NULL;
g_autofree char *port = NULL;
g_autofree char *ver = NULL;
g_autofree xmlNodePtr *nodeset = NULL;
virStoragePoolDefParseSourceString(const char *srcSpec,
int pool_type)
{
- VIR_AUTOPTR(xmlDoc) doc = NULL;
+ g_autoptr(xmlDoc) doc = NULL;
xmlNodePtr node = NULL;
- VIR_AUTOPTR(xmlXPathContext) xpath_ctxt = NULL;
- VIR_AUTOPTR(virStoragePoolSource) def = NULL;
+ g_autoptr(xmlXPathContext) xpath_ctxt = NULL;
+ g_autoptr(virStoragePoolSource) def = NULL;
if (!(doc = virXMLParseStringCtxt(srcSpec,
_("(storage_source_specification)"),
virStoragePoolOptionsPtr options;
virStoragePoolDefPtr ret = NULL;
xmlNodePtr source_node;
- VIR_AUTOPTR(virStoragePoolDef) def = NULL;
+ g_autoptr(virStoragePoolDef) def = NULL;
g_autofree char *type = NULL;
g_autofree char *uuid = NULL;
g_autofree char *target_path = NULL;
virStoragePoolDefParseNode(xmlDocPtr xml,
xmlNodePtr root)
{
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
if (!virXMLNodeNameEqual(root, "pool")) {
virReportError(VIR_ERR_XML_ERROR,
xmlNodePtr node;
size_t i;
int n;
- VIR_AUTOPTR(virStorageVolDef) def = NULL;
+ g_autoptr(virStorageVolDef) def = NULL;
g_autofree char *type = NULL;
g_autofree char *allocation = NULL;
g_autofree char *capacity = NULL;
xmlNodePtr root,
unsigned int flags)
{
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
if (!virXMLNodeNameEqual(root, "volume")) {
virReportError(VIR_ERR_XML_ERROR,
int ret = -1;
int rc;
char uuidstr[VIR_UUID_STRING_BUFLEN];
- VIR_AUTOPTR(virNetworkPortDef) portdef = NULL;
+ g_autoptr(virNetworkPortDef) portdef = NULL;
if (!(dir = virNetworkObjGetPortStatusDir(net, stateDir)))
goto cleanup;
static virNetworkPortDefPtr
virNetworkPortDefParseXML(xmlXPathContextPtr ctxt)
{
- VIR_AUTOPTR(virNetworkPortDef) def = NULL;
+ g_autoptr(virNetworkPortDef) def = NULL;
g_autofree char *uuid = NULL;
xmlNodePtr virtPortNode;
xmlNodePtr vlanNode;
const char *autostartLink)
{
virStoragePoolObjPtr obj;
- VIR_AUTOPTR(virStoragePoolDef) def = NULL;
+ g_autoptr(virStoragePoolDef) def = NULL;
if (!(def = virStoragePoolDefParseFile(path)))
return NULL;
xmlDocPtr xml = NULL;
xmlXPathContextPtr ctxt = NULL;
xmlNodePtr node = NULL;
- VIR_AUTOPTR(virStoragePoolDef) def = NULL;
+ g_autoptr(virStoragePoolDef) def = NULL;
if (!(stateFile = virFileBuildPath(stateDir, name, ".xml")))
return NULL;
char *taskInfoErrorMessage = NULL;
char *uuid_string = NULL;
char *key = NULL;
- VIR_AUTOPTR(virStorageVolDef) def = NULL;
+ g_autoptr(virStorageVolDef) def = NULL;
virCheckFlags(0, NULL);
char *taskInfoErrorMessage = NULL;
char *uuid_string = NULL;
char *key = NULL;
- VIR_AUTOPTR(virStorageVolDef) def = NULL;
+ g_autoptr(virStorageVolDef) def = NULL;
virCheckFlags(0, NULL);
char *sock_path = NULL;
char *alias = NULL;
virAdmConnectPtr conn = NULL;
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
char *uristr = NULL;
if (virAdmInitialize() < 0)
size_t i;
int res;
virConnectPtr ret;
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
char *uristr = NULL;
ret = virGetConnect();
int libxlDriverConfigLoadFile(libxlDriverConfigPtr cfg,
const char *filename)
{
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
/* defaults for keepalive messages */
cfg->keepAliveInterval = 5;
libxlDriverPrivatePtr driver = conn->privateData;
libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
virDomainDefPtr def = NULL;
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
char *xml = NULL;
virCheckFlags(0, NULL);
libxlDriverPrivatePtr driver = conn->privateData;
libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
virDomainDefPtr def = NULL;
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
int len = MAX_CONFIG_SIZE;
char *ret = NULL;
virConfPtr
xenFormatXL(virDomainDefPtr def, virConnectPtr conn)
{
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
if (!(conf = virConfNew()))
return NULL;
xenFormatXM(virConnectPtr conn,
virDomainDefPtr def)
{
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
if (!(conf = virConfNew()))
return NULL;
* (but still need to add @lockProgram into @srv). rv == 0 means that no
* saved state is present, therefore initialize from scratch here. */
if (rv == 0) {
- VIR_AUTOPTR(virSystemdActivation) act = NULL;
+ g_autoptr(virSystemdActivation) act = NULL;
virSystemdActivationMap actmap[] = {
{ .name = "virtlockd.socket", .family = AF_UNIX, .path = sock_file },
{ .name = "virtlockd-admin.socket", .family = AF_UNIX, .path = admin_sock_file },
const char *filename,
bool allow_missing)
{
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
if (allow_missing &&
access(filename, R_OK) == -1 &&
static int virLockManagerLockDaemonLoadConfig(const char *configFile)
{
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
if (access(configFile, R_OK) == -1) {
if (errno != ENOENT) {
virLockManagerSanlockLoadConfig(virLockManagerSanlockDriverPtr driver,
const char *configFile)
{
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
int ret = -1;
char *user = NULL;
char *group = NULL;
* scratch if rv == 0
*/
if (rv == 0) {
- VIR_AUTOPTR(virSystemdActivation) act = NULL;
+ g_autoptr(virSystemdActivation) act = NULL;
virSystemdActivationMap actmap[] = {
{ .name = "virtlogd.socket", .family = AF_UNIX, .path = sock_file },
{ .name = "virtlogd-admin.socket", .family = AF_UNIX, .path = admin_sock_file },
const char *filename,
bool allow_missing)
{
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
if (allow_missing &&
access(filename, R_OK) == -1 &&
virLXCLoadDriverConfig(virLXCDriverConfigPtr cfg,
const char *filename)
{
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
/* Avoid error from non-existent or unreadable file. */
if (access(filename, R_OK) == -1)
virDomainXMLOptionPtr xmlopt)
{
virDomainDefPtr vmdef = NULL;
- VIR_AUTOPTR(virConf) properties = NULL;
+ g_autoptr(virConf) properties = NULL;
g_autofree char *value = NULL;
if (!(properties = virConfReadString(config, VIR_CONF_FLAG_LXC_FORMAT)))
virNetworkDriverStatePtr driver = networkGetDriver();
virNetworkObjPtr obj;
virNetworkDefPtr def;
- VIR_AUTOPTR(virNetworkPortDef) portdef = NULL;
+ g_autoptr(virNetworkPortDef) portdef = NULL;
virNetworkPortPtr ret = NULL;
int rc;
virStorageVolPtr vol = NULL;
virStorageVolPtr dup_vol = NULL;
char *key = NULL;
- VIR_AUTOPTR(virStorageVolDef) voldef = NULL;
- VIR_AUTOPTR(virStoragePoolDef) spdef = NULL;
+ g_autoptr(virStorageVolDef) voldef = NULL;
+ g_autoptr(virStoragePoolDef) spdef = NULL;
if (VIR_ALLOC(spdef) < 0)
return NULL;
{
size_t i;
int ret = -1;
- VIR_AUTOPTR(virJSONValue) cmd = NULL;
- VIR_AUTOPTR(virJSONValue) reply = NULL;
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
virJSONValuePtr data;
size_t ndata = 0;
qemuAgentFSInfoPtr *info_ret = NULL;
int *nparams,
int *maxparams)
{
- VIR_AUTOPTR(virJSONValue) cmd = NULL;
- VIR_AUTOPTR(virJSONValue) reply = NULL;
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
virJSONValuePtr data = NULL;
size_t ndata;
size_t i;
int *nparams,
int *maxparams)
{
- VIR_AUTOPTR(virJSONValue) cmd = NULL;
- VIR_AUTOPTR(virJSONValue) reply = NULL;
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
virJSONValuePtr data = NULL;
if (!(cmd = qemuAgentMakeCommand("guest-get-osinfo", NULL)))
int *nparams,
int *maxparams)
{
- VIR_AUTOPTR(virJSONValue) cmd = NULL;
- VIR_AUTOPTR(virJSONValue) reply = NULL;
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
virJSONValuePtr data = NULL;
const char *name;
int offset;
virHashTablePtr nodenamestable,
qemuBlockNodeNameBackingChainDataPtr *nodenamedata)
{
- VIR_AUTOPTR(qemuBlockNodeNameBackingChainData) data = NULL;
+ g_autoptr(qemuBlockNodeNameBackingChainData) data = NULL;
qemuBlockNodeNameBackingChainDataPtr backingdata = NULL;
virJSONValuePtr backing = virJSONValueObjectGetObject(next, "backing");
virJSONValuePtr parent = virJSONValueObjectGetObject(next, "parent");
{
struct qemuBlockNodeNameGetBackingChainData *data = opaque;
const char *device = virJSONValueObjectGetString(item, "device");
- VIR_AUTOPTR(qemuBlockNodeNameBackingChainData) devicedata = NULL;
+ g_autoptr(qemuBlockNodeNameBackingChainData) devicedata = NULL;
if (qemuBlockNodeNameGetBackingChainBacking(item, data->nodenamestable,
&devicedata) < 0)
virJSONValuePtr blockstats)
{
struct qemuBlockNodeNameGetBackingChainData data;
- VIR_AUTOPTR(virHashTable) namednodestable = NULL;
- VIR_AUTOPTR(virHashTable) disks = NULL;
+ g_autoptr(virHashTable) namednodestable = NULL;
+ g_autoptr(virHashTable) disks = NULL;
memset(&data, 0, sizeof(data));
qemuDomainAsyncJob asyncJob)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
- VIR_AUTOPTR(virHashTable) disktable = NULL;
- VIR_AUTOPTR(virJSONValue) data = NULL;
- VIR_AUTOPTR(virJSONValue) blockstats = NULL;
+ g_autoptr(virHashTable) disktable = NULL;
+ g_autoptr(virJSONValue) data = NULL;
+ g_autoptr(virJSONValue) blockstats = NULL;
virDomainDiskDefPtr disk;
size_t i;
virHashTablePtr
qemuBlockGetNodeData(virJSONValuePtr data)
{
- VIR_AUTOPTR(virHashTable) nodedata = NULL;
+ g_autoptr(virHashTable) nodedata = NULL;
if (!(nodedata = virHashCreate(50, virJSONValueHashFree)))
return NULL;
virURIPtr
qemuBlockStorageSourceGetURI(virStorageSourcePtr src)
{
- VIR_AUTOPTR(virURI) uri = NULL;
+ g_autoptr(virURI) uri = NULL;
if (src->nhosts != 1) {
virReportError(VIR_ERR_INTERNAL_ERROR,
qemuBlockStorageSourceBuildJSONSocketAddress(virStorageNetHostDefPtr host,
bool legacy)
{
- VIR_AUTOPTR(virJSONValue) server = NULL;
+ g_autoptr(virJSONValue) server = NULL;
const char *transport;
const char *field;
g_autofree char *port = NULL;
qemuBlockStorageSourceBuildHostsJSONSocketAddress(virStorageSourcePtr src,
bool legacy)
{
- VIR_AUTOPTR(virJSONValue) servers = NULL;
- VIR_AUTOPTR(virJSONValue) server = NULL;
+ g_autoptr(virJSONValue) servers = NULL;
+ g_autoptr(virJSONValue) server = NULL;
virStorageNetHostDefPtr host;
size_t i;
static virJSONValuePtr
qemuBlockStorageSourceBuildHostsJSONInetSocketAddress(virStorageSourcePtr src)
{
- VIR_AUTOPTR(virJSONValue) servers = NULL;
- VIR_AUTOPTR(virJSONValue) server = NULL;
+ g_autoptr(virJSONValue) servers = NULL;
+ g_autoptr(virJSONValue) server = NULL;
virStorageNetHostDefPtr host;
size_t i;
bool legacy,
bool onlytarget)
{
- VIR_AUTOPTR(virJSONValue) servers = NULL;
- VIR_AUTOPTR(virJSONValue) props = NULL;
+ g_autoptr(virJSONValue) servers = NULL;
+ g_autoptr(virJSONValue) props = NULL;
if (!(servers = qemuBlockStorageSourceBuildHostsJSONSocketAddress(src, legacy)))
return NULL;
qemuBlockStorageSourceGetVxHSProps(virStorageSourcePtr src,
bool onlytarget)
{
- VIR_AUTOPTR(virJSONValue) server = NULL;
+ g_autoptr(virJSONValue) server = NULL;
const char *tlsAlias = src->tlsAlias;
virJSONValuePtr ret = NULL;
const char *passwordalias = NULL;
const char *username = NULL;
virJSONValuePtr ret = NULL;
- VIR_AUTOPTR(virURI) uri = NULL;
+ g_autoptr(virURI) uri = NULL;
g_autofree char *uristr = NULL;
/**
qemuBlockStorageSourceGetNBDProps(virStorageSourcePtr src,
bool onlytarget)
{
- VIR_AUTOPTR(virJSONValue) serverprops = NULL;
+ g_autoptr(virJSONValue) serverprops = NULL;
const char *tlsAlias = src->tlsAlias;
virJSONValuePtr ret = NULL;
bool onlytarget)
{
qemuDomainStorageSourcePrivatePtr srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src);
- VIR_AUTOPTR(virJSONValue) servers = NULL;
+ g_autoptr(virJSONValue) servers = NULL;
virJSONValuePtr ret = NULL;
const char *username = NULL;
- VIR_AUTOPTR(virJSONValue) authmodes = NULL;
- VIR_AUTOPTR(virJSONValue) mode = NULL;
+ g_autoptr(virJSONValue) authmodes = NULL;
+ g_autoptr(virJSONValue) mode = NULL;
const char *keysecret = NULL;
if (src->nhosts > 0 &&
static virJSONValuePtr
qemuBlockStorageSourceGetSheepdogProps(virStorageSourcePtr src)
{
- VIR_AUTOPTR(virJSONValue) serverprops = NULL;
+ g_autoptr(virJSONValue) serverprops = NULL;
virJSONValuePtr ret = NULL;
if (src->nhosts != 1) {
static virJSONValuePtr
qemuBlockStorageSourceGetSshProps(virStorageSourcePtr src)
{
- VIR_AUTOPTR(virJSONValue) serverprops = NULL;
+ g_autoptr(virJSONValue) serverprops = NULL;
virJSONValuePtr ret = NULL;
const char *username = NULL;
qemuBlockStorageSourceGetVvfatProps(virStorageSourcePtr src,
bool onlytarget)
{
- VIR_AUTOPTR(virJSONValue) ret = NULL;
+ g_autoptr(virJSONValue) ret = NULL;
/* libvirt currently does not handle the following attributes:
* '*fat-type': 'int'
qemuBlockStorageSourceGetBlockdevGetCacheProps(virStorageSourcePtr src,
virJSONValuePtr props)
{
- VIR_AUTOPTR(virJSONValue) cacheobj = NULL;
+ g_autoptr(virJSONValue) cacheobj = NULL;
bool direct = false;
bool noflush = false;
bool autoreadonly)
{
int actualType = virStorageSourceGetActualType(src);
- VIR_AUTOPTR(virJSONValue) fileprops = NULL;
+ g_autoptr(virJSONValue) fileprops = NULL;
const char *driver = NULL;
virTristateBool aro = VIR_TRISTATE_BOOL_ABSENT;
virTristateBool ro = VIR_TRISTATE_BOOL_ABSENT;
const char *format,
virJSONValuePtr props)
{
- VIR_AUTOPTR(virJSONValue) encprops = NULL;
+ g_autoptr(virJSONValue) encprops = NULL;
if (qemuBlockStorageSourceGetCryptoProps(src, &encprops) < 0)
return -1;
const char *discard = NULL;
int detectZeroesMode = virDomainDiskGetDetectZeroesMode(src->discard,
src->detect_zeroes);
- VIR_AUTOPTR(virJSONValue) props = NULL;
+ g_autoptr(virJSONValue) props = NULL;
if (qemuBlockNodeNameValidate(src->nodeformat) < 0)
return NULL;
qemuBlockStorageSourceGetBlockdevFormatProps(virStorageSourcePtr src)
{
const char *driver = NULL;
- VIR_AUTOPTR(virJSONValue) props = NULL;
+ g_autoptr(virJSONValue) props = NULL;
if (!(props = qemuBlockStorageSourceGetBlockdevFormatCommonProps(src)))
return NULL;
qemuBlockStorageSourceGetBlockdevProps(virStorageSourcePtr src,
virStorageSourcePtr backingStore)
{
- VIR_AUTOPTR(virJSONValue) props = NULL;
+ g_autoptr(virJSONValue) props = NULL;
if (!(props = qemuBlockStorageSourceGetBlockdevFormatProps(src)))
return NULL;
virStorageSourcePtr backingStore,
bool autoreadonly)
{
- VIR_AUTOPTR(qemuBlockStorageSourceAttachData) data = NULL;
+ g_autoptr(qemuBlockStorageSourceAttachData) data = NULL;
if (VIR_ALLOC(data) < 0)
return NULL;
char *driveAlias)
{
qemuDomainStorageSourcePrivatePtr srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src);
- VIR_AUTOPTR(qemuBlockStorageSourceAttachData) data = NULL;
+ g_autoptr(qemuBlockStorageSourceAttachData) data = NULL;
qemuBlockStorageSourceAttachDataPtr ret = NULL;
if (VIR_ALLOC(data) < 0)
qemuBlockStorageSourceChainDataPtr
qemuBlockStorageSourceChainDetachPrepareBlockdev(virStorageSourcePtr src)
{
- VIR_AUTOPTR(qemuBlockStorageSourceAttachData) backend = NULL;
- VIR_AUTOPTR(qemuBlockStorageSourceChainData) data = NULL;
+ g_autoptr(qemuBlockStorageSourceAttachData) backend = NULL;
+ g_autoptr(qemuBlockStorageSourceChainData) data = NULL;
virStorageSourcePtr n;
if (VIR_ALLOC(data) < 0)
qemuBlockStorageSourceChainDetachPrepareDrive(virStorageSourcePtr src,
char *driveAlias)
{
- VIR_AUTOPTR(qemuBlockStorageSourceAttachData) backend = NULL;
- VIR_AUTOPTR(qemuBlockStorageSourceChainData) data = NULL;
+ g_autoptr(qemuBlockStorageSourceAttachData) backend = NULL;
+ g_autoptr(qemuBlockStorageSourceChainData) data = NULL;
if (VIR_ALLOC(data) < 0)
return NULL;
qemuBlockGetBackingStoreString(virStorageSourcePtr src)
{
int actualType = virStorageSourceGetActualType(src);
- VIR_AUTOPTR(virJSONValue) backingProps = NULL;
- VIR_AUTOPTR(virURI) uri = NULL;
+ g_autoptr(virJSONValue) backingProps = NULL;
+ g_autoptr(virURI) uri = NULL;
g_autofree char *backingJSON = NULL;
char *ret = NULL;
virJSONValuePtr *retprops,
virStorageSourcePtr backing)
{
- VIR_AUTOPTR(virJSONValue) props = NULL;
+ g_autoptr(virJSONValue) props = NULL;
if (virJSONValueObjectCreate(&props,
"s:driver", driver,
virJSONValuePtr *luksProps)
{
qemuDomainStorageSourcePrivatePtr srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src);
- VIR_AUTOPTR(virJSONValue) props = NULL;
+ g_autoptr(virJSONValue) props = NULL;
g_autofree char *cipheralg = NULL;
const char *keysecret = NULL;
qemuBlockStorageSourceCreateGetFormatPropsLUKS(virStorageSourcePtr src,
virJSONValuePtr *props)
{
- VIR_AUTOPTR(virJSONValue) luksprops = NULL;
+ g_autoptr(virJSONValue) luksprops = NULL;
if (qemuBlockStorageSourceCreateGetEncryptionLUKS(src, &luksprops) < 0)
return -1;
qemuBlockStorageSourceCreateAddEncryptionQcow(virStorageSourcePtr src,
virJSONValuePtr props)
{
- VIR_AUTOPTR(virJSONValue) encryptProps = NULL;
+ g_autoptr(virJSONValue) encryptProps = NULL;
if (!src->encryption)
return 0;
virStorageSourcePtr backing,
virJSONValuePtr *props)
{
- VIR_AUTOPTR(virJSONValue) qcow2props = NULL;
+ g_autoptr(virJSONValue) qcow2props = NULL;
const char *qcow2version = NULL;
if (STREQ_NULLABLE(src->compat, "0.10"))
virStorageSourcePtr backing,
virJSONValuePtr *props)
{
- VIR_AUTOPTR(virJSONValue) qcowprops = NULL;
+ g_autoptr(virJSONValue) qcowprops = NULL;
if (virJSONValueObjectCreate(&qcowprops,
"s:driver", "qcow",
virStorageSourcePtr backing,
virJSONValuePtr *props)
{
- VIR_AUTOPTR(virJSONValue) qedprops = NULL;
+ g_autoptr(virJSONValue) qedprops = NULL;
if (virJSONValueObjectCreate(&qedprops,
"s:driver", "qed",
virJSONValuePtr *props)
{
int actualType = virStorageSourceGetActualType(src);
- VIR_AUTOPTR(virJSONValue) location = NULL;
+ g_autoptr(virJSONValue) location = NULL;
const char *driver = NULL;
const char *filename = NULL;
bool storageCreate,
qemuDomainAsyncJob asyncJob)
{
- VIR_AUTOPTR(virJSONValue) props = createProps;
+ g_autoptr(virJSONValue) props = createProps;
qemuDomainObjPrivatePtr priv = vm->privateData;
qemuBlockJobDataPtr job = NULL;
int ret = -1;
qemuDomainAsyncJob asyncJob)
{
int actualType = virStorageSourceGetActualType(src);
- VIR_AUTOPTR(virJSONValue) createstorageprops = NULL;
+ g_autoptr(virJSONValue) createstorageprops = NULL;
int ret;
/* We create local files directly to be able to apply security labels
virStorageSourcePtr chain,
qemuDomainAsyncJob asyncJob)
{
- VIR_AUTOPTR(virJSONValue) createformatprops = NULL;
+ g_autoptr(virJSONValue) createformatprops = NULL;
int ret;
if (src->format == VIR_STORAGE_FILE_RAW)
qemuDomainAsyncJob asyncJob)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
- VIR_AUTOPTR(virHashTable) stats = NULL;
+ g_autoptr(virHashTable) stats = NULL;
qemuBlockStatsPtr entry;
int rc;
qemuDomainAsyncJob asyncJob,
virStorageSourcePtr chain)
{
- VIR_AUTOPTR(qemuBlockStorageSourceChainData) data = NULL;
+ g_autoptr(qemuBlockStorageSourceChainData) data = NULL;
if (!(data = qemuBlockStorageSourceChainDetachPrepareBlockdev(chain)))
return;
qemuBlockJobDataPtr job,
qemuDomainAsyncJob asyncJob)
{
- VIR_AUTOPTR(qemuBlockStorageSourceAttachData) backend = NULL;
+ g_autoptr(qemuBlockStorageSourceAttachData) backend = NULL;
/* if there is a synchronous client waiting for this job that means that
* it will handle further hotplug of the created volume and also that
virQEMUCapsSEVInfoCopy(virSEVCapabilityPtr *dst,
virSEVCapabilityPtr src)
{
- VIR_AUTOPTR(virSEVCapability) tmp = NULL;
+ g_autoptr(virSEVCapability) tmp = NULL;
if (VIR_ALLOC(tmp) < 0 ||
VIR_STRDUP(tmp->pdh, src->pdh) < 0 ||
static int
virQEMUCapsParseSEVInfo(virQEMUCapsPtr qemuCaps, xmlXPathContextPtr ctxt)
{
- VIR_AUTOPTR(virSEVCapability) sev = NULL;
+ g_autoptr(virSEVCapability) sev = NULL;
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SEV_GUEST))
return 0;
virDomainCapsPtr domCaps)
{
virSEVCapability *cap = qemuCaps->sevCapabilities;
- VIR_AUTOPTR(virSEVCapability) sev = NULL;
+ g_autoptr(virSEVCapability) sev = NULL;
if (!cap)
return 0;
parentdef = virDomainCheckpointObjGetDef(moment);
for (j = 0; j < parentdef->ndisks; j++) {
virDomainCheckpointDiskDef *disk2;
- VIR_AUTOPTR(virJSONValue) arr = NULL;
+ g_autoptr(virJSONValue) arr = NULL;
disk2 = &parentdef->disks[j];
if (STRNEQ(disk->name, disk2->name) ||
virDomainMomentObjPtr other = NULL;
VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = NULL;
VIR_AUTOUNREF(virCapsPtr) caps = NULL;
- VIR_AUTOPTR(virJSONValue) actions = NULL;
+ g_autoptr(virJSONValue) actions = NULL;
int ret;
VIR_AUTOUNREF(virDomainCheckpointDefPtr) def = NULL;
qemuDomainSecretInfoPtr secinfo)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- VIR_AUTOPTR(virJSONValue) props = NULL;
+ g_autoptr(virJSONValue) props = NULL;
if (qemuBuildSecretInfoProps(secinfo, &props) < 0)
return -1;
virQEMUCapsPtr qemuCaps)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- VIR_AUTOPTR(virJSONValue) props = NULL;
+ g_autoptr(virJSONValue) props = NULL;
if (qemuBuildTLSx509BackendProps(tlspath, isListen, verifypeer, alias,
certEncSecretAlias, qemuCaps, &props) < 0)
qemuBuildNetworkDriveURI(virStorageSourcePtr src,
qemuDomainSecretInfoPtr secinfo)
{
- VIR_AUTOPTR(virURI) uri = NULL;
+ g_autoptr(virURI) uri = NULL;
if (!(uri = qemuBlockStorageSourceGetURI(src)))
return NULL;
static virJSONValuePtr
qemuDiskSourceGetProps(virStorageSourcePtr src)
{
- VIR_AUTOPTR(virJSONValue) props = NULL;
+ g_autoptr(virJSONValue) props = NULL;
virJSONValuePtr ret;
if (!(props = qemuBlockStorageSourceGetBackendProps(src, true, false, false)))
qemuDomainStorageSourcePrivatePtr srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(disk->src);
qemuDomainSecretInfoPtr secinfo = NULL;
qemuDomainSecretInfoPtr encinfo = NULL;
- VIR_AUTOPTR(virJSONValue) srcprops = NULL;
+ g_autoptr(virJSONValue) srcprops = NULL;
g_autofree char *source = NULL;
bool rawluks = false;
virDomainDiskDefPtr disk,
virQEMUCapsPtr qemuCaps)
{
- VIR_AUTOPTR(qemuBlockStorageSourceChainData) data = NULL;
- VIR_AUTOPTR(virJSONValue) copyOnReadProps = NULL;
+ g_autoptr(qemuBlockStorageSourceChainData) data = NULL;
+ g_autoptr(virJSONValue) copyOnReadProps = NULL;
g_autofree char *copyOnReadPropsStr = NULL;
size_t i;
bool prealloc = false;
virBitmapPtr nodemask = NULL;
int rc;
- VIR_AUTOPTR(virJSONValue) props = NULL;
+ g_autoptr(virJSONValue) props = NULL;
bool nodeSpecified = virDomainNumatuneNodeSpecified(def->numa, mem->targetNode);
unsigned long long pagesize = mem->pagesize;
bool needHugepage = !!pagesize;
qemuDomainObjPrivatePtr priv,
virBufferPtr buf)
{
- VIR_AUTOPTR(virJSONValue) props = NULL;
+ g_autoptr(virJSONValue) props = NULL;
g_autofree char *alias = NULL;
int rc;
virDomainMemoryDef mem = { 0 };
virQEMUDriverConfigPtr cfg,
qemuDomainObjPrivatePtr priv)
{
- VIR_AUTOPTR(virJSONValue) props = NULL;
+ g_autoptr(virJSONValue) props = NULL;
g_autofree char *alias = NULL;
if (!mem->info.alias) {
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
g_autofree char *netsource = NULL;
- VIR_AUTOPTR(virJSONValue) srcprops = NULL;
+ g_autoptr(virJSONValue) srcprops = NULL;
virDomainHostdevSubsysSCSIPtr scsisrc = &dev->source.subsys.u.scsi;
virDomainHostdevSubsysSCSIiSCSIPtr iscsisrc = &scsisrc->u.iscsi;
qemuDomainStorageSourcePrivatePtr srcPriv =
size_t i;
for (i = 0; i < def->nrngs; i++) {
- VIR_AUTOPTR(virJSONValue) props = NULL;
+ g_autoptr(virJSONValue) props = NULL;
virBuffer buf = VIR_BUFFER_INITIALIZER;
virDomainRNGDefPtr rng = def->rngs[i];
g_autofree char *chardev = NULL;
virQEMUCapsPtr qemuCaps,
bool chardevStdioLogd)
{
- VIR_AUTOPTR(virJSONValue) memProps = NULL;
+ g_autoptr(virJSONValue) memProps = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
g_autofree char *devstr = NULL;
g_autofree char *chardev = NULL;
qemuDomainObjPrivatePtr priv)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- VIR_AUTOPTR(virJSONValue) props = NULL;
+ g_autoptr(virJSONValue) props = NULL;
if (!virDomainDefHasManagedPR(def))
return 0;
qemuBuildDBusVMStateCommandLineData *data = user_data;
qemuDBusVMStatePtr vms = payload;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- VIR_AUTOPTR(virJSONValue) props = NULL;
+ g_autoptr(virJSONValue) props = NULL;
if (!(props = qemuBuildDBusVMStateInfoProps(id, vms->addr)))
return -1;
{
size_t i;
char uuid[VIR_UUID_STRING_BUFLEN];
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = virQEMUDriverGetConfig(driver);
unsigned int bootHostdevNet = 0;
qemuDomainObjPrivatePtr priv = vm->privateData;
qemuBuildHotpluggableCPUProps(const virDomainVcpuDef *vcpu)
{
qemuDomainVcpuPrivatePtr vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpu);
- VIR_AUTOPTR(virJSONValue) ret = NULL;
+ g_autoptr(virJSONValue) ret = NULL;
if (!(ret = virJSONValueCopy(vcpupriv->props)))
return NULL;
qemuBuildStorageSourceAttachPrepareDrive(virDomainDiskDefPtr disk,
virQEMUCapsPtr qemuCaps)
{
- VIR_AUTOPTR(qemuBlockStorageSourceAttachData) data = NULL;
+ g_autoptr(qemuBlockStorageSourceAttachData) data = NULL;
qemuBlockStorageSourceAttachDataPtr ret = NULL;
if (VIR_ALLOC(data) < 0)
qemuBuildStorageSourceChainAttachPrepareDrive(virDomainDiskDefPtr disk,
virQEMUCapsPtr qemuCaps)
{
- VIR_AUTOPTR(qemuBlockStorageSourceAttachData) elem = NULL;
- VIR_AUTOPTR(qemuBlockStorageSourceChainData) data = NULL;
+ g_autoptr(qemuBlockStorageSourceAttachData) elem = NULL;
+ g_autoptr(qemuBlockStorageSourceChainData) data = NULL;
if (VIR_ALLOC(data) < 0)
return NULL;
virStorageSourcePtr backingStore,
virQEMUCapsPtr qemuCaps)
{
- VIR_AUTOPTR(qemuBlockStorageSourceAttachData) elem = NULL;
+ g_autoptr(qemuBlockStorageSourceAttachData) elem = NULL;
if (!(elem = qemuBlockStorageSourceAttachPrepareBlockdev(src, backingStore, true)))
return -1;
qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSourcePtr top,
virQEMUCapsPtr qemuCaps)
{
- VIR_AUTOPTR(qemuBlockStorageSourceChainData) data = NULL;
+ g_autoptr(qemuBlockStorageSourceChainData) data = NULL;
virStorageSourcePtr n;
if (VIR_ALLOC(data) < 0)
virStorageSourcePtr backingStore,
virQEMUCapsPtr qemuCaps)
{
- VIR_AUTOPTR(qemuBlockStorageSourceChainData) data = NULL;
+ g_autoptr(qemuBlockStorageSourceChainData) data = NULL;
if (VIR_ALLOC(data) < 0)
return NULL;
const char *filename,
bool privileged)
{
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
/* Just check the file is readable before opening it, otherwise
* libvirt emits an error.
qemuDBusVMStatePtr
qemuDBusVMStateNew(const char *id, const char *addr)
{
- VIR_AUTOPTR(qemuDBusVMState) self = NULL;
+ g_autoptr(qemuDBusVMState) self = NULL;
if (VIR_ALLOC(self) < 0)
return NULL;
for (i = 0; i < n; i++) {
g_autofree char *alias = virXMLPropString(nodes[i], "alias");
g_autofree char *pid = virXMLPropString(nodes[i], "pid");
- VIR_AUTOPTR(qemuSlirp) slirp = qemuSlirpNew();
+ g_autoptr(qemuSlirp) slirp = qemuSlirpNew();
virDomainDeviceDef dev;
if (!alias || !pid || !slirp ||
virDomainObjPtr vm;
qemuDomainObjPrivatePtr priv;
bool postcopy = !!(flags & VIR_DOMAIN_MIGRATE_MAX_SPEED_POSTCOPY);
- VIR_AUTOPTR(qemuMigrationParams) migParams = NULL;
+ g_autoptr(qemuMigrationParams) migParams = NULL;
unsigned long long max;
int ret = -1;
virDomainObjPtr vm,
unsigned long *bandwidth)
{
- VIR_AUTOPTR(qemuMigrationParams) migParams = NULL;
+ g_autoptr(qemuMigrationParams) migParams = NULL;
unsigned long long bw;
int rc;
int ret = -1;
qemuDomainAsyncJob asyncJob)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
- VIR_AUTOPTR(virJSONValue) actions = NULL;
+ g_autoptr(virJSONValue) actions = NULL;
int rc;
int ret = -1;
size_t i;
VIR_AUTOUNREF(virStorageSourcePtr) mirror = mirrorsrc;
bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV);
bool mirror_initialized = false;
- VIR_AUTOPTR(qemuBlockStorageSourceChainData) data = NULL;
- VIR_AUTOPTR(qemuBlockStorageSourceChainData) crdata = NULL;
+ g_autoptr(qemuBlockStorageSourceChainData) data = NULL;
+ g_autoptr(qemuBlockStorageSourceChainData) crdata = NULL;
virStorageSourcePtr n;
virStorageSourcePtr mirrorBacking = NULL;
int rc = 0;
unsigned int flags)
{
g_autofree virDomainStatsRecordPtr tmp = NULL;
- VIR_AUTOPTR(virTypedParamList) params = NULL;
+ g_autoptr(virTypedParamList) params = NULL;
size_t i;
if (VIR_ALLOC(params) < 0)
qemuFirmwarePtr fw)
{
virJSONValuePtr interfacesJSON;
- VIR_AUTOPTR(qemuFirmwareOSInterface) interfaces = NULL;
+ g_autoptr(qemuFirmwareOSInterface) interfaces = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
size_t ninterfaces;
size_t i;
for (i = 0; i < ntargets; i++) {
virJSONValuePtr item = virJSONValueArrayGet(targetsJSON, i);
virJSONValuePtr machines;
- VIR_AUTOPTR(qemuFirmwareTarget) t = NULL;
+ g_autoptr(qemuFirmwareTarget) t = NULL;
const char *architectureStr = NULL;
size_t nmachines;
size_t j;
qemuFirmwarePtr fw)
{
virJSONValuePtr featuresJSON;
- VIR_AUTOPTR(qemuFirmwareFeature) features = NULL;
+ g_autoptr(qemuFirmwareFeature) features = NULL;
size_t nfeatures;
size_t i;
qemuFirmwareParse(const char *path)
{
g_autofree char *cont = NULL;
- VIR_AUTOPTR(virJSONValue) doc = NULL;
- VIR_AUTOPTR(qemuFirmware) fw = NULL;
+ g_autoptr(virJSONValue) doc = NULL;
+ g_autoptr(qemuFirmware) fw = NULL;
qemuFirmwarePtr ret = NULL;
if (virFileReadAll(path, DOCUMENT_SIZE, &cont) < 0)
qemuFirmwareInterfaceFormat(virJSONValuePtr doc,
qemuFirmwarePtr fw)
{
- VIR_AUTOPTR(virJSONValue) interfacesJSON = NULL;
+ g_autoptr(virJSONValue) interfacesJSON = NULL;
size_t i;
if (!(interfacesJSON = virJSONValueNewArray()))
static virJSONValuePtr
qemuFirmwareFlashFileFormat(qemuFirmwareFlashFile flash)
{
- VIR_AUTOPTR(virJSONValue) json = NULL;
+ g_autoptr(virJSONValue) json = NULL;
virJSONValuePtr ret;
if (!(json = virJSONValueNewObject()))
qemuFirmwareMappingFlashFormat(virJSONValuePtr mapping,
qemuFirmwareMappingFlashPtr flash)
{
- VIR_AUTOPTR(virJSONValue) executable = NULL;
- VIR_AUTOPTR(virJSONValue) nvram_template = NULL;
+ g_autoptr(virJSONValue) executable = NULL;
+ g_autoptr(virJSONValue) nvram_template = NULL;
if (!(executable = qemuFirmwareFlashFileFormat(flash->executable)))
return -1;
qemuFirmwareMappingFormat(virJSONValuePtr doc,
qemuFirmwarePtr fw)
{
- VIR_AUTOPTR(virJSONValue) mapping = NULL;
+ g_autoptr(virJSONValue) mapping = NULL;
if (!(mapping = virJSONValueNewObject()))
return -1;
qemuFirmwareTargetFormat(virJSONValuePtr doc,
qemuFirmwarePtr fw)
{
- VIR_AUTOPTR(virJSONValue) targetsJSON = NULL;
+ g_autoptr(virJSONValue) targetsJSON = NULL;
size_t i;
if (!(targetsJSON = virJSONValueNewArray()))
for (i = 0; i < fw->ntargets; i++) {
qemuFirmwareTargetPtr t = fw->targets[i];
- VIR_AUTOPTR(virJSONValue) target = NULL;
- VIR_AUTOPTR(virJSONValue) machines = NULL;
+ g_autoptr(virJSONValue) target = NULL;
+ g_autoptr(virJSONValue) machines = NULL;
size_t j;
if (!(target = virJSONValueNewObject()))
qemuFirmwareFeatureFormat(virJSONValuePtr doc,
qemuFirmwarePtr fw)
{
- VIR_AUTOPTR(virJSONValue) featuresJSON = NULL;
+ g_autoptr(virJSONValue) featuresJSON = NULL;
size_t i;
if (!(featuresJSON = virJSONValueNewArray()))
char *
qemuFirmwareFormat(qemuFirmwarePtr fw)
{
- VIR_AUTOPTR(virJSONValue) doc = NULL;
+ g_autoptr(virJSONValue) doc = NULL;
if (!fw)
return NULL;
}
if (fws && fwpath) {
- VIR_AUTOPTR(virFirmware) tmp = NULL;
+ g_autoptr(virFirmware) tmp = NULL;
/* Append only unique pairs. */
for (j = 0; j < *nfws; j++) {
qemuDomainAsyncJob asyncJob)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
- VIR_AUTOPTR(virJSONValue) props = NULL;
+ g_autoptr(virJSONValue) props = NULL;
int ret;
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DBUS_VMSTATE)) {
{
qemuDomainObjPrivatePtr priv = vm->privateData;
qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
- VIR_AUTOPTR(qemuBlockStorageSourceChainData) newbackend = NULL;
- VIR_AUTOPTR(qemuBlockStorageSourceChainData) oldbackend = NULL;
+ g_autoptr(qemuBlockStorageSourceChainData) newbackend = NULL;
+ g_autoptr(qemuBlockStorageSourceChainData) oldbackend = NULL;
g_autofree char *nodename = NULL;
int rc;
virDomainObjPtr vm,
virDomainDiskDefPtr disk)
{
- VIR_AUTOPTR(qemuBlockStorageSourceChainData) data = NULL;
+ g_autoptr(qemuBlockStorageSourceChainData) data = NULL;
int ret = -1;
qemuDomainObjPrivatePtr priv = vm->privateData;
g_autofree char *devstr = NULL;
VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = virQEMUDriverGetConfig(driver);
- VIR_AUTOPTR(virJSONValue) corProps = NULL;
+ g_autoptr(virJSONValue) corProps = NULL;
g_autofree char *corAlias = NULL;
bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV);
virDomainDiskDefPtr disk)
{
qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
- VIR_AUTOPTR(qemuBlockStorageSourceChainData) diskBackend = NULL;
+ g_autoptr(qemuBlockStorageSourceChainData) diskBackend = NULL;
virDomainDeviceDef dev;
size_t i;
qemuDomainObjPrivatePtr priv = vm->privateData;
virDomainNetDefPtr net)
{
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
- VIR_AUTOPTR(qemuSlirp) slirp = NULL;
+ g_autoptr(qemuSlirp) slirp = NULL;
size_t i;
if (!(slirp = qemuSlirpNewForHelper(cfg->slirpHelperName)))
char ***configs,
bool privileged)
{
- VIR_AUTOPTR(virHashTable) files = NULL;
+ g_autoptr(virHashTable) files = NULL;
g_autofree char *homeConfig = NULL;
g_autofree char *xdgConfig = NULL;
g_autofree char *sysLocation = virFileBuildPath(QEMU_SYSTEM_LOCATION, name, NULL);
unsigned int mirror_shallow,
const char *tlsAlias)
{
- VIR_AUTOPTR(qemuBlockStorageSourceAttachData) data = NULL;
+ g_autoptr(qemuBlockStorageSourceAttachData) data = NULL;
qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
int mon_ret = 0;
VIR_AUTOUNREF(virStorageSourcePtr) copysrc = NULL;
int nstats = 0;
int rc;
size_t i;
- VIR_AUTOPTR(virJSONValue) devices = NULL;
+ g_autoptr(virJSONValue) devices = NULL;
if (!(devices = qemuMonitorJSONQueryBlockstats(mon)))
return -1;
bool shallow,
bool reuse)
{
- VIR_AUTOPTR(virJSONValue) cmd = NULL;
- VIR_AUTOPTR(virJSONValue) reply = NULL;
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
cmd = qemuMonitorJSONMakeCommand("drive-mirror",
"s:device", device,
unsigned long long buf_size,
bool shallow)
{
- VIR_AUTOPTR(virJSONValue) cmd = NULL;
- VIR_AUTOPTR(virJSONValue) reply = NULL;
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
virTristateBool autofinalize = VIR_TRISTATE_BOOL_ABSENT;
virTristateBool autodismiss = VIR_TRISTATE_BOOL_ABSENT;
qemuMonitorJSONJobDismiss(qemuMonitorPtr mon,
const char *jobname)
{
- VIR_AUTOPTR(virJSONValue) cmd = NULL;
- VIR_AUTOPTR(virJSONValue) reply = NULL;
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
if (!(cmd = qemuMonitorJSONMakeCommand("job-dismiss",
"s:id", jobname,
const char *jobname,
bool quiet)
{
- VIR_AUTOPTR(virJSONValue) cmd = NULL;
- VIR_AUTOPTR(virJSONValue) reply = NULL;
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
if (!(cmd = qemuMonitorJSONMakeCommand("job-cancel",
"s:id", jobname,
qemuMonitorJSONJobComplete(qemuMonitorPtr mon,
const char *jobname)
{
- VIR_AUTOPTR(virJSONValue) cmd = NULL;
- VIR_AUTOPTR(virJSONValue) reply = NULL;
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
if (!(cmd = qemuMonitorJSONMakeCommand("job-complete",
"s:id", jobname,
bool fail_no_props,
qemuMonitorCPUModelInfoPtr *model_info)
{
- VIR_AUTOPTR(virJSONValue) model = NULL;
- VIR_AUTOPTR(virJSONValue) cmd = NULL;
- VIR_AUTOPTR(virJSONValue) reply = NULL;
+ g_autoptr(virJSONValue) model = NULL;
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
virJSONValuePtr data;
virJSONValuePtr cpu_model;
virJSONValuePtr cpu_props = NULL;
virCPUDefPtr cpu_b,
qemuMonitorCPUModelInfoPtr *baseline)
{
- VIR_AUTOPTR(virJSONValue) model_a = NULL;
- VIR_AUTOPTR(virJSONValue) model_b = NULL;
- VIR_AUTOPTR(virJSONValue) cmd = NULL;
- VIR_AUTOPTR(virJSONValue) reply = NULL;
+ g_autoptr(virJSONValue) model_a = NULL;
+ g_autoptr(virJSONValue) model_b = NULL;
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
virJSONValuePtr data;
virJSONValuePtr cpu_model;
virJSONValuePtr cpu_props = NULL;
virCPUDefPtr cpu_b,
char **result)
{
- VIR_AUTOPTR(virJSONValue) model_a = NULL;
- VIR_AUTOPTR(virJSONValue) model_b = NULL;
- VIR_AUTOPTR(virJSONValue) cmd = NULL;
- VIR_AUTOPTR(virJSONValue) reply = NULL;
+ g_autoptr(virJSONValue) model_a = NULL;
+ g_autoptr(virJSONValue) model_b = NULL;
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
const char *data_result;
virJSONValuePtr data;
const char *property,
char ***strList)
{
- VIR_AUTOPTR(virJSONValue) cmd = NULL;
- VIR_AUTOPTR(virJSONValue) reply = NULL;
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
VIR_AUTOSTRINGLIST list = NULL;
virJSONValuePtr data;
size_t n;
const char *cert_chain = NULL;
unsigned int cbitpos;
unsigned int reduced_phys_bits;
- VIR_AUTOPTR(virSEVCapability) capability = NULL;
+ g_autoptr(virSEVCapability) capability = NULL;
*capabilities = NULL;
qemuMonitorJSONGetCPUProperties(qemuMonitorPtr mon,
char ***props)
{
- VIR_AUTOPTR(virJSONValue) cmd = NULL;
- VIR_AUTOPTR(virJSONValue) reply = NULL;
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
*props = NULL;
const char *jobname,
virJSONValuePtr props)
{
- VIR_AUTOPTR(virJSONValue) cmd = NULL;
- VIR_AUTOPTR(virJSONValue) reply = NULL;
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
cmd = qemuMonitorJSONMakeCommand("blockdev-create",
"s:job-id", jobname,
const char *status = virJSONValueObjectGetString(data, "status");
const char *errmsg = virJSONValueObjectGetString(data, "error");
int tmp;
- VIR_AUTOPTR(qemuMonitorJobInfo) job = NULL;
+ g_autoptr(qemuMonitorJobInfo) job = NULL;
qemuMonitorJobInfoPtr ret = NULL;
if (VIR_ALLOC(job) < 0)
size_t *njobs)
{
virJSONValuePtr data;
- VIR_AUTOPTR(virJSONValue) cmd = NULL;
- VIR_AUTOPTR(virJSONValue) reply = NULL;
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
size_t i;
if (!(cmd = qemuMonitorJSONMakeCommand("query-jobs", NULL)))
static int
qemuProcessInitCpuAffinity(virDomainObjPtr vm)
{
- VIR_AUTOPTR(virBitmap) cpumapToSet = NULL;
+ g_autoptr(virBitmap) cpumapToSet = NULL;
virDomainNumatuneMemMode mem_mode;
qemuDomainObjPrivatePtr priv = vm->privateData;
virDomainNumatuneMemMode mem_mode;
virCgroupPtr cgroup = NULL;
virBitmapPtr use_cpumask = NULL;
- VIR_AUTOPTR(virBitmap) hostcpumap = NULL;
+ g_autoptr(virBitmap) hostcpumap = NULL;
char *mem_mask = NULL;
int ret = -1;
virHashTablePtr
virQEMUQAPISchemaConvert(virJSONValuePtr schemareply)
{
- VIR_AUTOPTR(virHashTable) schema = NULL;
- VIR_AUTOPTR(virJSONValue) schemajson = schemareply;
+ g_autoptr(virHashTable) schema = NULL;
+ g_autoptr(virJSONValue) schemajson = schemareply;
if (!(schema = virHashCreate(512, virJSONValueHashFree)))
return NULL;
qemuSlirpPtr
qemuSlirpNew(void)
{
- VIR_AUTOPTR(qemuSlirp) slirp = NULL;
+ g_autoptr(qemuSlirp) slirp = NULL;
if (VIR_ALLOC(slirp) < 0 ||
!(slirp->features = virBitmapNew(QEMU_SLIRP_FEATURE_LAST)))
qemuSlirpPtr
qemuSlirpNewForHelper(const char *helper)
{
- VIR_AUTOPTR(qemuSlirp) slirp = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(qemuSlirp) slirp = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *output = NULL;
- VIR_AUTOPTR(virJSONValue) doc = NULL;
+ g_autoptr(virJSONValue) doc = NULL;
virJSONValuePtr featuresJSON;
size_t i, nfeatures;
bool incoming)
{
VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = virQEMUDriverGetConfig(driver);
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *pidfile = NULL;
g_autofree char *dbus_path = NULL;
g_autofree char *dbus_addr = NULL;
qemuVhostUserParse(const char *path)
{
g_autofree char *cont = NULL;
- VIR_AUTOPTR(virJSONValue) doc = NULL;
- VIR_AUTOPTR(qemuVhostUser) vu = NULL;
+ g_autoptr(virJSONValue) doc = NULL;
+ g_autoptr(qemuVhostUser) vu = NULL;
qemuVhostUserPtr ret = NULL;
if (virFileReadAll(path, DOCUMENT_SIZE, &cont) < 0)
char *
qemuVhostUserFormat(qemuVhostUserPtr vu)
{
- VIR_AUTOPTR(virJSONValue) doc = NULL;
+ g_autoptr(virJSONValue) doc = NULL;
if (!vu)
return NULL;
virJSONValuePtr featuresJSON;
size_t nfeatures;
size_t i;
- VIR_AUTOPTR(qemuVhostUserGPUFeature) features = NULL;
+ g_autoptr(qemuVhostUserGPUFeature) features = NULL;
if (!(featuresJSON = virJSONValueObjectGetArray(doc, "features"))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
goto end;
for (i = 0; i < nvus; i++) {
- VIR_AUTOPTR(virJSONValue) doc = NULL;
+ g_autoptr(virJSONValue) doc = NULL;
g_autofree char *output = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
vu = vus[i];
if (vu->type != QEMU_VHOST_USER_TYPE_GPU)
VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = virQEMUDriverGetConfig(driver);
g_autofree char *shortname = NULL;
g_autofree char *pidfile = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
int pair[2] = { -1, -1 };
int cmdret = 0, rc;
int exitstatus = 0;
int unix_sock_rw_mask = 0;
int unix_sock_adm_mask = 0;
int ret = -1;
- VIR_AUTOPTR(virSystemdActivation) act = NULL;
+ g_autoptr(virSystemdActivation) act = NULL;
virSystemdActivationMap actmap[] = {
{ .name = DAEMON_NAME ".socket", .family = AF_UNIX, .path = sock_path },
{ .name = DAEMON_NAME "-ro.socket", .family = AF_UNIX, .path = sock_path_ro },
const char *filename,
bool allow_missing)
{
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
if (allow_missing &&
access(filename, R_OK) == -1 &&
const char *filename,
const char *filedata)
{
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
conf = virConfReadString(filedata, 0);
if (!conf)
static int
virSecuritySELinuxLXCInitialize(virSecurityManagerPtr mgr)
{
- VIR_AUTOPTR(virConf) selinux_conf = NULL;
+ g_autoptr(virConf) selinux_conf = NULL;
virSecuritySELinuxDataPtr data = virSecurityManagerGetPrivateData(mgr);
data->skipAllLabel = true;
const char * const argv[] = {
"/sbin/apparmor_parser", flag, profile, NULL
};
- VIR_AUTOPTR(virCommand) command = virCommandNewArgs(argv);
+ g_autoptr(virCommand) command = virCommandNewArgs(argv);
virCommandRawStatus(command);
if ((ret = virCommandRun(command, &status)) != 0 ||
.vol = vol,
};
g_autofree char *parthelper_path = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
if (!(parthelper_path = virFileFindResource("libvirt_parthelper",
abs_top_builddir "/src",
{
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
g_autofree char *parthelper_path = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
if (!(parthelper_path = virFileFindResource("libvirt_parthelper",
abs_top_builddir "/src",
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
int format = def->source.format;
const char *fmt;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
int ret = -1;
virCheckFlags(VIR_STORAGE_POOL_BUILD_OVERWRITE |
char *srcname = last_component(src_path);
bool isDevMapperDevice;
g_autofree char *devpath = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
virCheckFlags(0, -1);
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
virErrorPtr save_err;
g_autofree char *partFormat = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
cmd = virCommandNewArgList(PARTED,
def->source.devices[0].path,
1
};
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
cmd = virCommandNewArgList(SHOWMOUNT,
"--no-headers",
size_t i;
int retNFS = -1;
int retGluster = 0;
- VIR_AUTOPTR(virStoragePoolSource) source = NULL;
+ g_autoptr(virStoragePoolSource) source = NULL;
virCheckFlags(0, NULL);
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
int rc;
g_autofree char *src = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
if (virStorageBackendFileSystemIsValid(pool) < 0)
return -1;
{
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
int rc;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
if (virStorageBackendFileSystemIsValid(pool) < 0)
return -1;
virStorageBackendExecuteMKFS(const char *device,
const char *format)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
cmd = virCommandNewArgList(MKFS, "-t", format, NULL);
glfs_fd_t *fd = NULL;
ssize_t len;
int backingFormat;
- VIR_AUTOPTR(virStorageVolDef) vol = NULL;
+ g_autoptr(virStorageVolDef) vol = NULL;
VIR_AUTOUNREF(virStorageSourcePtr) meta = NULL;
g_autofree char *header = NULL;
char *ret = NULL;
int rc;
size_t i;
- VIR_AUTOPTR(virStoragePoolSource) source = NULL;
+ g_autoptr(virStoragePoolSource) source = NULL;
virCheckFlags(0, NULL);
.sources = NULL
};
g_autofree char *portal = NULL;
- VIR_AUTOPTR(virStoragePoolSource) source = NULL;
+ g_autoptr(virStoragePoolSource) source = NULL;
virCheckFlags(0, NULL);
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
uint32_t block_size;
uint64_t nb_block;
- VIR_AUTOPTR(virStorageVolDef) vol = NULL;
+ g_autoptr(virStorageVolDef) vol = NULL;
if (virISCSIDirectTestUnitReady(iscsi, lun) < 0)
return -1;
.sources = NULL
};
g_autofree char *portal = NULL;
- VIR_AUTOPTR(virStoragePoolSource) source = NULL;
+ g_autoptr(virStoragePoolSource) source = NULL;
virCheckFlags(0, NULL);
bool on)
{
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
int ret;
cmd = virStorageBackendLogicalChangeCmd(VGCHANGE, def, on);
static void
virStorageBackendLogicalRemoveDevice(const char *path)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
cmd = virCommandNewArgList(PVREMOVE, path, NULL);
if (virCommandRun(cmd, NULL) < 0)
static int
virStorageBackendLogicalInitializeDevice(const char *path)
{
- VIR_AUTOPTR(virCommand) pvcmd = NULL;
+ g_autoptr(virCommand) pvcmd = NULL;
/*
* LVM requires that the first sector is blanked if using
.pool = pool,
.vol = vol,
};
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
cmd = virCommandNewArgList(LVS,
"--separator", "#",
int vars[] = {
2
};
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
/*
* NOTE: ignoring errors here; this is just to "touch" any logical volumes
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
int ret = -1;
size_t i = 0;
- VIR_AUTOPTR(virCommand) vgcmd = NULL;
+ g_autoptr(virCommand) vgcmd = NULL;
virCheckFlags(VIR_STORAGE_POOL_BUILD_OVERWRITE |
VIR_STORAGE_POOL_BUILD_NO_OVERWRITE, ret);
2
};
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
virWaitForDevices();
{
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
size_t i;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
virCheckFlags(0, -1);
virStorageVolDefPtr vol,
unsigned int flags)
{
- VIR_AUTOPTR(virCommand) lvchange_cmd = NULL;
- VIR_AUTOPTR(virCommand) lvremove_cmd = NULL;
+ g_autoptr(virCommand) lvchange_cmd = NULL;
+ g_autoptr(virCommand) lvremove_cmd = NULL;
virCheckFlags(0, -1);
virStoragePoolDefPtr def)
{
unsigned long long capacity = vol->target.capacity;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
if (vol->target.encryption &&
vol->target.encryption->format != VIR_STORAGE_ENCRYPTION_FORMAT_LUKS) {
const char *dev)
{
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
- VIR_AUTOPTR(virStorageVolDef) vol = NULL;
+ g_autoptr(virStorageVolDef) vol = NULL;
if (VIR_ALLOC(vol) < 0)
return -1;
goto cleanup;
for (i = 0; names[i] != NULL; i++) {
- VIR_AUTOPTR(virStorageVolDef) vol = NULL;
+ g_autoptr(virStorageVolDef) vol = NULL;
if (VIR_ALLOC(vol) < 0)
goto cleanup;
static int
virStorageBackendSheepdogAddVolume(virStoragePoolObjPtr pool, const char *diskInfo)
{
- VIR_AUTOPTR(virStorageVolDef) vol = NULL;
+ g_autoptr(virStorageVolDef) vol = NULL;
if (diskInfo == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
g_autofree char *output = NULL;
VIR_AUTOSTRINGLIST lines = NULL;
VIR_AUTOSTRINGLIST cells = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
cmd = virCommandNewArgList(SHEEPDOGCLI, "vdi", "list", "-r", NULL);
virStorageBackendSheepdogAddHostArg(cmd, pool);
virStorageBackendSheepdogRefreshPool(virStoragePoolObjPtr pool)
{
g_autofree char *output = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
cmd = virCommandNewArgList(SHEEPDOGCLI, "node", "info", "-r", NULL);
virStorageBackendSheepdogAddHostArg(cmd, pool);
virStorageVolDefPtr vol,
unsigned int flags)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
virCheckFlags(0, -1);
virStorageVolDefPtr vol,
unsigned int flags)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
virCheckFlags(0, -1);
{
char *output = NULL;
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
cmd = virCommandNewArgList(SHEEPDOGCLI, "vdi", "list", vol->name, "-r", NULL);
virStorageBackendSheepdogAddHostArg(cmd, pool);
unsigned long long capacity,
unsigned int flags)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
virCheckFlags(0, -1);
g_autofree char *grp_name = NULL;
g_autofree char *usr_name = NULL;
g_autofree char *mode = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
int ret;
/* Check the permissions */
{
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
int rc;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
/* Short-circuit if already unmounted */
if ((rc = virStorageBackendVzIsMounted(pool)) != 1)
{
int ret = -1, exit_code = -1;
g_autofree char *error = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
/* 'zfs get' without arguments prints out
* usage information to stderr, including
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
size_t i;
VIR_AUTOSTRINGLIST lines = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *volumes_list = NULL;
/**
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
char *zpool_props = NULL;
size_t i;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
VIR_AUTOSTRINGLIST lines = NULL;
VIR_AUTOSTRINGLIST tokens = NULL;
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
int ret = -1;
int volmode_needed = -1;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
if (vol->target.encryption != NULL) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
unsigned int flags)
{
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
- VIR_AUTOPTR(virCommand) destroy_cmd = NULL;
+ g_autoptr(virCommand) destroy_cmd = NULL;
virCheckFlags(0, -1);
{
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
size_t i;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
int ret = -1;
virCheckFlags(0, -1);
unsigned int flags)
{
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
virCheckFlags(0, -1);
virStorageBackendPtr backend;
virObjectEventPtr event = NULL;
unsigned int build_flags = 0;
- VIR_AUTOPTR(virStoragePoolDef) newDef = NULL;
+ g_autoptr(virStoragePoolDef) newDef = NULL;
g_autofree char *stateFile = NULL;
virCheckFlags(VIR_STORAGE_POOL_CREATE_WITH_BUILD |
virStoragePoolDefPtr def;
virStoragePoolPtr pool = NULL;
virObjectEventPtr event = NULL;
- VIR_AUTOPTR(virStoragePoolDef) newDef = NULL;
+ g_autoptr(virStoragePoolDef) newDef = NULL;
virCheckFlags(0, NULL);
virStoragePoolDefPtr def;
virStorageBackendPtr backend;
virStorageVolPtr vol = NULL, newvol = NULL;
- VIR_AUTOPTR(virStorageVolDef) voldef = NULL;
+ g_autoptr(virStorageVolDef) voldef = NULL;
virCheckFlags(VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA, NULL);
virStorageVolPtr newvol = NULL;
virStorageVolPtr vol = NULL;
int buildret;
- VIR_AUTOPTR(virStorageVolDef) voldef = NULL;
+ g_autoptr(virStorageVolDef) voldef = NULL;
virCheckFlags(VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA |
VIR_STORAGE_VOL_CREATE_REFLINK,
static int
virStorageBackendPloopRestoreDesc(char *path)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *refresh_tool = NULL;
g_autofree char *desc = NULL;
{
int ret = -1;
bool created = false;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *create_tool = NULL;
virCheckFlags(0, -1);
storagePloopResize(virStorageVolDefPtr vol,
unsigned long long capacity)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *resize_tool = NULL;
resize_tool = virFindFileInPath("ploop");
const char *inputSecretPath,
virStorageVolEncryptConvertStep convertStep)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
cmd = virStorageBackendCreateQemuImgCmdFromVol(pool, vol, inputvol,
flags, create_tool,
int ret = -1;
const char *type;
virStorageEncryptionPtr enc = vol->target.encryption;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *img_tool = NULL;
g_autofree char *secretPath = NULL;
g_autofree char *secretAlias = NULL;
storageBackendPloopHasSnapshots(char *path)
{
char *snap_tool = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *output = NULL;
snap_tool = virFindFileInPath("ploop");
const char *alg_char = NULL;
struct stat st;
VIR_AUTOCLOSE fd = -1;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
fd = open(path, O_RDWR);
if (fd == -1) {
storageBackendVolWipePloop(virStorageVolDefPtr vol,
unsigned int algorithm)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *target_path = NULL;
g_autofree char *disk_desc = NULL;
g_autofree char *create_tool = NULL;
bool report)
{
int rc;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *glusterpath = NULL;
g_autofree char *outbuf = NULL;
};
char *start, *end;
int ret = VIR_STORAGE_PARTED_ERROR;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *output = NULL;
g_autofree char *error = NULL;
struct stat statbuf;
int direrr;
int ret = -1;
- VIR_AUTOPTR(virStorageVolDef) vol = NULL;
+ g_autoptr(virStorageVolDef) vol = NULL;
VIR_AUTOCLOSE fd = -1;
VIR_AUTOUNREF(virStorageSourcePtr) target = NULL;
{
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
int retval = -1;
- VIR_AUTOPTR(virStorageVolDef) vol = NULL;
+ g_autoptr(virStorageVolDef) vol = NULL;
g_autofree char *devpath = NULL;
/* Check if the pool is using a stable target path. The call to
int num;
g_autofree char *vol_xpath = NULL;
g_autofree xmlNodePtr *nodes = NULL;
- VIR_AUTOPTR(virStorageVolDef) volDef = NULL;
+ g_autoptr(virStorageVolDef) volDef = NULL;
/* Find storage volumes */
if (virAsprintf(&vol_xpath, "/node/pool[%d]/volume", objidx) < 0)
{
int pool_type;
char *ret = NULL;
- VIR_AUTOPTR(virStoragePoolSource) source = NULL;
+ g_autoptr(virStoragePoolSource) source = NULL;
virCheckFlags(0, NULL);
virStoragePoolDefPtr def;
virStoragePoolPtr pool = NULL;
virObjectEventPtr event = NULL;
- VIR_AUTOPTR(virStoragePoolDef) newDef = NULL;
+ g_autoptr(virStoragePoolDef) newDef = NULL;
virCheckFlags(0, NULL);
virStoragePoolDefPtr def;
virStoragePoolPtr pool = NULL;
virObjectEventPtr event = NULL;
- VIR_AUTOPTR(virStoragePoolDef) newDef = NULL;
+ g_autoptr(virStoragePoolDef) newDef = NULL;
virCheckFlags(0, NULL);
virStoragePoolObjPtr obj;
virStoragePoolDefPtr def;
virStorageVolPtr ret = NULL;
- VIR_AUTOPTR(virStorageVolDef) privvol = NULL;
+ g_autoptr(virStorageVolDef) privvol = NULL;
virCheckFlags(0, NULL);
virStoragePoolDefPtr def;
virStorageVolDefPtr origvol = NULL;
virStorageVolPtr ret = NULL;
- VIR_AUTOPTR(virStorageVolDef) privvol = NULL;
+ g_autoptr(virStorageVolDef) privvol = NULL;
virCheckFlags(0, NULL);
const char *path,
char **value)
{
- VIR_AUTOPTR(virAuthConfig) config = NULL;
+ g_autoptr(virAuthConfig) config = NULL;
const char *tmp;
*value = NULL;
virBitmapDataFormat(const void *data,
int len)
{
- VIR_AUTOPTR(virBitmap) map = NULL;
+ g_autoptr(virBitmap) map = NULL;
if (!(map = virBitmapNewData(data, len)))
return NULL;
int childout,
int childerr)
{
- VIR_AUTOPTR(virBitmap) fds = NULL;
+ g_autoptr(virBitmap) fds = NULL;
int openmax = sysconf(_SC_OPEN_MAX);
int fd = -1;
int
virRun(const char *const*argv, int *status)
{
- VIR_AUTOPTR(virCommand) cmd = virCommandNewArgs(argv);
+ g_autoptr(virCommand) cmd = virCommandNewArgs(argv);
return virCommandRun(cmd, status);
}
* This requests asynchronous string IO on @cmd. It is useful in
* combination with virCommandRunAsync():
*
- * VIR_AUTOPTR(virCommand) cmd = virCommandNew*(...);
+ * g_autoptr(virCommand) cmd = virCommandNew*(...);
* g_autofree char *buf = NULL;
*
* ...
{
g_autofree char *nbddev = NULL;
g_autofree char *qemunbd = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
const char *fmtstr = NULL;
if (!virFileNBDLoadDriver())
const char *const*args)
{
int status; /* Ignore failed commands without logging them */
- VIR_AUTOPTR(virCommand) cmd = virCommandNewArgs(args);
+ g_autoptr(virCommand) cmd = virCommandNewArgs(args);
if (virCommandRun(cmd, &status) < 0 || status) {
VIR_INFO("locking not supported by %s", args[0]);
} else {
{
size_t i;
const char *bin = virFirewallLayerCommandTypeToString(rule->layer);
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
int status;
g_autofree char *error = NULL;
if (virFirewallApplyGroup(firewall, i) < 0) {
VIR_DEBUG("Rolling back groups up to %zu for %p", i, firewall);
size_t first = i;
- VIR_AUTOPTR(virError) saved_error = virSaveLastError();
+ g_autoptr(virError) saved_error = virSaveLastError();
/*
* Look at any inheritance markers to figure out
{
int ret;
g_autofree char *path = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
const char *drvstr;
const char *opstr;
const char *subopstr;
virHostdevGetPCIHostDevice(const virDomainHostdevDef *hostdev,
virPCIDevicePtr *pci)
{
- VIR_AUTOPTR(virPCIDevice) actual = NULL;
+ g_autoptr(virPCIDevice) actual = NULL;
const virDomainHostdevSubsysPCI *pcisrc = &hostdev->source.subsys.u.pci;
*pci = NULL;
for (i = 0; i < nhostdevs; i++) {
virDomainHostdevDefPtr hostdev = hostdevs[i];
- VIR_AUTOPTR(virPCIDevice) pci = NULL;
+ g_autoptr(virPCIDevice) pci = NULL;
if (virHostdevGetPCIHostDevice(hostdev, &pci) < 0)
return NULL;
g_autofree char *linkdev = NULL;
g_autofree virMacAddrPtr MAC = NULL;
g_autofree virMacAddrPtr adminMAC = NULL;
- VIR_AUTOPTR(virNetDevVlan) vlan = NULL;
+ g_autoptr(virNetDevVlan) vlan = NULL;
virNetDevVPortProfilePtr virtPort;
int vf = -1;
bool port_profile_associate = false;
for (i = 0; i < nhostdevs; i++) {
const virDomainHostdevDef *hostdev = hostdevs[i];
- VIR_AUTOPTR(virPCIDevice) actual = NULL;
+ g_autoptr(virPCIDevice) actual = NULL;
if (virHostdevGetPCIHostDevice(hostdev, &actual) < 0)
goto cleanup;
virObjectLock(mgr->activeUSBHostdevs);
for (i = 0; i < nhostdevs; i++) {
virDomainHostdevSubsysUSBPtr usbsrc;
- VIR_AUTOPTR(virUSBDevice) usb = NULL;
+ g_autoptr(virUSBDevice) usb = NULL;
hostdev = hostdevs[i];
usbsrc = &hostdev->source.subsys.u.usb;
const char *dom_name)
{
virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host;
- VIR_AUTOPTR(virSCSIDevice) scsi = NULL;
+ g_autoptr(virSCSIDevice) scsi = NULL;
virSCSIDevicePtr tmp = NULL;
if (!(scsi = virSCSIDeviceNew(NULL,
{
int ret = -1;
size_t i;
- VIR_AUTOPTR(virMediatedDevice) mdev = NULL;
+ g_autoptr(virMediatedDevice) mdev = NULL;
if (nhostdevs == 0)
return 0;
for (i = 0; i < nhostdevs; i++) {
virDomainHostdevDefPtr hostdev = hostdevs[i];
bool required = true;
- VIR_AUTOPTR(virUSBDevice) usb = NULL;
+ g_autoptr(virUSBDevice) usb = NULL;
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
continue;
virSCSIDeviceListPtr list)
{
virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host;
- VIR_AUTOPTR(virSCSIDevice) scsi = NULL;
+ g_autoptr(virSCSIDevice) scsi = NULL;
if (hostdev->managed) {
virReportError(VIR_ERR_XML_ERROR, "%s",
for (i = 0; i < nhostdevs; i++) {
virDomainHostdevDefPtr hostdev = hostdevs[i];
virDomainHostdevSubsysSCSIVHostPtr hostsrc = &hostdev->source.subsys.u.scsi_host;
- VIR_AUTOPTR(virSCSIVHostDevice) host = NULL;
+ g_autoptr(virSCSIVHostDevice) host = NULL;
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST)
for (i = 0; i < nhostdevs; i++) {
virDomainHostdevDefPtr hostdev = hostdevs[i];
virDomainHostdevSubsysMediatedDevPtr src = &hostdev->source.subsys.u.mdev;
- VIR_AUTOPTR(virMediatedDevice) mdev = NULL;
+ g_autoptr(virMediatedDevice) mdev = NULL;
if (!virHostdevIsMdevDevice(hostdev))
continue;
for (i = 0; i < nhostdevs; i++) {
virDomainHostdevDefPtr hostdev = hostdevs[i];
virDomainHostdevSubsysUSBPtr usbsrc = &hostdev->source.subsys.u.usb;
- VIR_AUTOPTR(virUSBDevice) usb = NULL;
+ g_autoptr(virUSBDevice) usb = NULL;
virUSBDevicePtr tmp;
const char *usedby_drvname;
const char *usedby_domname;
const char *dom_name)
{
virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host;
- VIR_AUTOPTR(virSCSIDevice) scsi = NULL;
+ g_autoptr(virSCSIDevice) scsi = NULL;
virSCSIDevicePtr tmp;
if (!(scsi = virSCSIDeviceNew(NULL,
virObjectLock(mgr->activeSCSIVHostHostdevs);
for (i = 0; i < nhostdevs; i++) {
- VIR_AUTOPTR(virSCSIVHostDevice) host = NULL;
+ g_autoptr(virSCSIVHostDevice) host = NULL;
virSCSIVHostDevicePtr tmp;
virDomainHostdevDefPtr hostdev = hostdevs[i];
virDomainHostdevSubsysSCSIVHostPtr hostsrc = &hostdev->source.subsys.u.scsi_host;
virObjectLock(mgr->activeMediatedHostdevs);
for (i = 0; i < nhostdevs; i++) {
- VIR_AUTOPTR(virMediatedDevice) mdev = NULL;
+ g_autoptr(virMediatedDevice) mdev = NULL;
virMediatedDevicePtr tmp;
virDomainHostdevSubsysMediatedDevPtr mdevsrc;
virDomainHostdevDefPtr hostdev = hostdevs[i];
int exitstatus = 0;
g_autofree char *error = NULL;
- VIR_AUTOPTR(virCommand) cmd = virCommandNewArgList(ISCSIADM, "--mode",
+ g_autoptr(virCommand) cmd = virCommandNewArgList(ISCSIADM, "--mode",
"session", NULL);
virCommandSetErrorBuffer(cmd, &error);
g_autofree char *outbuf = NULL;
g_autofree char *iface = NULL;
g_autofree char *iqn = NULL;
- VIR_AUTOPTR(virCommand) cmd = virCommandNewArgList(ISCSIADM,
+ g_autoptr(virCommand) cmd = virCommandNewArgList(ISCSIADM,
"--mode", "iface", NULL);
*ifacename = NULL;
int exitstatus = -1;
g_autofree char *iface_name = NULL;
g_autofree char *temp_ifacename = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
if (virAsprintf(&temp_ifacename,
"libvirt-iface-%08llx",
"--targetname", target,
NULL
};
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *ifacename = NULL;
cmd = virCommandNewArgs(baseargv);
int
virISCSIRescanLUNs(const char *session)
{
- VIR_AUTOPTR(virCommand) cmd = virCommandNewArgList(ISCSIADM,
+ g_autoptr(virCommand) cmd = virCommandNewArgList(ISCSIADM,
"--mode", "session",
"-r", session,
"-R",
int vars[] = { 2 };
struct virISCSITargetList list;
size_t i;
- VIR_AUTOPTR(virCommand) cmd = virCommandNewArgList(ISCSIADM,
+ g_autoptr(virCommand) cmd = virCommandNewArgList(ISCSIADM,
"--mode", "discovery",
"--type", "sendtargets",
"--portal", portal,
virISCSINodeNew(const char *portal,
const char *target)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
int status;
cmd = virCommandNewArgList(ISCSIADM,
const char *name,
const char *value)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
int status;
cmd = virCommandNewArgList(ISCSIADM,
virJSONStringReformat(const char *jsonstr,
bool pretty)
{
- VIR_AUTOPTR(virJSONValue) json = NULL;
+ g_autoptr(virJSONValue) json = NULL;
if (!(json = virJSONValueFromString(jsonstr)))
return NULL;
virJSONValuePtr
virJSONValueObjectDeflatten(virJSONValuePtr json)
{
- VIR_AUTOPTR(virJSONValue) deflattened = NULL;
+ g_autoptr(virJSONValue) deflattened = NULL;
virJSONValuePtr ret = NULL;
if (!(deflattened = virJSONValueNewObject()))
static int
doModprobe(const char *opts, const char *module, char **outbuf, char **errbuf)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
cmd = virCommandNew(MODPROBE);
if (opts)
static int
doRmmod(const char *module, char **errbuf)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
cmd = virCommandNewArgList(RMMOD, module, NULL);
virCommandSetErrorBuffer(cmd, errbuf);
char **server_duid)
{
g_autofree char *lease_entries = NULL;
- VIR_AUTOPTR(virJSONValue) leases_array = NULL;
+ g_autoptr(virJSONValue) leases_array = NULL;
long long expirytime;
int custom_lease_file_len = 0;
virJSONValuePtr lease_tmp = NULL;
const char *iaid,
const char *server_duid)
{
- VIR_AUTOPTR(virJSONValue) lease_new = NULL;
+ g_autoptr(virJSONValue) lease_new = NULL;
const char *exptime_tmp = getenv("DNSMASQ_LEASE_EXPIRES");
long long expirytime = 0;
g_autofree char *exptime = NULL;
virMediatedDeviceNew(const char *uuidstr, virMediatedDeviceModelType model)
{
virMediatedDevicePtr ret = NULL;
- VIR_AUTOPTR(virMediatedDevice) dev = NULL;
+ g_autoptr(virMediatedDevice) dev = NULL;
g_autofree char *sysfspath = NULL;
if (!(sysfspath = virMediatedDeviceGetSysfsPath(uuidstr)))
virMediatedDeviceTypeReadAttrs(const char *sysfspath,
virMediatedDeviceTypePtr *type)
{
- VIR_AUTOPTR(virMediatedDeviceType) tmp = NULL;
+ g_autoptr(virMediatedDeviceType) tmp = NULL;
#define MDEV_GET_SYSFS_ATTR(attr, dst, cb, optional) \
do { \
char *buf = NULL;
char *next = NULL;
int ret = -1, len;
- VIR_AUTOPTR(virNetDevMcastEntry) entry = NULL;
+ g_autoptr(virNetDevMcastEntry) entry = NULL;
mcast->entries = NULL;
mcast->nentries = 0;
struct nlmsgerr *err;
unsigned int recvbuflen;
struct ndmsg ndm = { .ndm_family = PF_BRIDGE, .ndm_state = NUD_NOARP };
- VIR_AUTOPTR(virNetlinkMsg) nl_msg = NULL;
+ g_autoptr(virNetlinkMsg) nl_msg = NULL;
g_autofree struct nlmsghdr *resp = NULL;
if (virNetDevGetIndex(ifname, &ndm.ndm_ifindex) < 0)
unsigned int prefix)
{
unsigned int recvbuflen;
- VIR_AUTOPTR(virNetlinkMsg) nlmsg = NULL;
- VIR_AUTOPTR(virSocketAddr) broadcast = NULL;
+ g_autoptr(virNetlinkMsg) nlmsg = NULL;
+ g_autoptr(virSocketAddr) broadcast = NULL;
g_autofree struct nlmsghdr *resp = NULL;
g_autofree char *ipStr = NULL;
g_autofree char *peerStr = NULL;
unsigned int prefix)
{
unsigned int recvbuflen;
- VIR_AUTOPTR(virNetlinkMsg) nlmsg = NULL;
+ g_autoptr(virNetlinkMsg) nlmsg = NULL;
g_autofree struct nlmsghdr *resp = NULL;
if (!(nlmsg = virNetDevCreateNetlinkAddressMessage(RTM_DELADDR, ifname,
int errCode;
virSocketAddr defaultAddr;
virSocketAddrPtr actualAddr;
- VIR_AUTOPTR(virNetlinkMsg) nlmsg = NULL;
+ g_autoptr(virNetlinkMsg) nlmsg = NULL;
g_autofree char *toStr = NULL;
g_autofree char *viaStr = NULL;
g_autofree struct nlmsghdr *resp = NULL;
unsigned int recvbuflen;
bool dad = true;
time_t max_time = time(NULL) + VIR_DAD_WAIT_TIMEOUT;
- VIR_AUTOPTR(virNetlinkMsg) nlmsg = NULL;
+ g_autoptr(virNetlinkMsg) nlmsg = NULL;
if (!(nlmsg = nlmsg_alloc_simple(RTM_GETADDR,
NLM_F_REQUEST | NLM_F_DUMP))) {
.devices = NULL,
.ndevices = 0
};
- VIR_AUTOPTR(virNetlinkMsg) nlmsg = NULL;
+ g_autoptr(virNetlinkMsg) nlmsg = NULL;
/* Prepare the request message */
unsigned int prefix)
{
virSocketAddr broadcast;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *addrstr = NULL;
g_autofree char *bcaststr = NULL;
g_autofree char *peerstr = NULL;
virSocketAddr *addr,
unsigned int prefix)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *addrstr = NULL;
if (!(addrstr = virSocketAddrFormat(addr)))
virSocketAddrPtr gateway,
unsigned int metric)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *addrstr = NULL;
g_autofree char *gatewaystr = NULL;
}
if (mode == VIR_NETDEV_MACVLAN_MODE_PASSTHRU) {
- VIR_AUTOPTR(virMacAddr) MAC = NULL;
- VIR_AUTOPTR(virMacAddr) adminMAC = NULL;
- VIR_AUTOPTR(virNetDevVlan) vlan = NULL;
+ g_autoptr(virMacAddr) MAC = NULL;
+ g_autoptr(virMacAddr) adminMAC = NULL;
+ g_autoptr(virNetDevVlan) vlan = NULL;
if ((virNetDevReadNetConfig(linkdev, -1, stateDir,
&adminMAC, &vlan, &MAC) == 0) &&
char macaddrstr[VIR_MAC_STRING_BUFLEN];
char ifuuidstr[VIR_UUID_STRING_BUFLEN];
char vmuuidstr[VIR_UUID_STRING_BUFLEN];
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *attachedmac_ex_id = NULL;
g_autofree char *ifaceid_ex_id = NULL;
g_autofree char *profile_ex_id = NULL;
*/
int virNetDevOpenvswitchRemovePort(const char *brname G_GNUC_UNUSED, const char *ifname)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
cmd = virCommandNew(OVSVSCTL);
virNetDevOpenvswitchAddTimeout(cmd);
int virNetDevOpenvswitchGetMigrateData(char **migrate, const char *ifname)
{
size_t len;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
cmd = virCommandNew(OVSVSCTL);
virNetDevOpenvswitchAddTimeout(cmd);
*/
int virNetDevOpenvswitchSetMigrateData(char *migrate, const char *ifname)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
if (!migrate) {
VIR_DEBUG("No OVS port data for interface %s", ifname);
virNetDevOpenvswitchInterfaceParseStats(const char *json,
virDomainInterfaceStatsPtr stats)
{
- VIR_AUTOPTR(virJSONValue) jsonStats = NULL;
+ g_autoptr(virJSONValue) jsonStats = NULL;
virJSONValuePtr jsonMap = NULL;
size_t i;
virNetDevOpenvswitchInterfaceStats(const char *ifname,
virDomainInterfaceStatsPtr stats)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *output = NULL;
cmd = virCommandNew(OVSVSCTL);
size_t ntokens = 0;
int status;
int ret = -1;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
/* Openvswitch vhostuser path are hardcoded to
* /<runstatedir>/openvswitch/<ifname>
int virNetDevOpenvswitchUpdateVlan(const char *ifname,
virNetDevVlanPtr virtVlan)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
cmd = virCommandNew(OVSVSCTL);
virNetDevOpenvswitchAddTimeout(cmd);
for (i = 0; i < MAX_VETH_RETRIES; i++) {
g_autofree char *veth1auto = NULL;
g_autofree char *veth2auto = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
int status;
if (!*veth1) {
int virNetDevVethDelete(const char *veth)
{
int status;
- VIR_AUTOPTR(virCommand) cmd = virCommandNewArgList("ip", "link",
+ g_autoptr(virCommand) cmd = virCommandNewArgList("ip", "link",
"del", veth, NULL);
if (virCommandRun(cmd, &status) < 0)
};
struct pollfd fds[1];
g_autofree struct nlmsghdr *temp_resp = NULL;
- VIR_AUTOPTR(virNetlinkHandle) nlhandle = NULL;
+ g_autoptr(virNetlinkHandle) nlhandle = NULL;
int len = 0;
memset(fds, 0, sizeof(fds));
.nl_pid = dst_pid,
.nl_groups = 0,
};
- VIR_AUTOPTR(virNetlinkHandle) nlhandle = NULL;
+ g_autoptr(virNetlinkHandle) nlhandle = NULL;
if (!(nlhandle = virNetlinkSendRequest(nl_msg, src_pid, nladdr,
protocol, groups)))
.ifi_index = ifindex
};
unsigned int recvbuflen;
- VIR_AUTOPTR(virNetlinkMsg) nl_msg = NULL;
+ g_autoptr(virNetlinkMsg) nl_msg = NULL;
g_autofree struct nlmsghdr *resp = NULL;
if (ifname && ifindex <= 0 && virNetDevGetIndex(ifname, &ifindex) < 0)
struct nlattr *infodata = NULL;
unsigned int buflen;
struct ifinfomsg ifinfo = { .ifi_family = AF_UNSPEC };
- VIR_AUTOPTR(virNetlinkMsg) nl_msg = NULL;
+ g_autoptr(virNetlinkMsg) nl_msg = NULL;
g_autofree struct nlmsghdr *resp = NULL;
*error = 0;
struct nlmsgerr *err;
struct ifinfomsg ifinfo = { .ifi_family = AF_UNSPEC };
unsigned int recvbuflen;
- VIR_AUTOPTR(virNetlinkMsg) nl_msg = NULL;
+ g_autoptr(virNetlinkMsg) nl_msg = NULL;
g_autofree struct nlmsghdr *resp = NULL;
nl_msg = nlmsg_alloc_simple(RTM_DELLINK,
.ndm_family = AF_UNSPEC,
};
unsigned int recvbuflen;
- VIR_AUTOPTR(virNetlinkMsg) nl_msg = NULL;
+ g_autoptr(virNetlinkMsg) nl_msg = NULL;
g_autofree struct nlmsghdr *resp = NULL;
nl_msg = nlmsg_alloc_simple(RTM_GETNEIGH, NLM_F_DUMP | NLM_F_REQUEST);
static int
virNodeSuspendSupportsTargetPMUtils(unsigned int target, bool *supported)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *binary = NULL;
int status;
virNumaGetAutoPlacementAdvice(unsigned short vcpus,
unsigned long long balloon)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
char *output = NULL;
cmd = virCommandNewArgList(NUMAD, "-w", NULL);
size_t i;
g_autofree unsigned long *mask = NULL;
g_autofree unsigned long *allonesmask = NULL;
- VIR_AUTOPTR(virBitmap) cpumap = NULL;
+ g_autoptr(virBitmap) cpumap = NULL;
*cpus = NULL;
virNumaNodesetToCPUset(virBitmapPtr nodeset,
virBitmapPtr *cpuset)
{
- VIR_AUTOPTR(virBitmap) allNodesCPUs = NULL;
+ g_autoptr(virBitmap) allNodesCPUs = NULL;
size_t nodesetSize;
size_t i;
nodesetSize = virBitmapSize(nodeset);
for (i = 0; i < nodesetSize; i++) {
- VIR_AUTOPTR(virBitmap) nodeCPUs = NULL;
+ g_autoptr(virBitmap) nodeCPUs = NULL;
if (!virBitmapIsBitSet(nodeset, i))
continue;
while ((ret = virDirRead(dir, &entry, PCI_SYSFS "devices")) > 0) {
unsigned int domain, bus, slot, function;
- VIR_AUTOPTR(virPCIDevice) check = NULL;
+ g_autoptr(virPCIDevice) check = NULL;
char *tmp;
/* expected format: <domain>:<bus>:<slot>.<function> */
int cfgfd,
virPCIDeviceList *inactiveDevs)
{
- VIR_AUTOPTR(virPCIDevice) parent = NULL;
- VIR_AUTOPTR(virPCIDevice) conflict = NULL;
+ g_autoptr(virPCIDevice) parent = NULL;
+ g_autoptr(virPCIDevice) conflict = NULL;
uint8_t config_space[PCI_CONF_LEN];
uint16_t ctl;
int ret = -1;
unsigned int slot,
unsigned int function)
{
- VIR_AUTOPTR(virPCIDevice) dev = NULL;
+ g_autoptr(virPCIDevice) dev = NULL;
g_autofree char *vendor = NULL;
g_autofree char *product = NULL;
int
virPCIDeviceListAddCopy(virPCIDeviceListPtr list, virPCIDevicePtr dev)
{
- VIR_AUTOPTR(virPCIDevice) copy = virPCIDeviceCopy(dev);
+ g_autoptr(virPCIDevice) copy = virPCIDeviceCopy(dev);
if (!copy)
return -1;
virPCIDeviceGetIOMMUGroupAddOne(virPCIDeviceAddressPtr newDevAddr, void *opaque)
{
virPCIDeviceListPtr groupList = opaque;
- VIR_AUTOPTR(virPCIDevice) newDev = NULL;
+ g_autoptr(virPCIDevice) newDev = NULL;
if (!(newDev = virPCIDeviceNew(newDevAddr->domain, newDevAddr->bus,
newDevAddr->slot, newDevAddr->function)))
static int
virPCIDeviceIsBehindSwitchLackingACS(virPCIDevicePtr dev)
{
- VIR_AUTOPTR(virPCIDevice) parent = NULL;
+ g_autoptr(virPCIDevice) parent = NULL;
if (virPCIDeviceGetParent(dev, &parent) < 0)
return -1;
* parent can be found
*/
do {
- VIR_AUTOPTR(virPCIDevice) tmp = NULL;
+ g_autoptr(virPCIDevice) tmp = NULL;
int acs;
int ret;
DIR *dir = NULL;
struct dirent *entry;
g_autofree char *types_path = NULL;
- VIR_AUTOPTR(virMediatedDeviceType) mdev_type = NULL;
+ g_autoptr(virMediatedDeviceType) mdev_type = NULL;
virMediatedDeviceTypePtr *mdev_types = NULL;
size_t ntypes = 0;
size_t i;
{
ssize_t pos = -1;
ssize_t end;
- VIR_AUTOPTR(virBitmap) bitmap = NULL;
+ g_autoptr(virBitmap) bitmap = NULL;
if (virJSONValueGetArrayAsBitmap(array, &bitmap) < 0)
return -1;
bool readonly,
bool shareable)
{
- VIR_AUTOPTR(virSCSIDevice) dev = NULL;
+ g_autoptr(virSCSIDevice) dev = NULL;
virSCSIDevicePtr ret = NULL;
g_autofree char *sg = NULL;
g_autofree char *vendor_path = NULL;
const char *drvname,
const char *domname)
{
- VIR_AUTOPTR(virUsedByInfo) copy = NULL;
+ g_autoptr(virUsedByInfo) copy = NULL;
if (VIR_ALLOC(copy) < 0)
return -1;
virSCSIDeviceUsedByInfoFree(dev->used_by[i]);
VIR_DELETE_ELEMENT(dev->used_by, i, dev->n_used_by);
} else {
- VIR_AUTOPTR(virSCSIDevice) tmp = NULL;
+ g_autoptr(virSCSIDevice) tmp = NULL;
tmp = virSCSIDeviceListSteal(list, dev);
}
break;
virSCSIVHostDevicePtr
virSCSIVHostDeviceNew(const char *name)
{
- VIR_AUTOPTR(virSCSIVHostDevice) dev = NULL;
+ g_autoptr(virSCSIVHostDevice) dev = NULL;
virSCSIVHostDevicePtr ret = NULL;
if (VIR_ALLOC(dev) < 0)
*/
int status;
int ret = -1;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
cmd = virCommandNewArgList(LVS, "--noheadings",
"--unbuffered", "--nosuffix",
bool ignoreError G_GNUC_UNUSED)
{
int status;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
cmd = virCommandNewArgList("/lib/udev/scsi_id",
"--replace-whitespace",
const char *serial;
const char *port;
g_autofree char *outbuf = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
cmd = virCommandNewArgList("/lib/udev/scsi_id",
"--replace-whitespace",
virStorageAuthDefCopy(const virStorageAuthDef *src)
{
virStorageAuthDefPtr ret = NULL;
- VIR_AUTOPTR(virStorageAuthDef) authdef = NULL;
+ g_autoptr(virStorageAuthDef) authdef = NULL;
if (VIR_ALLOC(authdef) < 0)
return NULL;
xmlNodePtr saveNode = ctxt->node;
virStorageAuthDefPtr ret = NULL;
xmlNodePtr secretnode = NULL;
- VIR_AUTOPTR(virStorageAuthDef) authdef = NULL;
+ g_autoptr(virStorageAuthDef) authdef = NULL;
g_autofree char *authtype = NULL;
ctxt->node = node;
virStorageSourceParseBackingURI(virStorageSourcePtr src,
const char *uristr)
{
- VIR_AUTOPTR(virURI) uri = NULL;
+ g_autoptr(virURI) uri = NULL;
const char *path = NULL;
VIR_AUTOSTRINGLIST scheme = NULL;
{
char *p, *e, *next;
g_autofree char *options = NULL;
- VIR_AUTOPTR(virStorageAuthDef) authdef = NULL;
+ g_autoptr(virStorageAuthDef) authdef = NULL;
/* optionally skip the "rbd:" prefix if provided */
if (STRPREFIX(rbdstr, "rbd:"))
virStorageSourceParseBackingJSONInternal(virStorageSourcePtr src,
virJSONValuePtr json)
{
- VIR_AUTOPTR(virJSONValue) deflattened = NULL;
+ g_autoptr(virJSONValue) deflattened = NULL;
virJSONValuePtr file;
const char *drvname;
size_t i;
virStorageSourceParseBackingJSON(virStorageSourcePtr src,
const char *json)
{
- VIR_AUTOPTR(virJSONValue) root = NULL;
+ g_autoptr(virJSONValue) root = NULL;
if (!(root = virJSONValueFromString(json)))
return -1;
int exitstatus;
virBitmapPtr bitmap;
g_autofree char *outbuf = NULL;
- VIR_AUTOPTR(virJSONValue) json = NULL;
+ g_autoptr(virJSONValue) json = NULL;
virJSONValuePtr featureList;
virJSONValuePtr item;
size_t idx;
virTPMGetCaps(TypeFromStringFn typeFromStringFn,
const char *exec, const char *param1)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
if (!(cmd = virCommandNew(exec)))
return NULL;
struct dirent *de;
virUSBDeviceListPtr list = NULL;
virUSBDeviceListPtr ret = NULL;
- VIR_AUTOPTR(virUSBDevice) usb = NULL;
+ g_autoptr(virUSBDevice) usb = NULL;
int direrr;
if (!(list = virUSBDeviceListNew()))
void virWaitForDevices(void)
{
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *udev = NULL;
int exitstatus;
PRUint32 variant = HardDiskVariant_Standard;
resultCodeUnion resultCode;
virStorageVolPtr ret = NULL;
- VIR_AUTOPTR(virStorageVolDef) def = NULL;
+ g_autoptr(virStorageVolDef) def = NULL;
if (!data->vboxObj)
return ret;
const char *vmx)
{
bool success = false;
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
char *encoding = NULL;
char *utf8;
virDomainDefPtr def = NULL;
testBackingXMLjsonXML(const void *args)
{
const struct testBackingXMLjsonXMLdata *data = args;
- VIR_AUTOPTR(xmlDoc) xml = NULL;
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlDoc) xml = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- VIR_AUTOPTR(virJSONValue) backendprops = NULL;
- VIR_AUTOPTR(virJSONValue) wrapper = NULL;
+ g_autoptr(virJSONValue) backendprops = NULL;
+ g_autoptr(virJSONValue) wrapper = NULL;
g_autofree char *propsstr = NULL;
g_autofree char *protocolwrapper = NULL;
g_autofree char *actualxml = NULL;
virStorageSourcePtr n;
virJSONValuePtr formatProps = NULL;
virJSONValuePtr storageProps = NULL;
- VIR_AUTOPTR(virJSONValue) storageSrcOnlyProps = NULL;
+ g_autoptr(virJSONValue) storageSrcOnlyProps = NULL;
char *xmlpath = NULL;
char *xmlstr = NULL;
int ret = -1;
{
virDomainSnapshotDiskDefPtr diskdef = NULL;
- VIR_AUTOPTR(xmlDoc) doc = NULL;
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlDoc) doc = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
xmlNodePtr node;
g_autofree char *xmlpath = NULL;
virStorageSourcePtr ret = NULL;
testQemuImageCreate(const void *opaque)
{
struct testQemuImageCreateData *data = (void *) opaque;
- VIR_AUTOPTR(virJSONValue) protocolprops = NULL;
- VIR_AUTOPTR(virJSONValue) formatprops = NULL;
+ g_autoptr(virJSONValue) protocolprops = NULL;
+ g_autoptr(virJSONValue) formatprops = NULL;
VIR_AUTOUNREF(virStorageSourcePtr) src = NULL;
g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER;
g_auto(virBuffer) actualbuf = VIR_BUFFER_INITIALIZER;
{
const char *filename = opaque;
g_autofree char *path = NULL;
- VIR_AUTOPTR(qemuFirmware) fw = NULL;
+ g_autoptr(qemuFirmware) fw = NULL;
g_autofree char *buf = NULL;
- VIR_AUTOPTR(virJSONValue) json = NULL;
+ g_autoptr(virJSONValue) json = NULL;
g_autofree char *expected = NULL;
g_autofree char *actual = NULL;
static int
mymain(void)
{
- VIR_AUTOPTR(virHashTable) qmpschema = NULL;
+ g_autoptr(virHashTable) qmpschema = NULL;
int ret = 0;
struct qemuHotplugTestData data = {0};
struct testQemuHotplugCpuParams cpudata;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
bool running = false;
virDomainPausedReason reason = 0;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
int minor;
int micro;
char *package = NULL;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
const char *null = NULL;
size_t i;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
qemuMonitorCPUDefInfoPtr *cpus = NULL;
int ncpus = 0;
size_t i;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
char **commands = NULL;
int ncommands = 0;
size_t i;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
int ret = -1;
char **tpmmodels = NULL;
int ntpmmodels = 0;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
char **params = NULL;
int nparams = 0;
bool found = false;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
qemuMonitorJSONListPathPtr *paths;
int npaths = 0;
size_t i;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
qemuMonitorJSONObjectProperty prop;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
qemuMonitorJSONObjectProperty prop;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
const char **alias;
const char *expected[] = {
"virtio-disk25", "video0", "serial0", "ide0-0-0", "usb", NULL };
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
bool running = false;
virDomainPausedReason reason = 0;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
(testQemuMonitorJSONSimpleFuncDataPtr) opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
const char *reply = data->reply;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
const testQemuMonitorJSONSimpleFuncData *data = opaque; \
virDomainXMLOptionPtr xmlopt = data->xmlopt; \
const char *reply = data->reply; \
- VIR_AUTOPTR(qemuMonitorTest) test = NULL; \
+ g_autoptr(qemuMonitorTest) test = NULL; \
\
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema))) \
return -1; \
.socket = (char *)"/tmp/sock",
.transport = VIR_STORAGE_NET_HOST_TRANS_UNIX,
};
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
- VIR_AUTOPTR(virJSONValue) arr = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
+ g_autoptr(virJSONValue) arr = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
{0, 17629, (char *) "/machine/unattached/device[0]", false},
{1, 17630, (char *) "/machine/unattached/device[1]", false},
};
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
unsigned long long currmem;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virDomainVirtType virtType;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
int ret = -1;
virHashTablePtr blockDevices = NULL, expectedBlockDevices = NULL;
struct qemuDomainDiskInfo *info;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
virHashTablePtr blockstats = NULL;
qemuBlockStatsPtr stats;
int ret = -1;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
const char *reply =
"{"
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
unsigned long long cacheSize;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
int ret = -1;
qemuMonitorMigrationStats stats, expectedStats;
char *error = NULL;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
qemuMonitorChardevInfo info1 = { (char *) "/dev/pts/21", VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED };
qemuMonitorChardevInfo info2 = { (char *) "/dev/pts/20", VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT };
qemuMonitorChardevInfo info3 = { NULL, VIR_DOMAIN_CHR_DEVICE_STATE_DISCONNECTED };
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
int ret = -1;
virDomainBlockIoTuneInfo info, expectedInfo;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
int ret = -1;
char *arch;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
" ],"
" \"id\": \"libvirt-22\""
"}";
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
unsigned int keycodes[] = {43, 26, 46, 32};
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
unsigned int keycodes[] = {43, 26, 46, 32};
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
" \"desc\": \"Parameter 'top' is missing\""
" }"
"}";
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
" },"
" \"id\": \"libvirt-9\""
"}";
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
char *jsonStr = NULL;
char *actual = NULL;
int ret = -1;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(data->xmlopt, data->schema)))
return -1;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
virCPUDataPtr cpuData = NULL;
int rv, ret = -1;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
int ninfo = 0;
int ret = -1;
size_t i;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
qemuMonitorCPUInfoPtr vcpus = NULL;
int rc;
int ret = -1;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(data->xmlopt, data->schema)))
return -1;
testQemuMonitorJSONTransaction(const void *opaque)
{
const testGenericData *data = opaque;
- VIR_AUTOPTR(qemuMonitorTest) test = NULL;
- VIR_AUTOPTR(virJSONValue) actions = NULL;
- VIR_AUTOPTR(virJSONValue) mergebitmaps = NULL;
+ g_autoptr(qemuMonitorTest) test = NULL;
+ g_autoptr(virJSONValue) actions = NULL;
+ g_autoptr(virJSONValue) mergebitmaps = NULL;
if (!(test = qemuMonitorTestNewSchema(data->xmlopt, data->schema)))
return -1;
{
g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER;
virJSONValuePtr schemaroot;
- VIR_AUTOPTR(virJSONValue) emptyargs = NULL;
+ g_autoptr(virJSONValue) emptyargs = NULL;
g_autofree char *schemapath = NULL;
if (!test->qapischema)
const char *cmdstr)
{
struct qemuMonitorTestHandlerData *data = item->opaque;
- VIR_AUTOPTR(virJSONValue) val = NULL;
+ g_autoptr(virJSONValue) val = NULL;
virJSONValuePtr cmdargs = NULL;
const char *cmdname;
int rc;
struct qemuMonitorTestHandlerData *data = item->opaque;
g_autofree char *reformatted = NULL;
g_autofree char *errmsg = NULL;
- VIR_AUTOPTR(virJSONValue) json = NULL;
+ g_autoptr(virJSONValue) json = NULL;
virJSONValuePtr cmdargs;
const char *cmdname;
int ret = -1;
{
const char *filename = opaque;
g_autofree char *path = NULL;
- VIR_AUTOPTR(qemuVhostUser) vu = NULL;
+ g_autoptr(qemuVhostUser) vu = NULL;
g_autofree char *buf = NULL;
- VIR_AUTOPTR(virJSONValue) json = NULL;
+ g_autoptr(virJSONValue) json = NULL;
g_autofree char *expected = NULL;
g_autofree char *actual = NULL;
const struct testNodeInfoParserData *data = opaque;
collie_test test = data->data;
g_autofree char *output = NULL;
- VIR_AUTOPTR(virStoragePoolDef) pool = NULL;
+ g_autoptr(virStoragePoolDef) pool = NULL;
if (!(pool = virStoragePoolDefParseFile(data->poolxml)))
return -1;
const struct testVDIListParserData *data = opaque;
collie_test test = data->data;
g_autofree char *output = NULL;
- VIR_AUTOPTR(virStoragePoolDef) pool = NULL;
- VIR_AUTOPTR(virStorageVolDef) vol = NULL;
+ g_autoptr(virStoragePoolDef) pool = NULL;
+ g_autoptr(virStorageVolDef) vol = NULL;
if (!(pool = virStoragePoolDefParseFile(data->poolxml)))
return -1;
const char *defTypeStr;
g_autofree char *actualCmdline = NULL;
g_autofree char *src = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
if (!(def = virStoragePoolDefParseFile(poolxml)))
goto cleanup;
testCompareXMLToXMLFiles(const char *inxml, const char *outxml)
{
g_autofree char *actual = NULL;
- VIR_AUTOPTR(virStoragePoolDef) dev = NULL;
+ g_autoptr(virStoragePoolDef) dev = NULL;
if (!(dev = virStoragePoolDefParseFile(inxml)))
return -1;
virStoragePoolDefPtr def = NULL;
virStoragePoolObjPtr obj = NULL;
g_autofree char *actualCmdline = NULL;
- VIR_AUTOPTR(virStorageVolDef) vol = NULL;
- VIR_AUTOPTR(virStorageVolDef) inputvol = NULL;
- VIR_AUTOPTR(virStoragePoolDef) inputpool = NULL;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virStorageVolDef) vol = NULL;
+ g_autoptr(virStorageVolDef) inputvol = NULL;
+ g_autoptr(virStoragePoolDef) inputpool = NULL;
+ g_autoptr(virCommand) cmd = NULL;
if (!(def = virStoragePoolDefParseFile(poolxml)))
goto cleanup;
const char *outxml, unsigned int flags)
{
g_autofree char *actual = NULL;
- VIR_AUTOPTR(virStoragePoolDef) pool = NULL;
- VIR_AUTOPTR(virStorageVolDef) dev = NULL;
+ g_autoptr(virStoragePoolDef) pool = NULL;
+ g_autoptr(virStorageVolDef) dev = NULL;
if (!(pool = virStoragePoolDefParseFile(poolxml)))
return -1;
test15(const void *opaque)
{
const struct testBinaryOpData *data = opaque;
- VIR_AUTOPTR(virBitmap) amap = NULL;
- VIR_AUTOPTR(virBitmap) bmap = NULL;
- VIR_AUTOPTR(virBitmap) resmap = NULL;
+ g_autoptr(virBitmap) amap = NULL;
+ g_autoptr(virBitmap) bmap = NULL;
+ g_autoptr(virBitmap) resmap = NULL;
if (!(amap = virBitmapParseUnlimited(data->a)) ||
!(bmap = virBitmapParseUnlimited(data->b)) ||
{
const char *name = opaque;
int ret = -1;
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
int len = 10000;
char *buffer = NULL;
char *srcfile = NULL;
"string = 'foo'\n" \
"uint = 12345";
- VIR_AUTOPTR(virConf) conf = virConfReadString(srcdata, 0);
+ g_autoptr(virConf) conf = virConfReadString(srcdata, 0);
int ret = -1;
virConfValuePtr val;
unsigned long long llvalue;
"ssize_t = -87539319\n" \
"string = \"foo\"\n";
- VIR_AUTOPTR(virConf) conf = virConfReadString(srcdata, 0);
+ g_autoptr(virConf) conf = virConfReadString(srcdata, 0);
int iv;
unsigned int ui;
size_t s;
"int = 6963472309248\n" \
"string = \"foo\"\n";
- VIR_AUTOPTR(virConf) conf = virConfReadString(srcdata, 0);
+ g_autoptr(virConf) conf = virConfReadString(srcdata, 0);
bool f = true;
bool t = false;
"string = \"foo\"\n";
int ret = -1;
- VIR_AUTOPTR(virConf) conf = virConfReadString(srcdata, 0);
+ g_autoptr(virConf) conf = virConfReadString(srcdata, 0);
char *str = NULL;
if (!conf)
"string = \"foo\"\n";
int ret = -1;
- VIR_AUTOPTR(virConf) conf = virConfReadString(srcdata, 0);
+ g_autoptr(virConf) conf = virConfReadString(srcdata, 0);
char **str = NULL;
if (!conf)
testJSONFromFile(const void *data)
{
const struct testInfo *info = data;
- VIR_AUTOPTR(virJSONValue) injson = NULL;
+ g_autoptr(virJSONValue) injson = NULL;
g_autofree char *infile = NULL;
g_autofree char *indata = NULL;
g_autofree char *outfile = NULL;
testJSONFromString(const void *data)
{
const struct testInfo *info = data;
- VIR_AUTOPTR(virJSONValue) json = NULL;
+ g_autoptr(virJSONValue) json = NULL;
const char *expectstr = info->expect ? info->expect : info->doc;
g_autofree char *formatted = NULL;
testJSONAddRemove(const void *data)
{
const struct testInfo *info = data;
- VIR_AUTOPTR(virJSONValue) json = NULL;
- VIR_AUTOPTR(virJSONValue) name = NULL;
+ g_autoptr(virJSONValue) json = NULL;
+ g_autoptr(virJSONValue) name = NULL;
g_autofree char *infile = NULL;
g_autofree char *indata = NULL;
g_autofree char *outfile = NULL;
testJSONLookup(const void *data)
{
const struct testInfo *info = data;
- VIR_AUTOPTR(virJSONValue) json = NULL;
+ g_autoptr(virJSONValue) json = NULL;
virJSONValuePtr value = NULL;
g_autofree char *result = NULL;
int rc;
testJSONCopy(const void *data)
{
const struct testInfo *info = data;
- VIR_AUTOPTR(virJSONValue) json = NULL;
- VIR_AUTOPTR(virJSONValue) jsonCopy = NULL;
+ g_autoptr(virJSONValue) json = NULL;
+ g_autoptr(virJSONValue) jsonCopy = NULL;
g_autofree char *result = NULL;
g_autofree char *resultCopy = NULL;
testJSONDeflatten(const void *data)
{
const struct testInfo *info = data;
- VIR_AUTOPTR(virJSONValue) injson = NULL;
- VIR_AUTOPTR(virJSONValue) deflattened = NULL;
+ g_autoptr(virJSONValue) injson = NULL;
+ g_autoptr(virJSONValue) deflattened = NULL;
g_autofree char *infile = NULL;
g_autofree char *indata = NULL;
g_autofree char *outfile = NULL;
static int
testJSONEscapeObj(const void *data G_GNUC_UNUSED)
{
- VIR_AUTOPTR(virJSONValue) json = NULL;
- VIR_AUTOPTR(virJSONValue) nestjson = NULL;
- VIR_AUTOPTR(virJSONValue) parsejson = NULL;
+ g_autoptr(virJSONValue) json = NULL;
+ g_autoptr(virJSONValue) nestjson = NULL;
+ g_autoptr(virJSONValue) parsejson = NULL;
g_autofree char *neststr = NULL;
g_autofree char *result = NULL;
const char *parsednestedstr;
static int
testJSONObjectFormatSteal(const void *opaque G_GNUC_UNUSED)
{
- VIR_AUTOPTR(virJSONValue) a1 = NULL;
- VIR_AUTOPTR(virJSONValue) a2 = NULL;
- VIR_AUTOPTR(virJSONValue) t1 = NULL;
- VIR_AUTOPTR(virJSONValue) t2 = NULL;
+ g_autoptr(virJSONValue) a1 = NULL;
+ g_autoptr(virJSONValue) a2 = NULL;
+ g_autoptr(virJSONValue) t1 = NULL;
+ g_autoptr(virJSONValue) t2 = NULL;
if (!(a1 = virJSONValueNewString("test")) ||
!(a2 = virJSONValueNewString("test"))) {
{
char *actual = NULL;
int ret = -1;
- VIR_AUTOPTR(virNetworkPortDef) dev = NULL;
+ g_autoptr(virNetworkPortDef) dev = NULL;
if (!(dev = virNetworkPortDefParseFile(expected)))
goto cleanup;
{
int ret = EXIT_FAILURE;
bool compat = false;
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *buf = NULL;
qemuimg = virFindFileInPath("qemu-img");
struct testBackingParseData data5;
virStorageSourcePtr chain2; /* short for chain->backingStore */
virStorageSourcePtr chain3; /* short for chain2->backingStore */
- VIR_AUTOPTR(virCommand) cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
VIR_AUTOUNREF(virStorageSourcePtr) chain = NULL;
if (storageRegisterAll() < 0)
virSystemdActivationMap map[2];
int *fds = NULL;
size_t nfds = 0;
- VIR_AUTOPTR(virSystemdActivation) act = NULL;
+ g_autoptr(virSystemdActivation) act = NULL;
g_auto(virBuffer) names = VIR_BUFFER_INITIALIZER;
virBufferAddLit(&names, "demo-unix.socket");
testCompareParseXML(const char *xlcfg, const char *xml, bool replaceVars)
{
char *gotxlcfgData = NULL;
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
virConnectPtr conn = NULL;
int wrote = 4096;
int ret = -1;
{
char *xlcfgData = NULL;
char *gotxml = NULL;
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
int ret = -1;
virConnectPtr conn;
virDomainDefPtr def = NULL;
testCompareParseXML(const char *xmcfg, const char *xml)
{
char *gotxmcfgData = NULL;
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
int ret = -1;
virConnectPtr conn = NULL;
int wrote = 4096;
{
char *xmcfgData = NULL;
char *gotxml = NULL;
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
int ret = -1;
virDomainDefPtr def = NULL;
unsigned int flags)
{
virshControlPtr priv = ctl->privData;
- VIR_AUTOPTR(xmlDoc) xmldoc = NULL;
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlDoc) xmldoc = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
int ninterfaces;
g_autofree xmlNodePtr *interfaces = NULL;
size_t i;
unsigned int flags)
{
virshControlPtr priv = ctl->privData;
- VIR_AUTOPTR(xmlDoc) xmldoc = NULL;
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlDoc) xmldoc = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
g_autofree xmlNodePtr *disks = NULL;
int ndisks;
size_t i;
virshControlPtr priv = ctl->privData;
const char *iface = NULL;
char **ret = NULL;
- VIR_AUTOPTR(xmlDoc) xml = NULL;
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlDoc) xml = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
virMacAddr macaddr;
char macstr[VIR_MAC_STRING_BUFLEN] = "";
int ninterfaces;
unsigned int flags)
{
virshControlPtr priv = ctl->privData;
- VIR_AUTOPTR(xmlDoc) xmldoc = NULL;
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlDoc) xmldoc = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
int naliases;
g_autofree xmlNodePtr *aliases = NULL;
size_t i;
const vshCmd *cmd G_GNUC_UNUSED,
unsigned int flags)
{
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
virshControlPtr priv = ctl->privData;
unsigned int npages = 0;
g_autofree xmlNodePtr *pages = NULL;
- VIR_AUTOPTR(xmlDoc) doc = NULL;
+ g_autoptr(xmlDoc) doc = NULL;
size_t i = 0;
const char *cellnum = NULL;
bool cellno = vshCommandOptBool(cmd, "cellno");
const vshCmd *cmd G_GNUC_UNUSED,
unsigned int flags)
{
- VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
virshControlPtr priv = ctl->privData;
unsigned int ncells = 0;
g_autofree xmlNodePtr *cells = NULL;
- VIR_AUTOPTR(xmlDoc) doc = NULL;
+ g_autoptr(xmlDoc) doc = NULL;
size_t i = 0;
g_autofree char *cap_xml = NULL;
char **ret = NULL;
static bool
cmdInjectNMI(vshControl *ctl, const vshCmd *cmd)
{
- VIR_AUTOPTR(virshDomain) dom = NULL;
+ g_autoptr(virshDomain) dom = NULL;
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
static bool
cmdSendProcessSignal(vshControl *ctl, const vshCmd *cmd)
{
- VIR_AUTOPTR(virshDomain) dom = NULL;
+ g_autoptr(virshDomain) dom = NULL;
const char *signame;
long long pid_value;
int signum;
static bool
cmdQemuMonitorCommand(vshControl *ctl, const vshCmd *cmd)
{
- VIR_AUTOPTR(virshDomain) dom = NULL;
+ g_autoptr(virshDomain) dom = NULL;
g_autofree char *monitor_cmd = NULL;
g_autofree char *result = NULL;
unsigned int flags = 0;
int
main(int argc, char **argv)
{
- VIR_AUTOPTR(virConf) conf = NULL;
+ g_autoptr(virConf) conf = NULL;
const char *login_shell_path = conf_file;
pid_t cpid = -1;
int ret = EXIT_CANCELED;