[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/3] net: make netclient re-entrant with refcnt
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 3/3] net: make netclient re-entrant with refcnt |
Date: |
Mon, 4 Mar 2013 16:19:15 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Sun, Mar 03, 2013 at 09:21:22PM +0800, Liu Ping Fan wrote:
> diff --git a/net/hub.c b/net/hub.c
> index 97c3ac3..ab4448e 100644
> --- a/net/hub.c
> +++ b/net/hub.c
> @@ -36,6 +36,7 @@ typedef struct NetHubPort {
> } NetHubPort;
>
> struct NetHub {
> + QemuMutex lock;
Please document what this lock protects. I think it only protects the
ports list.
> diff --git a/net/net.c b/net/net.c
> index 0acb933..5a8bb6a 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -45,6 +45,7 @@
> # define CONFIG_NET_BRIDGE
> #endif
>
> +static QemuMutex net_clients_lock;
> static QTAILQ_HEAD(, NetClientState) net_clients;
I'm not sure what net_clients_lock protects since this lock is not taken
by all net_clients users.
The lock should be destroyed in net_cleanup().
This should be a separate patch that fully explains the purpose of the
lock and uses it consistently in net.c.
- Re: [Qemu-devel] [PATCH 1/3] net: spread hub on AioContexts, (continued)
[Qemu-devel] [PATCH 3/3] net: make netclient re-entrant with refcnt, Liu Ping Fan, 2013/03/03
- Re: [Qemu-devel] [PATCH 3/3] net: make netclient re-entrant with refcnt,
Stefan Hajnoczi <=
Re: [Qemu-devel] [PATCH 0/3] *** make netlayer re-entrant ***, mdroth, 2013/03/05