From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WL8Aw-0001EZ-Kl for qemu-devel@nongnu.org; Wed, 05 Mar 2014 04:31:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WL8An-0002Vo-SV for qemu-devel@nongnu.org; Wed, 05 Mar 2014 04:31:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WL8An-0002VS-KC for qemu-devel@nongnu.org; Wed, 05 Mar 2014 04:31:33 -0500 Message-ID: <5316EEEF.30901@redhat.com> Date: Wed, 05 Mar 2014 10:31:27 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1393969512-9468-1-git-send-email-stefanha@redhat.com> <5316DCD3.3000306@redhat.com> <5316ED59.8010400@suse.de> In-Reply-To: <5316ED59.8010400@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 0/4] qom: link property fixes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Peter Maydell , Anthony Liguori Il 05/03/2014 10:24, Andreas F=C3=A4rber ha scritto: > Am 05.03.2014 09:14, schrieb Paolo Bonzini: >> Il 04/03/2014 22:45, Stefan Hajnoczi ha scritto: >>> There are two problems with QOM link properties: >>> >>> 1. There are refcount leaks in many object_property_add_link() caller= s. >>> 2. There is no way to prevent link properties from being set after a >>> device is >>> realized. >>> >>> This patch series fixes these issues by extending the >>> object_property_add_link() function. >> >> Thanks for looking into this! Just two (mostly) cosmetic comments: >> >> 1) in patch 2 we could use a flags argument instead of a "bool". This >> is more easily extensible and self-documenting. > > I wonder if we can do this more cleverly: The two ways a link<> propert= y > can get set that I can think of are either a) assigning the field a new > value in C code or b) using object_property_set_link() with a textual > path. Can't the latter simply save an unref flag within the property's > opaque when used? Sounds too magic... Paolo