From: Amit Shah Date: Thu, 25 Feb 2010 11:54:44 +0000 (+0530) Subject: virtio-pci: Use DEV_NVECTORS_UNSPECIFIED instead of -1 for virtio-serial X-Git-Tag: TizenStudio_2.0_p2.3~5456 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ab4b38d1f20ecc750a37aed8d5fbb068be9017e4;p=sdk%2Femulator%2Fqemu.git virtio-pci: Use DEV_NVECTORS_UNSPECIFIED instead of -1 for virtio-serial Use the named constant instead of -1. Signed-off-by: Amit Shah Reported-by: "Michael S. Tsirkin" Signed-off-by: Anthony Liguori --- 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,