diff options
author | Asias He <asias@redhat.com> | 2013-03-15 09:45:15 +0800 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2013-05-15 07:47:12 +0200 |
commit | 49b9c599b5a05ef8b557bc5f10872a6093aef771 (patch) | |
tree | da98e4548facb84a8dc1e05d7f77f13dbb3269c9 | |
parent | 3b386a5b72a9efe9cf362410feedd3bfc71ff107 (diff) | |
download | seabios-49b9c599b5a05ef8b557bc5f10872a6093aef771.zip seabios-49b9c599b5a05ef8b557bc5f10872a6093aef771.tar.gz seabios-49b9c599b5a05ef8b557bc5f10872a6093aef771.tar.bz2 |
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 <asias@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 5a7730db57ab0715223421e65b54fb50d6fefe5c)
-rw-r--r-- | src/virtio-scsi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/virtio-scsi.c b/src/virtio-scsi.c index ab74729..bf6c68b 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: |