From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: [PATCH] qemu-kvm: Fix assigned device config space Date: Fri, 27 Nov 2009 10:41:05 +0800 Message-ID: <1259289665-17409-1-git-send-email-sheng@linux.intel.com> Cc: kvm@vger.kernel.org, Sheng Yang To: Avi Kivity , Marcelo Tosatti Return-path: Received: from mga03.intel.com ([143.182.124.21]:57801 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753786AbZK0ClH (ORCPT ); Thu, 26 Nov 2009 21:41:07 -0500 Sender: kvm-owner@vger.kernel.org List-ID: 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 --- 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