Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/openvz/openvz_conf.c | 12 ++++++------
src/openvz/openvz_driver.c | 6 +++---
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index cb64ed57f0..7676656af1 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -362,7 +362,7 @@ openvzReadFSConf(virDomainDefPtr def,
if (VIR_ALLOC(fs) < 0)
goto error;
- virAsprintf(&veid_str, "%d", veid);
+ veid_str = g_strdup_printf("%d", veid);
fs->type = VIR_DOMAIN_FS_TYPE_MOUNT;
if (!(fs->src->path = virStringReplace(temp, "$VEID",
veid_str)))
@@ -533,7 +533,7 @@ int openvzLoadDomains(struct openvz_driver *driver)
def->id = -1;
else
def->id = veid;
- virAsprintf(&def->name, "%i", veid);
+ def->name = g_strdup_printf("%i", veid);
openvzGetVPSUUID(veid, uuidstr, sizeof(uuidstr));
ret = virUUIDParse(uuidstr, def->uuid);
@@ -624,7 +624,7 @@ openvzWriteConfigParam(const char * conf_file, const char *param,
const char *va
char *line = NULL;
size_t line_size = 0;
- virAsprintf(&temp_file, "%s.tmp", conf_file);
+ temp_file = g_strdup_printf("%s.tmp", conf_file);
fp = fopen(conf_file, "r");
if (fp == NULL)
@@ -820,8 +820,8 @@ openvzCopyDefaultConfig(int vpsid)
if (confdir == NULL)
goto cleanup;
- virAsprintf(&default_conf_file, "%s/ve-%s.conf-sample", confdir,
- configfile_value);
+ default_conf_file = g_strdup_printf("%s/ve-%s.conf-sample", confdir,
+ configfile_value);
if (openvzLocateConfFile(vpsid, &conf_file, "conf") < 0)
goto cleanup;
@@ -851,7 +851,7 @@ openvzLocateConfFileDefault(int vpsid, char **conffile, const char
*ext)
if (confdir == NULL)
return -1;
- virAsprintf(conffile, "%s/%d.%s", confdir, vpsid, ext ? ext :
"conf");
+ *conffile = g_strdup_printf("%s/%d.%s", confdir, vpsid, ext ? ext :
"conf");
VIR_FREE(confdir);
return ret;
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index 463751ec86..8a24c9265f 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -702,7 +702,7 @@ openvzGenerateVethName(int veid, char *dev_name_ve)
if (sscanf(dev_name_ve, "%*[^0-9]%d", &ifNo) != 1)
return NULL;
- virAsprintf(&ret, "veth%d.%d.", veid, ifNo);
+ ret = g_strdup_printf("veth%d.%d.", veid, ifNo);
return ret;
}
@@ -729,7 +729,7 @@ openvzGenerateContainerVethName(int veid)
}
/* set new name */
- virAsprintf(&name, "eth%d", max + 1);
+ name = g_strdup_printf("eth%d", max + 1);
}
VIR_FREE(temp);
@@ -2207,7 +2207,7 @@ openvzDomainMigratePrepare3Params(virConnectPtr dconn,
}
}
- virAsprintf(uri_out, "ssh://%s", hostname);
+ *uri_out = g_strdup_printf("ssh://%s", hostname);
ret = 0;
goto done;
--
2.21.0