From nobody Thu May 15 09:56:19 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 1511345192427362.24349314741016; Wed, 22 Nov 2017 02:06:32 -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 56DF13A251; Wed, 22 Nov 2017 10:06:31 +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 3023A17CCC; Wed, 22 Nov 2017 10:06:31 +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 EF9D43D381; Wed, 22 Nov 2017 10:06:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAMA2QMu005553 for ; Wed, 22 Nov 2017 05:02:26 -0500 Received: by smtp.corp.redhat.com (Postfix) id 194E95C885; Wed, 22 Nov 2017 10:02:26 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 898261725E; Wed, 22 Nov 2017 10:02:21 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 22 Nov 2017 11:01:41 +0100 Message-Id: <065c81a9bc128711e2e14f80d34b2b2825ea2161.1511344783.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH v2 9/9] qemu: command: Anotate formatting of the frontend attributes with -drive 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.38]); Wed, 22 Nov 2017 10:06:31 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Explain that certain attributes formatted with -drive are in fact attributes of the drive itself and not the storage backing it. --- src/qemu/qemu_command.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ca4934b75c..26d395d67c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1764,8 +1764,13 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk, virBufferAsprintf(&opt, ",index=3D%d", idx); } + /* Format attributes for the drive itself (not the storage backing it)= which + * we've formatted historically with -drive */ qemuBuildDiskFrontendAttributes(disk, qemuCaps, &opt); + /* While this is a frontend attribute, it only makes sense to be used = when + * legacy -drive is used. In modern qemu the 'ide-cd' or 'scsi-cd' are= used. + * virtio and other just ignore the attribute anyways */ if (disk->device =3D=3D VIR_DOMAIN_DISK_DEVICE_CDROM) { if (disk->bus =3D=3D VIR_DOMAIN_DISK_BUS_SCSI) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_CD)) @@ -1778,12 +1783,15 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk, } } + /* This is a frontend attribute which was replaced by bootindex passed= in + * with -device arguments. */ if (bootable && virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_BOOT) && (disk->device =3D=3D VIR_DOMAIN_DISK_DEVICE_DISK || disk->device =3D=3D VIR_DOMAIN_DISK_DEVICE_LUN) && disk->bus !=3D VIR_DOMAIN_DISK_BUS_IDE) virBufferAddLit(&opt, ",boot=3Don"); + if (disk->src->readonly) virBufferAddLit(&opt, ",readonly=3Don"); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list