From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMIMR-0005FE-V4 for qemu-devel@nongnu.org; Tue, 26 Aug 2014 11:08:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMIMM-0004Zg-I3 for qemu-devel@nongnu.org; Tue, 26 Aug 2014 11:08:39 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:51991 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMIMM-0004ZQ-7v for qemu-devel@nongnu.org; Tue, 26 Aug 2014 11:08:34 -0400 Date: Tue, 26 Aug 2014 17:07:47 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140826150746.GC24511@irqsave.net> References: <1409036239-592-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1409036239-592-1-git-send-email-famz@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] block: Always compile virtio-blk dataplane List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com The Tuesday 26 Aug 2014 =E0 14:57:19 (+0800), Fam Zheng wrote : > Dataplane doesn't depend on linux-aio any more, so we don't need the > compiling condition now. >=20 > Configure options are kept but just print a message. >=20 > Signed-off-by: Fam Zheng > --- > configure | 21 ++------------------- > hw/block/Makefile.objs | 2 +- > hw/block/virtio-blk.c | 22 ++-------------------- > hw/virtio/Makefile.objs | 2 +- > include/hw/virtio/virtio-blk.h | 2 -- > 5 files changed, 6 insertions(+), 43 deletions(-) >=20 > diff --git a/configure b/configure > index 2063cf6..68cb4d2 100755 > --- a/configure > +++ b/configure > @@ -327,7 +327,6 @@ glusterfs=3D"" > glusterfs_discard=3D"no" > glusterfs_zerofill=3D"no" > archipelago=3D"" > -virtio_blk_data_plane=3D"" > gtk=3D"" > gtkabi=3D"" > vte=3D"" > @@ -1092,9 +1091,8 @@ for opt do > ;; > --enable-archipelago) archipelago=3D"yes" > ;; > - --disable-virtio-blk-data-plane) virtio_blk_data_plane=3D"no" > - ;; > - --enable-virtio-blk-data-plane) virtio_blk_data_plane=3D"yes" > + --disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane) > + echo "$0: $opt is obsolete, virtio-blk data-plane is always on" = >&2 > ;; > --disable-gtk) gtk=3D"no" > ;; > @@ -2936,16 +2934,6 @@ else > fi > =20 > ########################################## > -# adjust virtio-blk-data-plane based on linux-aio > - > -if test "$virtio_blk_data_plane" =3D "yes" -a \ > - "$linux_aio" !=3D "yes" ; then > - error_exit "virtio-blk-data-plane requires Linux AIO, please try --e= nable-linux-aio" > -elif test -z "$virtio_blk_data_plane" ; then > - virtio_blk_data_plane=3D$linux_aio > -fi > - > -########################################## > # attr probe > =20 > if test "$attr" !=3D "no" ; then > @@ -4319,7 +4307,6 @@ echo "coroutine backend $coroutine" > echo "coroutine pool $coroutine_pool" > echo "GlusterFS support $glusterfs" > echo "Archipelago support $archipelago" > -echo "virtio-blk-data-plane $virtio_blk_data_plane" > echo "gcov $gcov_tool" > echo "gcov enabled $gcov" > echo "TPM support $tpm" > @@ -4778,10 +4765,6 @@ if test "$quorum" =3D "yes" ; then > echo "CONFIG_QUORUM=3Dy" >> $config_host_mak > fi > =20 > -if test "$virtio_blk_data_plane" =3D "yes" ; then > - echo 'CONFIG_VIRTIO_BLK_DATA_PLANE=3D$(CONFIG_VIRTIO)' >> $config_ho= st_mak > -fi > - > if test "$vhdx" =3D "yes" ; then > echo "CONFIG_VHDX=3Dy" >> $config_host_mak > fi > diff --git a/hw/block/Makefile.objs b/hw/block/Makefile.objs > index bf46f03..d4c3ab7 100644 > --- a/hw/block/Makefile.objs > +++ b/hw/block/Makefile.objs > @@ -12,4 +12,4 @@ common-obj-$(CONFIG_NVME_PCI) +=3D nvme.o > obj-$(CONFIG_SH4) +=3D tc58128.o > =20 > obj-$(CONFIG_VIRTIO) +=3D virtio-blk.o > -obj-$(CONFIG_VIRTIO_BLK_DATA_PLANE) +=3D dataplane/ > +obj-$(CONFIG_VIRTIO) +=3D dataplane/ > diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c > index d9167ce..643eb2f 100644 > --- a/hw/block/virtio-blk.c > +++ b/hw/block/virtio-blk.c > @@ -18,10 +18,8 @@ > #include "hw/block/block.h" > #include "sysemu/blockdev.h" > #include "hw/virtio/virtio-blk.h" > -#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE > -# include "dataplane/virtio-blk.h" > -# include "migration/migration.h" > -#endif > +#include "dataplane/virtio-blk.h" > +#include "migration/migration.h" > #include "block/scsi.h" > #ifdef __linux__ > # include > @@ -432,7 +430,6 @@ static void virtio_blk_handle_output(VirtIODevice *= vdev, VirtQueue *vq) > .num_writes =3D 0, > }; > =20 > -#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE > /* Some guests kick before setting VIRTIO_CONFIG_S_DRIVER_OK so st= art > * dataplane here instead of waiting for .set_status(). > */ > @@ -440,7 +437,6 @@ static void virtio_blk_handle_output(VirtIODevice *= vdev, VirtQueue *vq) > virtio_blk_data_plane_start(s->dataplane); > return; > } > -#endif > =20 > while ((req =3D virtio_blk_get_request(s))) { > virtio_blk_handle_request(req, &mrb); > @@ -497,11 +493,9 @@ static void virtio_blk_reset(VirtIODevice *vdev) > { > VirtIOBlock *s =3D VIRTIO_BLK(vdev); > =20 > -#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE > if (s->dataplane) { > virtio_blk_data_plane_stop(s->dataplane); > } > -#endif > =20 > /* > * This should cancel pending requests, but can't do nicely until = there > @@ -591,12 +585,10 @@ static void virtio_blk_set_status(VirtIODevice *v= dev, uint8_t status) > VirtIOBlock *s =3D VIRTIO_BLK(vdev); > uint32_t features; > =20 > -#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE > if (s->dataplane && !(status & (VIRTIO_CONFIG_S_DRIVER | > VIRTIO_CONFIG_S_DRIVER_OK))) { > virtio_blk_data_plane_stop(s->dataplane); > } > -#endif > =20 > if (!(status & VIRTIO_CONFIG_S_DRIVER_OK)) { > return; > @@ -691,7 +683,6 @@ static const BlockDevOps virtio_block_ops =3D { > .resize_cb =3D virtio_blk_resize, > }; > =20 > -#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE > /* Disable dataplane thread during live migration since it does not > * update the dirty memory bitmap yet. > */ > @@ -722,16 +713,13 @@ static void virtio_blk_migration_state_changed(No= tifier *notifier, void *data) > } > } > } > -#endif /* CONFIG_VIRTIO_BLK_DATA_PLANE */ > =20 > static void virtio_blk_device_realize(DeviceState *dev, Error **errp) > { > VirtIODevice *vdev =3D VIRTIO_DEVICE(dev); > VirtIOBlock *s =3D VIRTIO_BLK(dev); > VirtIOBlkConf *blk =3D &(s->blk); > -#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE > Error *err =3D NULL; > -#endif > static int virtio_blk_id; > =20 > if (!blk->conf.bs) { > @@ -760,7 +748,6 @@ static void virtio_blk_device_realize(DeviceState *= dev, Error **errp) > =20 > s->vq =3D virtio_add_queue(vdev, 128, virtio_blk_handle_output); > s->complete_request =3D virtio_blk_complete_request; > -#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE > virtio_blk_data_plane_create(vdev, blk, &s->dataplane, &err); > if (err !=3D NULL) { > error_propagate(errp, err); > @@ -769,7 +756,6 @@ static void virtio_blk_device_realize(DeviceState *= dev, Error **errp) > } > s->migration_state_notifier.notify =3D virtio_blk_migration_state_= changed; > add_migration_state_change_notifier(&s->migration_state_notifier); > -#endif > =20 > s->change =3D qemu_add_vm_change_state_handler(virtio_blk_dma_rest= art_cb, s); > register_savevm(dev, "virtio-blk", virtio_blk_id++, 2, > @@ -787,11 +773,9 @@ static void virtio_blk_device_unrealize(DeviceStat= e *dev, Error **errp) > VirtIODevice *vdev =3D VIRTIO_DEVICE(dev); > VirtIOBlock *s =3D VIRTIO_BLK(dev); > =20 > -#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE > remove_migration_state_change_notifier(&s->migration_state_notifie= r); > virtio_blk_data_plane_destroy(s->dataplane); > s->dataplane =3D NULL; > -#endif > qemu_del_vm_change_state_handler(s->change); > unregister_savevm(dev, "virtio-blk", s); > blockdev_mark_auto_del(s->bs); > @@ -816,9 +800,7 @@ static Property virtio_blk_properties[] =3D { > #ifdef __linux__ > DEFINE_PROP_BIT("scsi", VirtIOBlock, blk.scsi, 0, true), > #endif > -#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE > DEFINE_PROP_BIT("x-data-plane", VirtIOBlock, blk.data_plane, 0, fa= lse), > -#endif > DEFINE_PROP_END_OF_LIST(), > }; > =20 > diff --git a/hw/virtio/Makefile.objs b/hw/virtio/Makefile.objs > index ec9e855..d21c397 100644 > --- a/hw/virtio/Makefile.objs > +++ b/hw/virtio/Makefile.objs > @@ -2,7 +2,7 @@ common-obj-y +=3D virtio-rng.o > common-obj-$(CONFIG_VIRTIO_PCI) +=3D virtio-pci.o > common-obj-y +=3D virtio-bus.o > common-obj-y +=3D virtio-mmio.o > -common-obj-$(CONFIG_VIRTIO_BLK_DATA_PLANE) +=3D dataplane/ > +common-obj-$(CONFIG_VIRTIO) +=3D dataplane/ > =20 > obj-y +=3D virtio.o virtio-balloon.o=20 > obj-$(CONFIG_LINUX) +=3D vhost.o vhost-backend.o vhost-user.o > diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-= blk.h > index afb7b8d..f4c5239 100644 > --- a/include/hw/virtio/virtio-blk.h > +++ b/include/hw/virtio/virtio-blk.h > @@ -131,10 +131,8 @@ typedef struct VirtIOBlock { > VMChangeStateEntry *change; > /* Function to push to vq and notify guest */ > void (*complete_request)(struct VirtIOBlockReq *req, unsigned char= status); > -#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE > Notifier migration_state_notifier; > struct VirtIOBlockDataPlane *dataplane; > -#endif > } VirtIOBlock; > =20 > typedef struct MultiReqBuffer { > --=20 > 2.1.0 >=20 >=20 Reviewed-by: Beno=EEt Canet