|
@@ -239,19 +239,10 @@ DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit)
|
|
return NULL;
|
|
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)
|
|
void drive_check_orphaned(void)
|
|
{
|
|
{
|
|
BlockBackend *blk;
|
|
BlockBackend *blk;
|
|
@@ -261,7 +252,17 @@ void drive_check_orphaned(void)
|
|
|
|
|
|
for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
|
|
for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
|
|
dinfo = blk_legacy_dinfo(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;
|
|
continue;
|
|
}
|
|
}
|
|
if (!blk_get_attached_dev(blk)) {
|
|
if (!blk_get_attached_dev(blk)) {
|
|
@@ -272,14 +273,6 @@ void drive_check_orphaned(void)
|
|
if_name[dinfo->type], dinfo->bus, dinfo->unit);
|
|
if_name[dinfo->type], dinfo->bus, dinfo->unit);
|
|
loc_pop(&loc);
|
|
loc_pop(&loc);
|
|
orphans = true;
|
|
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);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|