On 08/21/2015 09:37 AM, Kővágó, Zoltán wrote: > NetLegacy is just Netdev with some extra fields (name, vlan) and an > optional id. This patch merges the two structs, and net_client_init1 > got some extra checks to make sure only accept valid -netdev command > lines. This is some extra work, but allows us to uniformly manage both > legacy -net and non-legacy -netdev in code. > > Signed-off-by: Kővágó, Zoltán <dirty.ice...@gmail.com> > --- > net/net.c | 42 +++++++++++++++++++++--------------------- > qapi-schema.json | 30 +++++++++--------------------- > 2 files changed, 30 insertions(+), 42 deletions(-) > > diff --git a/net/net.c b/net/net.c > index 28a5597..10fbaca 100644 > --- a/net/net.c > +++ b/net/net.c > @@ -911,17 +911,29 @@ static int (* const > net_client_init_fun[NET_CLIENT_OPTIONS_KIND_MAX])( > }; > > > -static int net_client_init1(const void *object, int is_netdev, Error **errp) > +static int net_client_init1(const Netdev *netdev, int is_netdev, Error > **errp)
I'm really hoping to fix QMP netdev_add to use a flat union type from the get-go rather than its current type-unsafe gunk. It may be safer from the point of view of this patch to wait for that to land first (among others, we'll want: https://lists.gnu.org/archive/html/qemu-devel/2015-08/msg02093.html) So I'm reluctant to review this right now, if it will just add churn into getting that part done correctly. Don't throw this away just yet, because I'm not sure if QMP netdev_add needs to interact with command-line NetdevLegacy. But be aware that it is still an area under active debate/development. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature