From nobody Mon Feb 9 02:51:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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=1571752903; cv=none; d=zoho.com; s=zohoarc; b=O5oKmW/Mn8HHVcbJ/OHbmQLKQKvYTYLxMOzez18DGg78sQSAcNfELpAq4BhP+k57QHObRmCrXD0xiX2Eq1VlDg3G4Zqya+JOCoertzQ+LqDHBjbdkqnQBYXYPcETm9AzxlsLpJ/HB1B/2Q49cRH/Nhbapy5ALcVG9YRYpQcBE9Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571752903; 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=xB4Xz8S1/olet94grqqHO5/smT5k76+NGsk/wTjztV0=; b=hUZGmnLiAGV5OR0kS/WvSWcwWQgnyG1aa5B0xOFNDm2LRyLwOL2VPaQcEz5/zRNXmm17fNuZ834ZCnzE0mHGK6y1k+q476oOGTphDUVVkNq5U/VuS+SznE9E28z5p9VpodSNkAXvEabR/q3VvJv6M12eTOPrF4/fJhnWZnojbHw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1571752903320980.8238988177827; Tue, 22 Oct 2019 07:01:43 -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-353-H3KMA8F3NMWvyyC51Vx6qA-1; Tue, 22 Oct 2019 10:01:39 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3A0815FD; Tue, 22 Oct 2019 14:01:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED30F6012C; Tue, 22 Oct 2019 14:01:33 +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 754B7180BA9C; Tue, 22 Oct 2019 14:01:33 +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 x9ME11tJ002929 for ; Tue, 22 Oct 2019 10:01:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id A5ABD6012D; Tue, 22 Oct 2019 14:01:01 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B4886012C for ; Tue, 22 Oct 2019 14:01:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571752902; 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=xB4Xz8S1/olet94grqqHO5/smT5k76+NGsk/wTjztV0=; b=h2nIDYgzbSbccAgeHYtJhTP57hUBkQkw9SjoK3B4snUqBBQbL+ePhob6kypu0xBVlj+2Zb dKluhErvxa4QBtmSwZMWUxtF/qjo3wHF+hUHip9KrJ9H9hKTC9lZtNFzUQLADQOFxwat1U ZbPVfqvRnrFLnPRPc4gEB4FzoVdz7u0= From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 22 Oct 2019 15:58:11 +0200 Message-Id: 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 67/75] Use g_strdup_printf instead of virAsprintf everywhere 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.11 X-MC-Unique: H3KMA8F3NMWvyyC51Vx6qA-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 --- src/driver.c | 4 ++-- src/libvirt-admin.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/driver.c b/src/driver.c index 89851cb629..2392fd7d5f 100644 --- a/src/driver.c +++ b/src/driver.c @@ -90,7 +90,7 @@ virDriverShouldAutostart(const char *dir, =20 *autostart =3D false; =20 - virAsprintf(&path, "%s/autostarted", dir); + path =3D g_strdup_printf("%s/autostarted", dir); =20 if (virFileExists(path)) { VIR_DEBUG("Autostart file %s exists, skipping autostart", path); @@ -151,7 +151,7 @@ virGetConnectGeneric(virThreadLocalPtr threadPtr, const= char *name) g_autofree char *uri =3D NULL; const char *uriPath =3D geteuid() =3D=3D 0 ? "/system" : "/session= "; =20 - virAsprintf(&uri, "%s://%s", name, uriPath); + uri =3D g_strdup_printf("%s://%s", name, uriPath); =20 conn =3D virConnectOpen(uri); VIR_DEBUG("Opened new %s connection %p", name, conn); diff --git a/src/libvirt-admin.c b/src/libvirt-admin.c index 7ff549bca4..f156736d9f 100644 --- a/src/libvirt-admin.c +++ b/src/libvirt-admin.c @@ -141,16 +141,16 @@ getSocketPath(virURIPtr uri) if (legacy) { sockbase =3D g_strdup("libvirt-admin-sock"); } else { - virAsprintf(&sockbase, "%s-admin-sock", uri->scheme); + sockbase =3D g_strdup_printf("%s-admin-sock", uri->scheme); } =20 if (STREQ_NULLABLE(uri->path, "/system")) { - virAsprintf(&sock_path, RUNSTATEDIR "/libvirt/%s", sockbase); + sock_path =3D g_strdup_printf(RUNSTATEDIR "/libvirt/%s", sockb= ase); } else if (STREQ_NULLABLE(uri->path, "/session")) { if (!rundir) goto error; =20 - virAsprintf(&sock_path, "%s/%s", rundir, sockbase); + sock_path =3D g_strdup_printf("%s/%s", rundir, sockbase); } else { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Invalid URI path '%s', try '/system'"), --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list