From: Sheng Yang <sheng@linux.intel.com>
To: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org, Sheng Yang <sheng@linux.intel.com>
Subject: [PATCH] qemu-kvm: Fix assigned device config space
Date: Fri, 27 Nov 2009 10:41:05 +0800 [thread overview]
Message-ID: <1259289665-17409-1-git-send-email-sheng@linux.intel.com> (raw)
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@linux.intel.com>
---
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
next reply other threads:[~2009-11-27 2:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-27 2:41 Sheng Yang [this message]
2009-11-30 16:39 ` [PATCH] qemu-kvm: Fix assigned device config space Marcelo Tosatti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1259289665-17409-1-git-send-email-sheng@linux.intel.com \
--to=sheng@linux.intel.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.