aboutsummaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
Diffstat (limited to 'qom')
-rw-r--r--qom/object.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/qom/object.c b/qom/object.c
index dfdbd50f04..fe6e744b4d 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1712,15 +1712,13 @@ static Object *object_resolve_partial_path(Object *parent,
typename, ambiguous);
if (found) {
if (obj) {
- if (ambiguous) {
- *ambiguous = true;
- }
+ *ambiguous = true;
return NULL;
}
obj = found;
}
- if (ambiguous && *ambiguous) {
+ if (*ambiguous) {
return NULL;
}
}
@@ -1729,7 +1727,7 @@ static Object *object_resolve_partial_path(Object *parent,
}
Object *object_resolve_path_type(const char *path, const char *typename,
- bool *ambiguous)
+ bool *ambiguousp)
{
Object *obj;
gchar **parts;
@@ -1738,11 +1736,12 @@ Object *object_resolve_path_type(const char *path, const char *typename,
assert(parts);
if (parts[0] == NULL || strcmp(parts[0], "") != 0) {
- if (ambiguous) {
- *ambiguous = false;
- }
+ bool ambiguous = false;
obj = object_resolve_partial_path(object_get_root(), parts,
- typename, ambiguous);
+ typename, &ambiguous);
+ if (ambiguousp) {
+ *ambiguousp = ambiguous;
+ }
} else {
obj = object_resolve_abs_path(object_get_root(), parts, typename, 1);
}