From nobody Mon Feb 9 17:07:22 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=1561390873; cv=none; d=zoho.com; s=zohoarc; b=drfos/BLj3+ftkZDf1K840cpZO+dnCZK2kZbMD1QqZauygJ4zYqCZnZe4bSqIcuAJicThGECnwwMCZl+uqaO+w1gR10LUm+HyECYK75wZuIjXWHaJnajwPPJpljw30QCdX2jx5HSA0Iubu8Pr3zXzEwerpZnouKLI0eaeF5MiRs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561390873; 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=PF2fTh6DPpg6y389tXT4tS9jUPontmOMrGAd093cqaM=; b=Ez+w+cw/C/t8h/h5bpIeKkXj2rUl6SxNVXqq6e7pJi+7fQ3urYVzbON9edw+40osb0H7nLznPeWEZ6enQ29qFC8KYnWR5b2hW6he7BuZZqi0c0/wTIXaT2/u7qFTOHhDQNtJJhpUbAa7krr/wMbdSPN7vveSBaCxTt+0Q1xxxW0= 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 1561390873035207.58131113070692; Mon, 24 Jun 2019 08:41:13 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B5058C05A1D8; Mon, 24 Jun 2019 15:40:54 +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 8AD721001DEF; Mon, 24 Jun 2019 15:40:51 +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 3574B19725; Mon, 24 Jun 2019 15:40:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5OFd3aU020908 for ; Mon, 24 Jun 2019 11:39:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id AD6775DA34; Mon, 24 Jun 2019 15:39:03 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3711B5D9C5 for ; Mon, 24 Jun 2019 15:39:03 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 24 Jun 2019 17:38:50 +0200 Message-Id: <217a00832e8db67d867022c7e62fa4add51b7539.1561390513.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/10] qemu: command: Use VIR_AUTO infrastructure in qemuBuildDiskSourceCommandLine 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-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 24 Jun 2019 15:41:11 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index acfec8a1bb..1ae8a00352 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2560,8 +2560,8 @@ qemuBuildDiskSourceCommandLine(virCommandPtr cmd, virQEMUCapsPtr qemuCaps) { VIR_AUTOPTR(qemuBlockStorageSourceChainData) data =3D NULL; - virJSONValuePtr copyOnReadProps =3D NULL; - char *str =3D NULL; + VIR_AUTOPTR(virJSONValue) copyOnReadProps =3D NULL; + VIR_AUTOFREE(char *) copyOnReadPropsStr =3D NULL; size_t i; int ret =3D -1; @@ -2590,18 +2590,15 @@ qemuBuildDiskSourceCommandLine(virCommandPtr cmd, } if (copyOnReadProps) { - if (!(str =3D virJSONValueToString(copyOnReadProps, false))) + if (!(copyOnReadPropsStr =3D virJSONValueToString(copyOnReadProps,= false))) goto cleanup; - virCommandAddArgList(cmd, "-blockdev", str, NULL); - VIR_FREE(str); + virCommandAddArgList(cmd, "-blockdev", copyOnReadPropsStr, NULL); } ret =3D 0; cleanup: - virJSONValueFree(copyOnReadProps); - VIR_FREE(str); return ret; } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list