[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 1/4] ramblock-notifier: new
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-block] [PATCH 1/4] ramblock-notifier: new |
Date: |
Thu, 22 Dec 2016 10:56:50 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 |
> diff --git a/xen-mapcache.c b/xen-mapcache.c
> index 8f3a592..dc9b321 100644
> --- a/xen-mapcache.c
> +++ b/xen-mapcache.c
> @@ -163,6 +163,7 @@ static void xen_remap_bucket(MapCacheEntry *entry,
> err = g_malloc0(nb_pfn * sizeof (int));
>
> if (entry->vaddr_base != NULL) {
> + ram_block_removed(entry->vaddr_base, entry->size);
> if (munmap(entry->vaddr_base, entry->size) != 0) {
> perror("unmap fails");
> exit(-1);
> @@ -188,6 +189,7 @@ static void xen_remap_bucket(MapCacheEntry *entry,
> entry->valid_mapping = (unsigned long *) g_malloc0(sizeof(unsigned long)
> *
> BITS_TO_LONGS(size >> XC_PAGE_SHIFT));
>
> + ram_block_added(entry->vaddr_base, entry->size);
> bitmap_zero(entry->valid_mapping, nb_pfn);
> for (i = 0; i < nb_pfn; i++) {
> if (!err[i]) {
> @@ -397,6 +399,7 @@ static void
> xen_invalidate_map_cache_entry_unlocked(uint8_t *buffer)
> }
>
> pentry->next = entry->next;
> + ram_block_removed(entry->vaddr_base, entry->size);
> if (munmap(entry->vaddr_base, entry->size) != 0) {
> perror("unmap fails");
> exit(-1);
>
My mistake here, these should be ram_block_notify_{add,remove} instead.
Paolo