[PATCH] qemu-kvm: Fix assigned device config space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The new pci_dev->dev.config is a uint_8 pointer, but get_real_device()
still using sizeof(pci_dev->dev.config) to fill the configuration space,
which lost most of information.

Spot the issue when INTx cannot work again after previous fix...

Signed-off-by: Sheng Yang <sheng@xxxxxxxxxxxxxxx>
---
 hw/device-assignment.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/device-assignment.c b/hw/device-assignment.c
index 549ae67..13a86bb 100644
--- a/hw/device-assignment.c
+++ b/hw/device-assignment.c
@@ -481,7 +481,7 @@ static int get_real_device(AssignedDevice *pci_dev, uint8_t r_bus,
     }
     dev->config_fd = fd;
 again:
-    r = read(fd, pci_dev->dev.config, sizeof(pci_dev->dev.config));
+    r = read(fd, pci_dev->dev.config, pci_config_size(&pci_dev->dev));
     if (r < 0) {
         if (errno == EINTR || errno == EAGAIN)
             goto again;
-- 
1.5.4.5

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux