Message ID | 1468814749-14510-1-git-send-email-caoj.fnst@cn.fujitsu.com |
---|---|
State | New |
Headers | show |
On Mon, 07/18 12:05, Cao jin wrote: > No need duplicate the judgment, there is one in function entry. > > Cc: Stefan Hajnoczi <stefanha@redhat.com> > Cc: Kevin Wolf <kwolf@redhat.com> > Cc: Max Reitz <mreitz@redhat.com> > Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> > --- > hw/block/dataplane/virtio-blk.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c > index 54b9ac1..704a763 100644 > --- a/hw/block/dataplane/virtio-blk.c > +++ b/hw/block/dataplane/virtio-blk.c > @@ -112,10 +112,8 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *conf, > s->vdev = vdev; > s->conf = conf; > > - if (conf->iothread) { > - s->iothread = conf->iothread; > - object_ref(OBJECT(s->iothread)); > - } > + s->iothread = conf->iothread; > + object_ref(OBJECT(s->iothread)); > s->ctx = iothread_get_aio_context(s->iothread); > s->bh = aio_bh_new(s->ctx, notify_guest_bh, s); > s->batch_notify_vqs = bitmap_new(conf->num_queues); > -- > 2.1.0 > > > > Reviewed-by: Fam Zheng <famz@redhat.com>
On Mon, Jul 18, 2016 at 12:05:49PM +0800, Cao jin wrote: > No need duplicate the judgment, there is one in function entry. > > Cc: Stefan Hajnoczi <stefanha@redhat.com> > Cc: Kevin Wolf <kwolf@redhat.com> > Cc: Max Reitz <mreitz@redhat.com> > Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> > --- > hw/block/dataplane/virtio-blk.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) Thanks, applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan
diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index 54b9ac1..704a763 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/virtio-blk.c @@ -112,10 +112,8 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *conf, s->vdev = vdev; s->conf = conf; - if (conf->iothread) { - s->iothread = conf->iothread; - object_ref(OBJECT(s->iothread)); - } + s->iothread = conf->iothread; + object_ref(OBJECT(s->iothread)); s->ctx = iothread_get_aio_context(s->iothread); s->bh = aio_bh_new(s->ctx, notify_guest_bh, s); s->batch_notify_vqs = bitmap_new(conf->num_queues);
No need duplicate the judgment, there is one in function entry. Cc: Stefan Hajnoczi <stefanha@redhat.com> Cc: Kevin Wolf <kwolf@redhat.com> Cc: Max Reitz <mreitz@redhat.com> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> --- hw/block/dataplane/virtio-blk.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)