From nobody Mon Feb 9 03:52:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1631177453; cv=none; d=zohomail.com; s=zohoarc; b=L5+QwoiUMH+ae5fpH9Gg3pUOk84OiVmC5r+5MhPbmudBxAqKTpnSmRtk/O2SaFQgX4gU4BeAeRbC5gHpZZrmNVsqIBaywoBu5CyLBPAiV0vJEqQCUIJ8VG1+0KjLPbXS9ZFE4OopBp18od6edaOa4WefCrRaBYXIAL9SLKBlblk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631177453; 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=tX15mcwe/XJQhVxpf4gVLlLPDYYmT3NetllVSdV1uPc=; b=geS4wDveEYAg35OTyJijPryoIwTJ+ckuLjrpk8HIZOVSI5IGDIXothZKD/LqQOyDzpOdu606MQtfCwKL1kS4kicv+ecJ9z4hoZfvQYlnInDGkVWn7zNgbF087O1ziIDA709BrGdaSvgi75HnUiAdWhf7PmmgqvuaXKWkUYrAI8U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1631177453360477.4518191324453; Thu, 9 Sep 2021 01:50:53 -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-156-E-pnioOlOyW2A5ANNiPLig-1; Thu, 09 Sep 2021 04:50:50 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 98E7510168E7; Thu, 9 Sep 2021 08:50:44 +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 16E936C8D4; Thu, 9 Sep 2021 08:50:44 +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 D10E34EA3A; Thu, 9 Sep 2021 08:50:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1898ofSQ030797 for ; Thu, 9 Sep 2021 04:50:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id B0FC319736; Thu, 9 Sep 2021 08:50:41 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E71B1A26A for ; Thu, 9 Sep 2021 08:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177452; 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=tX15mcwe/XJQhVxpf4gVLlLPDYYmT3NetllVSdV1uPc=; b=eYEaWyBpND1T/zIJ+4c+LfZxhq0dd+a7Iqnxxzh7FHSAluyUS4qzI2ltA9t2dewNh4VG4m avXS95YN807Ha3HhORbc5AkK0Tjplnl6dFD6w+hXrDRvxMO/65HEdkxjGiMSBnQOcZEZJf JPHpG1EV04yrwNQUTBaZx/c8/N17/Cc= X-MC-Unique: E-pnioOlOyW2A5ANNiPLig-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 19/24] virstoragetest: testPrepImages: Don't reuse 'cmd' pointer Date: Thu, 9 Sep 2021 10:49:19 +0200 Message-Id: <050e89d6bd8144cba296fc774f44c5130f8e9709.1631177237.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com 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.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631177454066100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa --- tests/virstoragetest.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 955ac64e0b..90dde512cf 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -86,7 +86,8 @@ static int testPrepImages(void) { int ret =3D EXIT_FAILURE; - g_autoptr(virCommand) cmd =3D NULL; + g_autoptr(virCommand) cmdqcow2 =3D NULL; + g_autoptr(virCommand) cmdwrap =3D NULL; g_autofree char *buf =3D NULL; g_autofree char *absraw =3D g_strdup_printf("%s/raw", datadir); g_autofree char *absqcow2 =3D g_strdup_printf("%s/qcow2", datadir); @@ -118,25 +119,24 @@ testPrepImages(void) /* Create a qcow2 wrapping relative raw; later on, we modify its * metadata to test other configurations */ - cmd =3D virCommandNewArgList(qemuimg, "create", - "-f", "qcow2", - "-F", "raw", - "-b", absraw, - "-o", "compat=3D0.10", - absqcow2, NULL); - if (virCommandRun(cmd, NULL) < 0) + cmdqcow2 =3D virCommandNewArgList(qemuimg, "create", + "-f", "qcow2", + "-F", "raw", + "-b", absraw, + "-o", "compat=3D0.10", + absqcow2, NULL); + if (virCommandRun(cmdqcow2, NULL) < 0) goto skip; /* Create a second qcow2 wrapping the first, to be sure that we * can correctly avoid insecure probing. */ - virCommandFree(cmd); - cmd =3D virCommandNewArgList(qemuimg, "create", - "-f", "qcow2", - "-F", "qcow2", - "-b", absqcow2, - "-o", "compat=3D1.1", - abswrap, NULL); - if (virCommandRun(cmd, NULL) < 0) + cmdwrap =3D virCommandNewArgList(qemuimg, "create", + "-f", "qcow2", + "-F", "qcow2", + "-b", absqcow2, + "-o", "compat=3D1.1", + abswrap, NULL); + if (virCommandRun(cmdwrap, NULL) < 0) goto skip; ret =3D 0; --=20 2.31.1