All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qdev: Reset hot-plugged devices
@ 2011-07-24 16:52 Jan Kiszka
  2011-07-24 17:38 ` [Qemu-devel] [PATCH v2] " Jan Kiszka
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2011-07-24 16:52 UTC (permalink / raw)
  To: qemu-devel, Markus Armbruster; +Cc: Gleb Natapov

From: Jan Kiszka <jan.kiszka@siemens.com>

Device models rely on the core invoking their reset handlers after init.
We do this in the cold-plug case, but so far we miss this step after
hot-plug.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

This is also one piece in the puzzle of getting CPU hot-plug work.

 hw/qdev.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/qdev.c b/hw/qdev.c
index a0fcd06..404a91e 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -265,6 +265,9 @@ DeviceState *qdev_device_add(QemuOpts *opts)
         return NULL;
     }
     qdev->opts = opts;
+    if (qdev->hotplugged && qdev->info->reset) {
+        qdev->info->reset(qdev);
+    }
     return qdev;
 }
 
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH v2] qdev: Reset hot-plugged devices
  2011-07-24 16:52 [Qemu-devel] [PATCH] qdev: Reset hot-plugged devices Jan Kiszka
@ 2011-07-24 17:38 ` Jan Kiszka
  2011-07-29 14:17   ` Anthony Liguori
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2011-07-24 17:38 UTC (permalink / raw)
  To: qemu-devel, Markus Armbruster; +Cc: Gleb Natapov

From: Jan Kiszka <jan.kiszka@siemens.com>

Device models rely on the core invoking their reset handlers after init.
We do this in the cold-plug case, but so far we miss this step after
hot-plug.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Changes in v2:
 - move reset to qdev_init in case the device is created by the
   hot-plugged one (composed devices)

 hw/qdev.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/qdev.c b/hw/qdev.c
index a0fcd06..b4ea8e1 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -289,6 +289,9 @@ int qdev_init(DeviceState *dev)
                                        dev->alias_required_for_version);
     }
     dev->state = DEV_STATE_INITIALIZED;
+    if (dev->hotplugged && dev->info->reset) {
+        dev->info->reset(dev);
+    }
     return 0;
 }
 
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH v2] qdev: Reset hot-plugged devices
  2011-07-24 17:38 ` [Qemu-devel] [PATCH v2] " Jan Kiszka
@ 2011-07-29 14:17   ` Anthony Liguori
  0 siblings, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2011-07-29 14:17 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: qemu-devel, Gleb Natapov, Markus Armbruster

On 07/24/2011 12:38 PM, Jan Kiszka wrote:
> From: Jan Kiszka<jan.kiszka@siemens.com>
>
> Device models rely on the core invoking their reset handlers after init.
> We do this in the cold-plug case, but so far we miss this step after
> hot-plug.
>
> Signed-off-by: Jan Kiszka<jan.kiszka@siemens.com>

Applied.  Thanks.

Regards,

Anthony Liguori

> ---
>
> Changes in v2:
>   - move reset to qdev_init in case the device is created by the
>     hot-plugged one (composed devices)
>
>   hw/qdev.c |    3 +++
>   1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/hw/qdev.c b/hw/qdev.c
> index a0fcd06..b4ea8e1 100644
> --- a/hw/qdev.c
> +++ b/hw/qdev.c
> @@ -289,6 +289,9 @@ int qdev_init(DeviceState *dev)
>                                          dev->alias_required_for_version);
>       }
>       dev->state = DEV_STATE_INITIALIZED;
> +    if (dev->hotplugged&&  dev->info->reset) {
> +        dev->info->reset(dev);
> +    }
>       return 0;
>   }
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-29 14:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-24 16:52 [Qemu-devel] [PATCH] qdev: Reset hot-plugged devices Jan Kiszka
2011-07-24 17:38 ` [Qemu-devel] [PATCH v2] " Jan Kiszka
2011-07-29 14:17   ` Anthony Liguori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.