From patchwork Tue Jul 11 16:37:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manos Pitsidianakis X-Patchwork-Id: 9835321 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6E38F60363 for ; Tue, 11 Jul 2017 17:23:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52B3525EA6 for ; Tue, 11 Jul 2017 17:23:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 474C8269A3; Tue, 11 Jul 2017 17:23:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3D04725EA6 for ; Tue, 11 Jul 2017 17:23:05 +0000 (UTC) Received: from localhost ([::1]:47792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUysK-0008WO-Hp for patchwork-qemu-devel@patchwork.kernel.org; Tue, 11 Jul 2017 13:23:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUyBH-0000TM-En for qemu-devel@nongnu.org; Tue, 11 Jul 2017 12:38:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUyBG-0002gF-Ig for qemu-devel@nongnu.org; Tue, 11 Jul 2017 12:38:35 -0400 Received: from smtp1.ntua.gr ([2001:648:2000:de::183]:20791) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUyBB-0002dp-S6; Tue, 11 Jul 2017 12:38:30 -0400 Received: from mail.ntua.gr (ppp046176127036.access.hol.gr [46.176.127.36]) (authenticated bits=0) by smtp1.ntua.gr (8.15.2/8.15.2) with ESMTPSA id v6BGcQFr070995 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jul 2017 19:38:26 +0300 (EEST) (envelope-from el13635@mail.ntua.gr) X-Authentication-Warning: smtp1.ntua.gr: Host ppp046176127036.access.hol.gr [46.176.127.36] claimed to be mail.ntua.gr From: Manos Pitsidianakis To: qemu-devel Date: Tue, 11 Jul 2017 19:37:46 +0300 Message-Id: <20170711163748.17817-3-el13635@mail.ntua.gr> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170711163748.17817-1-el13635@mail.ntua.gr> References: <20170711163748.17817-1-el13635@mail.ntua.gr> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:648:2000:de::183 Subject: [Qemu-devel] [PATCH v4 2/4] block: remove bdrv_media_changed X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Alberto Garcia , qemu-block , Max Reitz , Stefan Hajnoczi Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This function is not used anywhere, so remove it. Signed-off-by: Manos Pitsidianakis Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi --- block.c | 14 -------------- block/raw-format.c | 6 ------ include/block/block.h | 1 - include/block/block_int.h | 1 - 4 files changed, 22 deletions(-) diff --git a/block.c b/block.c index 7f7530b6..5ca60f97 100644 --- a/block.c +++ b/block.c @@ -4213,20 +4213,6 @@ bool bdrv_is_inserted(BlockDriverState *bs) } /** - * Return whether the media changed since the last call to this - * function, or -ENOTSUP if we don't know. Most drivers don't know. - */ -int bdrv_media_changed(BlockDriverState *bs) -{ - BlockDriver *drv = bs->drv; - - if (drv && drv->bdrv_media_changed) { - return drv->bdrv_media_changed(bs); - } - return -ENOTSUP; -} - -/** * If eject_flag is TRUE, eject the media. Otherwise, close the tray */ void bdrv_eject(BlockDriverState *bs, bool eject_flag) diff --git a/block/raw-format.c b/block/raw-format.c index 1ea8c2d7..df3bc5d5 100644 --- a/block/raw-format.c +++ b/block/raw-format.c @@ -346,11 +346,6 @@ static int raw_truncate(BlockDriverState *bs, int64_t offset, Error **errp) return bdrv_truncate(bs->file, offset, errp); } -static int raw_media_changed(BlockDriverState *bs) -{ - return bdrv_media_changed(bs->file->bs); -} - static void raw_eject(BlockDriverState *bs, bool eject_flag) { bdrv_eject(bs->file->bs, eject_flag); @@ -483,7 +478,6 @@ BlockDriver bdrv_raw = { .bdrv_refresh_limits = &raw_refresh_limits, .bdrv_probe_blocksizes = &raw_probe_blocksizes, .bdrv_probe_geometry = &raw_probe_geometry, - .bdrv_media_changed = &raw_media_changed, .bdrv_eject = &raw_eject, .bdrv_lock_medium = &raw_lock_medium, .bdrv_co_ioctl = &raw_co_ioctl, diff --git a/include/block/block.h b/include/block/block.h index afe1b615..3cb4cae7 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -438,7 +438,6 @@ int bdrv_can_set_read_only(BlockDriverState *bs, bool read_only, Error **errp); int bdrv_set_read_only(BlockDriverState *bs, bool read_only, Error **errp); bool bdrv_is_sg(BlockDriverState *bs); bool bdrv_is_inserted(BlockDriverState *bs); -int bdrv_media_changed(BlockDriverState *bs); void bdrv_lock_medium(BlockDriverState *bs, bool locked); void bdrv_eject(BlockDriverState *bs, bool eject_flag); const char *bdrv_get_format_name(BlockDriverState *bs); diff --git a/include/block/block_int.h b/include/block/block_int.h index 75e93f72..3d9a8164 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -246,7 +246,6 @@ struct BlockDriver { /* removable device specific */ bool (*bdrv_is_inserted)(BlockDriverState *bs); - int (*bdrv_media_changed)(BlockDriverState *bs); void (*bdrv_eject)(BlockDriverState *bs, bool eject_flag); void (*bdrv_lock_medium)(BlockDriverState *bs, bool locked);