From patchwork Thu May 19 15:21:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 9127859 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 654AC60453 for ; Thu, 19 May 2016 15:42:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A5F6281BD for ; Thu, 19 May 2016 15:42:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2ECEB281C3; Thu, 19 May 2016 15:42:32 +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 B1E14281BD for ; Thu, 19 May 2016 15:42:31 +0000 (UTC) Received: from localhost ([::1]:51037 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3Q5m-0006Go-F3 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 May 2016 11:42:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3Pma-0005HQ-GW for qemu-devel@nongnu.org; Thu, 19 May 2016 11:22:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3PmV-0000Ba-BB for qemu-devel@nongnu.org; Thu, 19 May 2016 11:22:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3PmN-0008TP-RP; Thu, 19 May 2016 11:22:27 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 790BA74B; Thu, 19 May 2016 15:22:27 +0000 (UTC) Received: from noname.str.redhat.com. (dhcp-192-197.str.redhat.com [10.33.192.197]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4JFMEB1025145; Thu, 19 May 2016 11:22:26 -0400 From: Kevin Wolf To: qemu-block@nongnu.org Date: Thu, 19 May 2016 17:21:50 +0200 Message-Id: <1463671329-22655-13-git-send-email-kwolf@redhat.com> In-Reply-To: <1463671329-22655-1-git-send-email-kwolf@redhat.com> References: <1463671329-22655-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 19 May 2016 15:22:27 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 12/31] block: Remove bdrv_move_feature_fields() 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: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP bdrv_move_feature_fields() and swap_feature_fields() are empty now, they can be removed. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Acked-by: Stefan Hajnoczi --- block.c | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/block.c b/block.c index 98226fe..39f14c7 100644 --- a/block.c +++ b/block.c @@ -2210,13 +2210,6 @@ void bdrv_close_all(void) } } -/* Fields that need to stay with the top-level BDS */ -static void bdrv_move_feature_fields(BlockDriverState *bs_dest, - BlockDriverState *bs_src) -{ - /* move some fields that need to stay attached to the device */ -} - static void change_parent_backing_link(BlockDriverState *from, BlockDriverState *to) { @@ -2240,16 +2233,6 @@ static void change_parent_backing_link(BlockDriverState *from, } } -static void swap_feature_fields(BlockDriverState *bs_top, - BlockDriverState *bs_new) -{ - BlockDriverState tmp; - - bdrv_move_feature_fields(&tmp, bs_top); - bdrv_move_feature_fields(bs_top, bs_new); - bdrv_move_feature_fields(bs_new, &tmp); -} - /* * Add new bs contents at the top of an image chain while the chain is * live, while keeping required fields on the top layer. @@ -2273,9 +2256,6 @@ void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top) bdrv_ref(bs_top); - /* Some fields always stay on top of the backing file chain */ - swap_feature_fields(bs_top, bs_new); - change_parent_backing_link(bs_top, bs_new); bdrv_set_backing_hd(bs_new, bs_top); bdrv_unref(bs_top); @@ -2292,16 +2272,6 @@ void bdrv_replace_in_backing_chain(BlockDriverState *old, BlockDriverState *new) bdrv_ref(old); - if (old->blk) { - /* As long as these fields aren't in BlockBackend, but in the top-level - * BlockDriverState, it's not possible for a BDS to have two BBs. - * - * We really want to copy the fields from old to new, but we go for a - * swap instead so that pointers aren't duplicated and cause trouble. - * (Also, bdrv_swap() used to do the same.) */ - assert(!new->blk); - swap_feature_fields(old, new); - } change_parent_backing_link(old, new); /* Change backing files if a previously independent node is added to the