From patchwork Thu Nov 19 14:09:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 546481 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 67FEE1402D6 for ; Fri, 20 Nov 2015 01:10:25 +1100 (AEDT) Received: from localhost ([::1]:41950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzPup-0000fG-H8 for incoming@patchwork.ozlabs.org; Thu, 19 Nov 2015 09:10:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzPuM-0008EE-1N for qemu-devel@nongnu.org; Thu, 19 Nov 2015 09:09:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzPuH-0005t5-R1 for qemu-devel@nongnu.org; Thu, 19 Nov 2015 09:09:53 -0500 Received: from mx2.suse.de ([195.135.220.15]:40804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzPuH-0005sx-IG for qemu-devel@nongnu.org; Thu, 19 Nov 2015 09:09:49 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CB269AAC4; Thu, 19 Nov 2015 14:09:23 +0000 (UTC) To: "Daniel P. Berrange" , Peter Maydell References: <1447879178-5440-1-git-send-email-afaerber@suse.de> <20151119115359.GD9247@redhat.com> From: =?UTF-8?Q?Andreas_F=c3=a4rber?= X-Enigmail-Draft-Status: N1110 Organization: SUSE Linux GmbH Message-ID: <564DD82B.5070203@suse.de> Date: Thu, 19 Nov 2015 15:09:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151119115359.GD9247@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 Cc: Pavel Fedin , QEMU Developers Subject: Re: [Qemu-devel] [PULL for-2.5 00/10] QOM devices patch queue 2015-11-18 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 Am 19.11.2015 um 12:53 schrieb Daniel P. Berrange: > On Thu, Nov 19, 2015 at 10:54:15AM +0000, Peter Maydell wrote: >> On 18 November 2015 at 20:39, Andreas Färber wrote: >>> Hello Peter, >>> >>> This is my late QOM (devices) patch queue. Please pull. >>> >>> Regards, >>> Andreas >>> >>> Cc: Peter Maydell >>> Cc: Daniel P. Berrange >>> Cc: Pavel Fedin >>> >>> The following changes since commit 74fcbd22d20a2fbc1a47a7b00cce5bf98fd7be5f: >>> >>> hw/misc: Add support for ADC controller in Xilinx Zynq 7000 (2015-11-12 21:30:42 +0000) >>> >>> are available in the git repository at: >>> >>> git://github.com/afaerber/qemu-cpu.git tags/qom-devices-for-peter >>> >>> for you to fetch changes up to c5760450796433621ccdc125866a84b892e2d5b6: >>> >>> MAINTAINERS: Add check-qom-{interface,proplist} to QOM (2015-11-18 21:13:50 +0100) >>> >>> ---------------------------------------------------------------- >>> QOM infrastructure fixes and device conversions >>> >>> * Fix for properties on objects > 4 GiB >>> * Performance improvements for QOM property handling >>> * Assertion cleanups >>> * MAINTAINERS additions >> >> Hi. Unfortunately this doesn't build with our minimum supported >> glib version: >> >> /Users/pm215/src/qemu-for-merges/qom/object.c:921:9: warning: implicit >> declaration of function 'g_hash_table_contains' is invalid in C99 >> [-Wimplicit-function-declaration] >> if (g_hash_table_contains(obj->properties, name)) { >> ^ >> >> g_hash_table_contains was only introduced in glib 2.32. > > Since we never store NULL as a valid value in the hash tble, we > can simply replace this with g_hash_table_lookup instead Seems to work fine, too: object_get_typename(obj)); Will respin. Thanks, Andreas Reviewed-by: Daniel P. Berrange diff --git a/qom/object.c b/qom/object.c index 19e7561..ff34c86 100644 --- a/qom/object.c +++ b/qom/object.c @@ -918,7 +918,7 @@ object_property_add(Object *obj, const char *name, const char *type, return ret; } - if (g_hash_table_contains(obj->properties, name)) { + if (g_hash_table_lookup(obj->properties, name) != NULL) { error_setg(errp, "attempt to add duplicate property '%s'" " to object (type '%s')", name,