* David Hildenbrand ([email protected]) wrote:
> We implement the RamDiscardMgr interface and only require coordinated
> discarding of RAM to work.
> 
> Cc: Paolo Bonzini <[email protected]>
> Cc: "Michael S. Tsirkin" <[email protected]>
> Cc: Alex Williamson <[email protected]>
> Cc: Dr. David Alan Gilbert <[email protected]>
> Cc: Igor Mammedov <[email protected]>
> Cc: Pankaj Gupta <[email protected]>
> Cc: Peter Xu <[email protected]>
> Cc: Auger Eric <[email protected]>
> Cc: Wei Yang <[email protected]>
> Cc: teawater <[email protected]>
> Cc: Marek Kedzierski <[email protected]>
> Signed-off-by: David Hildenbrand <[email protected]>

Reviewed-by: Dr. David Alan Gilbert <[email protected]>

> ---
>  hw/virtio/virtio-mem.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
> index 93257b6c26..932d386c37 100644
> --- a/hw/virtio/virtio-mem.c
> +++ b/hw/virtio/virtio-mem.c
> @@ -687,7 +687,7 @@ static void virtio_mem_device_realize(DeviceState *dev, 
> Error **errp)
>          return;
>      }
>  
> -    if (ram_block_discard_require(true)) {
> +    if (ram_block_coordinated_discard_require(true)) {
>          error_setg(errp, "Discarding RAM is disabled");
>          return;
>      }
> @@ -695,7 +695,7 @@ static void virtio_mem_device_realize(DeviceState *dev, 
> Error **errp)
>      ret = ram_block_discard_range(rb, 0, qemu_ram_get_used_length(rb));
>      if (ret) {
>          error_setg_errno(errp, -ret, "Unexpected error discarding RAM");
> -        ram_block_discard_require(false);
> +        ram_block_coordinated_discard_require(false);
>          return;
>      }
>  
> @@ -738,7 +738,7 @@ static void virtio_mem_device_unrealize(DeviceState *dev)
>      virtio_del_queue(vdev, 0);
>      virtio_cleanup(vdev);
>      g_free(vmem->bitmap);
> -    ram_block_discard_require(false);
> +    ram_block_coordinated_discard_require(false);
>  }
>  
>  static int virtio_mem_discard_range_cb(const VirtIOMEM *vmem, void *arg,
> -- 
> 2.26.2
> 
-- 
Dr. David Alan Gilbert / [email protected] / Manchester, UK


Reply via email to