From: Wei Yang <richardw.yang@linux.intel.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org, Eduardo Habkost <ehabkost@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
Wei Yang <richardw.yang@linux.intel.com>
Subject: Re: [Qemu-devel] [PATCH v3 1/2] hostmem: simplify ifdef-s in file_backend_memory_alloc()
Date: Thu, 14 Feb 2019 15:26:29 +0800 [thread overview]
Message-ID: <20190214072629.GA18896@richard> (raw)
In-Reply-To: <20190214031004.32522-2-stefanha@redhat.com>
Maybe change the title
s/hotmem/hostmem-file/
would be more proper.
I missed this in previous review.
On Thu, Feb 14, 2019 at 11:10:03AM +0800, Stefan Hajnoczi wrote:
>From: Igor Mammedov <imammedo@redhat.com>
>
>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 <imammedo@redhat.com>
>Suggested-by: Wei Yang <richardw.yang@linux.intel.com>
>Reviewed-by: Wei Yang <richardw.yang@linux.intel.com>
>Message-Id: <20190213123858.24620-1-imammedo@redhat.com>
>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
>---
> 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 ba601ce940..ce54788048 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)
> {
>+#ifndef CONFIG_POSIX
>+ error_setg(errp, "backend '%s' not supported on this host",
>+ object_get_typename(OBJECT(backend)));
>+#else
> HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(backend);
>-#ifdef CONFIG_POSIX
> gchar *name;
>-#endif
>
> if (!backend->size) {
> error_setg(errp, "can't create backend with size 0");
>@@ -54,9 +56,6 @@ file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)
> error_setg(errp, "mem-path property not set");
> return;
> }
>-#ifndef CONFIG_POSIX
>- error_setg(errp, "-mem-path not supported on this host");
>-#else
> backend->force_prealloc = mem_prealloc;
> name = host_memory_backend_get_name(backend);
> memory_region_init_ram_from_file(&backend->mr, OBJECT(backend),
>--
>2.20.1
--
Wei Yang
Help you, Help me
next prev parent reply other threads:[~2019-02-14 7:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-14 3:10 [Qemu-devel] [PATCH v3 0/2] hostmem-file: reject invalid pmem file sizes Stefan Hajnoczi
2019-02-14 3:10 ` [Qemu-devel] [PATCH v3 1/2] hostmem: simplify ifdef-s in file_backend_memory_alloc() Stefan Hajnoczi
2019-02-14 7:26 ` Wei Yang [this message]
2019-02-14 8:16 ` Stefan Hajnoczi
2019-03-01 10:40 ` Igor Mammedov
2019-03-01 16:47 ` Stefan Hajnoczi
2019-03-06 10:23 ` Laurent Vivier
2019-02-14 3:10 ` [Qemu-devel] [PATCH v3 2/2] hostmem-file: reject invalid pmem file sizes Stefan Hajnoczi
2019-02-14 4:19 ` Wei Yang
2019-02-14 8:15 ` Stefan Hajnoczi
2019-02-14 8:20 ` Wei Yang
2019-02-14 11:01 ` Igor Mammedov
2019-03-08 17:53 ` Eduardo Habkost
2019-02-14 8:50 ` [Qemu-devel] [PATCH v3 0/2] " Pankaj Gupta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190214072629.GA18896@richard \
--to=richardw.yang@linux.intel.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).