Re: [Qemu-devel] [PATCH 01/16] net: Add a hub net client

2012-07-23 Thread Blue Swirl
On Mon, Jul 23, 2012 at 4:33 PM, Andreas Färber wrote: > Am 23.07.2012 17:23, schrieb Stefan Hajnoczi: >> On Mon, Jul 23, 2012 at 4:16 PM, Laszlo Ersek wrote: >>> On 07/23/12 16:52, Stefan Hajnoczi wrote: On Mon, Jul 23, 2012 at 3:05 PM, Laszlo Ersek wrote: >>> > The idea is, rather tha

Re: [Qemu-devel] [PATCH 01/16] net: Add a hub net client

2012-07-23 Thread Markus Armbruster
Andreas Färber writes: > Hm, I'm not so much into those documents [cc'ing Blue], but we used to > be stricter about ANSI C some years back (which iirc forbids > non-constant expressions in initializers?). FWIW we have since switched It doesn't, except when the variable has static storage duratio

Re: [Qemu-devel] [PATCH 01/16] net: Add a hub net client

2012-07-23 Thread Andreas Färber
Am 23.07.2012 17:23, schrieb Stefan Hajnoczi: > On Mon, Jul 23, 2012 at 4:16 PM, Laszlo Ersek wrote: >> On 07/23/12 16:52, Stefan Hajnoczi wrote: >>> On Mon, Jul 23, 2012 at 3:05 PM, Laszlo Ersek wrote: >> The idea is, rather than unsigned int id = hub->num_ports++; i

Re: [Qemu-devel] [PATCH 01/16] net: Add a hub net client

2012-07-23 Thread Stefan Hajnoczi
On Mon, Jul 23, 2012 at 4:16 PM, Laszlo Ersek wrote: > On 07/23/12 16:52, Stefan Hajnoczi wrote: >> On Mon, Jul 23, 2012 at 3:05 PM, Laszlo Ersek wrote: > >>> The idea is, rather than >>> >>> unsigned int id = hub->num_ports++; >>> >>> it should say >>> >>> unsigned int id; >>> /* ...

Re: [Qemu-devel] [PATCH 01/16] net: Add a hub net client

2012-07-23 Thread Laszlo Ersek
On 07/23/12 16:52, Stefan Hajnoczi wrote: > On Mon, Jul 23, 2012 at 3:05 PM, Laszlo Ersek wrote: >> The idea is, rather than >> >> unsigned int id = hub->num_ports++; >> >> it should say >> >> unsigned int id; >> /* ... */ >> id = hub->num_ports++; >> >> ... Hm, yes, I remember it

Re: [Qemu-devel] [PATCH 01/16] net: Add a hub net client

2012-07-23 Thread Stefan Hajnoczi
On Mon, Jul 23, 2012 at 3:05 PM, Laszlo Ersek wrote: > On 07/23/12 15:49, Stefan Hajnoczi wrote: >> On Mon, Jul 23, 2012 at 1:45 PM, Laszlo Ersek wrote: >>> Two hairs to split: >>> >>> On 07/20/12 14:01, Stefan Hajnoczi wrote: >>> +static NetHubPort *net_hub_port_new(NetHub *hub, const char

Re: [Qemu-devel] [PATCH 01/16] net: Add a hub net client

2012-07-23 Thread Laszlo Ersek
On 07/23/12 15:49, Stefan Hajnoczi wrote: > On Mon, Jul 23, 2012 at 1:45 PM, Laszlo Ersek wrote: >> Two hairs to split: >> >> On 07/20/12 14:01, Stefan Hajnoczi wrote: >> >>> +static NetHubPort *net_hub_port_new(NetHub *hub, const char *name) >>> +{ >>> +VLANClientState *nc; >>> +NetHubPor

Re: [Qemu-devel] [PATCH 01/16] net: Add a hub net client

2012-07-23 Thread Stefan Hajnoczi
On Mon, Jul 23, 2012 at 1:45 PM, Laszlo Ersek wrote: > Two hairs to split: > > On 07/20/12 14:01, Stefan Hajnoczi wrote: > >> +static NetHubPort *net_hub_port_new(NetHub *hub, const char *name) >> +{ >> +VLANClientState *nc; >> +NetHubPort *port; >> +unsigned int id = hub->num_ports++;

Re: [Qemu-devel] [PATCH 01/16] net: Add a hub net client

2012-07-23 Thread Laszlo Ersek
Two hairs to split: On 07/20/12 14:01, Stefan Hajnoczi wrote: > +static NetHubPort *net_hub_port_new(NetHub *hub, const char *name) > +{ > +VLANClientState *nc; > +NetHubPort *port; > +unsigned int id = hub->num_ports++; There are projects that don't like to put logic or externally v

[Qemu-devel] [PATCH 01/16] net: Add a hub net client

2012-07-20 Thread Stefan Hajnoczi
The vlan feature can be implemented in terms of hubs. By introducing a hub net client it becomes possible to remove the special case vlan code from net.c and push the vlan feature out of generic networking code. Signed-off-by: Stefan Hajnoczi Signed-off-by: Zhi Yong Wu --- net.c |