[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-trivial] [PULL 09/10] hostmem-file: simplify ifdef-s in file_backe

From: Laurent Vivier
Subject: [Qemu-trivial] [PULL 09/10] hostmem-file: simplify ifdef-s in file_backend_memory_alloc()
Date: Wed, 6 Mar 2019 12:07:10 +0100

From: Igor Mammedov <address@hidden>

cleanup file_backend_memory_alloc() by using one CONFIG_POSIX ifdef
instead of several ones within the function to make it simpler to follow.

Signed-off-by: Igor Mammedov <address@hidden>
Suggested-by: Wei Yang <address@hidden>
Reviewed-by: Wei Yang <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Message-Id: <address@hidden>
[lv: s/hostmem/hostmem-file/]
Signed-off-by: Laurent Vivier <address@hidden>
 backends/hostmem-file.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c
index ba601ce94088..ce5478804804 100644
--- a/backends/hostmem-file.c
+++ b/backends/hostmem-file.c
@@ -41,10 +41,12 @@ struct HostMemoryBackendFile {
 static void
 file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)
+    error_setg(errp, "backend '%s' not supported on this host",
+               object_get_typename(OBJECT(backend)));
     HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(backend);
     gchar *name;
     if (!backend->size) {
         error_setg(errp, "can't create backend with size 0");
@@ -54,9 +56,6 @@ file_backend_memory_alloc(HostMemoryBackend *backend, Error 
         error_setg(errp, "mem-path property not set");
-    error_setg(errp, "-mem-path not supported on this host");
     backend->force_prealloc = mem_prealloc;
     name = host_memory_backend_get_name(backend);
     memory_region_init_ram_from_file(&backend->mr, OBJECT(backend),

reply via email to

[Prev in Thread] Current Thread [Next in Thread]