aboutsummaryrefslogtreecommitdiff
path: root/backends/hostmem-file.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-10-18 10:33:30 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-10-18 10:33:30 +0100
commitf525c8a6cb9e445ceef6e73aeccab553866b2f36 (patch)
treec63e2308714d68da383b6fe9b021e5e6e8ac2291 /backends/hostmem-file.c
parente8ddc2eae5ccc41f0815e5c43e70cb04a7e67e2e (diff)
parent026ac483c70850c82fad849de656204b16f8415e (diff)
downloadqemu-f525c8a6cb9e445ceef6e73aeccab553866b2f36.zip
qemu-f525c8a6cb9e445ceef6e73aeccab553866b2f36.tar.gz
qemu-f525c8a6cb9e445ceef6e73aeccab553866b2f36.tar.bz2
Merge remote-tracking branch 'remotes/ehabkost/tags/machine-pull-request' into staging
machine + memory backend queue, 2016-10-17 # gpg: Signature made Mon 17 Oct 2016 18:54:57 BST # gpg: using RSA key 0x2807936F984DC5A6 # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-pull-request: hostmem-file: Register TYPE_MEMORY_BACKEND_FILE properties as class properties hostmem: Register TYPE_MEMORY_BACKEND properties as class properties pc: Register TYPE_PC_MACHINE properties as class properties machine: Register TYPE_MACHINE properties as class properties machine: Fix replacement of '_' by '-' in machine property names Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'backends/hostmem-file.c')
-rw-r--r--backends/hostmem-file.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c
index 5c4b808..42efb2f 100644
--- a/backends/hostmem-file.c
+++ b/backends/hostmem-file.c
@@ -64,14 +64,6 @@ file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)
#endif
}
-static void
-file_backend_class_init(ObjectClass *oc, void *data)
-{
- HostMemoryBackendClass *bc = MEMORY_BACKEND_CLASS(oc);
-
- bc->alloc = file_backend_memory_alloc;
-}
-
static char *get_mem_path(Object *o, Error **errp)
{
HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(o);
@@ -112,13 +104,18 @@ static void file_memory_backend_set_share(Object *o, bool value, Error **errp)
}
static void
-file_backend_instance_init(Object *o)
+file_backend_class_init(ObjectClass *oc, void *data)
{
- object_property_add_bool(o, "share",
- file_memory_backend_get_share,
- file_memory_backend_set_share, NULL);
- object_property_add_str(o, "mem-path", get_mem_path,
- set_mem_path, NULL);
+ HostMemoryBackendClass *bc = MEMORY_BACKEND_CLASS(oc);
+
+ bc->alloc = file_backend_memory_alloc;
+
+ object_class_property_add_bool(oc, "share",
+ file_memory_backend_get_share, file_memory_backend_set_share,
+ &error_abort);
+ object_class_property_add_str(oc, "mem-path",
+ get_mem_path, set_mem_path,
+ &error_abort);
}
static void file_backend_instance_finalize(Object *o)
@@ -132,7 +129,6 @@ static const TypeInfo file_backend_info = {
.name = TYPE_MEMORY_BACKEND_FILE,
.parent = TYPE_MEMORY_BACKEND,
.class_init = file_backend_class_init,
- .instance_init = file_backend_instance_init,
.instance_finalize = file_backend_instance_finalize,
.instance_size = sizeof(HostMemoryBackendFile),
};