From patchwork Tue Oct 2 19:22:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 188639 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 453BE2C00A0 for ; Wed, 3 Oct 2012 05:22:54 +1000 (EST) Received: from localhost ([::1]:59857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ83Q-00071n-5j for incoming@patchwork.ozlabs.org; Tue, 02 Oct 2012 15:22:52 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ82u-0005n4-GJ for qemu-devel@nongnu.org; Tue, 02 Oct 2012 15:22:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJ82q-0002OI-8D for qemu-devel@nongnu.org; Tue, 02 Oct 2012 15:22:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54282) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ82q-0002OD-0D for qemu-devel@nongnu.org; Tue, 02 Oct 2012 15:22:16 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q92JMFUM002009 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 2 Oct 2012 15:22:15 -0400 Received: from bling.home (ovpn-113-153.phx2.redhat.com [10.3.113.153]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q92JME8m019372; Tue, 2 Oct 2012 15:22:14 -0400 From: Alex Williamson To: mst@redhat.com, qemu-devel@nongnu.org Date: Tue, 02 Oct 2012 13:22:14 -0600 Message-ID: <20121002192213.31100.86057.stgit@bling.home> In-Reply-To: <20121002191609.31100.77382.stgit@bling.home> References: <20121002191609.31100.77382.stgit@bling.home> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: jan.kiszka@siemens.com, alex.williamson@redhat.com Subject: [Qemu-devel] [PATCH 6/6] pci-assign: Use msi_get_message() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org pci-assign only uses a subset of the flexibility msi_get_message() provides, but it's still worthwhile to use it. Signed-off-by: Alex Williamson --- hw/kvm/pci-assign.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/kvm/pci-assign.c b/hw/kvm/pci-assign.c index ddde573..d76b1bd 100644 --- a/hw/kvm/pci-assign.c +++ b/hw/kvm/pci-assign.c @@ -1008,12 +1008,9 @@ static void assigned_dev_update_msi(PCIDevice *pci_dev) } if (ctrl_byte & PCI_MSI_FLAGS_ENABLE) { - uint8_t *pos = pci_dev->config + pci_dev->msi_cap; - MSIMessage msg; + MSIMessage msg = msi_get_message(pci_dev, 0); int virq; - msg.address = pci_get_long(pos + PCI_MSI_ADDRESS_LO); - msg.data = pci_get_word(pos + PCI_MSI_DATA_32); virq = kvm_irqchip_add_msi_route(kvm_state, msg); if (virq < 0) { perror("assigned_dev_update_msi: kvm_irqchip_add_msi_route");