From patchwork Wed Aug 12 10:47:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 31182 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 45713B6F31 for ; Wed, 12 Aug 2009 20:49:50 +1000 (EST) Received: from localhost ([127.0.0.1]:38137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbBOm-0000p3-VG for incoming@patchwork.ozlabs.org; Wed, 12 Aug 2009 06:49:41 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MbBMm-0008KL-3E for qemu-devel@nongnu.org; Wed, 12 Aug 2009 06:47:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MbBMh-0008JA-5M for qemu-devel@nongnu.org; Wed, 12 Aug 2009 06:47:35 -0400 Received: from [199.232.76.173] (port=52975 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbBMg-0008J4-Rc for qemu-devel@nongnu.org; Wed, 12 Aug 2009 06:47:30 -0400 Received: from mx2.redhat.com ([66.187.237.31]:50746) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MbBMf-0007Mu-Sh for qemu-devel@nongnu.org; Wed, 12 Aug 2009 06:47:30 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7CAlTI6018326 for ; Wed, 12 Aug 2009 06:47:29 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n7CAlSsT016343; Wed, 12 Aug 2009 06:47:28 -0400 Received: from zweiblum.home.kraxel.org (vpn2-8-87.ams2.redhat.com [10.36.8.87]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with SMTP id n7CAlQkU003306; Wed, 12 Aug 2009 06:47:27 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id AC2B1700D2; Wed, 12 Aug 2009 12:47:24 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 12 Aug 2009 12:47:24 +0200 Message-Id: <1250074044-24667-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH] virtio-blk: add msi support. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Gerd Hoffmann --- hw/pc.c | 4 ++++ hw/virtio-pci.c | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index cc6e7e8..cccb865 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -1487,6 +1487,10 @@ static QEMUMachine pc_machine_v0_10 = { .driver = "virtio-net-pci", .property = "vectors", .value = stringify(0), + },{ + .driver = "virtio-blk-pci", + .property = "vectors", + .value = stringify(0), }, { /* end of list */ } }, diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index 8b57dfc..e95700a 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -437,10 +437,13 @@ static void virtio_blk_init_pci(PCIDevice *pci_dev) fprintf(stderr, "drive property not set\n"); } vdev = virtio_blk_init(&pci_dev->qdev, proxy->dinfo); + vdev->nvectors = proxy->nvectors; virtio_init_pci(proxy, vdev, PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_DEVICE_ID_VIRTIO_BLOCK, proxy->class_code, 0x00); + /* make the actual value visible */ + proxy->nvectors = vdev->nvectors; } static void virtio_console_init_pci(PCIDevice *pci_dev) @@ -504,6 +507,7 @@ static PCIDeviceInfo virtio_info[] = { .qdev.props = (Property[]) { DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0), DEFINE_PROP_DRIVE("drive", VirtIOPCIProxy, dinfo), + DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2), DEFINE_PROP_END_OF_LIST(), }, },{ @@ -511,8 +515,8 @@ static PCIDeviceInfo virtio_info[] = { .qdev.size = sizeof(VirtIOPCIProxy), .init = virtio_net_init_pci, .qdev.props = (Property[]) { - DEFINE_PROP_HEX32("vectors", VirtIOPCIProxy, nvectors, - NIC_NVECTORS_UNSPECIFIED), + DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, + NIC_NVECTORS_UNSPECIFIED), DEFINE_PROP_END_OF_LIST(), }, },{