From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlJkx-0001lj-6a for qemu-devel@nongnu.org; Fri, 16 May 2014 11:09:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WlJko-0006RF-66 for qemu-devel@nongnu.org; Fri, 16 May 2014 11:09:07 -0400 Received: from [2001:41d0:8:2b42::1] (port=49993 helo=greensocs.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlJkn-0006R5-SX for qemu-devel@nongnu.org; Fri, 16 May 2014 11:08:58 -0400 Message-ID: <53762A08.50106@greensocs.com> Date: Fri, 16 May 2014 17:08:56 +0200 From: Frederic Konrad MIME-Version: 1.0 References: <1395244138-8834-1-git-send-email-stefanha@redhat.com> In-Reply-To: <1395244138-8834-1-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 0/5] virtio: use alias properties in transport devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Peter Maydell , Andreas Faerber On 19/03/2014 16:48, Stefan Hajnoczi wrote: > This RFC is just the beginning. The same problem exists for virtio-net and > other devices. I am looking for feedback before I convert all of virtio. > > The virtio transport/device split is broken as follows: > > 1. The virtio-blk device is never finalized because the transport devices > (virtio-blk-pci and friends) leak the refcount. > > 2. If we fix the refcount leak then we double-free the 'serial' string property > upon hot unplug since its char* is copied into the virtio-blk device which > has an identical 'serial' qdev property. > > This series solves both of these problems as follows: > > 1. Introduce a qdev child alias property that lets the transport device forward > qdev property accesses into the virtio device (the child). > > 2. Use qdev child alias properties in transport devices, instead of keeping a > duplicate copy of the VirtIOBlkConf struct. > > 3. Fix the virtio-blk device refcount leak. It's now safe to do this since the > double-free has been resolved. > > Note about the new qdev child alias property type: I haven't made the alias > fully transparent yet. Perhaps we should hide the alias completely? > $ qemu-system-x86_64 -device virtio-blk-pci,\? > ... > virtio-blk-pci.logical_block_size=ChildAlias <--- should be uint64 or similar > > Stefan Hajnoczi (5): > qdev: add child alias properties > virtio: add child alias properties for virtio-blk > virtio: use child aliases for virtio-blk transport properties > virtio-blk: drop virtio_blk_set_conf() > virtio: fix virtio-blk child refcount in transports > > hw/block/virtio-blk.c | 6 ------ > hw/core/qdev-properties.c | 28 ++++++++++++++++++++++++++++ > hw/s390x/s390-virtio-bus.c | 4 ++-- > hw/s390x/s390-virtio-bus.h | 1 - > hw/s390x/virtio-ccw.c | 6 +++--- > hw/s390x/virtio-ccw.h | 1 - > hw/virtio/virtio-pci.c | 6 +++--- > hw/virtio/virtio-pci.h | 1 - > include/hw/block/block.h | 14 ++++++++++++++ > include/hw/qdev-properties.h | 28 ++++++++++++++++++++++++++++ > include/hw/virtio/virtio-blk.h | 17 ++++++++++++++++- > 11 files changed, 94 insertions(+), 18 deletions(-) > Hi, Sorry I missed this. Is there any repo with those patches I can clone? Thanks, Fred