From patchwork Thu Jun 29 18:43:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manos Pitsidianakis X-Patchwork-Id: 9817727 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 6D6946035F for ; Thu, 29 Jun 2017 18:46:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61CE928786 for ; Thu, 29 Jun 2017 18:46:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5692A28790; Thu, 29 Jun 2017 18:46:56 +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 AAD0E28787 for ; Thu, 29 Jun 2017 18:46:55 +0000 (UTC) Received: from localhost ([::1]:40793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQeSs-0003zt-VV for patchwork-qemu-devel@patchwork.kernel.org; Thu, 29 Jun 2017 14:46:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQeQX-0002kh-DM for qemu-devel@nongnu.org; Thu, 29 Jun 2017 14:44:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQeQW-0005Ta-Jy for qemu-devel@nongnu.org; Thu, 29 Jun 2017 14:44:29 -0400 Received: from smtp1.ntua.gr ([2001:648:2000:de::183]:38423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQeQR-0005R7-2p; Thu, 29 Jun 2017 14:44:23 -0400 Received: from mail.ntua.gr (ppp005055127131.access.hol.gr [5.55.127.131]) (authenticated bits=0) by smtp1.ntua.gr (8.15.2/8.15.2) with ESMTPSA id v5TIhlr2022423 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 29 Jun 2017 21:43:47 +0300 (EEST) (envelope-from el13635@mail.ntua.gr) X-Authentication-Warning: smtp1.ntua.gr: Host ppp005055127131.access.hol.gr [5.55.127.131] claimed to be mail.ntua.gr From: Manos Pitsidianakis To: qemu-devel Date: Thu, 29 Jun 2017 21:43:19 +0300 Message-Id: <20170629184320.7151-3-el13635@mail.ntua.gr> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170629184320.7151-1-el13635@mail.ntua.gr> References: <20170629184320.7151-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 v2 2/3] block: use defaults of bdrv_* callbacks in raw 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 , Stefan Hajnoczi , qemu-block , Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Now that passing the call to bs->file is the default for some bdrv_* callbacks, remove the duplicate implementations in block/raw-format.c Signed-off-by: Manos Pitsidianakis Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi --- block/raw-format.c | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/block/raw-format.c b/block/raw-format.c index 1ea8c2d7..ff9b4359 100644 --- a/block/raw-format.c +++ b/block/raw-format.c @@ -312,11 +312,6 @@ static int64_t raw_getlength(BlockDriverState *bs) return s->size; } -static int raw_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) -{ - return bdrv_get_info(bs->file->bs, bdi); -} - static void raw_refresh_limits(BlockDriverState *bs, Error **errp) { if (bs->probed) { @@ -346,21 +341,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); -} - -static void raw_lock_medium(BlockDriverState *bs, bool locked) -{ - bdrv_lock_medium(bs->file->bs, locked); -} - static int raw_co_ioctl(BlockDriverState *bs, unsigned long int req, void *buf) { BDRVRawState *s = bs->opaque; @@ -370,11 +350,6 @@ static int raw_co_ioctl(BlockDriverState *bs, unsigned long int req, void *buf) return bdrv_co_ioctl(bs->file->bs, req, buf); } -static int raw_has_zero_init(BlockDriverState *bs) -{ - return bdrv_has_zero_init(bs->file->bs); -} - static int raw_create(const char *filename, QemuOpts *opts, Error **errp) { return bdrv_create_file(filename, opts, errp); @@ -479,16 +454,11 @@ BlockDriver bdrv_raw = { .bdrv_truncate = &raw_truncate, .bdrv_getlength = &raw_getlength, .has_variable_length = true, - .bdrv_get_info = &raw_get_info, .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, - .create_opts = &raw_create_opts, - .bdrv_has_zero_init = &raw_has_zero_init + .create_opts = &raw_create_opts }; static void bdrv_raw_init(void)