Patchwork [01/38] qdev: document assumption that unrealize is followed by finalize

login
register
mail settings
Submitter Paolo Bonzini
Date Sept. 3, 2013, 12:32 p.m.
Message ID <1378211609-16121-2-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/272215/
State New
Headers show

Comments

Paolo Bonzini - Sept. 3, 2013, 12:32 p.m.
This becomes important when undoing realize's initializations is split
in two places (unrealize and exit).

The way to fix this could be to split realize further into "alloc" (done
once) and "realize" (can be undone).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/hw/qdev-core.h | 4 ++++
 1 file changed, 4 insertions(+)
Michael S. Tsirkin - Sept. 17, 2013, 9 a.m.
On Tue, Sep 03, 2013 at 02:32:52PM +0200, Paolo Bonzini wrote:
> This becomes important when undoing realize's initializations is split
> in two places (unrealize and exit).
> 
> The way to fix this could be to split realize further into "alloc" (done
> once) and "realize" (can be undone).

Or alloc + init ?

> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  include/hw/qdev-core.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
> index 46972f4..d840f06 100644
> --- a/include/hw/qdev-core.h
> +++ b/include/hw/qdev-core.h
> @@ -86,6 +86,10 @@ struct VMStateDescription;
>   * object_initialize() in their own #TypeInfo.instance_init and forward the
>   * realization events appropriately.
>   *
> + * Note that for now it is not possible to unrealize a device and then
> + * re-realize it.  While this may change in the future, it is a valid
> + * assumption for now.
> + *
>   * The @init callback is considered private to a particular bus implementation
>   * (immediate abstract child types of TYPE_DEVICE). Derived leaf types set an
>   * "init" callback on their parent class instead.
> -- 
> 1.8.3.1
>

Patch

diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 46972f4..d840f06 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -86,6 +86,10 @@  struct VMStateDescription;
  * object_initialize() in their own #TypeInfo.instance_init and forward the
  * realization events appropriately.
  *
+ * Note that for now it is not possible to unrealize a device and then
+ * re-realize it.  While this may change in the future, it is a valid
+ * assumption for now.
+ *
  * The @init callback is considered private to a particular bus implementation
  * (immediate abstract child types of TYPE_DEVICE). Derived leaf types set an
  * "init" callback on their parent class instead.