From nobody Sat Apr 27 00:00:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=nutanix.com ARC-Seal: i=1; a=rsa-sha256; t=1560300854; cv=none; d=zoho.com; s=zohoarc; b=okNW52+5gh6JCXx2paLCXgoOU2iYjNx5cTDZVbIvYzwGtxGhRtGBjpuT6xDdxhc2Vh2fkaBelXQZu66/Ez/iY4YOi+gxJnxIilGYp2C/ZGQtRoQlBQ94+z5IUz5mY4qT0hB0ASZU2KJhyRm5dghKWiuzxwNbQ5NPveEdPRe15dc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560300854; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=2F7vcljhXATEWQVvudn1482QT/TNqRxRhXZCZi5CsYk=; b=jds3oYXyznhd0buAZPc9X4xYNNhoBi6Rszj4JliSlP6QTTWPob1vOzMowAt3Lh5P6xWbbtomgckm4pmINairCPD3YzD5+xi8ZmPwjRsm9Dn3s4I2G2VPomPTqNx5A28IXdQYPRZKjkNMYInacXtcHVoQvH8UBIfk/BprECCiTSA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560300854369967.466236332375; Tue, 11 Jun 2019 17:54:14 -0700 (PDT) Received: from localhost ([::1]:55996 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1harWk-0007Ez-2K for importer@patchew.org; Tue, 11 Jun 2019 20:54:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46849) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1harUf-0006EY-PZ for qemu-devel@nongnu.org; Tue, 11 Jun 2019 20:52:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1harMb-0004xP-6s for qemu-devel@nongnu.org; Tue, 11 Jun 2019 20:43:42 -0400 Received: from [192.146.154.1] (port=33243 helo=mcp01.nutanix.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1harMb-0004wx-1V for qemu-devel@nongnu.org; Tue, 11 Jun 2019 20:43:41 -0400 Received: from raphael-norwitz.dev.nutanix.com (unknown [10.41.25.241]) by mcp01.nutanix.com (Postfix) with ESMTP id 849E1100941A; Wed, 12 Jun 2019 00:35:20 +0000 (UTC) From: Raphael Norwitz To: qemu-devel@nongnu.org Date: Tue, 11 Jun 2019 17:35:17 -0700 Message-Id: <1560299717-177734-1-git-send-email-raphael.norwitz@nutanix.com> X-Mailer: git-send-email 1.9.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 192.146.154.1 Subject: [Qemu-devel] [PATCH] vhost-user-scsi: prevent using uninitialized vqs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Paolo Bonzini , "Michael S. Tsirkin" , Raphael Norwitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Of the 3 virtqueues, seabios only sets cmd, leaving ctrl and event without a physical address. This can cause vhost_verify_ring_part_mapping to return ENOMEM, causing the following logs: qemu-system-x86_64: Unable to map available ring for ring 0 qemu-system-x86_64: Verify ring failure on region 0 The qemu commit e6cc11d64fc998c11a4dfcde8fda3fc33a74d844 has already resolved the issue for vhost scsi devices but the fix was never applied to vhost-user scsi devices. Signed-off-by: Raphael Norwitz Reviewed-by: Stefan Hajnoczi --- hw/scsi/vhost-user-scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c index a9fd8ea..e4aae95 100644 --- a/hw/scsi/vhost-user-scsi.c +++ b/hw/scsi/vhost-user-scsi.c @@ -91,7 +91,7 @@ static void vhost_user_scsi_realize(DeviceState *dev, Err= or **errp) } =20 vsc->dev.nvqs =3D 2 + vs->conf.num_queues; - vsc->dev.vqs =3D g_new(struct vhost_virtqueue, vsc->dev.nvqs); + vsc->dev.vqs =3D g_new0(struct vhost_virtqueue, vsc->dev.nvqs); vsc->dev.vq_index =3D 0; vsc->dev.backend_features =3D 0; vqs =3D vsc->dev.vqs; --=20 1.9.4