[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 34/42] virtio-net: move qdev properties into virtio-n
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 34/42] virtio-net: move qdev properties into virtio-net.c |
Date: |
Thu, 11 Jun 2015 14:00:21 +0200 |
From: Shannon Zhao <address@hidden>
As only one place in virtio-net.c uses DEFINE_VIRTIO_NET_FEATURES,
there is no need to expose it. Inline it into virtio-net.c to avoid
wrongly use.
Signed-off-by: Shannon Zhao <address@hidden>
Signed-off-by: Shannon Zhao <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/hw/virtio/virtio-net.h | 24 -----------------------
hw/net/virtio-net.c | 44 ++++++++++++++++++++++++++++++++++++++++--
2 files changed, 42 insertions(+), 26 deletions(-)
diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h
index e0dbb41..c142b42 100644
--- a/include/hw/virtio/virtio-net.h
+++ b/include/hw/virtio/virtio-net.h
@@ -109,30 +109,6 @@ typedef struct VirtIONet {
#define VIRTIO_NET_CTRL_GUEST_OFFLOADS 5
#define VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET 0
-#define DEFINE_VIRTIO_NET_FEATURES(_state, _field) \
- DEFINE_PROP_BIT("any_layout", _state, _field, VIRTIO_F_ANY_LAYOUT,
true), \
- DEFINE_PROP_BIT("csum", _state, _field, VIRTIO_NET_F_CSUM, true), \
- DEFINE_PROP_BIT("guest_csum", _state, _field, VIRTIO_NET_F_GUEST_CSUM,
true), \
- DEFINE_PROP_BIT("gso", _state, _field, VIRTIO_NET_F_GSO, true), \
- DEFINE_PROP_BIT("guest_tso4", _state, _field, VIRTIO_NET_F_GUEST_TSO4,
true), \
- DEFINE_PROP_BIT("guest_tso6", _state, _field, VIRTIO_NET_F_GUEST_TSO6,
true), \
- DEFINE_PROP_BIT("guest_ecn", _state, _field, VIRTIO_NET_F_GUEST_ECN,
true), \
- DEFINE_PROP_BIT("guest_ufo", _state, _field, VIRTIO_NET_F_GUEST_UFO,
true), \
- DEFINE_PROP_BIT("guest_announce", _state, _field,
VIRTIO_NET_F_GUEST_ANNOUNCE, true), \
- DEFINE_PROP_BIT("host_tso4", _state, _field, VIRTIO_NET_F_HOST_TSO4,
true), \
- DEFINE_PROP_BIT("host_tso6", _state, _field, VIRTIO_NET_F_HOST_TSO6,
true), \
- DEFINE_PROP_BIT("host_ecn", _state, _field, VIRTIO_NET_F_HOST_ECN,
true), \
- DEFINE_PROP_BIT("host_ufo", _state, _field, VIRTIO_NET_F_HOST_UFO,
true), \
- DEFINE_PROP_BIT("mrg_rxbuf", _state, _field, VIRTIO_NET_F_MRG_RXBUF,
true), \
- DEFINE_PROP_BIT("status", _state, _field, VIRTIO_NET_F_STATUS, true), \
- DEFINE_PROP_BIT("ctrl_vq", _state, _field, VIRTIO_NET_F_CTRL_VQ,
true), \
- DEFINE_PROP_BIT("ctrl_rx", _state, _field, VIRTIO_NET_F_CTRL_RX,
true), \
- DEFINE_PROP_BIT("ctrl_vlan", _state, _field, VIRTIO_NET_F_CTRL_VLAN,
true), \
- DEFINE_PROP_BIT("ctrl_rx_extra", _state, _field,
VIRTIO_NET_F_CTRL_RX_EXTRA, true), \
- DEFINE_PROP_BIT("ctrl_mac_addr", _state, _field,
VIRTIO_NET_F_CTRL_MAC_ADDR, true), \
- DEFINE_PROP_BIT("ctrl_guest_offloads", _state, _field,
VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, true), \
- DEFINE_PROP_BIT("mq", _state, _field, VIRTIO_NET_F_MQ, false)
-
#define DEFINE_VIRTIO_NET_PROPERTIES(_state, _field)
\
DEFINE_PROP_UINT32("x-txtimer", _state, _field.txtimer,
TX_TIMER_INTERVAL),\
DEFINE_PROP_INT32("x-txburst", _state, _field.txburst, TX_BURST),
\
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 49fa13f..9281aa1 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1707,10 +1707,50 @@ static void virtio_net_instance_init(Object *obj)
}
static Property virtio_net_properties[] = {
- DEFINE_VIRTIO_NET_FEATURES(VirtIONet, host_features),
+ DEFINE_PROP_BIT("any_layout", VirtIONet, host_features,
+ VIRTIO_F_ANY_LAYOUT, true),
+ DEFINE_PROP_BIT("csum", VirtIONet, host_features, VIRTIO_NET_F_CSUM, true),
+ DEFINE_PROP_BIT("guest_csum", VirtIONet, host_features,
+ VIRTIO_NET_F_GUEST_CSUM, true),
+ DEFINE_PROP_BIT("gso", VirtIONet, host_features, VIRTIO_NET_F_GSO, true),
+ DEFINE_PROP_BIT("guest_tso4", VirtIONet, host_features,
+ VIRTIO_NET_F_GUEST_TSO4, true),
+ DEFINE_PROP_BIT("guest_tso6", VirtIONet, host_features,
+ VIRTIO_NET_F_GUEST_TSO6, true),
+ DEFINE_PROP_BIT("guest_ecn", VirtIONet, host_features,
+ VIRTIO_NET_F_GUEST_ECN, true),
+ DEFINE_PROP_BIT("guest_ufo", VirtIONet, host_features,
+ VIRTIO_NET_F_GUEST_UFO, true),
+ DEFINE_PROP_BIT("guest_announce", VirtIONet, host_features,
+ VIRTIO_NET_F_GUEST_ANNOUNCE, true),
+ DEFINE_PROP_BIT("host_tso4", VirtIONet, host_features,
+ VIRTIO_NET_F_HOST_TSO4, true),
+ DEFINE_PROP_BIT("host_tso6", VirtIONet, host_features,
+ VIRTIO_NET_F_HOST_TSO6, true),
+ DEFINE_PROP_BIT("host_ecn", VirtIONet, host_features,
+ VIRTIO_NET_F_HOST_ECN, true),
+ DEFINE_PROP_BIT("host_ufo", VirtIONet, host_features,
+ VIRTIO_NET_F_HOST_UFO, true),
+ DEFINE_PROP_BIT("mrg_rxbuf", VirtIONet, host_features,
+ VIRTIO_NET_F_MRG_RXBUF, true),
+ DEFINE_PROP_BIT("status", VirtIONet, host_features,
+ VIRTIO_NET_F_STATUS, true),
+ DEFINE_PROP_BIT("ctrl_vq", VirtIONet, host_features,
+ VIRTIO_NET_F_CTRL_VQ, true),
+ DEFINE_PROP_BIT("ctrl_rx", VirtIONet, host_features,
+ VIRTIO_NET_F_CTRL_RX, true),
+ DEFINE_PROP_BIT("ctrl_vlan", VirtIONet, host_features,
+ VIRTIO_NET_F_CTRL_VLAN, true),
+ DEFINE_PROP_BIT("ctrl_rx_extra", VirtIONet, host_features,
+ VIRTIO_NET_F_CTRL_RX_EXTRA, true),
+ DEFINE_PROP_BIT("ctrl_mac_addr", VirtIONet, host_features,
+ VIRTIO_NET_F_CTRL_MAC_ADDR, true),
+ DEFINE_PROP_BIT("ctrl_guest_offloads", VirtIONet, host_features,
+ VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, true),
+ DEFINE_PROP_BIT("mq", VirtIONet, host_features, VIRTIO_NET_F_MQ, false),
DEFINE_NIC_PROPERTIES(VirtIONet, nic_conf),
DEFINE_PROP_UINT32("x-txtimer", VirtIONet, net_conf.txtimer,
- TX_TIMER_INTERVAL),
+ TX_TIMER_INTERVAL),
DEFINE_PROP_INT32("x-txburst", VirtIONet, net_conf.txburst, TX_BURST),
DEFINE_PROP_STRING("tx", VirtIONet, net_conf.tx),
DEFINE_PROP_END_OF_LIST(),
--
MST
- [Qemu-devel] [PULL 23/42] virtio-balloon: switch to virtio_add_feature, (continued)
- [Qemu-devel] [PULL 23/42] virtio-balloon: switch to virtio_add_feature, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 24/42] virtio-pci: add struct VirtIOPCIRegion for virtio-1 regions, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 25/42] virtio-pci: add virtio_pci_modern_regions_init(), Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 26/42] virtio-pci: add virtio_pci_modern_region_map(), Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 27/42] virtio-pci: move virtio_pci_add_mem_cap call to virtio_pci_modern_region_map, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 29/42] virtio-pci: drop identical virtio_pci_cap, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 28/42] virtio-pci: move cap type to VirtIOPCIRegion, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 31/42] pci: add PCI_CLASS_INPUT_*, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 30/42] virtio-pci: fill VirtIOPCIRegions early., Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 32/42] virtio-input: core code & base class [pci], Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 34/42] virtio-net: move qdev properties into virtio-net.c,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 33/42] virtio-input: emulated devices [pci], Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 35/42] virtio-net.h: Remove unsed DEFINE_VIRTIO_NET_PROPERTIES, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 36/42] virtio-scsi: move qdev properties into virtio-scsi.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 37/42] virtio-rng: move qdev properties into virtio-rng.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 39/42] virtio-9p-device: move qdev properties into virtio-9p-device.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 38/42] virtio-serial-bus: move qdev properties into virtio-serial-bus.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 40/42] vhost-scsi: move qdev properties into vhost-scsi.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 41/42] i386/acpi-build: more traditional _UID and _HID for PXB root buses, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 42/42] i386/acpi-build: fix PXB workarounds for unsupported BIOSes, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 21/42] virtio-pci: correctly set host notifiers for modern bar, Michael S. Tsirkin, 2015/06/11