On Fri, Aug 17, 2012 at 09:38:45AM +0800, Rongqing Li wrote:
On 2012年08月16日 20:57, Stefan Hajnoczi wrote:
I think the solution is not to drop Vincent/Zhi Yong's code. Instead we
should distinguish between "up" and "down". If a net client is "up" but
cannot receive, then the hub will queue the packet. If a net client is
"down" then the hub will ignore the client and send packets to other
clients.
I don't have patches for this but have added it to my TODO list.
Stefan
Ok, Thanks for you explanation! and expect your patch.
If you have time to fix this I suggest you try to submit the patch
because I may not get to within the next week.
We need a way to determine whether the interface is up/down. There is
already a link_down flag that can be set. Not sure if its semantics are
exactly what we need, you'd need to check net.h/net.c.
The second step is looking at qemu_can_send_packet() and .can_receive().
net/hub.c:net_hub_port_can_receive() needs to be tweaked so peers with
link_down are skipped.
Stefan