From patchwork Fri Nov 27 02:41:05 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 63257 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAR2ff80023906 for ; Fri, 27 Nov 2009 02:41:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753725AbZK0ClM (ORCPT ); Thu, 26 Nov 2009 21:41:12 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753789AbZK0ClK (ORCPT ); Thu, 26 Nov 2009 21:41:10 -0500 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 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 26 Nov 2009 18:41:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.47,298,1257148800"; d="scan'208";a="216171268" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.36.163]) by azsmga001.ch.intel.com with ESMTP; 26 Nov 2009 18:41:12 -0800 Received: from yasker by syang10-desktop with local (Exim 4.69) (envelope-from ) id 1NDqle-0004XH-Gi; Fri, 27 Nov 2009 10:41:06 +0800 From: Sheng Yang To: Avi Kivity , Marcelo Tosatti Cc: kvm@vger.kernel.org, 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> X-Mailer: git-send-email 1.6.3.3 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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;