From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXyUW-0001CY-3u for qemu-devel@nongnu.org; Fri, 04 Sep 2015 17:25:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXyUG-0002Ou-Lp for qemu-devel@nongnu.org; Fri, 04 Sep 2015 17:25:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52896) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXyUG-0002NR-Dy for qemu-devel@nongnu.org; Fri, 04 Sep 2015 17:25:32 -0400 References: From: Eric Blake Message-ID: <55EA0C42.1080503@redhat.com> Date: Fri, 4 Sep 2015 15:25:22 -0600 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="OmJB6qq8BxqtC870o6IhOELpNwEcJxj6J" Subject: Re: [Qemu-devel] [PATCH v2 04/49] net: remove NetLegacy struct List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?S8WRdsOhZ8OzLCBab2x0w6Fu?= , qemu-devel@nongnu.org Cc: Jason Wang , Gerd Hoffmann , Stefan Hajnoczi , Markus Armbruster This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --OmJB6qq8BxqtC870o6IhOELpNwEcJxj6J Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/21/2015 09:37 AM, K=C5=91v=C3=A1g=C3=B3, Zolt=C3=A1n 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. >=20 > Signed-off-by: K=C5=91v=C3=A1g=C3=B3, Zolt=C3=A1n > --- > net/net.c | 42 +++++++++++++++++++++--------------------- > qapi-schema.json | 30 +++++++++--------------------- > 2 files changed, 30 insertions(+), 42 deletions(-) >=20 > 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_CLIEN= T_OPTIONS_KIND_MAX])( > }; > =20 > =20 > -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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --OmJB6qq8BxqtC870o6IhOELpNwEcJxj6J Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJV6gxCAAoJEKeha0olJ0Nqhr8IAIAwFFmWbNBYsW+gTPA44591 iAa4SAwmLQAjyACuTRTgeYgZ4dXsT/YXjVWt8sxgSNw/xO4xMusQEZ8CdZ/Dx8KL ZWskxnfjVpdR65P9sBU8mAHvkCwgkhoHrKNn3q7wzZZq01SHKTTpxNPdjdjFHVm/ XqV6xFIRVmcSt5vnBn1vwhuuCuWeukOlDwWMTRx7lJz370nOBkKBIoO6M0PKh/bH JkTY8Qdsc6fasuezOpu3cpqnPrGriZFUlY6zzDcq+rbjHgGgGU7JEvH+yMMSZ1j5 UTlmHEbe4ULbb6VRiIztMWzXwC1g3zdSWHXP3Rkfr7WCAqKn53myaWAxH6YkTjM= =pDlF -----END PGP SIGNATURE----- --OmJB6qq8BxqtC870o6IhOELpNwEcJxj6J--