qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 04/49] net: remove NetLegacy struct


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 04/49] net: remove NetLegacy struct
Date: Fri, 4 Sep 2015 15:25:22 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

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 <address@hidden>
> ---
>  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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]