From nobody Mon Feb 9 01:22:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571752871; cv=none; d=zoho.com; s=zohoarc; b=DUN389+EqEoOLbIsCxB5NZRq3f7V61Wa4lmOZ/EBwXXLXCYDBHCoAKmQEvRMk7lNBb9zV4hOiv2T5XZtEPFfT6kUFOYY0XNLgpDjwFaJrkyx2dmjhGB9vExCEqkGaYmaNywG+NtUwN6snx4ush3gWI4x6S5JtXfuRgguZoV2l8s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571752871; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zuWJvENXB6phXEz5GXBDDT6kLdNPtfooAA9ZwVtExA0=; b=hmiJEo/rN/wQZz0z51rPKzSKoOTPsCeaNr550doa5MC4nUC+ceHzLIW9D6adie/Hrh+wUp5YuY6ri2r9FShh3bLiSzkCFmQBQdJVIQntxjTyF2N3KQ/XHKs0BW8STLmNC76RU1PwCSf9bImA2c4RdWPqN9PQ3vKZliCyz+uQIRI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1571752871460975.7145767946358; Tue, 22 Oct 2019 07:01:11 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-367-3dgoEitQOnq2ow4Z0vdVyQ-1; Tue, 22 Oct 2019 10:01:08 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AF607100552F; Tue, 22 Oct 2019 14:01:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 772DA5DC18; Tue, 22 Oct 2019 14:01:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0ADD83FB40; Tue, 22 Oct 2019 14:01:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9ME0mB3002718 for ; Tue, 22 Oct 2019 10:00:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 779926012C; Tue, 22 Oct 2019 14:00:48 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id ECA3A60167 for ; Tue, 22 Oct 2019 14:00:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571752870; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=zuWJvENXB6phXEz5GXBDDT6kLdNPtfooAA9ZwVtExA0=; b=fypMBwMKux2NO4qqnL+unR6jhAMwlCKgx67ntLmtW73EzSMUms7Hh96DpxF8ZKUT50wylE kQpOPC5jA8QuRYm4GxxOlz5KlMgk9X/wnAatF7Cne8CYwLaS7Tcx/lxjErNcAqpxTVAE/6 6A7KL6+mLLuuDk0JcHGthyv0PShOIzY= From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 22 Oct 2019 15:57:55 +0200 Message-Id: <99341bee0b48a885bfc3e65e208e6cf582cb7fc4.1571752582.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 51/75] openvz: Use g_strdup_printf() instead of virAsprintf() X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: 3dgoEitQOnq2ow4Z0vdVyQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Michal Privoznik Reviewed-by: Daniel Henrique Barboza --- 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; =20 - virAsprintf(&veid_str, "%d", veid); + veid_str =3D g_strdup_printf("%d", veid); =20 fs->type =3D VIR_DOMAIN_FS_TYPE_MOUNT; if (!(fs->src->path =3D virStringReplace(temp, "$VEID", veid_str))) @@ -533,7 +533,7 @@ int openvzLoadDomains(struct openvz_driver *driver) def->id =3D -1; else def->id =3D veid; - virAsprintf(&def->name, "%i", veid); + def->name =3D g_strdup_printf("%i", veid); =20 openvzGetVPSUUID(veid, uuidstr, sizeof(uuidstr)); ret =3D virUUIDParse(uuidstr, def->uuid); @@ -624,7 +624,7 @@ openvzWriteConfigParam(const char * conf_file, const ch= ar *param, const char *va char *line =3D NULL; size_t line_size =3D 0; =20 - virAsprintf(&temp_file, "%s.tmp", conf_file); + temp_file =3D g_strdup_printf("%s.tmp", conf_file); =20 fp =3D fopen(conf_file, "r"); if (fp =3D=3D NULL) @@ -820,8 +820,8 @@ openvzCopyDefaultConfig(int vpsid) if (confdir =3D=3D NULL) goto cleanup; =20 - virAsprintf(&default_conf_file, "%s/ve-%s.conf-sample", confdir, - configfile_value); + default_conf_file =3D g_strdup_printf("%s/ve-%s.conf-sample", confdir, + configfile_value); =20 if (openvzLocateConfFile(vpsid, &conf_file, "conf") < 0) goto cleanup; @@ -851,7 +851,7 @@ openvzLocateConfFileDefault(int vpsid, char **conffile,= const char *ext) if (confdir =3D=3D NULL) return -1; =20 - virAsprintf(conffile, "%s/%d.%s", confdir, vpsid, ext ? ext : "conf"); + *conffile =3D g_strdup_printf("%s/%d.%s", confdir, vpsid, ext ? ext : = "conf"); =20 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) =20 if (sscanf(dev_name_ve, "%*[^0-9]%d", &ifNo) !=3D 1) return NULL; - virAsprintf(&ret, "veth%d.%d.", veid, ifNo); + ret =3D g_strdup_printf("veth%d.%d.", veid, ifNo); return ret; } =20 @@ -729,7 +729,7 @@ openvzGenerateContainerVethName(int veid) } =20 /* set new name */ - virAsprintf(&name, "eth%d", max + 1); + name =3D g_strdup_printf("eth%d", max + 1); } =20 VIR_FREE(temp); @@ -2207,7 +2207,7 @@ openvzDomainMigratePrepare3Params(virConnectPtr dconn, } } =20 - virAsprintf(uri_out, "ssh://%s", hostname); + *uri_out =3D g_strdup_printf("ssh://%s", hostname); =20 ret =3D 0; goto done; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list