[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 6/8] qom: do not return root for empty path
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 6/8] qom: do not return root for empty path |
Date: |
Thu, 18 Apr 2013 18:44:02 +0200 |
An empty path will return the sole object of that type in the
QOM tree. This is different from "/", which returns the root.
Signed-off-by: Paolo Bonzini <address@hidden>
---
qom/object.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/qom/object.c b/qom/object.c
index 093502e..dd53d24 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1113,21 +1113,13 @@ static Object *object_resolve_partial_path(Object
*parent,
Object *object_resolve_path_type(const char *path, const char *typename,
bool *ambiguous)
{
- bool partial_path = true;
Object *obj;
gchar **parts;
parts = g_strsplit(path, "/", 0);
- if (parts == NULL || parts[0] == NULL) {
- g_strfreev(parts);
- return object_get_root();
- }
-
- if (strcmp(parts[0], "") == 0) {
- partial_path = false;
- }
+ assert(parts);
- if (partial_path) {
+ if (parts[0] == NULL || strcmp(parts[0], "") != 0) {
if (ambiguous) {
*ambiguous = false;
}
--
1.8.1.4
- [Qemu-devel] [PATCH 4/8] audio: remove CONFIG_* symbols, (continued)
- [Qemu-devel] [PATCH 4/8] audio: remove CONFIG_* symbols, Paolo Bonzini, 2013/04/18
- [Qemu-devel] [PATCH 3/8] audio: remove HAS_AUDIO, Paolo Bonzini, 2013/04/18
- [Qemu-devel] [PATCH 5/8] audio: replace audio card configuration with default-configs, Paolo Bonzini, 2013/04/18
- [Qemu-devel] [PATCH 2/8] audio: remove the need for audio card CONFIG_* symbols, Paolo Bonzini, 2013/04/18
- [Qemu-devel] [PATCH 7/8] audio: look for the ISA and PCI buses, Paolo Bonzini, 2013/04/18
- Re: [Qemu-devel] [PATCH 7/8] audio: look for the ISA and PCI buses, Alexander Graf, 2013/04/30
- [Qemu-devel] [PATCH 8/8] audio: enable PCI audio cards for all PCI-enabled targets, Paolo Bonzini, 2013/04/18
- [Qemu-devel] [PATCH 6/8] qom: do not return root for empty path,
Paolo Bonzini <=
- Re: [Qemu-devel] [PATCH 1.5 0/8] make audio card configuration uniform, Paolo Bonzini, 2013/04/29
- Re: [Qemu-devel] [PATCH 1.5 0/8] make audio card configuration uniform, Anthony Liguori, 2013/04/30