From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5wwL-000371-VF for qemu-devel@nongnu.org; Fri, 19 Jun 2015 10:06:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5wwI-00045m-Lr for qemu-devel@nongnu.org; Fri, 19 Jun 2015 10:06:41 -0400 Date: Fri, 19 Jun 2015 15:06:32 +0100 From: Stefan Hajnoczi Message-ID: <20150619140632.GA18654@stefanha-thinkpad.redhat.com> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jI8keyz6grp/JLjh" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v3 3/8] qapi: change Netdev and NetLegacy into a flat union List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?B?S8WRdsOhZ8OzLCBab2x0w6Fu?= Cc: Peter Maydell , "Michael S. Tsirkin" , Jason Wang , qemu-devel@nongnu.org, Vincenzo Maffione , Alexander Graf , Max Filippov , Gerd Hoffmann , Dmitry Fleytman , "Edgar E. Iglesias" , Rob Herring , Markus Armbruster , Scott Feldman , Jiri Pirko , Jan Kiszka , Giuseppe Lettieri , Luiz Capitulino , Luigi Rizzo , David Gibson , Peter Crosthwaite , Michael Walle , "open list:sPAPR (pseries)" --jI8keyz6grp/JLjh Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 18, 2015 at 06:43:45PM +0200, K=C5=91v=C3=A1g=C3=B3, Zolt=C3=A1= n wrote: > @@ -713,8 +710,6 @@ int net_init_tap(const NetClientOptions *opts, const = char *name, > const char *vhostfdname; > char ifname[128]; > =20 > - assert(opts->kind =3D=3D NET_CLIENT_OPTIONS_KIND_TAP); > - tap =3D opts->tap; =2E.. > @@ -109,14 +109,11 @@ static int net_vde_init(NetClientState *peer, const= char *model, > return 0; > } > =20 > -int net_init_vde(const NetClientOptions *opts, const char *name, > +int net_init_vde(const void *opts, const char *name, > NetClientState *peer, Error **errp) > { > /* FIXME error_setg(errp, ...) on failure */ > - const NetdevVdeOptions *vde; > - > - assert(opts->kind =3D=3D NET_CLIENT_OPTIONS_KIND_VDE); > - vde =3D opts->vde; > + const NetdevVdeOptions *vde =3D opts; > =20 > /* missing optional values have been initialized to "all bits zero" = */ > if (net_vde_init(peer, "vde", name, vde->sock, vde->port, vde->group, =2E.. > @@ -228,16 +228,13 @@ static int net_vhost_check_net(void *opaque, QemuOp= ts *opts, Error **errp) > return 0; > } > =20 > -int net_init_vhost_user(const NetClientOptions *opts, const char *name, > +int net_init_vhost_user(const void *opts, const char *name, > NetClientState *peer, Error **errp) > { > uint32_t queues; > - const NetdevVhostUserOptions *vhost_user_opts; > + const NetdevVhostUserOptions *vhost_user_opts =3D opts; > CharDriverState *chr; > =20 > - assert(opts->kind =3D=3D NET_CLIENT_OPTIONS_KIND_VHOST_USER); > - vhost_user_opts =3D opts->vhost_user; > - Why drop the assertion? --jI8keyz6grp/JLjh Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVhCHoAAoJEJykq7OBq3PIxp0IAMYzwBsLr1Q07tgOkE5uDyOO ssGYdVdYAYWMh+vNcvZRHsGvc5hJmWkrpSjeXAHhYVhI6gUCrEggP/gREzCTJ7T3 skkluLwSOwToJfAUrLJVGc2EFMH5JAFmRiZr0zf3KLAXTFwsV8KWs9w+SBMgvTO1 s4nqk5wE2El722nj5sy63iNx9E4xehEIa62pMyYie2ysSExPnOBifIdkicHYz7OZ OkCjK1j9MJqS4YmX1jHEgSHmtL33FnAg0au+0ZxhCdcqHZOPD929idxDi4epRpL2 oQmS34IzbUADmyflpKFgcNyX7HQwGd+VIfLj/xwUg6XOI0InnqJkvlXvUcguZK4= =vLI9 -----END PGP SIGNATURE----- --jI8keyz6grp/JLjh--