diff options
Diffstat (limited to 'backends')
-rw-r--r-- | backends/Makefile.objs | 5 | ||||
-rw-r--r-- | backends/hostmem-file.c | 9 | ||||
-rw-r--r-- | backends/hostmem.c | 3 |
3 files changed, 8 insertions, 9 deletions
diff --git a/backends/Makefile.objs b/backends/Makefile.objs index 717fcbdae4..ff619d31b4 100644 --- a/backends/Makefile.objs +++ b/backends/Makefile.objs @@ -9,10 +9,9 @@ common-obj-$(CONFIG_POSIX) += hostmem-file.o common-obj-y += cryptodev.o common-obj-y += cryptodev-builtin.o -ifeq ($(CONFIG_VIRTIO),y) +ifeq ($(CONFIG_VIRTIO_CRYPTO),y) common-obj-y += cryptodev-vhost.o -common-obj-$(call land,$(CONFIG_VHOST_USER),$(CONFIG_LINUX)) += \ - cryptodev-vhost-user.o +common-obj-$(CONFIG_VHOST_CRYPTO) += cryptodev-vhost-user.o endif common-obj-$(CONFIG_LINUX) += hostmem-memfd.o 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), diff --git a/backends/hostmem.c b/backends/hostmem.c index 87b19d2111..04baf479a1 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -88,7 +88,7 @@ host_memory_backend_get_host_nodes(Object *obj, Visitor *v, const char *name, value = find_first_bit(backend->host_nodes, MAX_NODES); if (value == MAX_NODES) { - return; + goto ret; } *node = g_malloc0(sizeof(**node)); @@ -106,6 +106,7 @@ host_memory_backend_get_host_nodes(Object *obj, Visitor *v, const char *name, node = &(*node)->next; } while (true); +ret: visit_type_uint16List(v, name, &host_nodes, errp); } |