diff mbox

qemu-kvm: Fix assigned device config space

Message ID 1259289665-17409-1-git-send-email-sheng@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sheng Yang Nov. 27, 2009, 2:41 a.m. UTC
None
diff mbox

Patch

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;