From: Sheng Yang <[email protected]>

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 <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>

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;
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to