]> xenbits.xensource.com Git - seabios.git/commitdiff
virtio-scsi: Set _DRIVER_OK flag before scsi target scanning
authorAsias He <asias@redhat.com>
Fri, 15 Mar 2013 01:45:15 +0000 (09:45 +0800)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 17 Mar 2013 14:27:58 +0000 (10:27 -0400)
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>
src/virtio-scsi.c

index 879ddfb9ae1f3ebefd423d3326e3698028c41ede..4de1255fd90c4cc8043859bd17f5b208db2011cd 100644 (file)
@@ -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: