aboutsummaryrefslogtreecommitdiff
path: root/backends/hostmem-file.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2017-03-10 21:09:30 +0800
committerEduardo Habkost <ehabkost@redhat.com>2017-04-20 15:22:41 -0300
commit6f4c60e47fdb39848eb40804f54e53d8ccaa0f2e (patch)
treec3f554f7577c198352203a78b68a86e13064b1c0 /backends/hostmem-file.c
parent4728b5741040df8bd02a5ad8fd3c2beefae3dcb1 (diff)
downloadqemu-6f4c60e47fdb39848eb40804f54e53d8ccaa0f2e.zip
qemu-6f4c60e47fdb39848eb40804f54e53d8ccaa0f2e.tar.gz
qemu-6f4c60e47fdb39848eb40804f54e53d8ccaa0f2e.tar.bz2
hostmem: use host_memory_backend_mr_inited() where proper
Use the new interface to boost readability. Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <1489151370-15453-3-git-send-email-peterx@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'backends/hostmem-file.c')
-rw-r--r--backends/hostmem-file.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c
index 42efb2f..fc4ef46 100644
--- a/backends/hostmem-file.c
+++ b/backends/hostmem-file.c
@@ -51,7 +51,7 @@ file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)
#ifndef CONFIG_LINUX
error_setg(errp, "-mem-path not supported on this host");
#else
- if (!memory_region_size(&backend->mr)) {
+ if (!host_memory_backend_mr_inited(backend)) {
gchar *path;
backend->force_prealloc = mem_prealloc;
path = object_get_canonical_path(OBJECT(backend));
@@ -76,7 +76,7 @@ static void set_mem_path(Object *o, const char *str, Error **errp)
HostMemoryBackend *backend = MEMORY_BACKEND(o);
HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(o);
- if (memory_region_size(&backend->mr)) {
+ if (host_memory_backend_mr_inited(backend)) {
error_setg(errp, "cannot change property value");
return;
}
@@ -96,7 +96,7 @@ static void file_memory_backend_set_share(Object *o, bool value, Error **errp)
HostMemoryBackend *backend = MEMORY_BACKEND(o);
HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(o);
- if (memory_region_size(&backend->mr)) {
+ if (host_memory_backend_mr_inited(backend)) {
error_setg(errp, "cannot change property value");
return;
}