]> git.proxmox.com Git - qemu.git/commitdiff
qom: Make object_resolve_path_component() path argument const
authorAndreas Färber <afaerber@suse.de>
Tue, 15 Jan 2013 01:55:10 +0000 (02:55 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 15 Jan 2013 09:54:23 +0000 (10:54 +0100)
A usage with a hardcoded partial path such as

  object_resolve_path_component(obj, "foo")

is totally valid but currently leads to a compilation error. Fix this.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
include/qom/object.h
qom/object.c

index d43b289a407a432dee844014c4487487596c0390..1ef2f0edd43f654cb0ddd55679dc8107a32c0925 100644 (file)
@@ -900,7 +900,7 @@ Object *object_resolve_path_type(const char *path, const char *typename,
  *
  * Returns: The resolved object or NULL on path lookup failure.
  */
-Object *object_resolve_path_component(Object *parent, gchar *part);
+Object *object_resolve_path_component(Object *parent, const gchar *part);
 
 /**
  * object_property_add_child:
index 351b88c817b5222e87d8544e8673c02278766b2f..03e6f24d284539de43f5cd6731e21db54c4b03fc 100644 (file)
@@ -1017,7 +1017,7 @@ gchar *object_get_canonical_path(Object *obj)
     return newpath;
 }
 
-Object *object_resolve_path_component(Object *parent, gchar *part)
+Object *object_resolve_path_component(Object *parent, const gchar *part)
 {
     ObjectProperty *prop = object_property_find(parent, part, NULL);
     if (prop == NULL) {