Message ID | 1525817687-34620-6-git-send-email-pbonzini@redhat.com |
---|---|
State | New |
Headers | show
Return-Path: <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WVhLtmX7"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40gYpL0jrhz9s2t for <incoming@patchwork.ozlabs.org>; Wed, 9 May 2018 08:20:26 +1000 (AEST) Received: from localhost ([::1]:53531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>) id 1fGAy7-0007Oo-FC for incoming@patchwork.ozlabs.org; Tue, 08 May 2018 18:20:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <paolo.bonzini@gmail.com>) id 1fGAst-0002rB-BX for qemu-devel@nongnu.org; Tue, 08 May 2018 18:15:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <paolo.bonzini@gmail.com>) id 1fGAss-0001JZ-B5 for qemu-devel@nongnu.org; Tue, 08 May 2018 18:14:59 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:40906) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <paolo.bonzini@gmail.com>) id 1fGAss-0001JC-42 for qemu-devel@nongnu.org; Tue, 08 May 2018 18:14:58 -0400 Received: by mail-wm0-x241.google.com with SMTP id j5-v6so24175698wme.5 for <qemu-devel@nongnu.org>; Tue, 08 May 2018 15:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=XdU8P3iE2P0MFK9soiU0i94HvJYFXKxVRe1v7GYUoAM=; b=WVhLtmX7DnDinGl7BJt6njQ0MkDXCgjZ1gaercBTU/fNClhCsTwlliAs1gVaz7rJDw ye/RHNPCO9ef+XTju33SGkEWGQZACCBOLvgnxPBOEpq6Zo8z3SXNOUv0Zq6f/TjCnYaC v+gVUOIVXa3x6aiEdvEwBlSrc6hoYqsPiXtJ0BpbwLsaBwJhvxtIicFk8EpwKA5dGyYD 5UNqTpAWembYbWkbn/fF7idgVlebwEkXO7nPxIev9A8pIG3eWE/9ziZ3LeROK6OobRRX 4TgBCIVSssh39ctrYv6Z2cs+t6sWPGP3bqEBx/aDQNfUxz8zz+wJ45RUrZNzXXD+v0ku hCJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=XdU8P3iE2P0MFK9soiU0i94HvJYFXKxVRe1v7GYUoAM=; b=EkF9o9+PX9eoAX9kNh/rnFvUtNZzMsqQyH0S0mle2zdAVYdlCuW7ERHmMXd//r7OnO yJU1KlqdiCabMT5AOCAmCzK78DrRe6a9rRPiDOtqKjOLhWEvnjwPr1dBZDWnWvAZnLZx 1lkQLO2YO7PAWpqtmrsWTwHMQnrfMJaYdwAoAxkYq1W+dOm5O4pR7hs6J6+DcCfet0ca E9X76BquZZlDULCqDLwfgn5F0oibZAr+IFDOMCV9G955GrMNiij7Z07pRRl6AwAHNQDC 1N2gLTfB97S5bZrN1yZh8rDejnkPknL/9ZdBegm2IUScQpVsgbl47aUpa09Y1JTevfli 59nw== X-Gm-Message-State: ALQs6tDqRtSYjb/RDKfNZaCLXvcvFqsAZMx2bDiC6wbRRAEatbAF+g8e jFpfzYCs09/VpqyKIjP2IMJ80/ak X-Google-Smtp-Source: AB8JxZrh6+n6rpEcCOSyFDjd3yHrGPnDceCS6EmjM7ivDN8vvJ6rSg7mLyWp7zzi6SRA9P4SaPIIcQ== X-Received: by 2002:a50:b6e2:: with SMTP id f31-v6mr57031242ede.23.1525817696853; Tue, 08 May 2018 15:14:56 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-189-60.clienti.tiscali.it. [78.12.189.60]) by smtp.gmail.com with ESMTPSA id c15-v6sm14020129edr.78.2018.05.08.15.14.55 for <qemu-devel@nongnu.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 May 2018 15:14:56 -0700 (PDT) From: Paolo Bonzini <pbonzini@redhat.com> To: qemu-devel@nongnu.org Date: Wed, 9 May 2018 00:14:22 +0200 Message-Id: <1525817687-34620-6-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1525817687-34620-1-git-send-email-pbonzini@redhat.com> References: <1525817687-34620-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 05/30] qom: allow object_get_canonical_path_component without parent X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> |
Series |
[PULL,01/30] configure: recognize more rpmbuild macros
|
expand
|
diff --git a/include/qom/object.h b/include/qom/object.h index 96ce81b..a0c78c7 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1302,6 +1302,7 @@ Object *object_get_internal_root(void); * * Returns: The final component in the object's canonical path. The canonical * path is the path within the composition tree starting from the root. + * %NULL if the object doesn't have a parent (and thus a canonical path). */ gchar *object_get_canonical_path_component(Object *obj); diff --git a/qom/object.c b/qom/object.c index 76a89af..0fc9720 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1644,8 +1644,9 @@ gchar *object_get_canonical_path_component(Object *obj) ObjectProperty *prop = NULL; GHashTableIter iter; - g_assert(obj); - g_assert(obj->parent != NULL); + if (obj->parent == NULL) { + return NULL; + } g_hash_table_iter_init(&iter, obj->parent->properties); while (g_hash_table_iter_next(&iter, NULL, (gpointer *)&prop)) {
Just return NULL; any callers that cause a change in behavior would have caused an assertion failure before, so this is safe. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- include/qom/object.h | 1 + qom/object.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-)