From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3] vhost: fix leak of fds and mmaps Date: Fri, 19 Feb 2016 16:08:32 +0100 Message-ID: <14867543.eEYu7dpNMI@xps13> References: <1453060638-58510-1-git-send-email-rlane@bigswitch.com> <1455129655-25520-1-git-send-email-rlane@bigswitch.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Rich Lane Return-path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id 3A1F4C44C for ; Fri, 19 Feb 2016 16:10:07 +0100 (CET) Received: by mail-wm0-f54.google.com with SMTP id a4so75003998wme.1 for ; Fri, 19 Feb 2016 07:10:07 -0800 (PST) In-Reply-To: <1455129655-25520-1-git-send-email-rlane@bigswitch.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-02-10 10:40, Rich Lane: > The common vhost code only supported a single mmap per device. vhost-user > worked around this by saving the address/length/fd of each mmap after the end > of the rte_virtio_memory struct. This only works if the vhost-user code frees > dev->mem, since the common code is unaware of the extra info. The > VHOST_USER_RESET_OWNER message is one situation where the common code frees > dev->mem and leaks the fds and mappings. This happens every time I shut down a > VM. > > The new code calls back into the implementation (vhost-user or vhost-cuse) to > clean up these resources. > > The vhost-cuse changes are only compile tested. > > Signed-off-by: Rich Lane > Acked-by: Yuanhan Liu Applied, thanks