qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 4/5] virtio-balloon: Add exit handler, fix me


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v2 4/5] virtio-balloon: Add exit handler, fix memleaks
Date: Thu, 28 Jul 2011 09:35:55 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Amit Shah <address@hidden> writes:

> Add an exit handler that will free up RAM and unregister the savevm
> section after a virtio-balloon device is unplugged.
>
> Signed-off-by: Amit Shah <address@hidden>
> ---
>  hw/virtio-balloon.c |    5 +++++
>  hw/virtio-pci.c     |   11 ++++++++++-
>  hw/virtio.h         |    1 +
>  3 files changed, 16 insertions(+), 1 deletions(-)
>
> diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c
> index 26ee364..0ce0049 100644
> --- a/hw/virtio-balloon.c
> +++ b/hw/virtio-balloon.c
> @@ -297,3 +297,8 @@ VirtIODevice *virtio_balloon_init(DeviceState *dev)
>  
>      return &s->vdev;
>  }
> +
> +void virtio_balloon_exit(VirtIODevice *vdev)
> +{
> +    virtio_cleanup(vdev);
> +}
> diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
> index ca5f125..316bf92 100644
> --- a/hw/virtio-pci.c
> +++ b/hw/virtio-pci.c
> @@ -795,6 +795,15 @@ static int virtio_balloon_init_pci(PCIDevice *pci_dev)
>      return 0;
>  }
>  
> +static int virtio_balloon_exit_pci(PCIDevice *pci_dev)
> +{
> +    VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
> +
> +    virtio_pci_stop_ioeventfd(proxy);
> +    virtio_balloon_exit(proxy->vdev);
> +    return virtio_exit_pci(pci_dev);
> +}
> +

Same code in every other virtio_*_exit_pci().  Suggests there's
something wrong with the generic code.  Outside the scope of this
series, of course.

[...]



reply via email to

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