char *remote_file = NULL;
int ret = -1;
- if (virAsprintf(&remote_file, "/home/%s/libvirt_uuid_table",
- NULLSTR(conn->uri->user)) < 0)
- goto cleanup;
+ remote_file = g_strdup_printf("/home/%s/libvirt_uuid_table",
+ NULLSTR(conn->uri->user));
if (stat(local_file, &local_fileinfo) == -1) {
VIR_WARN("Unable to stat local file.");
char *remote_file = NULL;
int ret = -1;
- if (virAsprintf(&remote_file, "/home/%s/libvirt_uuid_table",
- NULLSTR(conn->uri->user)) < 0)
- goto cleanup;
+ remote_file = g_strdup_printf("/home/%s/libvirt_uuid_table",
+ NULLSTR(conn->uri->user));
/* Trying to stat the remote file. */
do {
if (userhome == NULL)
goto err;
- if (virAsprintf(&pubkey, "%s/.ssh/id_rsa.pub", userhome) < 0)
- goto err;
+ pubkey = g_strdup_printf("%s/.ssh/id_rsa.pub", userhome);
- if (virAsprintf(&pvtkey, "%s/.ssh/id_rsa", userhome) < 0)
- goto err;
+ pvtkey = g_strdup_printf("%s/.ssh/id_rsa", userhome);
if (conn->uri->user != NULL) {
username = g_strdup(conn->uri->user);
if (!pv)
goto cleanup;
- if (virAsprintf(&path, "/%s/%s/%s", pv, ret, vol->name) < 0)
- goto cleanup;
+ path = g_strdup_printf("/%s/%s/%s", pv, ret, vol->name);
cleanup:
VIR_FREE(ret);