From patchwork Thu Feb 25 11:54:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 46235 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 ozlabs.org (Postfix) with ESMTPS id E0C6BB7C48 for ; Thu, 25 Feb 2010 23:03:14 +1100 (EST) Received: from localhost ([127.0.0.1]:54004 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NkcN7-0006vA-2w for incoming@patchwork.ozlabs.org; Thu, 25 Feb 2010 06:59:13 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NkcKK-0006ET-0C for qemu-devel@nongnu.org; Thu, 25 Feb 2010 06:56:20 -0500 Received: from [199.232.76.173] (port=59049 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NkcKJ-0006EG-Cn for qemu-devel@nongnu.org; Thu, 25 Feb 2010 06:56:19 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NkcKF-000114-Jl for qemu-devel@nongnu.org; Thu, 25 Feb 2010 06:56:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2106) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NkcKE-00010R-6W for qemu-devel@nongnu.org; Thu, 25 Feb 2010 06:56:14 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1PBu5v0008434 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 25 Feb 2010 06:56:05 -0500 Received: from localhost (vpn-233-100.phx2.redhat.com [10.3.233.100]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1PBu2D9016108; Thu, 25 Feb 2010 06:56:03 -0500 From: Amit Shah To: qemu-devel@nongnu.org Date: Thu, 25 Feb 2010 17:24:44 +0530 Message-Id: <1267098884-5103-2-git-send-email-amit.shah@redhat.com> In-Reply-To: <1267098884-5103-1-git-send-email-amit.shah@redhat.com> References: <1267098884-5103-1-git-send-email-amit.shah@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Amit Shah , mst@redhat.com Subject: [Qemu-devel] [PATCH 2/2] virtio-pci: Use DEV_NVECTORS_UNSPECIFIED instead of -1 for virtio-serial 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 Use the named constant instead of -1. Signed-off-by: Amit Shah Reported-by: "Michael S. Tsirkin" Acked-by: Michael S. Tsirkin --- hw/virtio-pci.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index bcd40f7..799f664 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -500,8 +500,9 @@ static int virtio_serial_init_pci(PCIDevice *pci_dev) if (!vdev) { return -1; } - vdev->nvectors = proxy->nvectors == -1 ? proxy->max_virtserial_ports + 1 - : proxy->nvectors; + vdev->nvectors = proxy->nvectors == DEV_NVECTORS_UNSPECIFIED + ? proxy->max_virtserial_ports + 1 + : proxy->nvectors; virtio_init_pci(proxy, vdev, PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_DEVICE_ID_VIRTIO_CONSOLE, @@ -585,7 +586,8 @@ static PCIDeviceInfo virtio_info[] = { .init = virtio_serial_init_pci, .exit = virtio_exit_pci, .qdev.props = (Property[]) { - DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, -1), + DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, + DEV_NVECTORS_UNSPECIFIED), DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0), DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features), DEFINE_PROP_UINT32("max_ports", VirtIOPCIProxy, max_virtserial_ports,