On 12/03/2009 02:55 PM, Juan Quintela wrote:
sorry, already allocated memory. basically -device foo
requires that qdev creates foo and then it call foo_init().
Alternatives:
- foo_init() allocates Foo and calls qdev_init() (how C++ works, but
cumbersome here)
- we put the offset of D
"Michael S. Tsirkin" wrote:
> On Thu, Dec 03, 2009 at 12:56:57PM +0100, Juan Quintela wrote:
>> "Michael S. Tsirkin" wrote:
>> > On Wed, Dec 02, 2009 at 08:03:22PM +0100, Juan Quintela wrote:
>> >> "Michael S. Tsirkin" wrote:
>> >>
>> >> > I don't understand.
>> >> > container_of is just more g
On Thu, Dec 03, 2009 at 12:56:57PM +0100, Juan Quintela wrote:
> "Michael S. Tsirkin" wrote:
> > On Wed, Dec 02, 2009 at 08:03:22PM +0100, Juan Quintela wrote:
> >> "Michael S. Tsirkin" wrote:
> >>
> >> > I don't understand.
> >> > container_of is just more generic than DO_UPCAST.
> >> > So why
"Michael S. Tsirkin" wrote:
> On Wed, Dec 02, 2009 at 08:03:22PM +0100, Juan Quintela wrote:
>> "Michael S. Tsirkin" wrote:
>>
>> > I don't understand.
>> > container_of is just more generic than DO_UPCAST.
>> > So why *ever* use DO_UPCAST? Let's get rid of it.
>> See how you create a dev
On Wed, Dec 02, 2009 at 08:03:22PM +0100, Juan Quintela wrote:
> "Michael S. Tsirkin" wrote:
>
> > I don't understand.
> > container_of is just more generic than DO_UPCAST.
> > So why *ever* use DO_UPCAST? Let's get rid of it.
>
> functions that use a PCIDevice and you pass FooState "require" th
"Michael S. Tsirkin" wrote:
> I don't understand.
> container_of is just more generic than DO_UPCAST.
> So why *ever* use DO_UPCAST? Let's get rid of it.
functions that use a PCIDevice and you pass FooState "require" that
PCIDevice to be the 1st element in the struct.
Notice that it is "require
On Wed, Dec 02, 2009 at 07:42:35PM +0100, Juan Quintela wrote:
> "Michael S. Tsirkin" wrote:
> > On Wed, Dec 02, 2009 at 07:19:17PM +0100, Juan Quintela wrote:
> >> "Michael S. Tsirkin" wrote:
> >> > On Wed, Dec 02, 2009 at 01:04:04PM +0100, Juan Quintela wrote:
> >> >> virtio_common_init() creat
"Michael S. Tsirkin" wrote:
> On Wed, Dec 02, 2009 at 07:19:17PM +0100, Juan Quintela wrote:
>> "Michael S. Tsirkin" wrote:
>> > On Wed, Dec 02, 2009 at 01:04:04PM +0100, Juan Quintela wrote:
>> >> virtio_common_init() creates a struct with the right size, DO_UPCAST
>> >> is the appropiate thing
On Wed, Dec 02, 2009 at 07:19:17PM +0100, Juan Quintela wrote:
> "Michael S. Tsirkin" wrote:
> > On Wed, Dec 02, 2009 at 01:04:04PM +0100, Juan Quintela wrote:
> >> virtio_common_init() creates a struct with the right size, DO_UPCAST
> >> is the appropiate thing here
> >>
> >> Signed-off-by: Juan
"Michael S. Tsirkin" wrote:
> On Wed, Dec 02, 2009 at 01:04:04PM +0100, Juan Quintela wrote:
>> virtio_common_init() creates a struct with the right size, DO_UPCAST
>> is the appropiate thing here
>>
>> Signed-off-by: Juan Quintela
>
> BTW why not container_of? That one does not require
> field
On Wed, Dec 02, 2009 at 01:04:04PM +0100, Juan Quintela wrote:
> virtio_common_init() creates a struct with the right size, DO_UPCAST
> is the appropiate thing here
>
> Signed-off-by: Juan Quintela
BTW why not container_of? That one does not require
field to be at the beginning of structure.
>
11 matches
Mail list logo