qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Kővágó Zoltán" <dirty.ice.hu@gmail.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	qemu-devel@nongnu.org, Vincenzo Maffione <v.maffione@gmail.com>,
	Alexander Graf <agraf@suse.de>, Max Filippov <jcmvbkbc@gmail.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Dmitry Fleytman <dmitry@daynix.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Rob Herring <robh@kernel.org>,
	Markus Armbruster <armbru@redhat.com>,
	Scott Feldman <sfeldma@gmail.com>, Jiri Pirko <jiri@resnulli.us>,
	Jan Kiszka <jan.kiszka@web.de>,
	Giuseppe Lettieri <g.lettieri@iet.unipi.it>,
	Luiz Capitulino <lcapitulino@redhat.com>,
	Luigi Rizzo <rizzo@iet.unipi.it>,
	David Gibson <david@gibson.dropbear.id.au>,
	Peter Crosthwaite <peter.crosthwaite@xilinx.com>,
	Michael Walle <michael@walle.cc>,
	"open list:sPAPR (pseries)" <qemu-ppc@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v3 3/8] qapi: change Netdev and NetLegacy into a flat union
Date: Fri, 19 Jun 2015 16:56:49 +0200	[thread overview]
Message-ID: <55842DB1.40602@gmail.com> (raw)
In-Reply-To: <20150619140632.GA18654@stefanha-thinkpad.redhat.com>

2015-06-19 16:06 keltezéssel, Stefan Hajnoczi írta:
> 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?
>
Because otherwise you would have to make a version that gets a Netdev 
and an other that gets Netlegacy, because the common NetClientOptions is 
gone. Unless, of course, I'm overlooking something.

(I've actually tried to simply pass the corect type as arguments, like 
net_init_chost_user(const NetdevVhostUserOptions *opts, ...; but then 
net_client_init_fun in net.c becomes problematic. Maybe replacing it 
with a giant swicth-case would be better?)

  reply	other threads:[~2015-06-19 14:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-18 16:43 [Qemu-devel] [PATCH v3 0/8] -audiodev option Kővágó, Zoltán
2015-06-18 16:43 ` [Qemu-devel] [PATCH v3 1/8] qapi: support implicit structs in OptsVisitor Kővágó, Zoltán
2015-06-18 16:43 ` [Qemu-devel] [PATCH v3 2/8] qapi: convert NumaOptions into a flat union Kővágó, Zoltán
2015-06-18 16:43 ` [Qemu-devel] [PATCH v3 3/8] qapi: change Netdev and NetLegacy " Kővágó, Zoltán
2015-06-19 14:06   ` Stefan Hajnoczi
2015-06-19 14:56     ` Kővágó Zoltán [this message]
2015-06-18 16:43 ` [Qemu-devel] [PATCH v3 4/8] qapi: qapi for audio backends Kővágó, Zoltán
2015-06-18 16:43 ` [Qemu-devel] [PATCH v3 5/8] qapi: support nested structs in OptsVisitor Kővágó, Zoltán
2015-06-18 17:15   ` Laszlo Ersek
2015-06-18 17:35     ` Kővágó Zoltán
2015-06-18 16:43 ` [Qemu-devel] [PATCH v3 6/8] opts: produce valid command line in qemu_opts_print Kővágó, Zoltán
2015-06-18 16:43 ` [Qemu-devel] [PATCH v3 7/8] audio: use qapi AudioFormat instead of audfmt_e Kővágó, Zoltán
2015-06-18 16:43 ` [Qemu-devel] [PATCH v3 8/8] audio: -audiodev command line option Kővágó, Zoltán

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55842DB1.40602@gmail.com \
    --to=dirty.ice.hu@gmail.com \
    --cc=agraf@suse.de \
    --cc=armbru@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=dmitry@daynix.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=g.lettieri@iet.unipi.it \
    --cc=jan.kiszka@web.de \
    --cc=jasowang@redhat.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=kraxel@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=michael@walle.cc \
    --cc=mst@redhat.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rizzo@iet.unipi.it \
    --cc=robh@kernel.org \
    --cc=sfeldma@gmail.com \
    --cc=stefanha@redhat.com \
    --cc=v.maffione@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).