On 08/06/2015 17:19, Igor Mammedov wrote:
> +        assert(!subregion->hva_mapped);
>          if (rsvd_hva.mr) {
> +            subregion->hva_mapped = true;
>              qemu_ram_remap_hva(mr->ram_addr,
>                  memory_region_get_ram_ptr(rsvd_hva.mr) +
>                      rsvd_hva.offset_within_region);
> @@ -1788,6 +1790,15 @@ void memory_region_del_subregion(MemoryRegion *mr,
>  {
>      memory_region_transaction_begin();
>      assert(subregion->container == mr);
> +
> +    if (mr->ram) {

"if (subregion->hva_mapped)" I think would replace this "if" and the one
below.

Paolo

> +        MemoryRegionSection rsvd_hva = memory_region_find_hva_range(mr);
> +
> +        if (rsvd_hva.mr) {
> +            qemu_ram_unmap_hva(mr->ram_addr);
> +        }
> +    }
> +

Reply via email to