summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2014-09-03 12:00:12 +0300
committerMichael S. Tsirkin <mst@redhat.com>2014-09-03 16:41:05 +0300
commit3a1655fc53a2d0375dc0b8cd358405c2cae288e3 (patch)
tree1bf3b229829e5a1a81bb43541c995a60cd1428fd
parentb49ae9138d5cadb47fb868297fbcdac8292fb666 (diff)
downloadqemu-3a1655fc53a2d0375dc0b8cd358405c2cae288e3.zip
vhost-scsi: init backend features earlier
As vhost core can use backend_features during init, clear it earlier to avoid using uninitialized memory. This use would be harmless since vhost scsi ignores the result anyway, but initializing earlier will help prevent valgrind errors, and make scsi and net behave similarly. Cc: qemu-stable@nongnu.org Acked-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--hw/scsi/vhost-scsi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index ddfe76aed0..7146e0ec49 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");