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

Re: [PATCH V5 1/6] libxl: Add support for Virtio I2C device



On 07-09-22, 18:49, Julien Grall wrote:
> Looking at this series, you will add ~250 lines (assuming your new patch)
> for the i2c and then likely the same amount for GPIO.
> 
> I am assuming that for every new virtio device (e.g. gps, sound,
> display...), we would also need to 250 lines of code. I am worry that we
> will end up to bloat libxl with duplicated code and or for device that are
> barely used.

I agree.

> I think it would be better to find a generic way to add new virtio device
> without adding code (very limited) in libxl. The advantage is someone will
> be able to create a new virtio device with less effort.
> 
> The approach I can think of is something along the lines:
> 
> virtio = ["type=<compatible>,transport=<transport>,..."]

It sounds good and yeah it will save a lot of trouble.

> where the compatible is the one that should be written in the DT and
> transport is mmio or pci. the [...] refers to specific parameters that would
> need to be passed to the backend (it is not clear how you provide them
> today?).

The backend doesn't need lot of parameters to be passed right now, the host
specific ones (like which devices on a bus to share to the guests) are passed by
its command line. The backends in our case are hypervisor agnostic and are run
independently as daemons, they just need to know base/irq, which we get from xen
libraries.

> AFAICT, the GPIO one may need some tweaking because it requires specific
> properties. I think it would be more acceptable as this will be only a few
> lines (compare to 250 lines today).

Right.

If everyone agrees, I will be happy to work towards this.

-- 
viresh



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.