if (VIR_ALLOC(fs) < 0)
goto error;
- if (virAsprintf(&veid_str, "%d", veid) < 0)
- goto error;
+ veid_str = g_strdup_printf("%d", veid);
fs->type = VIR_DOMAIN_FS_TYPE_MOUNT;
if (!(fs->src->path = virStringReplace(temp, "$VEID", veid_str)))
def->id = -1;
else
def->id = veid;
- if (virAsprintf(&def->name, "%i", veid) < 0)
- goto cleanup;
+ def->name = g_strdup_printf("%i", veid);
openvzGetVPSUUID(veid, uuidstr, sizeof(uuidstr));
ret = virUUIDParse(uuidstr, def->uuid);
char *line = NULL;
size_t line_size = 0;
- if (virAsprintf(&temp_file, "%s.tmp", conf_file)<0)
- return -1;
+ temp_file = g_strdup_printf("%s.tmp", conf_file);
fp = fopen(conf_file, "r");
if (fp == NULL)
if (confdir == NULL)
goto cleanup;
- if (virAsprintf(&default_conf_file, "%s/ve-%s.conf-sample", confdir,
- configfile_value) < 0)
- goto cleanup;
+ default_conf_file = g_strdup_printf("%s/ve-%s.conf-sample", confdir,
+ configfile_value);
if (openvzLocateConfFile(vpsid, &conf_file, "conf") < 0)
goto cleanup;
if (confdir == NULL)
return -1;
- if (virAsprintf(conffile, "%s/%d.%s", confdir, vpsid,
- ext ? ext : "conf") < 0)
- ret = -1;
+ *conffile = g_strdup_printf("%s/%d.%s", confdir, vpsid, ext ? ext : "conf");
VIR_FREE(confdir);
return ret;
if (sscanf(dev_name_ve, "%*[^0-9]%d", &ifNo) != 1)
return NULL;
- ignore_value(virAsprintf(&ret, "veth%d.%d.", veid, ifNo));
+ ret = g_strdup_printf("veth%d.%d.", veid, ifNo);
return ret;
}
}
/* set new name */
- ignore_value(virAsprintf(&name, "eth%d", max + 1));
+ name = g_strdup_printf("eth%d", max + 1);
}
VIR_FREE(temp);
}
}
- if (virAsprintf(uri_out, "ssh://%s", hostname) < 0)
- goto error;
+ *uri_out = g_strdup_printf("ssh://%s", hostname);
ret = 0;
goto done;