[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 02/17] ipmi: Add a PC ISA type structure

From: Corey Minyard
Subject: Re: [Qemu-devel] [PATCH 02/17] ipmi: Add a PC ISA type structure
Date: Fri, 15 May 2015 20:48:27 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

On 05/13/2015 09:52 AM, Paolo Bonzini wrote:
> 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.
>> 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=bmc0,chardev=foo
>    -device isa-ipmi-kcs,bmc=bmc0
> vs.
>    -object ipmi-bmc,id=bmc0
>    -device isa-ipmi-bt,bmc=bmc0
> 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
I've been trying to piece this together, and the problem is that BT and
KCS can sit on different kinds of busses, not just ISA.  There are PCI
and memory based implementations.  I'd prefer to have one implementation
for all, so I'm trying to figure out a way to piece all these things

What I've come up with is the following class structure:

IPMIBmc (abstract subclass of Device)
  Implements the base BMC handling

IPMIBmcInternal (subclass of IPMIBmc)
  An internal BMC

IPMIBmcExternal (subclass of IPMIBmc)
  A connection to an external BMC

BusDevice (subclass of Interface)
  An interface where a device can connect to a bus and do I/O and

BusDeviceISA (subclass of ISADevice, implements BusDevice)
  An ISA interface for BusDevice

IPMIInterface (subclass of Interface)
  An Interface that connects between a BMC and a physical IPMI interface
  (BT, KCS, SMBus)

IPMIDevice (abstract subclass of Device, implements IPMIInterface)
  The base class for the various IPMI devices.  This code finds the IPMIBmc
  and the BusDevice objects and plugs them in to the subclasses of this

IPMIDevKCS (subclass of IPMIDevice)
  KCS interface

IPMIDevBT (subclass of IPMIDevice)
  BT interface

So on the command line, you would say:

  -device isadev,irq=5,id=ipmiisadev,addr=0xca2 -device
  -device ipmi-kcs,bmc=bmc1,busdev=ipmiisadev

This seems rather complicated, but it seem like the only way to break
this up.  And
I don't know if object_property_add_link() works on interfaces, but that
should be easy
to fix if it doesn't.

Does this sound plausible?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]