qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/4] net: del hub port when peer is deleted


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 3/4] net: del hub port when peer is deleted
Date: Thu, 5 Feb 2015 14:25:57 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

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 <address@hidden>
> ---
>  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.

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.

Stefan

Attachment: pgpx_3ytZXPLy.pgp
Description: PGP signature


reply via email to

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