qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Jason Wang <jasowang@redhat.com>
Cc: aliguori@amazon.com, stefanha@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/4] net: del hub port when peer is deleted
Date: Fri, 6 Feb 2015 14:06:34 +0000	[thread overview]
Message-ID: <20150206140634.GD18729@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1423214994.28488.0@smtp.corp.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1649 bytes --]

On Fri, Feb 06, 2015 at 09:37:54AM +0008, Jason Wang wrote:
> On Thu, Feb 5, 2015 at 10:25 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> >On Mon, Feb 02, 2015 at 03:06:37PM +0800, Jason Wang wrote:
> >> We should del hub port when peer is deleted since it will not be reused
> >> and will only be freed during exit.
> >> Signed-off-by: Jason Wang <jasowang@redhat.com>
> >> ---
> >>  net/net.c | 2 ++
> >>  1 file changed, 2 insertions(+)
> >> diff --git a/net/net.c b/net/net.c
> >> index 7acc162..74e651e 100644
> >> --- a/net/net.c
> >> +++ b/net/net.c
> >> @@ -996,6 +996,8 @@ void net_host_device_remove(Monitor *mon, const
> >>QDict *qdict)
> >>          error_report("invalid host network device '%s'", device);
> >>          return;
> >>      }
> >> +
> >> +    qemu_del_net_client(nc->peer);
> >>      qemu_del_net_client(nc);
> >>  }
> >
> >If qmp_netdev_del() is used the hub port will stay alive.
> 
> This is true if it has a peer. And the port will be freed during the
> deletion of its peer. If no peer, it will be deleted soon. This is
> consistent with the behaviors of other type of netdevs.
> >
> >Should the peer deletion happen in qemu_del_net_client(), similar to the
> >existing NIC peer check?
> >
> >  /* If there is a peer NIC, delete and cleanup client, but do not free.
> >*/
> >  if (nc->peer && nc->peer->info->type == NET_CLIENT_OPTIONS_KIND_NIC) {
> >
> >This way the hub port is consistently deleted when its peer is deleted.
> 
> Not sure, but if management always do netdev_del after device_del, it will
> get an error.

Okay, I will merge this patch as-is.

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2015-02-06 14:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-02  7:06 [Qemu-devel] [PATCH 1/4] monitor: print hub port name during info network Jason Wang
2015-02-02  7:06 ` [Qemu-devel] [PATCH 2/4] net: remove the wrong comment in net_init_hubport() Jason Wang
2015-02-02  7:06 ` [Qemu-devel] [PATCH 3/4] net: del hub port when peer is deleted Jason Wang
2015-02-05 14:25   ` Stefan Hajnoczi
2015-02-06  9:29     ` Jason Wang
2015-02-06 14:06       ` Stefan Hajnoczi [this message]
2015-02-02  7:06 ` [Qemu-devel] [PATCH 4/4] monitor: more accurate completion for host_net_remove() Jason Wang
2015-02-06 14:06 ` [Qemu-devel] [PATCH 1/4] monitor: print hub port name during info network Stefan Hajnoczi

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=20150206140634.GD18729@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=aliguori@amazon.com \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).