From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTxFF-0003YC-S9 for qemu-devel@nongnu.org; Tue, 16 Sep 2014 14:12:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTxF9-0003Hx-5P for qemu-devel@nongnu.org; Tue, 16 Sep 2014 14:12:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56783) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTxF8-0003GA-U0 for qemu-devel@nongnu.org; Tue, 16 Sep 2014 14:12:47 -0400 From: Markus Armbruster Date: Tue, 16 Sep 2014 20:12:24 +0200 Message-Id: <1410891148-28849-20-git-send-email-armbru@redhat.com> In-Reply-To: <1410891148-28849-1-git-send-email-armbru@redhat.com> References: <1410891148-28849-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH v3 19/23] blockdev: Drop DriveInfo member enable_auto_del List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, benoit.canet@nodalink.com, stefanha@redhat.com, mreitz@redhat.com 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 --- blockdev.c | 11 +++-------- include/sysemu/blockdev.h | 1 - 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/blockdev.c b/blockdev.c index 0d99be0..e218c59 100644 --- a/blockdev.c +++ b/blockdev.c @@ -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) @@ -900,7 +898,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; @@ -1716,7 +1713,6 @@ int do_drive_del(Monitor *mon, const QDict *qdict, QObject **ret_data) const char *id = qdict_get_str(qdict, "id"); BlockBackend *blk; BlockDriverState *bs; - DriveInfo *dinfo; AioContext *aio_context; Error *local_err = NULL; @@ -1727,8 +1723,7 @@ int do_drive_del(Monitor *mon, const QDict *qdict, QObject **ret_data) } bs = blk_bs(blk); - dinfo = blk_legacy_dinfo(blk); - if (dinfo && !dinfo->enable_auto_del) { + if (!blk_legacy_dinfo(blk)) { error_report("Deleting device added with blockdev-add" " is not supported"); return -1; diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h index 27a40d5..2129d81 100644 --- a/include/sysemu/blockdev.h +++ b/include/sysemu/blockdev.h @@ -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; -- 1.9.3