aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2018-04-30 11:48:18 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2018-05-09 00:13:37 +0200
commit29de4ec164ba2ceac4983ffd08491ea98ca8f8af (patch)
tree7acc1a3db8d3feb22a3e7ebe910f34e22027ae5a /backends
parent770dec2627b085457280490ac0543def97396fef (diff)
downloadqemu-29de4ec164ba2ceac4983ffd08491ea98ca8f8af.zip
qemu-29de4ec164ba2ceac4983ffd08491ea98ca8f8af.tar.gz
qemu-29de4ec164ba2ceac4983ffd08491ea98ca8f8af.tar.bz2
memdev: remove "id" property
The "id" property is unnecessary and can be replaced simply with object_get_canonical_path_component. This patch mostly undoes commit e1ff3c67e8 ("monitor: fix qmp/hmp query-memdev not reporting IDs of memory backends", 2017-01-12). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'backends')
-rw-r--r--backends/hostmem.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/backends/hostmem.c b/backends/hostmem.c
index 6a0c474..3627e61 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -369,24 +369,6 @@ host_memory_backend_can_be_deleted(UserCreatable *uc)
}
}
-static char *get_id(Object *o, Error **errp)
-{
- HostMemoryBackend *backend = MEMORY_BACKEND(o);
-
- return g_strdup(backend->id);
-}
-
-static void set_id(Object *o, const char *str, Error **errp)
-{
- HostMemoryBackend *backend = MEMORY_BACKEND(o);
-
- if (backend->id) {
- error_setg(errp, "cannot change property value");
- return;
- }
- backend->id = g_strdup(str);
-}
-
static bool host_memory_backend_get_share(Object *o, Error **errp)
{
HostMemoryBackend *backend = MEMORY_BACKEND(o);
@@ -434,18 +416,11 @@ host_memory_backend_class_init(ObjectClass *oc, void *data)
&HostMemPolicy_lookup,
host_memory_backend_get_policy,
host_memory_backend_set_policy, &error_abort);
- object_class_property_add_str(oc, "id", get_id, set_id, &error_abort);
object_class_property_add_bool(oc, "share",
host_memory_backend_get_share, host_memory_backend_set_share,
&error_abort);
}
-static void host_memory_backend_finalize(Object *o)
-{
- HostMemoryBackend *backend = MEMORY_BACKEND(o);
- g_free(backend->id);
-}
-
static const TypeInfo host_memory_backend_info = {
.name = TYPE_MEMORY_BACKEND,
.parent = TYPE_OBJECT,
@@ -454,7 +429,6 @@ static const TypeInfo host_memory_backend_info = {
.class_init = host_memory_backend_class_init,
.instance_size = sizeof(HostMemoryBackend),
.instance_init = host_memory_backend_init,
- .instance_finalize = host_memory_backend_finalize,
.interfaces = (InterfaceInfo[]) {
{ TYPE_USER_CREATABLE },
{ }