qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: qemu-devel <qemu-devel@nongnu.org>,
	Markus Armbruster <armbru@redhat.com>
Cc: Gleb Natapov <gleb@redhat.com>
Subject: [Qemu-devel] [PATCH v2] qdev: Reset hot-plugged devices
Date: Sun, 24 Jul 2011 19:38:36 +0200	[thread overview]
Message-ID: <4E2C589C.8040101@web.de> (raw)
In-Reply-To: <4E2C4DE1.6010002@web.de>

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

  reply	other threads:[~2011-07-24 17:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-24 16:52 [Qemu-devel] [PATCH] qdev: Reset hot-plugged devices Jan Kiszka
2011-07-24 17:38 ` Jan Kiszka [this message]
2011-07-29 14:17   ` [Qemu-devel] [PATCH v2] " Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E2C589C.8040101@web.de \
    --to=jan.kiszka@web.de \
    --cc=armbru@redhat.com \
    --cc=gleb@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).