@@ -90,16 +90,14 @@ void blockdev_mark_auto_del(BlockBackend *blk)
DriveInfo *dinfo = blk_legacy_dinfo(blk);
BlockDriverState *bs = blk_bs(blk);
- if (dinfo && !dinfo->enable_auto_del) {
+ if (!dinfo) {
return;
}
if (bs->job) {
block_job_cancel(bs->job);
}
- if (dinfo) {
- dinfo->auto_del = 1;
- }
+ dinfo->auto_del = 1;
}
void blockdev_auto_del(BlockBackend *blk)
@@ -899,7 +897,6 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type)
/* Set legacy DriveInfo fields */
dinfo = g_malloc0(sizeof(*dinfo));
- dinfo->enable_auto_del = true;
dinfo->opts = all_opts;
dinfo->cyls = cyls;
dinfo->heads = heads;
@@ -35,7 +35,6 @@ struct DriveInfo {
int bus;
int unit;
int auto_del; /* see blockdev_mark_auto_del() */
- bool enable_auto_del; /* Only for legacy drive_new() */
int media_cd;
int cyls, heads, secs, trans;
QemuOpts *opts;
Commit 2d246f0 introduced DriveInfo member enable_auto_del to distinguish DriveInfo created via drive_new() from DriveInfo created via qmp_blockdev_add(). The latter no longer exist. Drop enable_auto_del. Signed-off-by: Markus Armbruster <armbru@redhat.com> --- blockdev.c | 7 ++----- include/sysemu/blockdev.h | 1 - 2 files changed, 2 insertions(+), 6 deletions(-)