aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-03-19 15:24:59 +0000
committerPeter Maydell <peter.maydell@linaro.org>2021-03-19 15:24:59 +0000
commit8631a430e65ef73b3d8a297128be2ef3c7317b90 (patch)
treeaacaa13dc9879b923b9ea13864742d39b7c3b411 /blockdev.c
parent92566947b3ac5ca75f91a34acb188219c455fc71 (diff)
parentbb3c92ed105f0704ffd1cc1dc6031b6d457c829e (diff)
Merge remote-tracking branch 'remotes/armbru/tags/pull-qom-fdc-2021-03-16-v5' into staging
QOM and fdc patches patches for 2021-03-16 # gpg: Signature made Fri 19 Mar 2021 14:18:47 GMT # gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653 # gpg: issuer "armbru@redhat.com" # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-qom-fdc-2021-03-16-v5: memory: Drop "qemu:" prefix from QOM memory region type names hw: Replace anti-social QOM type names blockdev: Drop deprecated bogus -drive interface type fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common() fdc: Drop deprecated floppy configuration docs/system/deprecated: Fix note on fdc drive properties fuzz: Avoid deprecated misuse of -drive if=sd Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c37
1 files changed, 15 insertions, 22 deletions
diff --git a/blockdev.c b/blockdev.c
index 5cc7c7effe..cf70bb4e43 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -239,19 +239,10 @@ DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit)
return NULL;
}
-void drive_mark_claimed_by_board(void)
-{
- BlockBackend *blk;
- DriveInfo *dinfo;
-
- for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
- dinfo = blk_legacy_dinfo(blk);
- if (dinfo && blk_get_attached_dev(blk)) {
- dinfo->claimed_by_board = 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)
for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
dinfo = blk_legacy_dinfo(blk);
- if (dinfo->is_default || dinfo->type == IF_NONE) {
+ /*
+ * Ignore default drives, because we create certain default
+ * drives unconditionally, then leave them unclaimed. Not the
+ * users fault.
+ * Ignore IF_VIRTIO, because it gets desugared into -device,
+ * so we can leave failing to -device.
+ * Ignore IF_NONE, because leaving unclaimed IF_NONE remains
+ * available for device_add is a feature.
+ */
+ if (dinfo->is_default || dinfo->type == IF_VIRTIO
+ || dinfo->type == 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 = true;
- continue;
- }
- if (!dinfo->claimed_by_board && dinfo->type != IF_VIRTIO) {
- loc_push_none(&loc);
- qemu_opts_loc_restore(dinfo->opts);
- warn_report("bogus if=%s is deprecated, use if=none",
- if_name[dinfo->type]);
- loc_pop(&loc);
}
}