qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Julia Suvorova <jusual@redhat.com>, qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH 2/2] virtio-balloon: Reject qmp_balloon during hot-unplug
Date: Thu, 16 Jan 2020 13:36:03 +0100	[thread overview]
Message-ID: <38fdd88d-1399-effb-b74b-e02b7343f044@redhat.com> (raw)
In-Reply-To: <20200115224025.538368-3-jusual@redhat.com>

On 15.01.20 23:40, Julia Suvorova wrote:
> Hot-unplug takes some time due to communication with the guest.
> Do not change the device while freeing up resources.
> 
> Signed-off-by: Julia Suvorova <jusual@redhat.com>
> ---
>  balloon.c                  | 2 +-
>  hw/virtio/virtio-balloon.c | 9 ++++++++-
>  include/sysemu/balloon.h   | 2 +-
>  3 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/balloon.c b/balloon.c
> index f104b42961..998ec53a0f 100644
> --- a/balloon.c
> +++ b/balloon.c
> @@ -119,5 +119,5 @@ void qmp_balloon(int64_t target, Error **errp)
>      }
>  
>      trace_balloon_event(balloon_opaque, target);
> -    balloon_event_fn(balloon_opaque, target);
> +    balloon_event_fn(balloon_opaque, target, errp);
>  }
> diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
> index 57f3b9f22d..0fa4e4454b 100644
> --- a/hw/virtio/virtio-balloon.c
> +++ b/hw/virtio/virtio-balloon.c
> @@ -717,12 +717,19 @@ static void virtio_balloon_stat(void *opaque, BalloonInfo *info)
>                                               VIRTIO_BALLOON_PFN_SHIFT);
>  }
>  
> -static void virtio_balloon_to_target(void *opaque, ram_addr_t target)
> +static void virtio_balloon_to_target(void *opaque, ram_addr_t target,
> +                                     Error **errp)
>  {
> +    DeviceState *bus_dev = qdev_get_bus_device(DEVICE(opaque));
>      VirtIOBalloon *dev = VIRTIO_BALLOON(opaque);
>      VirtIODevice *vdev = VIRTIO_DEVICE(dev);
>      ram_addr_t vm_ram_size = get_current_ram_size();
>  
> +    if (bus_dev && bus_dev->pending_deleted_event) {
> +        error_setg(errp, "Hot-unplug of %s is in progress", vdev->name);
> +        return;
> +    }
> +

How exactly does this help? The guest is free to inflate/deflate
whenever it wants.


-- 
Thanks,

David / dhildenb



  reply	other threads:[~2020-01-16 12:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 22:40 [PATCH 0/2] virtio-balloon: Reject qmp_balloon during hot-unplug Julia Suvorova
2020-01-15 22:40 ` [PATCH 1/2] qdev: Introduce qdev_get_bus_device Julia Suvorova
2020-01-16 18:13   ` Philippe Mathieu-Daudé
2020-01-21  7:31     ` Markus Armbruster
2020-01-24 10:46   ` Igor Mammedov
2020-01-15 22:40 ` [PATCH 2/2] virtio-balloon: Reject qmp_balloon during hot-unplug Julia Suvorova
2020-01-16 12:36   ` David Hildenbrand [this message]
2020-01-23 14:08     ` Julia Suvorova
2020-01-23 14:17       ` David Hildenbrand
2020-01-23 15:46         ` Julia Suvorova
2020-01-27  9:18           ` David Hildenbrand
2020-01-27 10:54           ` Michael S. Tsirkin
2020-01-27 14:53             ` Julia Suvorova
2020-01-27 15:38               ` Michael S. Tsirkin

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=38fdd88d-1399-effb-b74b-e02b7343f044@redhat.com \
    --to=david@redhat.com \
    --cc=berrange@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jusual@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).