]> git.proxmox.com Git - mirror_qemu.git/commit - net/slirp.c
qapi: Change Netdev into a flat union
authorEric Blake <eblake@redhat.com>
Thu, 14 Jul 2016 03:50:23 +0000 (21:50 -0600)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 19 Jul 2016 18:18:02 +0000 (20:18 +0200)
commitf394b2e20d9a666fb194fb692179a0eeaca5daea
tree4d01037fde0500c9bfa746ef852ae32e04b7dbb8
parentfaecd40a592dbd8f12d2b3b4783fa05ae22364ea
qapi: Change Netdev into a flat union

This is a mostly-mechanical conversion that creates a new flat
union 'Netdev' QAPI type that covers all the branches of the
former 'NetClientOptions' simple union, where the branches are
now listed in a new 'NetClientDriver' enum rather than generated
from the simple union.  The existence of a flat union has no
change to the command line syntax accepted for new code, and
will make it possible for a future patch to switch the QMP
command to parse a boxed union for no change to valid QMP; but
it does have some ripple effect on the C code when dealing with
the new types.

While making the conversion, note that the 'NetLegacy' type
remains unchanged: it applies only to legacy command line options,
and will not be ported to QMP, so it should remain a wrapper
around a simple union; to avoid confusion, the type named
'NetClientOptions' is now gone, and we introduce 'NetLegacyOptions'
in its place.  Then, in the C code, we convert from NetLegacy to
Netdev as soon as possible, so that the bulk of the net stack
only has to deal with one QAPI type, not two.  Note that since
the old legacy code always rejected 'hubport', we can just omit
that branch from the new 'NetLegacyOptions' simple union.

Based on an idea originally by Zoltán Kővágó <DirtY.iCE.hu@gmail.com>:
Message-Id: <01a527fbf1a5de880091f98cf011616a78adeeee.1441627176.git.DirtY.iCE.hu@gmail.com>
although the sed script in that patch no longer applies due to
other changes in the tree since then, and I also did some manual
cleanups (such as fixing whitespace to keep checkpatch happy).

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1468468228-27827-13-git-send-email-eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Fixup from Eric squashed in]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
48 files changed:
hw/arm/musicpal.c
hw/core/qdev-properties-system.c
hw/net/allwinner_emac.c
hw/net/cadence_gem.c
hw/net/dp8393x.c
hw/net/e1000.c
hw/net/e1000e.c
hw/net/eepro100.c
hw/net/etraxfs_eth.c
hw/net/fsl_etsec/etsec.c
hw/net/imx_fec.c
hw/net/lan9118.c
hw/net/lance.c
hw/net/mcf_fec.c
hw/net/milkymist-minimac2.c
hw/net/mipsnet.c
hw/net/ne2000-isa.c
hw/net/ne2000.c
hw/net/opencores_eth.c
hw/net/pcnet-pci.c
hw/net/rocker/rocker_fp.c
hw/net/rtl8139.c
hw/net/smc91c111.c
hw/net/spapr_llan.c
hw/net/stellaris_enet.c
hw/net/vhost_net.c
hw/net/virtio-net.c
hw/net/vmxnet3.c
hw/net/xen_nic.c
hw/net/xgmac.c
hw/net/xilinx_axienet.c
hw/net/xilinx_ethlite.c
hw/usb/dev-network.c
include/net/net.h
monitor.c
net/dump.c
net/filter.c
net/hub.c
net/l2tpv3.c
net/net.c
net/netmap.c
net/slirp.c
net/socket.c
net/tap-win32.c
net/tap.c
net/vde.c
net/vhost-user.c
qapi-schema.json