mirror of https://gitee.com/openkylin/qemu.git
hostmem-file: remove object id from pmem error message
We will never get the canonical path from the object before object_property_add_child. Signed-off-by: Zhang Yi <yi.z.zhang@linux.intel.com> Message-Id: <a6491f996827f4039c1a52198ed5dcc7727cb0f9.1540389255.git.yi.z.zhang@linux.intel.com> [ehabkost: reword commit message] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
32a1a94dd3
commit
87dc3ce60a
|
@ -145,26 +145,20 @@ static void file_memory_backend_set_pmem(Object *o, bool value, Error **errp)
|
||||||
HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(o);
|
HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(o);
|
||||||
|
|
||||||
if (host_memory_backend_mr_inited(backend)) {
|
if (host_memory_backend_mr_inited(backend)) {
|
||||||
char *path = object_get_canonical_path_component(o);
|
|
||||||
|
|
||||||
error_setg(errp, "cannot change property 'pmem' of %s '%s'",
|
error_setg(errp, "cannot change property 'pmem' of %s.",
|
||||||
object_get_typename(o),
|
object_get_typename(o));
|
||||||
path);
|
|
||||||
g_free(path);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_LIBPMEM
|
#ifndef CONFIG_LIBPMEM
|
||||||
if (value) {
|
if (value) {
|
||||||
Error *local_err = NULL;
|
Error *local_err = NULL;
|
||||||
char *path = object_get_canonical_path_component(o);
|
|
||||||
|
|
||||||
error_setg(&local_err,
|
error_setg(&local_err,
|
||||||
"Lack of libpmem support while setting the 'pmem=on'"
|
"Lack of libpmem support while setting the 'pmem=on'"
|
||||||
" of %s '%s'. We can't ensure data persistence.",
|
" of %s. We can't ensure data persistence.",
|
||||||
object_get_typename(o),
|
object_get_typename(o));
|
||||||
path);
|
|
||||||
g_free(path);
|
|
||||||
error_propagate(errp, local_err);
|
error_propagate(errp, local_err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue