From nobody Sun Feb 8 22:22:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566305987; cv=none; d=zoho.com; s=zohoarc; b=Kr1ypD01PJezxRoNISzmj2e9dIY1p8S4xIFln9Ar/pQI53UFvxQIoMpXQG2Zw8J44OoW/8Xy2Ey4Db25HjIkc8yKioBnA3HedVQi+ynwHCOxGXczbw7vZDuq+4Xpo+OVo5FxgFj8GPsBtQLLw7HZo+KUo/fuLHuYmIsSdeW1Rt8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566305987; 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:ARC-Authentication-Results; bh=FPSaAJ/6OGsZhdFqd5bKUubA60IhHx4xPAlP9/KWwbY=; b=nepDXh7UOobUHKysoQFtSnOO0Si+Sl/aeYFkg7ZGDLLGdlkw/80RBHV0DL8dhwsdir3XsKBYIXI6iZ0MYvie4imiFuXs+CEFBFIsKguZeBA6xmTJ78KX9FyMgRTmJ2SNPA/Mfr4pafS/buGnnzoYjbpMAcp+yVbZ8k8BLjNlb78= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15663059870041015.5771360856955; Tue, 20 Aug 2019 05:59:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D8C37307D95F; Tue, 20 Aug 2019 12:59:45 +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 B4D168CBF9; Tue, 20 Aug 2019 12:59:45 +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 7AA184E58B; Tue, 20 Aug 2019 12:59:45 +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 x7KCxhme023240 for ; Tue, 20 Aug 2019 08:59:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id DCE411E4; Tue, 20 Aug 2019 12:59:43 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 66F6F4274 for ; Tue, 20 Aug 2019 12:59:41 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Tue, 20 Aug 2019 14:59:11 +0200 Message-Id: <7a50f1a496eeb5ad7e42c36bae62ca3d3c958850.1566305923.git.jtomko@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 12/19] qemuBuildRNGCommandLine: use VIR_AUTOFREE 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 20 Aug 2019 12:59:46 +0000 (UTC) Use separate variables for the chardev and the device. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 298a1c3fea..67de0fc35e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6022,7 +6022,8 @@ qemuBuildRNGCommandLine(virLogManagerPtr logManager, VIR_AUTOPTR(virJSONValue) props =3D NULL; virBuffer buf =3D VIR_BUFFER_INITIALIZER; virDomainRNGDefPtr rng =3D def->rngs[i]; - char *tmp; + VIR_AUTOFREE(char *) chardev =3D NULL; + VIR_AUTOFREE(char *) devstr =3D NULL; int rc; =20 if (!rng->info.alias) { @@ -6033,14 +6034,12 @@ qemuBuildRNGCommandLine(virLogManagerPtr logManager, =20 /* possibly add character device for backend */ if (qemuBuildRNGBackendChrdevStr(logManager, secManager, cmd, cfg,= def, - rng, qemuCaps, &tmp, + rng, qemuCaps, &chardev, chardevStdioLogd) < 0) return -1; =20 - if (tmp) { - virCommandAddArgList(cmd, "-chardev", tmp, NULL); - VIR_FREE(tmp); - } + if (chardev) + virCommandAddArgList(cmd, "-chardev", chardev, NULL); =20 if (qemuBuildRNGBackendProps(rng, qemuCaps, &props) < 0) return -1; @@ -6057,10 +6056,9 @@ qemuBuildRNGCommandLine(virLogManagerPtr logManager, if (qemuCommandAddExtDevice(cmd, &rng->info) < 0) return -1; =20 - if (!(tmp =3D qemuBuildRNGDevStr(def, rng, qemuCaps))) + if (!(devstr =3D qemuBuildRNGDevStr(def, rng, qemuCaps))) return -1; - virCommandAddArgList(cmd, "-device", tmp, NULL); - VIR_FREE(tmp); + virCommandAddArgList(cmd, "-device", devstr, NULL); } =20 return 0; --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list