From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzTm5-0008Cf-DL for qemu-devel@nongnu.org; Wed, 26 Oct 2016 15:22:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzTm3-0007Y0-0V for qemu-devel@nongnu.org; Wed, 26 Oct 2016 15:22:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42566) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bzTm2-0007Xc-RG for qemu-devel@nongnu.org; Wed, 26 Oct 2016 15:22:06 -0400 From: Eduardo Habkost Date: Wed, 26 Oct 2016 17:21:55 -0200 Message-Id: <1477509718-6969-2-git-send-email-ehabkost@redhat.com> In-Reply-To: <1477509718-6969-1-git-send-email-ehabkost@redhat.com> References: <1477509718-6969-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH 1/4] e1000e: Use regular DEFINE_PROP_ macros for properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Dmitry Fleytman , Jason Wang Instead of hacking custom PropertyInfo structs, use the regular DEFINE_PROP_ macros for the e1000e properties. This also fixes a bug in the disable_vnet_hdr property definition, that was using qdev_prop_uint8 for a bool field. Signed-off-by: Eduardo Habkost --- hw/net/e1000e.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c index 4994e1c..df24e55 100644 --- a/hw/net/e1000e.c +++ b/hw/net/e1000e.c @@ -638,19 +638,11 @@ static const VMStateDescription e1000e_vmstate = { } }; -static PropertyInfo e1000e_prop_disable_vnet, - e1000e_prop_subsys_ven, - e1000e_prop_subsys; - static Property e1000e_properties[] = { DEFINE_NIC_PROPERTIES(E1000EState, conf), - DEFINE_PROP_DEFAULT("disable_vnet_hdr", E1000EState, disable_vnet, false, - e1000e_prop_disable_vnet, bool), - DEFINE_PROP_DEFAULT("subsys_ven", E1000EState, subsys_ven, - PCI_VENDOR_ID_INTEL, - e1000e_prop_subsys_ven, uint16_t), - DEFINE_PROP_DEFAULT("subsys", E1000EState, subsys, 0, - e1000e_prop_subsys, uint16_t), + DEFINE_PROP_BOOL("disable_vnet_hdr", E1000EState, disable_vnet, false), + DEFINE_PROP_UINT16("subsys_ven", E1000EState, subsys_ven, PCI_VENDOR_ID_INTEL), + DEFINE_PROP_UINT16("subsys", E1000EState, subsys, 0), DEFINE_PROP_END_OF_LIST(), }; @@ -673,17 +665,6 @@ static void e1000e_class_init(ObjectClass *class, void *data) dc->vmsd = &e1000e_vmstate; dc->props = e1000e_properties; - e1000e_prop_disable_vnet = qdev_prop_uint8; - e1000e_prop_disable_vnet.description = "Do not use virtio headers, " - "perform SW offloads emulation " - "instead"; - - e1000e_prop_subsys_ven = qdev_prop_uint16; - e1000e_prop_subsys_ven.description = "PCI device Subsystem Vendor ID"; - - e1000e_prop_subsys = qdev_prop_uint16; - e1000e_prop_subsys.description = "PCI device Subsystem ID"; - set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } -- 2.7.4