From: Asias He Date: Fri, 15 Mar 2013 01:45:15 +0000 (+0800) Subject: virtio-scsi: Set _DRIVER_OK flag before scsi target scanning X-Git-Tag: rel-1.7.3~32 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=5a7730db57ab0715223421e65b54fb50d6fefe5c;p=seabios.git virtio-scsi: Set _DRIVER_OK flag before scsi target scanning 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 --- 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: