[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH v3 3/8] qapi: change Netdev and NetLegacy into a f
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-ppc] [PATCH v3 3/8] qapi: change Netdev and NetLegacy into a flat union |
Date: |
Fri, 19 Jun 2015 15:06:32 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Thu, Jun 18, 2015 at 06:43:45PM +0200, Kővágó, Zoltán wrote:
> @@ -713,8 +710,6 @@ int net_init_tap(const NetClientOptions *opts, const char
> *name,
> const char *vhostfdname;
> char ifname[128];
>
> - assert(opts->kind == NET_CLIENT_OPTIONS_KIND_TAP);
> - tap = opts->tap;
...
> @@ -109,14 +109,11 @@ static int net_vde_init(NetClientState *peer, const
> char *model,
> return 0;
> }
>
> -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 == NET_CLIENT_OPTIONS_KIND_VDE);
> - vde = opts->vde;
> + const NetdevVdeOptions *vde = opts;
>
> /* missing optional values have been initialized to "all bits zero" */
> if (net_vde_init(peer, "vde", name, vde->sock, vde->port, vde->group,
...
> @@ -228,16 +228,13 @@ static int net_vhost_check_net(void *opaque, QemuOpts
> *opts, Error **errp)
> return 0;
> }
>
> -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 = opts;
> CharDriverState *chr;
>
> - assert(opts->kind == NET_CLIENT_OPTIONS_KIND_VHOST_USER);
> - vhost_user_opts = opts->vhost_user;
> -
Why drop the assertion?
pgpj0TUeN58uX.pgp
Description: PGP signature