Received: from eggs.gnu.org ([2001:4830:134:3::10]:35323) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3jJU-0001pc-8E for qemu-devel@nongnu.org; Mon, 07 Nov 2016 07:46:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3jJP-0000pm-9F for qemu-devel@nongnu.org; Mon, 07 Nov 2016 07:46:12 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:52556) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c3jJP-0000pX-0j for qemu-devel@nongnu.org; Mon, 07 Nov 2016 07:46:07 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uA7ChqpM137686 for ; Mon, 7 Nov 2016 07:46:05 -0500 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 26jqgrfvqy-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 07 Nov 2016 07:46:05 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 7 Nov 2016 12:46:02 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id C11941B08061 for ; Mon, 7 Nov 2016 12:48:12 +0000 (GMT) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uA7Ck0cu10092880 for ; Mon, 7 Nov 2016 12:46:00 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uA7Ck0gG005701 for ; Mon, 7 Nov 2016 05:46:00 -0700 References: <1477705687-31175-1-git-send-email-ehabkost@redhat.com> <1477705687-31175-8-git-send-email-ehabkost@redhat.com> From: Halil Pasic Date: Mon, 7 Nov 2016 13:45:59 +0100 MIME-Version: 1.0 In-Reply-To: <1477705687-31175-8-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Message-Id: <14edf10a-a961-3216-2cbb-c839ce913725@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: Igor Mammedov , Markus Armbruster , =?UTF-8?Q?Andreas_F=c3=a4rber?= On 10/29/2016 03:48 AM, Eduardo Habkost wrote: > When an abstract class is used on device-list-properties, we can > simply return the class properties registered for the class. > > This will be useful if management software needs to query for > supported options that apply to all devices of a given type (e.g. > options supported by all CPU models, options supported by all PCI > devices). This will question is slightly off topic (sorry about that) but it does concern the feature you are trying to establish. I stumbled upon this while trying clean up qdev properties in virtio-ccw. What I dislike is that there is a bunch of properties which are conceptually inherited from ancestor classes (like devno from CcwDevice) yet the qdev properties are independent at the moment (that is each device declares the devno property for itself -- lots of code duplication). Now here comes the problem. The ioeventfd property is a property of the transport (that is logically belonging to VirtioCcwDevice) and tells if QEMU should use ioeventfd for notifiers. The trouble is this property is not present for vhost devices since basically the ioeventfd is used by the in host kernel vhost driver, so the degree of freedom is gone. By the way, we have the same with virtio-pci and there the ioeventfd property was simply left out of common virtio-pci properties regardless of the properties memory backing (where the set writes to and get reads from) sitting in that is the base class. Now I think loosing a degree of freedom in the process of specialization is not something outrageous, but I was unable to figure out how this is to be modeled with your class based property approach. Can you help me here? With the old object anchored properties I was tempted to do something like simply just removing the property form the object or overriding it with a read only property but this would now break the semantic of class properties. Of course having the data backing in the parent and the property in the child does work but is IMHO kind of ugly. Regards, Halil > > Signed-off-by: Eduardo Habkost