From nobody Sat Feb 7 06:40:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1615449159; cv=none; d=zohomail.com; s=zohoarc; b=e8u2MhU/tNLBFgca3YDgEcCwGQYZriRkk1LN70UhyTvSCiNUT4XQD3BcaYdrsqJv68NAepQqDU7ztROO/I+KDEd9Rj2gPmVsJzTnz6h0b9VWK7DsVL/sIhDFH1Slzult9bP7APIjmmdgVCfZaJjt6iHxC6MBxjuBHHkNtnzqZ0o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615449159; h=Content-Type:Content-Transfer-Encoding:Cc: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=origTRd/6QwIFTBf2+vHW/E+QKQjO0XtzaaIEuVWKvI=; b=Rf8qGbhZpxF634tMTuTH78OZJHDhmK6Es2q7j9FWIGWNrW5I0t8M+fR7bbh+uiPS5ZsvDNRiNd1ozQdz4PE6AwQhcqKnYuGNX1PNBmKRicaKlY50DqNn2z1v8n/JwF3WxgGVSonBPBOqsAlt8vW0SqdWgwbOkQAy6JZztgPOo14= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615449159907484.7703804850894; Wed, 10 Mar 2021 23:52:39 -0800 (PST) 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-173-FsGP-bIpPWy0_aafzwx91Q-1; Thu, 11 Mar 2021 02:52:35 -0500 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 DA1DE10866A0; Thu, 11 Mar 2021 07:52:29 +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 B850C5B6BF; Thu, 11 Mar 2021 07:52:29 +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 7EE1B57DC2; Thu, 11 Mar 2021 07:52:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12B7qQAK004888 for ; Thu, 11 Mar 2021 02:52:26 -0500 Received: by smtp.corp.redhat.com (Postfix) id 854A75D6D7; Thu, 11 Mar 2021 07:52:26 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-83.phx2.redhat.com [10.3.112.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0800A5B6BF; Thu, 11 Mar 2021 07:52:23 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 90F991141CBD; Thu, 11 Mar 2021 08:52:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615449158; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=origTRd/6QwIFTBf2+vHW/E+QKQjO0XtzaaIEuVWKvI=; b=hqC8KkjEL5QFMjSqFUhjO1S6efkfqMfYxgkRiqa+X3L609Nj5hfjyY9Pb5iKgkPKixiyB+ /hNn2WtamTuEeTRqNU8UsTEvLzZGqGkqKiMlt7ir4KW2jLR6hY63pgFAOpyiJCBkgtU2uc xhchk1JBUbqtuCyz7tNmMWlU9/P59MI= X-MC-Unique: FsGP-bIpPWy0_aafzwx91Q-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v4 4/4] blockdev: Drop deprecated bogus -drive interface type Date: Thu, 11 Mar 2021 08:52:21 +0100 Message-Id: <20210311075221.1795266-5-armbru@redhat.com> In-Reply-To: <20210311075221.1795266-1-armbru@redhat.com> References: <20210311075221.1795266-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, qemu-block@nongnu.org, libvir-list@redhat.com, richard.henderson@linaro.org, mreitz@redhat.com, jsnow@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) Content-Type: text/plain; charset="utf-8" Drop the crap deprecated in commit a1b40bda08 "blockdev: Deprecate -drive with bogus interface type" (v5.1.0). drive_check_orphaned() no longer depends on qemu_create_cli_devices(). Call it right after board initialization for clarity. Signed-off-by: Markus Armbruster --- docs/system/deprecated.rst | 7 ------ docs/system/removed-features.rst | 7 ++++++ include/sysemu/blockdev.h | 1 - blockdev.c | 37 +++++++++++++------------------- softmmu/vl.c | 11 +--------- 5 files changed, 23 insertions(+), 40 deletions(-) diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst index 8d43b9336a..1279b57ee2 100644 --- a/docs/system/deprecated.rst +++ b/docs/system/deprecated.rst @@ -94,13 +94,6 @@ QEMU 5.1 has three options: to the user to load all the images they need. 3. ``-bios `` - Tells QEMU to load the specified file as the firmwr= ae. =20 -``-drive`` with bogus interface type (since 5.1) -'''''''''''''''''''''''''''''''''''''''''''''''' - -Drives with interface types other than ``if=3Dnone`` are for onboard -devices. It is possible to use drives the board doesn't pick up with --device. This usage is now deprecated. Use ``if=3Dnone`` instead. - Short-form boolean options (since 6.0) '''''''''''''''''''''''''''''''''''''' =20 diff --git a/docs/system/removed-features.rst b/docs/system/removed-feature= s.rst index d10fc8cc17..40b1a5ede3 100644 --- a/docs/system/removed-features.rst +++ b/docs/system/removed-features.rst @@ -87,6 +87,13 @@ becomes -device isa-fdc,... -device floppy,unit=3D1,drive=3D... =20 +``-drive`` with bogus interface type (removed in 6.0) +''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Drives with interface types other than ``if=3Dnone`` are for onboard +devices. Drives the board doesn't pick up can no longer be used with +-device. Use ``if=3Dnone`` instead. + QEMU Machine Protocol (QMP) commands ------------------------------------ =20 diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h index 3b5fcda08d..32c2d6023c 100644 --- a/include/sysemu/blockdev.h +++ b/include/sysemu/blockdev.h @@ -35,7 +35,6 @@ struct DriveInfo { bool is_default; /* Added by default_drive() ? */ int media_cd; QemuOpts *opts; - bool claimed_by_board; QTAILQ_ENTRY(DriveInfo) next; }; =20 diff --git a/blockdev.c b/blockdev.c index 68f022827c..c6149fe6a8 100644 --- a/blockdev.c +++ b/blockdev.c @@ -239,19 +239,10 @@ DriveInfo *drive_get(BlockInterfaceType type, int bus= , int unit) return NULL; } =20 -void drive_mark_claimed_by_board(void) -{ - BlockBackend *blk; - DriveInfo *dinfo; - - for (blk =3D blk_next(NULL); blk; blk =3D blk_next(blk)) { - dinfo =3D blk_legacy_dinfo(blk); - if (dinfo && blk_get_attached_dev(blk)) { - dinfo->claimed_by_board =3D true; - } - } -} - +/* + * Check board claimed all -drive that are meant to be claimed. + * Fatal error if any remain unclaimed. + */ void drive_check_orphaned(void) { BlockBackend *blk; @@ -261,7 +252,17 @@ void drive_check_orphaned(void) =20 for (blk =3D blk_next(NULL); blk; blk =3D blk_next(blk)) { dinfo =3D blk_legacy_dinfo(blk); - if (dinfo->is_default || dinfo->type =3D=3D IF_NONE) { + /* + * Ignore default drives, because we create certain default + * drives unconditionally, then leave them unclaimed. Not the + * user's fault. + * Ignore IF_VIRTIO, because it gets desugared into -device. + * Leave failing to -device. + * Ignore IF_NONE, because leaving unclaimed IF_NONE available + * for device_add is a feature. + */ + if (dinfo->is_default || dinfo->type =3D=3D IF_VIRTIO + || dinfo->type =3D=3D IF_NONE) { continue; } if (!blk_get_attached_dev(blk)) { @@ -272,14 +273,6 @@ void drive_check_orphaned(void) if_name[dinfo->type], dinfo->bus, dinfo->unit); loc_pop(&loc); orphans =3D true; - continue; - } - if (!dinfo->claimed_by_board && dinfo->type !=3D IF_VIRTIO) { - loc_push_none(&loc); - qemu_opts_loc_restore(dinfo->opts); - warn_report("bogus if=3D%s is deprecated, use if=3Dnone", - if_name[dinfo->type]); - loc_pop(&loc); } } =20 diff --git a/softmmu/vl.c b/softmmu/vl.c index ff488ea3e7..acaba95346 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2460,13 +2460,7 @@ static void qemu_init_board(void) /* From here on we enter MACHINE_PHASE_INITIALIZED. */ machine_run_board_init(current_machine); =20 - /* - * TODO To drop support for deprecated bogus if=3D..., move - * drive_check_orphaned() here, replacing this call. Also drop - * its deprecation warning, along with DriveInfo member - * @claimed_by_board. - */ - drive_mark_claimed_by_board(); + drive_check_orphaned(); =20 realtime_init(); =20 @@ -2500,9 +2494,6 @@ static void qemu_machine_creation_done(void) { MachineState *machine =3D MACHINE(qdev_get_machine()); =20 - /* Did we create any drives that we failed to create a device for? */ - drive_check_orphaned(); - /* Don't warn about the default network setup that you get if * no command line -net or -netdev options are specified. There * are two cases that we would otherwise complain about: --=20 2.26.2