Received: from eggs.gnu.org ([2001:4830:134:3::10]:56959) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTs4A-00049e-NH for qemu-devel@nongnu.org; Tue, 16 Sep 2014 08:41:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTs42-0002LN-RF for qemu-devel@nongnu.org; Tue, 16 Sep 2014 08:41:06 -0400 Received: from dew.nodalink.com ([95.130.14.197]:55810) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTs42-0002L7-H0 for qemu-devel@nongnu.org; Tue, 16 Sep 2014 08:40:58 -0400 Date: Tue, 16 Sep 2014 12:40:58 +0000 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140916124058.GB27495@nodalink.com> References: <1410620427-20089-1-git-send-email-armbru@redhat.com> <1410620427-20089-6-git-send-email-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1410620427-20089-6-git-send-email-armbru@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 05/23] block: Code motion to get rid of stubs/blockdev.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, benoit.canet@nodalink.com On Sat, Sep 13, 2014 at 05:00:09PM +0200, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > block/block-backend.c | 15 +++++++++++++++ > blockdev.c | 13 ------------- > include/sysemu/blockdev.h | 1 - > stubs/Makefile.objs | 1 - > stubs/blockdev.c | 12 ------------ > 5 files changed, 15 insertions(+), 27 deletions(-) > delete mode 100644 stubs/blockdev.c >=20 > diff --git a/block/block-backend.c b/block/block-backend.c > index 7b8c062..0842abe 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); > @@ -92,6 +94,19 @@ static void blk_delete(BlockBackend *blk) > g_free(blk); > } > =20 > +static void drive_info_del(DriveInfo *dinfo) > +{ > + if (!dinfo) { > + return; > + } > + if (dinfo->opts) { > + 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 aec9f0e..0ed108d 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -223,19 +223,6 @@ void drive_del(DriveInfo *dinfo) > blk_unref(blk_by_legacy_dinfo(dinfo)); > } > =20 > -void drive_info_del(DriveInfo *dinfo) > -{ > - if (!dinfo) { > - return; > - } > - if (dinfo->opts) { > - 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 1dc5906..2ed297b 100644 > --- a/include/sysemu/blockdev.h > +++ b/include/sysemu/blockdev.h > @@ -60,7 +60,6 @@ QemuOpts *drive_add(BlockInterfaceType type, int inde= x, const char *file, > const char *optstr); > DriveInfo *drive_new(QemuOpts *arg, BlockInterfaceType block_default_t= ype); > 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.9.3 >=20 Reviewed-by: Beno=EEt Canet