From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP6be-000506-B6 for qemu-devel@nongnu.org; Wed, 03 Sep 2014 05:12:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XP6bZ-0007dn-8n for qemu-devel@nongnu.org; Wed, 03 Sep 2014 05:11:58 -0400 Date: Wed, 3 Sep 2014 12:15:10 +0300 From: "Michael S. Tsirkin" Message-ID: <20140903091510.GC6792@redhat.com> References: <1409734912-6932-1-git-send-email-mst@redhat.com> <5406DA70.5010605@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5406DA70.5010605@redhat.com> Subject: Re: [Qemu-devel] [PATCH] vhost-scsi: init backend features earlier List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Jason Wang , qemu-devel@nongnu.org, qemu-stable@nongnu.org On Wed, Sep 03, 2014 at 11:08:00AM +0200, Paolo Bonzini wrote: > Il 03/09/2014 11:02, Michael S. Tsirkin ha scritto: > > As vhost core uses backend_features during init, > > clear it earlier to avoid using uninitialized > > memory. > > This is harmless since vhost scsi ignores the result > > anyway, but it avoids valgrind errors. > > > > Cc: qemu-stable@nongnu.org > > Cc: Jason Wang > > Signed-off-by: Michael S. Tsirkin > > --- > > hw/scsi/vhost-scsi.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c > > index ddfe76a..7146e0e 100644 > > --- a/hw/scsi/vhost-scsi.c > > +++ b/hw/scsi/vhost-scsi.c > > @@ -238,6 +238,7 @@ static void vhost_scsi_realize(DeviceState *dev, Error **errp) > > s->dev.nvqs = VHOST_SCSI_VQ_NUM_FIXED + vs->conf.num_queues; > > s->dev.vqs = g_new(struct vhost_virtqueue, s->dev.nvqs); > > s->dev.vq_index = 0; > > + s->dev.backend_features = 0; > > > > ret = vhost_dev_init(&s->dev, (void *)(uintptr_t)vhostfd, > > VHOST_BACKEND_TYPE_KERNEL, true); > > @@ -246,7 +247,6 @@ static void vhost_scsi_realize(DeviceState *dev, Error **errp) > > strerror(-ret)); > > return; > > } > > - s->dev.backend_features = 0; > > > > error_setg(&s->migration_blocker, > > "vhost-scsi does not support migration"); > > > > Acked-by: Paolo Bonzini > > want to keep it in your treee? > > Paolo Yes please.