[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f8fccc5745755e92077306189577da2fe591f586.camel@infradead.org>
Date: Tue, 28 May 2019 14:59:46 +0200
From: Amit Shah <amit@...radead.org>
To: Greg KH <gregkh@...uxfoundation.org>, amit@...nel.org,
zhenwei pi <pizhenwei@...edance.com>
Cc: arnd@...db.de, virtualization@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] virtio_console: remove vq buf while unpluging port
On Fri, 2019-05-24 at 20:51 +0200, Greg KH wrote:
> On Sun, Apr 28, 2019 at 09:50:04AM +0800, zhenwei pi wrote:
> > A bug can be easily reproduced:
> > Host# cat guest-agent.xml
> > <channel type="unix">
> > <source mode="bind" path="/var/lib/libvirt/qemu/stretch.agent"/>
> > <target type="virtio" name="org.qemu.guest_agent.0"
> > state="connected"/>
> > </channel>
> > Host# virsh attach-device instance guest-agent.xml
> > Host# virsh detach-device instance guest-agent.xml
> > Host# virsh attach-device instance guest-agent.xml
> >
> > and guest report: virtio-ports vport0p1: Error allocating inbufs
> >
> > The reason is that the port is unplugged and the vq buf still
> > remained.
> > So, fix two cases in this patch:
> > 1, fix memory leak with attach-device/detach-device.
> > 2, fix logic bug with attach-device/detach-device/attach-device.
The "leak" happens because the host-side of the connection is still
connected. This is by design -- if a guest has written data before
being unplugged, the port isn't released till the host connection goes
down to ensure a host process reads all the data out of the port.
Can you try similar, but also disconnecting the host side and see if
that fixes things?
> Amit, any ideas if this is valid or not and if this should be
> applied?
This had indeed been missed, thanks!
Amit
Powered by blists - more mailing lists