From nobody Fri Dec 19 20:48:38 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1548692398337806.7133255373495; Mon, 28 Jan 2019 08:19:58 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B43F83D95C; Mon, 28 Jan 2019 16:19:55 +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 646FBC95B9; Mon, 28 Jan 2019 16:19:55 +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 D740B180BAAC; Mon, 28 Jan 2019 16:19:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0SGJZpW018267 for ; Mon, 28 Jan 2019 11:19:35 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6389A82EDC; Mon, 28 Jan 2019 16:19:35 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE65482ED8 for ; Mon, 28 Jan 2019 16:19:34 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 28 Jan 2019 17:18:56 +0100 Message-Id: <9d59cff39dc4440921738bc3bdd38e1ab0da0311.1548692131.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 27/32] qemu: command: Drop formatting of 'media=cdrom' from -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: , 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 28 Jan 2019 16:19:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" For SCSI, IDE, and AHCI cdroms the appropriate device types which select the correct media are used. In qemu there's one other code path that looks at -drive media=3Dcdrom in the XEN pv code. Thankfully we don't support it with qemu (see qemuBuildDiskDeviceStr). All other devices ignore it as the comment states, thus we can drop that code. The test fallout is expectedly only in the test added for uncommon cdrom types. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 9 --------- .../disk-cdrom-bus-other.x86_64-latest.args | 9 ++++----- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d85580b857..0a62317a33 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1748,15 +1748,6 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk, if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_USB_STORAGE_WERROR)) qemuBuildDiskFrontendAttributeErrorPolicy(disk, &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 && - disk->bus !=3D VIR_DOMAIN_DISK_BUS_SCSI && - disk->bus !=3D VIR_DOMAIN_DISK_BUS_IDE) - virBufferAddLit(&opt, ",media=3Dcdrom"); - if (!virStorageSourceIsEmpty(disk->src)) { if (disk->src->readonly) virBufferAddLit(&opt, ",readonly=3Don"); diff --git a/tests/qemuxml2argvdata/disk-cdrom-bus-other.x86_64-latest.args= b/tests/qemuxml2argvdata/disk-cdrom-bus-other.x86_64-latest.args index 34849c2e96..aba5599aad 100644 --- a/tests/qemuxml2argvdata/disk-cdrom-bus-other.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-cdrom-bus-other.x86_64-latest.args @@ -24,15 +24,14 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --drive file=3D/root/boot.iso,format=3Draw,if=3Dnone,id=3Ddrive-usb-disk0,m= edia=3Dcdrom,\ -readonly=3Don \ +-drive file=3D/root/boot.iso,format=3Draw,if=3Dnone,id=3Ddrive-usb-disk0,r= eadonly=3Don \ -device usb-storage,bus=3Dusb.0,port=3D1,drive=3Ddrive-usb-disk0,id=3Dusb-= disk0,\ removable=3Doff \ --drive if=3Dnone,id=3Ddrive-usb-disk1,media=3Dcdrom \ +-drive if=3Dnone,id=3Ddrive-usb-disk1 \ -device usb-storage,bus=3Dusb.0,port=3D2,drive=3Ddrive-usb-disk1,id=3Dusb-= disk1,\ removable=3Doff \ --drive file=3D/root/boot2.iso,format=3Draw,if=3Dsd,index=3D2,media=3Dcdrom= ,readonly=3Don \ --drive if=3Dsd,index=3D3,media=3Dcdrom \ +-drive file=3D/root/boot2.iso,format=3Draw,if=3Dsd,index=3D2,readonly=3Don= \ +-drive if=3Dsd,index=3D3 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ -msg timestamp=3Don --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list