Blame SOURCES/kvm-hostmem-drop-error-variable-from-host_memory_backend.patch

7711c0
From 09b663f38767ce0d84b2301c97efec2d37e71a49 Mon Sep 17 00:00:00 2001
7711c0
From: Markus Armbruster <armbru@redhat.com>
7711c0
Date: Mon, 29 Oct 2018 07:01:36 +0100
7711c0
Subject: [PATCH 06/22] hostmem: drop error variable from
7711c0
 host_memory_backend_get_memory()
7711c0
MIME-Version: 1.0
7711c0
Content-Type: text/plain; charset=UTF-8
7711c0
Content-Transfer-Encoding: 8bit
7711c0
7711c0
RH-Author: Markus Armbruster <armbru@redhat.com>
7711c0
Message-id: <20181029070137.21196-3-armbru@redhat.com>
7711c0
Patchwork-id: 82902
7711c0
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH 2/3] hostmem: drop error variable from host_memory_backend_get_memory()
7711c0
Bugzilla: 1620373
7711c0
RH-Acked-by: David Hildenbrand <david@redhat.com>
7711c0
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
7711c0
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
7711c0
RH-Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7711c0
7711c0
From: David Hildenbrand <david@redhat.com>
7711c0
7711c0
Unused, so let's remove it.
7711c0
7711c0
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
7711c0
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
7711c0
Signed-off-by: David Hildenbrand <david@redhat.com>
7711c0
Message-Id: <20180619134141.29478-8-david@redhat.com>
7711c0
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7711c0
(cherry picked from commit 7943e97b858e64eddf0f3395427e58c5cc00a7d9)
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 backends/hostmem.c       | 3 +--
7711c0
 hw/mem/nvdimm.c          | 4 ++--
7711c0
 hw/mem/pc-dimm.c         | 4 ++--
7711c0
 hw/misc/ivshmem.c        | 3 +--
7711c0
 include/sysemu/hostmem.h | 3 +--
7711c0
 numa.c                   | 3 +--
7711c0
 6 files changed, 8 insertions(+), 12 deletions(-)
7711c0
7711c0
diff --git a/backends/hostmem.c b/backends/hostmem.c
7711c0
index f610936..799ec69 100644
7711c0
--- a/backends/hostmem.c
7711c0
+++ b/backends/hostmem.c
7711c0
@@ -246,8 +246,7 @@ bool host_memory_backend_mr_inited(HostMemoryBackend *backend)
7711c0
     return memory_region_size(&backend->mr) != 0;
7711c0
 }
7711c0
 
7711c0
-MemoryRegion *
7711c0
-host_memory_backend_get_memory(HostMemoryBackend *backend, Error **errp)
7711c0
+MemoryRegion *host_memory_backend_get_memory(HostMemoryBackend *backend)
7711c0
 {
7711c0
     return host_memory_backend_mr_inited(backend) ? &backend->mr : NULL;
7711c0
 }
7711c0
diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c
7711c0
index 5f1813d..da2b989 100644
7711c0
--- a/hw/mem/nvdimm.c
7711c0
+++ b/hw/mem/nvdimm.c
7711c0
@@ -106,7 +106,7 @@ static MemoryRegion *nvdimm_get_memory_region(PCDIMMDevice *dimm, Error **errp)
7711c0
 
7711c0
 static void nvdimm_realize(PCDIMMDevice *dimm, Error **errp)
7711c0
 {
7711c0
-    MemoryRegion *mr = host_memory_backend_get_memory(dimm->hostmem, errp);
7711c0
+    MemoryRegion *mr = host_memory_backend_get_memory(dimm->hostmem);
7711c0
     NVDIMMDevice *nvdimm = NVDIMM(dimm);
7711c0
     uint64_t align, pmem_size, size = memory_region_size(mr);
7711c0
 
7711c0
@@ -168,7 +168,7 @@ static void nvdimm_write_label_data(NVDIMMDevice *nvdimm, const void *buf,
7711c0
         pmem_memcpy_persist(nvdimm->label_data + offset, buf, size);
7711c0
     }
7711c0
 
7711c0
-    mr = host_memory_backend_get_memory(dimm->hostmem, &error_abort);
7711c0
+    mr = host_memory_backend_get_memory(dimm->hostmem);
7711c0
     backend_offset = memory_region_size(mr) - nvdimm->label_size + offset;
7711c0
     memory_region_set_dirty(mr, backend_offset, size);
7711c0
 }
7711c0
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
7711c0
index a9d7c51..c4a6551 100644
7711c0
--- a/hw/mem/pc-dimm.c
7711c0
+++ b/hw/mem/pc-dimm.c
7711c0
@@ -442,12 +442,12 @@ static MemoryRegion *pc_dimm_get_memory_region(PCDIMMDevice *dimm, Error **errp)
7711c0
         return NULL;
7711c0
     }
7711c0
 
7711c0
-    return host_memory_backend_get_memory(dimm->hostmem, errp);
7711c0
+    return host_memory_backend_get_memory(dimm->hostmem);
7711c0
 }
7711c0
 
7711c0
 static MemoryRegion *pc_dimm_get_vmstate_memory_region(PCDIMMDevice *dimm)
7711c0
 {
7711c0
-    return host_memory_backend_get_memory(dimm->hostmem, &error_abort);
7711c0
+    return host_memory_backend_get_memory(dimm->hostmem);
7711c0
 }
7711c0
 
7711c0
 static void pc_dimm_class_init(ObjectClass *oc, void *data)
7711c0
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
7711c0
index bfbfc0e..47456b8 100644
7711c0
--- a/hw/misc/ivshmem.c
7711c0
+++ b/hw/misc/ivshmem.c
7711c0
@@ -916,8 +916,7 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp)
7711c0
     if (s->hostmem != NULL) {
7711c0
         IVSHMEM_DPRINTF("using hostmem\n");
7711c0
 
7711c0
-        s->ivshmem_bar2 = host_memory_backend_get_memory(s->hostmem,
7711c0
-                                                         &error_abort);
7711c0
+        s->ivshmem_bar2 = host_memory_backend_get_memory(s->hostmem);
7711c0
     } else {
7711c0
         Chardev *chr = qemu_chr_fe_get_driver(&s->server_chr);
7711c0
         assert(chr);
7711c0
diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h
7711c0
index 47bc984..69ba393 100644
7711c0
--- a/include/sysemu/hostmem.h
7711c0
+++ b/include/sysemu/hostmem.h
7711c0
@@ -63,8 +63,7 @@ struct HostMemoryBackend {
7711c0
 };
7711c0
 
7711c0
 bool host_memory_backend_mr_inited(HostMemoryBackend *backend);
7711c0
-MemoryRegion *host_memory_backend_get_memory(HostMemoryBackend *backend,
7711c0
-                                             Error **errp);
7711c0
+MemoryRegion *host_memory_backend_get_memory(HostMemoryBackend *backend);
7711c0
 
7711c0
 void host_memory_backend_set_mapped(HostMemoryBackend *backend, bool mapped);
7711c0
 bool host_memory_backend_is_mapped(HostMemoryBackend *backend);
7711c0
diff --git a/numa.c b/numa.c
7711c0
index e78fba5..6e3d679 100644
7711c0
--- a/numa.c
7711c0
+++ b/numa.c
7711c0
@@ -512,8 +512,7 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
7711c0
         if (!backend) {
7711c0
             continue;
7711c0
         }
7711c0
-        MemoryRegion *seg = host_memory_backend_get_memory(backend,
7711c0
-                                                           &error_fatal);
7711c0
+        MemoryRegion *seg = host_memory_backend_get_memory(backend);
7711c0
 
7711c0
         if (memory_region_is_mapped(seg)) {
7711c0
             char *path = object_get_canonical_path_component(OBJECT(backend));
7711c0
-- 
7711c0
1.8.3.1
7711c0