From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsY1F-00054o-Gi for qemu-devel@nongnu.org; Wed, 13 May 2015 10:52:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YsY1A-0002I5-Ng for qemu-devel@nongnu.org; Wed, 13 May 2015 10:52:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsY1A-0002Hx-II for qemu-devel@nongnu.org; Wed, 13 May 2015 10:52:16 -0400 Message-ID: <5553651B.9050401@redhat.com> Date: Wed, 13 May 2015 16:52:11 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1429829878-26862-1-git-send-email-minyard@acm.org> <1429829878-26862-3-git-send-email-minyard@acm.org> <20150426105502-mutt-send-email-mst@redhat.com> <554D2791.6070401@acm.org> <5550E641.2060108@suse.de> <5551063B.2030708@redhat.com> <555109F6.9020108@acm.org> In-Reply-To: <555109F6.9020108@acm.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 02/17] ipmi: Add a PC ISA type structure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: minyard@acm.org, =?windows-1252?Q?Andreas_F=E4rber?= , "Michael S. Tsirkin" Cc: Corey Minyard , qemu-devel@nongnu.org On 11/05/2015 21:58, Corey Minyard wrote: > I've debated this in my mind since I've been learning more about > qemu. Some of the bmc properties are being passed in to the interface > and passed on to the bmc. Plus some IPMI systems have multiple > interfaces that point to the same bmc. It might be best to have the > user create a bmc device then tie an interface device to it. >=20 > If I do this, what is the acceptable way to look up another object > this way? I hunted a bit and didn't come up with anything clean. Yes, you're right indeed!!! I think you want something like -object ipmi-bmc-extern,id=3Dbmc0,chardev=3Dfoo -device isa-ipmi-kcs,bmc=3Dbmc0 vs. -object ipmi-bmc,id=3Dbmc0 -device isa-ipmi-bt,bmc=3Dbmc0 ipmi-bmc would be a subclass of Object like the one that you have, but it needs to implement the UserCreatable interface; see backends/rng.c for an example. Then ipmi-isa-kcs would be your usual ISA device, so a subclass of TYPE_ISA_DEVICE; however it would implement IPMIInterface, which would be an interface rather than an abstract class. For an example of interface boilerplate, see hw/core/hotplug.c. For an example of how to implement the "bmc" property, see hw/mem/pc-dimm.c. Paolo