qemu-kvm: Fix assigned device config space
PATCH 1/1 qemu-kvm: Fix assigned device config space
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]>
--- hw/device-assignment.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
hw/device-assignment.c +1 -1
@@ -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;
Signature · 1 line
1.5.4.5
Marcelo Tosatti
AppliedQuoted 5 lines · Sheng Yang
The new
pci_dev->dev.configis auint_8pointer, butget_real_device()still usingsizeof(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...
Applied, thanks.