qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 23/28] smbus-eeprom: remove PROP_PTR


From: Marc-André Lureau
Subject: Re: [PATCH v2 23/28] smbus-eeprom: remove PROP_PTR
Date: Tue, 22 Oct 2019 19:56:03 +0200

Hi

On Tue, Oct 22, 2019 at 7:19 PM Peter Maydell <address@hidden> wrote:
>
> On Tue, 22 Oct 2019 at 17:24, Marc-André Lureau
> <address@hidden> wrote:
> >
> > Instead, set the initial data field directly.
> >
> > (the initial data is an array of 256 bytes. As I don't know if it may
> > change over time, I keep the pointer to original buffer as is, but it
> > might be worth to consider to copy it instead)
>
> All the callers to smbus_eeprom_init_one() allocate the
> memory for the initial data, populate it, pass the pointer
> to smbus_eeprom_init_one() and do not save the pointer
> anyway. So we effectively "own" the data -- we could choose
> to copy the data and make the callers free the memory instead.
>
> > Signed-off-by: Marc-André Lureau <address@hidden>
>
> I'd still like to know what the right QOM way to pass
> 256 bytes of constant data to a device as a property is.
>

A property with a uint list visitor is the closest thing we have I
guess. We can probably have a specialized QObject to hold a fixed
array, but string form will probably remain a list, I guess.

I can try that, but this is quite complicated to pass 256 bytes internally..



reply via email to

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