From: Stefan Hajnoczi <stefanha@gmail.com>
To: Liu Ping Fan <qemulist@gmail.com>
Cc: mdroth <mdroth@linux.vnet.ibm.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/3] net: make netclient re-entrant with refcnt
Date: Mon, 4 Mar 2013 16:19:15 +0100 [thread overview]
Message-ID: <20130304151915.GA16196@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1362316883-7948-4-git-send-email-qemulist@gmail.com>
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.
next prev parent reply other threads:[~2013-03-04 15:19 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-03 13:21 [Qemu-devel] [PATCH 0/3] *** make netlayer re-entrant *** Liu Ping Fan
2013-03-03 13:21 ` [Qemu-devel] [PATCH 1/3] net: spread hub on AioContexts Liu Ping Fan
2013-03-04 14:35 ` Stefan Hajnoczi
2013-03-05 2:45 ` liu ping fan
2013-03-03 13:21 ` [Qemu-devel] [PATCH 2/3] net: introduce lock to protect NetClientState's send_queue Liu Ping Fan
2013-03-04 14:49 ` Stefan Hajnoczi
2013-03-04 15:04 ` Paolo Bonzini
2013-03-05 2:45 ` liu ping fan
2013-03-05 8:23 ` Paolo Bonzini
2013-03-05 2:45 ` liu ping fan
2013-03-05 3:04 ` liu ping fan
2013-03-05 10:39 ` Stefan Hajnoczi
2013-03-03 13:21 ` [Qemu-devel] [PATCH 3/3] net: make netclient re-entrant with refcnt Liu Ping Fan
2013-03-04 15:19 ` Stefan Hajnoczi [this message]
2013-03-05 2:48 ` liu ping fan
2013-03-05 21:30 ` [Qemu-devel] [PATCH 0/3] *** make netlayer re-entrant *** mdroth
2013-03-07 2:06 ` liu ping fan
2013-03-07 9:31 ` Stefan Hajnoczi
2013-03-07 9:33 ` Stefan Hajnoczi
2013-03-11 15:18 ` Paolo Bonzini
2013-03-12 8:41 ` Paolo Bonzini
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=20130304151915.GA16196@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=anthony@codemonkey.ws \
--cc=mdroth@linux.vnet.ibm.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemulist@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).