Skip to contentSkip to conversation

hostmem-file: remove the invalid pmem object id.

PATCH In review Zhang Yi 2 participants 2 messages Oct 24, 2018 – Oct 26, 2018 1 message not in the archive Arm STM32

lore
Share & tools
lore

Zhang Yi

author
#1 lore raw

PATCH 1/1 hostmem-file: remove the invalid pmem object id.

In reply to a message not in the archive

We will never get the canonical path from the object before object_property_add_child.

---
 backends/hostmem-file.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)
backends/hostmem-file.c +4 -10
index 639c8d4..9691c48 100644
@@ -145,26 +145,20 @@ static void file_memory_backend_set_pmem(Object *o, bool value, Error **errp)
     HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(o);
 
     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'",
-                   object_get_typename(o),
-                   path);
-        g_free(path);
+        error_setg(errp, "cannot change property 'pmem' of %s.",
+                   object_get_typename(o));
         return;
     }
 
 #ifndef CONFIG_LIBPMEM
     if (value) {
         Error *local_err = NULL;
-        char *path = object_get_canonical_path_component(o);
 
         error_setg(&local_err,
                    "Lack of libpmem support while setting the 'pmem=on'"
-                   " of %s '%s'. We can't ensure data persistence.",
-                   object_get_typename(o),
-                   path);
-        g_free(path);
+                   " of %s. We can't ensure data persistence.",
+                   object_get_typename(o));
         error_propagate(errp, local_err);
         return;
     }
Signature · 1 line
2.7.4
#2 lore raw
Quoted 4 lines · Zhang Yi

We will never get the canonical path from the object before object_property_add_child.

Thanks. I'm queueing it on machine-next, after rewriting the subject line as:

hostmem-file: remove object id from pmem error message

Signature · 1 line
Eduardo