From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnQ4t-0001WR-O3 for qemu-devel@nongnu.org; Thu, 22 May 2014 06:18:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnQ4j-0000sb-U5 for qemu-devel@nongnu.org; Thu, 22 May 2014 06:18:23 -0400 Received: from cantor2.suse.de ([195.135.220.15]:47791 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnQ4j-0000s9-O6 for qemu-devel@nongnu.org; Thu, 22 May 2014 06:18:13 -0400 Message-ID: <537DCEE2.1020402@suse.de> Date: Thu, 22 May 2014 12:18:10 +0200 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1400703772-3324-1-git-send-email-stefanha@redhat.com> <1400703772-3324-5-git-send-email-stefanha@redhat.com> <537D22EC.1090409@redhat.com> In-Reply-To: <537D22EC.1090409@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 4/7] virtio-blk: use aliases instead of duplicate qdev properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Peter Crosthwaite , Frederic Konrad Am 22.05.2014 00:04, schrieb Paolo Bonzini: > Il 21/05/2014 22:22, Stefan Hajnoczi ha scritto: >> virtio-blk-pci, virtio-blk-s390, and virtio-blk-ccw all duplicate the >> qdev properties of their VirtIOBlock child. This approach does not wo= rk >> well with string or pointer properties since we must be careful about >> leaking or double-freeing them. >> >> Use the QOM alias property to forward property accesses to the >> VirtIOBlock child. This way no duplication is necessary. >> >> Remember to stop calling virtio_blk_set_conf() so that we don't clobbe= r >> the values already set on the VirtIOBlock instance. >=20 > Which properties are _not_ being added? This is probably needed for al= l > other virtio devices so a generic solution would be nice. "type", "realized" and the child<> property for VirtIODevice come to mind, possibly one or two more. If we follow a generic scheme, we could add an .instance_post_init hook for VirtIOPCIProxy iterating over all properties and blacklisting some. Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg