qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH v7 7/8] virtio-pci-blk : Switch to new API.


From: Andreas Färber
Subject: Re: [Qemu-devel] [RFC PATCH v7 7/8] virtio-pci-blk : Switch to new API.
Date: Sun, 16 Dec 2012 17:41:56 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

Am 12.12.2012 18:53, schrieb Andreas Färber:
> Finally supplying a public device_initialize() or so would be helpful
> for the latter since VMState cannot cross pointers IIRC. I'll look into
> that part since inlining the old qdev functions cripples my Tegra work.

Investigating this, it turned out that my branch was outdated in still
calling qdev_prop_set_globals(), which some good soul (Paolo?) inlined
into device initfn. So the only step taken by qdev_try_create() that
remains after object_initialize() is qdev_set_parent_bus(), which I
think does not warrant a

device_post_initialize:
-> qdev_set_parent_bus()

qdev_try_create:
-> object_new()
-> device_post_initialize()

qdev_create:
-> qdev_try_create()

device_initialize:
-> object_initialize()
-> device_post_initialize()

construction.

So, given that virtio device states are in (or moved to) a header, they
can already be embedded in a has-a virtio-bus has-a Virtio*Device device
today and initialized with object_initialize(&s->the_device) and
qdev_set_parent_bus(&s->the_device, &s->the_virtio_bus).

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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