From patchwork Tue Jan 15 17:13:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 212256 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 966B12C0096 for ; Wed, 16 Jan 2013 04:14:31 +1100 (EST) Received: from localhost ([::1]:50410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvA5l-0002YW-Kw for incoming@patchwork.ozlabs.org; Tue, 15 Jan 2013 12:14:29 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvA5M-0002Cn-Fe for qemu-devel@nongnu.org; Tue, 15 Jan 2013 12:14:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvA5J-0004Wa-84 for qemu-devel@nongnu.org; Tue, 15 Jan 2013 12:14:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60583) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvA5I-0004VM-Up for qemu-devel@nongnu.org; Tue, 15 Jan 2013 12:14:01 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0FHE0I8008695 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 15 Jan 2013 12:14:00 -0500 Received: from localhost (ovpn-112-16.ams2.redhat.com [10.36.112.16]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0FHDx7p027136; Tue, 15 Jan 2013 12:13:59 -0500 From: Stefan Hajnoczi To: Date: Tue, 15 Jan 2013 18:13:52 +0100 Message-Id: <1358270033-18064-3-git-send-email-stefanha@redhat.com> In-Reply-To: <1358270033-18064-1-git-send-email-stefanha@redhat.com> References: <1358270033-18064-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id r0FHE0I8008695 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Anthony Liguori , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 2/3] qom: Make object_resolve_path_component() path argument const X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Andreas Färber 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 Signed-off-by: Stefan Hajnoczi --- include/qom/object.h | 2 +- qom/object.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index d43b289..1ef2f0e 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -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: diff --git a/qom/object.c b/qom/object.c index 351b88c..03e6f24 100644 --- a/qom/object.c +++ b/qom/object.c @@ -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) {