/* build return data */
memset(&data, 0, sizeof(data));
- if (VIR_STRDUP(data.srcPath, srcPath) < 0 ||
- VIR_STRDUP(data.devAlias, devAlias) < 0)
- goto error;
+ data.srcPath = g_strdup(srcPath);
+ data.devAlias = g_strdup(devAlias);
if (make_nonnull_domain(&data.dom, dom) < 0)
goto error;
data.action = action;
/* build return data */
memset(&data, 0, sizeof(data));
- if (VIR_STRDUP(data.srcPath, srcPath) < 0 ||
- VIR_STRDUP(data.devAlias, devAlias) < 0 ||
- VIR_STRDUP(data.reason, reason) < 0)
- goto error;
+ data.srcPath = g_strdup(srcPath);
+ data.devAlias = g_strdup(devAlias);
+ data.reason = g_strdup(reason);
data.action = action;
if (make_nonnull_domain(&data.dom, dom) < 0)
data.phase = phase;
data.local.family = local->family;
data.remote.family = remote->family;
- if (VIR_STRDUP(data.authScheme, authScheme) < 0 ||
- VIR_STRDUP(data.local.node, local->node) < 0 ||
- VIR_STRDUP(data.local.service, local->service) < 0 ||
- VIR_STRDUP(data.remote.node, remote->node) < 0 ||
- VIR_STRDUP(data.remote.service, remote->service) < 0)
- goto error;
+ data.authScheme = g_strdup(authScheme);
+
+ data.local.node = g_strdup(local->node);
+
+ data.local.service = g_strdup(local->service);
+
+ data.remote.node = g_strdup(remote->node);
+
+ data.remote.service = g_strdup(remote->service);
data.subject.subject_len = subject->nidentity;
if (VIR_ALLOC_N(data.subject.subject_val, data.subject.subject_len) < 0)
goto error;
for (i = 0; i < data.subject.subject_len; i++) {
- if (VIR_STRDUP(data.subject.subject_val[i].type, subject->identities[i].type) < 0 ||
- VIR_STRDUP(data.subject.subject_val[i].name, subject->identities[i].name) < 0)
- goto error;
+ data.subject.subject_val[i].type = g_strdup(subject->identities[i].type);
+ data.subject.subject_val[i].name = g_strdup(subject->identities[i].name);
}
if (make_nonnull_domain(&data.dom, dom) < 0)
goto error;
/* build return data */
memset(&data, 0, sizeof(data));
- if (VIR_STRDUP(data.path, path) < 0)
- return -1;
+ data.path = g_strdup(path);
data.type = type;
data.status = status;
if (make_nonnull_domain(&data.dom, dom) < 0)
/* build return data */
memset(&data, 0, sizeof(data));
- if (oldSrcPath &&
- ((VIR_ALLOC(data.oldSrcPath) < 0) ||
- VIR_STRDUP(*(data.oldSrcPath), oldSrcPath) < 0))
- goto error;
+ if (oldSrcPath) {
+ if (VIR_ALLOC(data.oldSrcPath) < 0)
+ goto error;
+ *(data.oldSrcPath) = g_strdup(oldSrcPath);
+ }
- if (newSrcPath &&
- ((VIR_ALLOC(data.newSrcPath) < 0) ||
- VIR_STRDUP(*(data.newSrcPath), newSrcPath) < 0))
- goto error;
+ if (newSrcPath) {
+ if (VIR_ALLOC(data.newSrcPath) < 0)
+ goto error;
+ *(data.newSrcPath) = g_strdup(newSrcPath);
+ }
- if (VIR_STRDUP(data.devAlias, devAlias) < 0)
- goto error;
+ data.devAlias = g_strdup(devAlias);
data.reason = reason;
if (make_nonnull_domain(&data.dom, dom) < 0)
/* build return data */
memset(&data, 0, sizeof(data));
- if (VIR_STRDUP(data.devAlias, devAlias) < 0)
- return -1;
+ data.devAlias = g_strdup(devAlias);
data.reason = reason;
if (make_nonnull_domain(&data.dom, dom) < 0)
/* build return data */
memset(&data, 0, sizeof(data));
- if (VIR_STRDUP(data.devAlias, devAlias) < 0)
- return -1;
+ data.devAlias = g_strdup(devAlias);
if (make_nonnull_domain(&data.dom, dom) < 0)
goto error;
/* build return data */
memset(&data, 0, sizeof(data));
data.callbackID = callback->callbackID;
- if (VIR_STRDUP(data.dst, dst) < 0)
- return -1;
+ data.dst = g_strdup(dst);
data.type = type;
data.status = status;
if (make_nonnull_domain(&data.dom, dom) < 0)
/* build return data */
memset(&data, 0, sizeof(data));
- if (VIR_STRDUP(data.devAlias, devAlias) < 0)
- return -1;
+ data.devAlias = g_strdup(devAlias);
if (make_nonnull_domain(&data.dom, dom) < 0)
goto error;
/* build return data */
memset(&data, 0, sizeof(data));
- if (VIR_STRDUP(data.devAlias, devAlias) < 0)
- return -1;
+ data.devAlias = g_strdup(devAlias);
if (make_nonnull_domain(&data.dom, dom) < 0)
goto error;
data.type = type;
if (nsuri) {
- if (VIR_ALLOC(data.nsuri) < 0 ||
- VIR_STRDUP(*(data.nsuri), nsuri) < 0)
+ if (VIR_ALLOC(data.nsuri) < 0)
goto error;
+ *(data.nsuri) = g_strdup(nsuri);
}
if (make_nonnull_domain(&data.dom, dom) < 0)
/* build return data */
memset(&data, 0, sizeof(data));
data.callbackID = callback->callbackID;
- if (VIR_STRDUP(data.dev, dev) < 0)
- goto error;
+ data.dev = g_strdup(dev);
if (path) {
- if (VIR_ALLOC(data.path) < 0 ||
- VIR_STRDUP(*(data.path), path) < 0)
+ if (VIR_ALLOC(data.path) < 0)
goto error;
+ *(data.path) = g_strdup(path);
}
data.threshold = threshold;
data.excess = excess;
/* build return data */
memset(&data, 0, sizeof(data));
data.callbackID = callback->callbackID;
- if (VIR_STRDUP(data.event, event) < 0)
- goto error;
+ data.event = g_strdup(event);
data.seconds = seconds;
data.micros = micros;
- if (details &&
- ((VIR_ALLOC(data.details) < 0) ||
- VIR_STRDUP(*(data.details), details) < 0))
- goto error;
+ if (details) {
+ if (VIR_ALLOC(data.details) < 0)
+ goto error;
+ *(data.details) = g_strdup(details);
+ }
if (make_nonnull_domain(&data.dom, dom) < 0)
goto error;
for (i = 0; i < len; i++) {
size_t label_len = strlen(seclabels[i].label) + 1;
remote_domain_get_security_label_ret *cur = &ret->labels.labels_val[i];
- if (VIR_STRDUP(cur->label.label_val, seclabels[i].label) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("failed to copy security label"));
- goto cleanup;
- }
+ cur->label.label_val = g_strdup(seclabels[i].label);
cur->label.label_len = label_len;
cur->enforcing = seclabels[i].enforcing;
}
for (i = 0; i < nparams; ++i) {
/* remoteDispatchClientRequest will free this: */
- if (VIR_STRDUP(ret->params.params_val[i].field, params[i].field) < 0)
- goto cleanup;
+ ret->params.params_val[i].field = g_strdup(params[i].field);
ret->params.params_val[i].value = params[i].value;
}
for (i = 0; i < nparams; ++i) {
/* remoteDispatchClientRequest will free this: */
- if (VIR_STRDUP(ret->params.params_val[i].field, params[i].field) < 0)
- goto cleanup;
+ ret->params.params_val[i].field = g_strdup(params[i].field);
ret->params.params_val[i].value = params[i].value;
}
ret->parentName = NULL;
} else {
/* remoteDispatchClientRequest will free this. */
- if (VIR_ALLOC(ret->parentName) < 0 ||
- VIR_STRDUP(*(ret->parentName), parent) < 0)
+ if (VIR_ALLOC(ret->parentName) < 0)
goto cleanup;
+ *(ret->parentName) = g_strdup(parent);
}
rv = 0;
lease_dst->type = lease_src->type;
lease_dst->prefix = lease_src->prefix;
- if (VIR_STRDUP(lease_dst->iface, lease_src->iface) < 0 ||
- VIR_STRDUP(lease_dst->ipaddr, lease_src->ipaddr) < 0)
- goto error;
+ lease_dst->iface = g_strdup(lease_src->iface);
+ lease_dst->ipaddr = g_strdup(lease_src->ipaddr);
if (lease_src->mac) {
- if (VIR_ALLOC(mac_tmp) < 0 ||
- VIR_STRDUP(*mac_tmp, lease_src->mac) < 0)
+ if (VIR_ALLOC(mac_tmp) < 0)
goto error;
+ *mac_tmp = g_strdup(lease_src->mac);
}
if (lease_src->iaid) {
- if (VIR_ALLOC(iaid_tmp) < 0 ||
- VIR_STRDUP(*iaid_tmp, lease_src->iaid) < 0)
+ if (VIR_ALLOC(iaid_tmp) < 0)
goto error;
+ *iaid_tmp = g_strdup(lease_src->iaid);
}
if (lease_src->hostname) {
- if (VIR_ALLOC(hostname_tmp) < 0 ||
- VIR_STRDUP(*hostname_tmp, lease_src->hostname) < 0)
+ if (VIR_ALLOC(hostname_tmp) < 0)
goto error;
+ *hostname_tmp = g_strdup(lease_src->hostname);
}
if (lease_src->clientid) {
- if (VIR_ALLOC(clientid_tmp) < 0 ||
- VIR_STRDUP(*clientid_tmp, lease_src->clientid) < 0)
+ if (VIR_ALLOC(clientid_tmp) < 0)
goto error;
+ *clientid_tmp = g_strdup(lease_src->clientid);
}
lease_dst->mac = mac_tmp;
for (i = 0; i < ninfo; i++) {
dst = &ret->info.info_val[i];
- if (VIR_STRDUP(dst->mountpoint, info[i]->mountpoint) < 0)
- goto cleanup;
+ dst->mountpoint = g_strdup(info[i]->mountpoint);
- if (VIR_STRDUP(dst->name, info[i]->name) < 0)
- goto cleanup;
+ dst->name = g_strdup(info[i]->name);
- if (VIR_STRDUP(dst->fstype, info[i]->fstype) < 0)
- goto cleanup;
+ dst->fstype = g_strdup(info[i]->fstype);
ndisk = info[i]->ndevAlias;
if (ndisk > REMOTE_DOMAIN_FSINFO_DISKS_MAX) {
if (VIR_ALLOC_N(dst->dev_aliases.dev_aliases_val, ndisk) < 0)
goto cleanup;
- for (j = 0; j < ndisk; j++) {
- if (VIR_STRDUP(dst->dev_aliases.dev_aliases_val[j],
- info[i]->devAlias[j]) < 0)
- goto cleanup;
- }
+ for (j = 0; j < ndisk; j++)
+ dst->dev_aliases.dev_aliases_val[j] = g_strdup(info[i]->devAlias[j]);
dst->dev_aliases.dev_aliases_len = ndisk;
} else {
virDomainInterfacePtr iface = ifaces[i];
remote_domain_interface *iface_ret = &(ret->ifaces.ifaces_val[i]);
- if ((VIR_STRDUP(iface_ret->name, iface->name)) < 0)
- goto cleanup;
+ iface_ret->name = g_strdup(iface->name);
- if (iface->hwaddr &&
- (VIR_ALLOC(iface_ret->hwaddr) < 0 ||
- VIR_STRDUP(*iface_ret->hwaddr, iface->hwaddr) < 0))
- goto cleanup;
+ if (iface->hwaddr) {
+ if (VIR_ALLOC(iface_ret->hwaddr) < 0)
+ goto cleanup;
+ *iface_ret->hwaddr = g_strdup(iface->hwaddr);
+ }
if (iface->naddrs > REMOTE_DOMAIN_IP_ADDR_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR,
remote_domain_ip_addr *ip_addr_ret =
&(iface_ret->addrs.addrs_val[j]);
- if (VIR_STRDUP(ip_addr_ret->addr, ip_addr->addr) < 0)
- goto cleanup;
+ ip_addr_ret->addr = g_strdup(ip_addr->addr);
ip_addr_ret->prefix = ip_addr->prefix;
ip_addr_ret->type = ip_addr->type;
make_nonnull_domain(remote_nonnull_domain *dom_dst, virDomainPtr dom_src)
{
dom_dst->id = dom_src->id;
- if (VIR_STRDUP(dom_dst->name, dom_src->name) < 0)
- return -1;
+ dom_dst->name = g_strdup(dom_src->name);
memcpy(dom_dst->uuid, dom_src->uuid, VIR_UUID_BUFLEN);
return 0;
}
static int
make_nonnull_network(remote_nonnull_network *net_dst, virNetworkPtr net_src)
{
- if (VIR_STRDUP(net_dst->name, net_src->name) < 0)
- return -1;
+ net_dst->name = g_strdup(net_src->name);
memcpy(net_dst->uuid, net_src->uuid, VIR_UUID_BUFLEN);
return 0;
}
static int
make_nonnull_network_port(remote_nonnull_network_port *port_dst, virNetworkPortPtr port_src)
{
- if (VIR_STRDUP(port_dst->net.name, port_src->net->name) < 0)
- return -1;
+ port_dst->net.name = g_strdup(port_src->net->name);
memcpy(port_dst->net.uuid, port_src->net->uuid, VIR_UUID_BUFLEN);
memcpy(port_dst->uuid, port_src->uuid, VIR_UUID_BUFLEN);
return 0;
make_nonnull_interface(remote_nonnull_interface *interface_dst,
virInterfacePtr interface_src)
{
- if (VIR_STRDUP(interface_dst->name, interface_src->name) < 0)
- return -1;
- if (VIR_STRDUP(interface_dst->mac, interface_src->mac) < 0) {
- VIR_FREE(interface_dst->name);
- return -1;
- }
+ interface_dst->name = g_strdup(interface_src->name);
+ interface_dst->mac = g_strdup(interface_src->mac);
return 0;
}
static int
make_nonnull_storage_pool(remote_nonnull_storage_pool *pool_dst, virStoragePoolPtr pool_src)
{
- if (VIR_STRDUP(pool_dst->name, pool_src->name) < 0)
- return -1;
+ pool_dst->name = g_strdup(pool_src->name);
memcpy(pool_dst->uuid, pool_src->uuid, VIR_UUID_BUFLEN);
return 0;
}
static int
make_nonnull_storage_vol(remote_nonnull_storage_vol *vol_dst, virStorageVolPtr vol_src)
{
- if (VIR_STRDUP(vol_dst->pool, vol_src->pool) < 0)
- return -1;
- if (VIR_STRDUP(vol_dst->name, vol_src->name) < 0) {
- VIR_FREE(vol_dst->pool);
- return -1;
- }
- if (VIR_STRDUP(vol_dst->key, vol_src->key) < 0) {
- VIR_FREE(vol_dst->pool);
- VIR_FREE(vol_dst->name);
- return -1;
- }
+ vol_dst->pool = g_strdup(vol_src->pool);
+ vol_dst->name = g_strdup(vol_src->name);
+ vol_dst->key = g_strdup(vol_src->key);
return 0;
}
static int
make_nonnull_node_device(remote_nonnull_node_device *dev_dst, virNodeDevicePtr dev_src)
{
- if (VIR_STRDUP(dev_dst->name, dev_src->name) < 0)
- return -1;
+ dev_dst->name = g_strdup(dev_src->name);
return 0;
}
{
memcpy(secret_dst->uuid, secret_src->uuid, VIR_UUID_BUFLEN);
secret_dst->usageType = secret_src->usageType;
- if (VIR_STRDUP(secret_dst->usageID, secret_src->usageID) < 0)
- return -1;
+ secret_dst->usageID = g_strdup(secret_src->usageID);
return 0;
}
static int
make_nonnull_nwfilter(remote_nonnull_nwfilter *nwfilter_dst, virNWFilterPtr nwfilter_src)
{
- if (VIR_STRDUP(nwfilter_dst->name, nwfilter_src->name) < 0)
- return -1;
+ nwfilter_dst->name = g_strdup(nwfilter_src->name);
memcpy(nwfilter_dst->uuid, nwfilter_src->uuid, VIR_UUID_BUFLEN);
return 0;
}
static int
make_nonnull_nwfilter_binding(remote_nonnull_nwfilter_binding *binding_dst, virNWFilterBindingPtr binding_src)
{
- if (VIR_STRDUP(binding_dst->portdev, binding_src->portdev) < 0)
- return -1;
- if (VIR_STRDUP(binding_dst->filtername, binding_src->filtername) < 0) {
- VIR_FREE(binding_dst->portdev);
- return -1;
- }
+ binding_dst->portdev = g_strdup(binding_src->portdev);
+ binding_dst->filtername = g_strdup(binding_src->filtername);
return 0;
}
static int
make_nonnull_domain_checkpoint(remote_nonnull_domain_checkpoint *checkpoint_dst, virDomainCheckpointPtr checkpoint_src)
{
- if (VIR_STRDUP(checkpoint_dst->name, checkpoint_src->name) < 0)
- return -1;
+ checkpoint_dst->name = g_strdup(checkpoint_src->name);
if (make_nonnull_domain(&checkpoint_dst->dom, checkpoint_src->domain) < 0) {
VIR_FREE(checkpoint_dst->name);
return -1;
static int
make_nonnull_domain_snapshot(remote_nonnull_domain_snapshot *snapshot_dst, virDomainSnapshotPtr snapshot_src)
{
- if (VIR_STRDUP(snapshot_dst->name, snapshot_src->name) < 0)
- return -1;
+ snapshot_dst->name = g_strdup(snapshot_src->name);
if (make_nonnull_domain(&snapshot_dst->dom, snapshot_src->domain) < 0) {
VIR_FREE(snapshot_dst->name);
return -1;
goto error;
for (i = 0; i < nerrors; i++) {
- if (VIR_STRDUP(val[i].disk, errors[i].disk) < 0)
- goto error;
+ val[i].disk = g_strdup(errors[i].disk);
val[i].error = errors[i].error;
}
return -1;
if (p) {
- if (VIR_STRDUP(*transport, p + 1) < 0) {
- VIR_FREE(*driver);
- return -1;
- }
+ *transport = g_strdup(p + 1);
p = *transport;
while (*p) {
#define EXTRACT_URI_ARG_STR(ARG_NAME, ARG_VAR) \
if (STRCASEEQ(var->name, ARG_NAME)) { \
VIR_FREE(ARG_VAR); \
- if (VIR_STRDUP(ARG_VAR, var->value) < 0) \
- goto failed; \
+ ARG_VAR = g_strdup(var->value); \
var->ignore = 1; \
continue; \
}
virAsprintf(&direct_daemon, "virt%sd", driver) < 0)
return NULL;
- if (VIR_STRDUP(legacy_daemon, "libvirtd") < 0)
- return NULL;
+ legacy_daemon = g_strdup("libvirtd");
if (driver &&
!(direct_sock_name = remoteGetUNIXSocketHelper(transport, direct_daemon, flags)))
if (virAsprintf(&port, "%d", conn->uri->port) < 0)
goto failed;
} else if (transport == REMOTE_DRIVER_TRANSPORT_TLS) {
- if (VIR_STRDUP(port, LIBVIRTD_TLS_PORT) < 0)
- goto failed;
+ port = g_strdup(LIBVIRTD_TLS_PORT);
} else if (transport == REMOTE_DRIVER_TRANSPORT_TCP) {
- if (VIR_STRDUP(port, LIBVIRTD_TCP_PORT) < 0)
- goto failed;
+ port = g_strdup(LIBVIRTD_TCP_PORT);
} /* Port not used for unix, ext., default for ssh */
- if (VIR_STRDUP(priv->hostname,
- conn->uri && conn->uri->server ?
- conn->uri->server : "localhost") < 0)
- goto failed;
+ priv->hostname = g_strdup(conn->uri && conn->uri->server ? conn->uri->server : "localhost");
- if (conn->uri && VIR_STRDUP(username, conn->uri->user) < 0)
- goto failed;
+ if (conn->uri)
+ username = g_strdup(conn->uri->user);
/* Get the variables from the query string.
* Then we need to reconstruct the query string (because
(STREQ(conn->uri->scheme, "remote") ||
STRPREFIX(conn->uri->scheme, "remote+"))) {
/* Allow remote serve to probe */
- if (VIR_STRDUP(name, "") < 0)
- goto failed;
+ name = g_strdup("");
} else {
virURI tmpuri = {
.scheme = (char *)driver_str,
}
} else {
/* Probe URI server side */
- if (VIR_STRDUP(name, "") < 0)
- goto failed;
+ name = g_strdup("");
}
if (conf && !mode_str &&
}
for (i = 0; i < ret_errors_len; i++) {
- if (VIR_STRDUP(errors[i].disk, ret_errors_val[i].disk) < 0)
- goto error;
+ errors[i].disk = g_strdup(ret_errors_val[i].disk);
errors[i].error = ret_errors_val[i].error;
}
if (VIR_ALLOC(localAddr) < 0)
goto error;
localAddr->family = msg->local.family;
- if (VIR_STRDUP(localAddr->service, msg->local.service) < 0 ||
- VIR_STRDUP(localAddr->node, msg->local.node) < 0)
- goto error;
+ localAddr->service = g_strdup(msg->local.service);
+ localAddr->node = g_strdup(msg->local.node);
if (VIR_ALLOC(remoteAddr) < 0)
goto error;
remoteAddr->family = msg->remote.family;
- if (VIR_STRDUP(remoteAddr->service, msg->remote.service) < 0 ||
- VIR_STRDUP(remoteAddr->node, msg->remote.node) < 0)
- goto error;
+ remoteAddr->service = g_strdup(msg->remote.service);
+ remoteAddr->node = g_strdup(msg->remote.node);
if (VIR_ALLOC(subject) < 0)
goto error;
goto error;
subject->nidentity = msg->subject.subject_len;
for (i = 0; i < subject->nidentity; i++) {
- if (VIR_STRDUP(subject->identities[i].type, msg->subject.subject_val[i].type) < 0 ||
- VIR_STRDUP(subject->identities[i].name, msg->subject.subject_val[i].name) < 0)
- goto error;
+ subject->identities[i].type = g_strdup(msg->subject.subject_val[i].type);
+ subject->identities[i].name = g_strdup(msg->subject.subject_val[i].name);
}
event = virDomainEventGraphicsNewFromDom(dom,
(xdrproc_t) xdr_qemu_domain_monitor_command_ret, (char *) &ret) == -1)
goto done;
- if (VIR_STRDUP(*result, ret.result) < 0)
- goto cleanup;
+ *result = g_strdup(ret.result);
rv = 0;
- cleanup:
xdr_free((xdrproc_t) xdr_qemu_domain_monitor_command_ret, (char *) &ret);
done:
lease_dst->type = lease_src->type;
lease_dst->prefix = lease_src->prefix;
- if (VIR_STRDUP(lease_dst->iface, lease_src->iface) < 0)
- goto error;
+ lease_dst->iface = g_strdup(lease_src->iface);
- if (VIR_STRDUP(lease_dst->ipaddr, lease_src->ipaddr) < 0)
- goto error;
+ lease_dst->ipaddr = g_strdup(lease_src->ipaddr);
if (lease_src->mac) {
- if (VIR_STRDUP(lease_dst->mac, *lease_src->mac) < 0)
- goto error;
+ lease_dst->mac = g_strdup(*lease_src->mac);
} else {
lease_src->mac = NULL;
}
if (lease_src->iaid) {
- if (VIR_STRDUP(lease_dst->iaid, *lease_src->iaid) < 0)
- goto error;
+ lease_dst->iaid = g_strdup(*lease_src->iaid);
} else {
lease_src->iaid = NULL;
}
if (lease_src->hostname) {
- if (VIR_STRDUP(lease_dst->hostname, *lease_src->hostname) < 0)
- goto error;
+ lease_dst->hostname = g_strdup(*lease_src->hostname);
} else {
lease_src->hostname = NULL;
}
if (lease_src->clientid) {
- if (VIR_STRDUP(lease_dst->clientid, *lease_src->clientid) < 0)
- goto error;
+ lease_dst->clientid = g_strdup(*lease_src->clientid);
} else {
lease_src->clientid = NULL;
}
return 0;
-
- error:
- virNetworkDHCPLeaseFree(lease_dst);
- return -1;
}
if (VIR_ALLOC(info_ret[i]) < 0)
goto cleanup;
- if (VIR_STRDUP(info_ret[i]->mountpoint, src->mountpoint) < 0)
- goto cleanup;
+ info_ret[i]->mountpoint = g_strdup(src->mountpoint);
- if (VIR_STRDUP(info_ret[i]->name, src->name) < 0)
- goto cleanup;
+ info_ret[i]->name = g_strdup(src->name);
- if (VIR_STRDUP(info_ret[i]->fstype, src->fstype) < 0)
- goto cleanup;
+ info_ret[i]->fstype = g_strdup(src->fstype);
len = src->dev_aliases.dev_aliases_len;
info_ret[i]->ndevAlias = len;
VIR_ALLOC_N(info_ret[i]->devAlias, len) < 0)
goto cleanup;
- for (j = 0; j < len; j++) {
- if (VIR_STRDUP(info_ret[i]->devAlias[j],
- src->dev_aliases.dev_aliases_val[j]) < 0)
- goto cleanup;
- }
+ for (j = 0; j < len; j++)
+ info_ret[i]->devAlias[j] = g_strdup(src->dev_aliases.dev_aliases_val[j]);
}
*info = info_ret;
iface = ifaces_ret[i];
- if (VIR_STRDUP(iface->name, iface_ret->name) < 0)
- goto cleanup;
+ iface->name = g_strdup(iface_ret->name);
- if (iface_ret->hwaddr &&
- VIR_STRDUP(iface->hwaddr, *iface_ret->hwaddr) < 0)
- goto cleanup;
+ if (iface_ret->hwaddr)
+ iface->hwaddr = g_strdup(*iface_ret->hwaddr);
if (iface_ret->addrs.addrs_len > REMOTE_DOMAIN_IP_ADDR_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR,
remote_domain_ip_addr *ip_addr_ret =
&(iface_ret->addrs.addrs_val[j]);
- if (VIR_STRDUP(ip_addr->addr, ip_addr_ret->addr) < 0)
- goto cleanup;
+ ip_addr->addr = g_strdup(ip_addr_ret->addr);
ip_addr->prefix = ip_addr_ret->prefix;
ip_addr->type = ip_addr_ret->type;
remote_domain_rename_ret ret;
char *tmp = NULL;
- if (VIR_STRDUP(tmp, new_name) < 0)
- return -1;
+ tmp = g_strdup(new_name);
remoteDriverLock(priv);