From nobody Thu May 15 10:15:27 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 1511198776324144.29881804253955; Mon, 20 Nov 2017 09:26:16 -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 4B67661491; Mon, 20 Nov 2017 17:26:15 +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 1FCC784F67; Mon, 20 Nov 2017 17:26:15 +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 CD21D1800FC4; Mon, 20 Nov 2017 17:26:14 +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 vAKHPuvs024794 for ; Mon, 20 Nov 2017 12:25:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id B9035649D2; Mon, 20 Nov 2017 17:25:56 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18097600CC; Mon, 20 Nov 2017 17:25:55 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 20 Nov 2017 18:25:19 +0100 Message-Id: <0af0206af7a06687ac378878a67cf22a06e1f991.1511198532.git.pkrempa@redhat.com> 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 02/12] qemu: command: Format frontend props with -device rather than -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.39]); Mon, 20 Nov 2017 17:26:15 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Historically we've formatted a lot of the attributes of a disk (disk geometry, etc) with -drive. Since we use -device now, they should be formatted there. --- src/qemu/qemu_command.c | 5 ++++- tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.args | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 9dac68981a..8c7bb245ed 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1689,7 +1689,8 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk, if (disk->src->readonly) virBufferAddLit(&opt, ",readonly=3Don"); - qemuBuildDiskFrontendAttributes(disk, &opt); + if (!emitDeviceSyntax) + qemuBuildDiskFrontendAttributes(disk, &opt); if (disk->serial && virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_SERIAL)) { @@ -2124,6 +2125,8 @@ qemuBuildDriveDevStr(const virDomainDef *def, disk->blockio.physical_block_size); } + qemuBuildDiskFrontendAttributes(disk, &opt); + if (disk->wwn) { if (STRPREFIX(disk->wwn, "0x")) virBufferAsprintf(&opt, ",wwn=3D%s", disk->wwn); diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.args b/tests= /qemuxml2argvdata/qemuxml2argv-disk-geometry.args index 3badaae28c..2b92dde39f 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.args @@ -19,7 +19,7 @@ server,nowait \ -no-acpi \ -boot c \ -usb \ --drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0,\ -cyls=3D16383,heads=3D16,secs=3D63,trans=3Dlba \ --device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ +-device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0,cyls=3D16383,\ +heads=3D16,secs=3D63,trans=3Dlba \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list