Re: [PATCH] virtio-balloon: fix free-page BH teardown on unrealize

"David Hildenbrand (Arm)" <[email protected]>
Newsgroups gmane.comp.emulators.qemu
Message-ID <[email protected]>
> +
>  static void virtio_balloon_device_unrealize(DeviceState *dev)
>  {
>      VirtIODevice *vdev = VIRTIO_DEVICE(dev);
> @@ -919,9 +928,17 @@ static void virtio_balloon_device_unrealize(DeviceState *dev)
>  
>      qemu_unregister_resettable(OBJECT(dev));
>      if (s->free_page_bh) {
> +        AioContext *ctx = iothread_get_aio_context(s->iothread);
> +
>          qemu_bh_delete(s->free_page_bh);
> +
> +        qemu_mutex_lock(&s->free_page_lock);
> +        s->free_page_hint_status = FREE_PAGE_HINT_S_UNREALIZE;
> +        qemu_cond_signal(&s->free_page_cond);
> +        qemu_mutex_unlock(&s->free_page_lock);
> +        aio_wait_bh_oneshot(ctx, dummy_bh, NULL);
> +
>          object_unref(OBJECT(s->iothread));
> -        virtio_balloon_free_page_stop(s);
>          precopy_remove_notifier(&s->free_page_hint_notify);
>      }
>      balloon_stats_destroy_timer(s);

Not sure if this already went upsteam, but FWIW

Reviewed-by: David Hildenbrand <[email protected]>

-- 
Cheers,

David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.