From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgD8C-0004KJ-II for qemu-devel@nongnu.org; Mon, 20 Oct 2014 09:36:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XgD86-0007Eb-Sa for qemu-devel@nongnu.org; Mon, 20 Oct 2014 09:36:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgD86-0007ER-LG for qemu-devel@nongnu.org; Mon, 20 Oct 2014 09:36:10 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9KDaA1Q030722 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 20 Oct 2014 09:36:10 -0400 From: Kevin Wolf Date: Mon, 20 Oct 2014 15:35:35 +0200 Message-Id: <1413812154-11153-10-git-send-email-kwolf@redhat.com> In-Reply-To: <1413812154-11153-1-git-send-email-kwolf@redhat.com> References: <1413812154-11153-1-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 09/28] block: Code motion to get rid of stubs/blockdev.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com From: Markus Armbruster Signed-off-by: Markus Armbruster Reviewed-by: Beno=C3=AEt Canet Reviewed-by: Max Reitz Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/block-backend.c | 13 +++++++++++++ blockdev.c | 11 ----------- include/sysemu/blockdev.h | 1 - stubs/Makefile.objs | 1 - stubs/blockdev.c | 12 ------------ 5 files changed, 13 insertions(+), 25 deletions(-) delete mode 100644 stubs/blockdev.c diff --git a/block/block-backend.c b/block/block-backend.c index edaf73c..d4bdd48 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -22,6 +22,8 @@ struct BlockBackend { QTAILQ_ENTRY(BlockBackend) link; /* for blk_backends */ }; =20 +static void drive_info_del(DriveInfo *dinfo); + /* All the BlockBackends (except for hidden ones) */ static QTAILQ_HEAD(, BlockBackend) blk_backends =3D QTAILQ_HEAD_INITIALIZER(blk_backends); @@ -93,6 +95,17 @@ static void blk_delete(BlockBackend *blk) g_free(blk); } =20 +static void drive_info_del(DriveInfo *dinfo) +{ + if (!dinfo) { + return; + } + qemu_opts_del(dinfo->opts); + g_free(dinfo->id); + g_free(dinfo->serial); + g_free(dinfo); +} + /* * Increment @blk's reference count. * @blk must not be null. diff --git a/blockdev.c b/blockdev.c index 24d40f9..a00461d 100644 --- a/blockdev.c +++ b/blockdev.c @@ -284,17 +284,6 @@ void drive_del(DriveInfo *dinfo) blk_unref(blk); } =20 -void drive_info_del(DriveInfo *dinfo) -{ - if (!dinfo) { - return; - } - qemu_opts_del(dinfo->opts); - g_free(dinfo->id); - g_free(dinfo->serial); - g_free(dinfo); -} - typedef struct { QEMUBH *bh; BlockDriverState *bs; diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h index c814a90..ccd4bf4 100644 --- a/include/sysemu/blockdev.h +++ b/include/sysemu/blockdev.h @@ -65,7 +65,6 @@ QemuOpts *drive_add(BlockInterfaceType type, int index,= const char *file, const char *optstr); DriveInfo *drive_new(QemuOpts *arg, BlockInterfaceType block_default_typ= e); void drive_del(DriveInfo *dinfo); -void drive_info_del(DriveInfo *dinfo); =20 /* device-hotplug */ =20 diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index c0b1f6a..5e347d0 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -1,6 +1,5 @@ stub-obj-y +=3D arch-query-cpu-def.o stub-obj-y +=3D bdrv-commit-all.o -stub-obj-y +=3D blockdev.o stub-obj-y +=3D chr-baum-init.o stub-obj-y +=3D chr-msmouse.o stub-obj-y +=3D chr-testdev.o diff --git a/stubs/blockdev.c b/stubs/blockdev.c deleted file mode 100644 index 5d0a79c..0000000 --- a/stubs/blockdev.c +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include "sysemu/blockdev.h" - -DriveInfo *drive_get_by_blockdev(BlockDriverState *bs) -{ - return NULL; -} - -void drive_info_del(DriveInfo *dinfo) -{ - assert(!dinfo); -} --=20 1.8.3.1