From: Amit Shah <amit.shah@redhat.com>
To: qemu-devel@nongnu.org
Cc: Amit Shah <amit.shah@redhat.com>, mst@redhat.com
Subject: [Qemu-devel] [PATCH 2/2] virtio-pci: Use DEV_NVECTORS_UNSPECIFIED instead of -1 for virtio-serial
Date: Thu, 25 Feb 2010 17:24:44 +0530 [thread overview]
Message-ID: <1267098884-5103-2-git-send-email-amit.shah@redhat.com> (raw)
In-Reply-To: <1267098884-5103-1-git-send-email-amit.shah@redhat.com>
Use the named constant instead of -1.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reported-by: "Michael S. Tsirkin" <mst@redhat.com>
---
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,
--
1.6.2.5
next prev parent reply other threads:[~2010-02-25 11:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-25 11:54 [Qemu-devel] [PATCH 1/2] qdev: Add a DEV_NVECTORS_UNSPECIFIED enum for unspecified nr of MSI vectors Amit Shah
2010-02-25 11:54 ` Amit Shah [this message]
2010-02-25 12:04 ` [Qemu-devel] Re: [PATCH 2/2] virtio-pci: Use DEV_NVECTORS_UNSPECIFIED instead of -1 for virtio-serial Michael S. Tsirkin
2010-02-25 12:02 ` [Qemu-devel] Re: [PATCH 1/2] qdev: Add a DEV_NVECTORS_UNSPECIFIED enum for unspecified nr of MSI vectors Michael S. Tsirkin
2010-03-09 14:25 ` [Qemu-devel] " Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1267098884-5103-2-git-send-email-amit.shah@redhat.com \
--to=amit.shah@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).