qemu-devel
[Top][All Lists]
Advanced

[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: liu ping fan
Subject: Re: [Qemu-devel] [PATCH 3/3] net: make netclient re-entrant with refcnt
Date: Tue, 5 Mar 2013 10:48:31 +0800

On Mon, Mar 4, 2013 at 11:19 PM, Stefan Hajnoczi <address@hidden> wrote:
> 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.
>
OK
>> 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.
>
Oh, some made mistake when rebasing. Will fix it.
> The lock should be destroyed in net_cleanup().
>
OK
> This should be a separate patch that fully explains the purpose of the
> lock and uses it consistently in net.c.
OK

Thanks and regards,
Pingfan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]