From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WL6yB-00062a-FY for qemu-devel@nongnu.org; Wed, 05 Mar 2014 03:14:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WL6y3-0007tZ-1t for qemu-devel@nongnu.org; Wed, 05 Mar 2014 03:14:27 -0500 Received: from mail-qg0-x230.google.com ([2607:f8b0:400d:c04::230]:51110) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WL6y2-0007tU-T3 for qemu-devel@nongnu.org; Wed, 05 Mar 2014 03:14:18 -0500 Received: by mail-qg0-f48.google.com with SMTP id j107so2022090qga.7 for ; Wed, 05 Mar 2014 00:14:18 -0800 (PST) Sender: Paolo Bonzini Message-ID: <5316DCD3.3000306@redhat.com> Date: Wed, 05 Mar 2014 09:14:11 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1393969512-9468-1-git-send-email-stefanha@redhat.com> In-Reply-To: <1393969512-9468-1-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/4] qom: link property fixes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Peter Maydell , Andreas Faerber , Anthony Liguori 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() callers. > 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. 2) in patch 3 what you're adding is not exactly a setter; it is more like a check. I think we should either switch to a get/set model (more consistent with other properties, but more boilerplate too), or rename it to something else than "check". Paolo > Stefan Hajnoczi (4): > qom: split object_property_set_link() > qom: make QOM link property unref optional > qom: add set() argument to object_property_add_link() > virtio-rng: avoid default_backend refcount leak > > hw/core/qdev-properties.c | 12 ++++ > hw/core/qdev.c | 9 ++- > hw/dma/xilinx_axidma.c | 16 ++++-- > hw/net/xilinx_axienet.c | 16 ++++-- > hw/pcmcia/pxa2xx.c | 5 +- > hw/s390x/s390-virtio-bus.c | 4 +- > hw/s390x/virtio-ccw.c | 4 +- > hw/virtio/virtio-pci.c | 4 +- > hw/virtio/virtio-rng.c | 7 ++- > include/hw/qdev-properties.h | 11 ++++ > include/qom/object.h | 19 ++++++- > qom/object.c | 128 ++++++++++++++++++++++++++++++++----------- > ui/console.c | 4 +- > 13 files changed, 190 insertions(+), 49 deletions(-) >