From patchwork Fri Mar 15 01:45:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 227837 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5C61C2C00D9 for ; Fri, 15 Mar 2013 12:47:22 +1100 (EST) Received: from localhost ([::1]:35451 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGJjs-0004HH-K9 for incoming@patchwork.ozlabs.org; Thu, 14 Mar 2013 21:47:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGJjR-0003zy-O5 for qemu-devel@nongnu.org; Thu, 14 Mar 2013 21:46:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UGJjO-0006ng-PJ for qemu-devel@nongnu.org; Thu, 14 Mar 2013 21:46:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGJjO-0006mv-H4 for qemu-devel@nongnu.org; Thu, 14 Mar 2013 21:46:50 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2F1klZi002462 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 14 Mar 2013 21:46:47 -0400 Received: from hj.localdomain.com (vpn1-113-152.nay.redhat.com [10.66.113.152]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2F1jfiF015840; Thu, 14 Mar 2013 21:46:19 -0400 From: Asias He To: seabios@seabios.org Date: Fri, 15 Mar 2013 09:45:15 +0800 Message-Id: <1363311916-23121-2-git-send-email-asias@redhat.com> In-Reply-To: <1363311916-23121-1-git-send-email-asias@redhat.com> References: <1363311916-23121-1-git-send-email-asias@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: target-devel@vger.kernel.org, kvm@vger.kernel.org, "Michael S. Tsirkin" , qemu-devel@nongnu.org, Nicholas Bellinger , virtualization@lists.linux-foundation.org, Kevin O'Connor , Stefan Hajnoczi , Paolo Bonzini , Asias He Subject: [Qemu-devel] [PATCH 1/2] virtio-scsi: Set _DRIVER_OK flag before scsi target scanning X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Before we start scsi target scanning, we need to set the VIRTIO_CONFIG_S_DRIVER_OK flag so the device can do setup properly. This fix a bug when booting tcm_vhost with seabios. Signed-off-by: Asias He Acked-by: Paolo Bonzini Acked-by: Michael S. Tsirkin --- src/virtio-scsi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/virtio-scsi.c b/src/virtio-scsi.c index 879ddfb..4de1255 100644 --- a/src/virtio-scsi.c +++ b/src/virtio-scsi.c @@ -147,6 +147,9 @@ init_virtio_scsi(struct pci_device *pci) goto fail; } + vp_set_status(ioaddr, VIRTIO_CONFIG_S_ACKNOWLEDGE | + VIRTIO_CONFIG_S_DRIVER | VIRTIO_CONFIG_S_DRIVER_OK); + int i, tot; for (tot = 0, i = 0; i < 256; i++) tot += virtio_scsi_scan_target(pci, ioaddr, vq, i); @@ -154,8 +157,6 @@ init_virtio_scsi(struct pci_device *pci) if (!tot) goto fail; - vp_set_status(ioaddr, VIRTIO_CONFIG_S_ACKNOWLEDGE | - VIRTIO_CONFIG_S_DRIVER | VIRTIO_CONFIG_S_DRIVER_OK); return; fail: