I found the following mistake after posting...
+int virtio_pci_setup(VDev *vdev)
+{
+    VRing *vr;
+    int rc;
+    uint8_t status;
+    int i = 0;
+
+    vdev->guessed_disk_nature = VIRTIO_GDN_NONE;
+    vdev->cmd_vr_idx = 0;
+
+    if (virtio_reset(vdev)) {
+        return -EIO;
+    }
+
+    status = VPCI_S_ACKNOWLEDGE;
+    if (virtio_pci_set_status(status)) {
+        puts("Virtio-pci device Failed to ACKNOWLEDGE");
+        return -EIO;
+    }
+
+    rc = virtio_pci_read_pci_cap_config();
+    if (rc) {
+        puts("Invalid virtio PCI capabilities");
+        return -EIO;
+    }

Reading the capabilities configuration must be done before writing status to the device.

I have already fixed it for the next version.

Regards,
Jared Rossi

Reply via email to