From nobody Wed Jul 9 23:30:24 2025 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511454717491966.6001924217566; Thu, 23 Nov 2017 08:31:57 -0800 (PST) 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 80A39DF23; Thu, 23 Nov 2017 16:31:56 +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 551832D34F; Thu, 23 Nov 2017 16:31:56 +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 07F211800BDB; Thu, 23 Nov 2017 16:31:56 +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 vANGPBxq006818 for ; Thu, 23 Nov 2017 11:25:11 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9EC751914D; Thu, 23 Nov 2017 16:25:11 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id F299C18B55; Thu, 23 Nov 2017 16:25:10 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 23 Nov 2017 17:24:38 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 1/6] qemu: command: Inject password-secret only when not using JSON props 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: , MIME-Version: 1.0 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.30]); Thu, 23 Nov 2017 16:31:56 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The 'file.password-secret' injection should be used only if we are using the old formatter. When formatting the source string from the JSON properities, the property should be added there. Also drop the comment which refers to stuff that will not be used in libvirt sine -blockdev is the way to go. --- src/qemu/qemu_command.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 26d395d67c..667ac746e1 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1578,6 +1578,9 @@ qemuBuildDriveSourceStr(virDomainDiskDefPtr disk, } virQEMUBuildBufferEscapeComma(buf, source); + + if (secinfo && secinfo->type =3D=3D VIR_DOMAIN_SECRET_INFO_TYPE_AE= S) + virBufferAsprintf(buf, ",file.password-secret=3D%s", secinfo->= s.aes.alias); } else { if (!(source =3D virQEMUBuildDriveCommandlineFromJSON(srcprops))) goto cleanup; @@ -1592,16 +1595,6 @@ qemuBuildDriveSourceStr(virDomainDiskDefPtr disk, virBufferAsprintf(buf, "file.debug=3D%d,", cfg->glusterDebugLe= vel); } - if (secinfo && secinfo->type =3D=3D VIR_DOMAIN_SECRET_INFO_TYPE_AES) { - /* NB: If libvirt starts using the more modern option based - * syntax to build the command line (e.g., "-drive driver=3Drb= d, - * filename=3D%s,...") instead of the legacy model (e.g."-drive - * file=3D%s,..."), then the "file." prefix can be removed - */ - virBufferAsprintf(buf, "file.password-secret=3D%s,", - secinfo->s.aes.alias); - } - if (encinfo) virQEMUBuildLuksOpts(buf, &disk->src->encryption->encinfo, encinfo->s.aes.alias); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list