From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYt2L-0008I3-D3 for qemu-devel@nongnu.org; Tue, 30 Sep 2014 04:44:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYt2A-0003Ok-UU for qemu-devel@nongnu.org; Tue, 30 Sep 2014 04:43:57 -0400 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:54363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYt2A-0003O6-KR for qemu-devel@nongnu.org; Tue, 30 Sep 2014 04:43:46 -0400 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 30 Sep 2014 09:43:40 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 9B9321B0805F for ; Tue, 30 Sep 2014 09:44:49 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s8U8hbD453870732 for ; Tue, 30 Sep 2014 08:43:37 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s8U8ha4L018386 for ; Tue, 30 Sep 2014 02:43:37 -0600 Date: Tue, 30 Sep 2014 10:43:31 +0200 From: Cornelia Huck Message-ID: <20140930104331.287ec03e.cornelia.huck@de.ibm.com> In-Reply-To: <1412057438-10004-4-git-send-email-arei.gonglei@huawei.com> References: <1412057438-10004-1-git-send-email-arei.gonglei@huawei.com> <1412057438-10004-4-git-send-email-arei.gonglei@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 03/12] virtio/vhost-scsi: use aliases instead of duplicate qdev properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com Cc: weidong.huang@huawei.com, mst@redhat.com, armbru@redhat.com, luonengjun@huawei.com, agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, stefanha@redhat.com, pbonzini@redhat.com, peter.huangpeng@huawei.com, rth@twiddle.net On Tue, 30 Sep 2014 14:10:29 +0800 wrote: > From: Gonglei > > {virtio, vhost}-scsi-{pci, s390, ccw} all duplicate the > qdev properties of their VirtIOSCSI/VHostSCSI child. > This approach does not work 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 > VirtIOSCSI/VHostSCSI child. This way no duplication is necessary. > > Signed-off-by: Gonglei > --- > hw/s390x/s390-virtio-bus.c | 4 ++-- > hw/s390x/virtio-ccw.c | 4 ++-- > hw/virtio/virtio-pci.c | 4 ++-- > 3 files changed, 6 insertions(+), 6 deletions(-) I just noticed that qemu-system-s390x -device vhost-scsi-{s390,ccw},? segfaults on me - but it also does on master, so that is an orthogonal problem I'll look into later. This patch looks fine to me and actually also fixes a bug for ccw where vhost-scsi referenced VirtIOSCSICcw instead of VHostSCSICcw, so: Reviewed-by: Cornelia Huck