From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NkcTV-0001Bt-Qs for qemu-devel@nongnu.org; Thu, 25 Feb 2010 07:05:49 -0500 Received: from [199.232.76.173] (port=38196 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NkcTV-0001Be-EZ for qemu-devel@nongnu.org; Thu, 25 Feb 2010 07:05:49 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NkcTT-0001at-Ro for qemu-devel@nongnu.org; Thu, 25 Feb 2010 07:05:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:65269) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NkcTT-0001ap-GL for qemu-devel@nongnu.org; Thu, 25 Feb 2010 07:05:47 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1PC5jjq031092 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 25 Feb 2010 07:05:45 -0500 Date: Thu, 25 Feb 2010 14:02:31 +0200 From: "Michael S. Tsirkin" Message-ID: <20100225120231.GF9116@redhat.com> References: <1267098884-5103-1-git-send-email-amit.shah@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1267098884-5103-1-git-send-email-amit.shah@redhat.com> Subject: [Qemu-devel] Re: [PATCH 1/2] qdev: Add a DEV_NVECTORS_UNSPECIFIED enum for unspecified nr of MSI vectors List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: qemu-devel@nongnu.org On Thu, Feb 25, 2010 at 05:24:43PM +0530, Amit Shah wrote: > net.c used a constant to signify no MSI vectors were specified. Extend > that to all qdev devices. > > Signed-off-by: Amit Shah > Reported-by: "Michael S. Tsirkin" Acked-by: Michael S. Tsirkin > --- > hw/qdev.c | 2 +- > hw/qdev.h | 4 ++++ > net.c | 6 ++++-- > net.h | 3 --- > 4 files changed, 9 insertions(+), 6 deletions(-) > > diff --git a/hw/qdev.c b/hw/qdev.c > index d0052d4..b634890 100644 > --- a/hw/qdev.c > +++ b/hw/qdev.c > @@ -387,7 +387,7 @@ void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd) > qdev_prop_set_vlan(dev, "vlan", nd->vlan); > if (nd->netdev) > qdev_prop_set_netdev(dev, "netdev", nd->netdev); > - if (nd->nvectors != NIC_NVECTORS_UNSPECIFIED && > + if (nd->nvectors != DEV_NVECTORS_UNSPECIFIED && > qdev_prop_exists(dev, "vectors")) { > qdev_prop_set_uint32(dev, "vectors", nd->nvectors); > } > diff --git a/hw/qdev.h b/hw/qdev.h > index 0eb45b0..adfcf79 100644 > --- a/hw/qdev.h > +++ b/hw/qdev.h > @@ -24,6 +24,10 @@ enum DevState { > DEV_STATE_INITIALIZED, > }; > > +enum { > + DEV_NVECTORS_UNSPECIFIED = -1, > +}; > + > /* This structure should not be accessed directly. We declare it here > so that it can be embedded in individual device state structures. */ > struct DeviceState { > diff --git a/net.c b/net.c > index a1bf49f..dd3962e 100644 > --- a/net.c > +++ b/net.c > @@ -35,6 +35,7 @@ > #include "sysemu.h" > #include "qemu-common.h" > #include "qemu_socket.h" > +#include "hw/qdev.h" > > static QTAILQ_HEAD(, VLANState) vlans; > static QTAILQ_HEAD(, VLANClientState) non_vlan_clients; > @@ -804,8 +805,9 @@ static int net_init_nic(QemuOpts *opts, > return -1; > } > > - nd->nvectors = qemu_opt_get_number(opts, "vectors", NIC_NVECTORS_UNSPECIFIED); > - if (nd->nvectors != NIC_NVECTORS_UNSPECIFIED && > + nd->nvectors = qemu_opt_get_number(opts, "vectors", > + DEV_NVECTORS_UNSPECIFIED); > + if (nd->nvectors != DEV_NVECTORS_UNSPECIFIED && > (nd->nvectors < 0 || nd->nvectors > 0x7ffffff)) { > qemu_error("invalid # of vectors: %d\n", nd->nvectors); > return -1; > diff --git a/net.h b/net.h > index 33a1eaf..16f19c5 100644 > --- a/net.h > +++ b/net.h > @@ -123,9 +123,6 @@ void do_set_link(Monitor *mon, const QDict *qdict); > /* NIC info */ > > #define MAX_NICS 8 > -enum { > - NIC_NVECTORS_UNSPECIFIED = -1 > -}; > > struct NICInfo { > uint8_t macaddr[6]; > -- > 1.6.2.5 > >