From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 3/4] qdev: integrate vmstate
Date: Tue, 1 Sep 2009 09:56:14 +0200 [thread overview]
Message-ID: <1251791775-5358-4-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1251791775-5358-1-git-send-email-kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qdev.c | 6 ++++++
hw/qdev.h | 3 +++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/hw/qdev.c b/hw/qdev.c
index e045968..288f95b 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -218,12 +218,18 @@ int qdev_init(DeviceState *dev)
return rc;
if (dev->info->reset)
qemu_register_reset(dev->info->reset, dev);
+ if (dev->info->vmsd)
+ vmstate_register(-1, dev->info->vmsd, dev);
return 0;
}
/* Unlink device from bus and free the structure. */
void qdev_free(DeviceState *dev)
{
+#if 0 /* FIXME: need sane vmstate_unregister function */
+ if (dev->info->vmsd)
+ vmstate_unregister(dev->info->vmsd, dev);
+#endif
if (dev->info->reset)
qemu_unregister_reset(dev->info->reset, dev);
LIST_REMOVE(dev, sibling);
diff --git a/hw/qdev.h b/hw/qdev.h
index fde29ea..103489d 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -113,6 +113,9 @@ struct DeviceInfo {
/* callbacks */
QEMUResetHandler *reset;
+ /* device state */
+ const VMStateDescription *vmsd;
+
/* Private to qdev / bus. */
qdev_initfn init;
BusInfo *bus_info;
--
1.6.2.5
next prev parent reply other threads:[~2009-09-01 7:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-01 7:56 [Qemu-devel] [PATCH 0/4] integrate more device handling bits with qdev Gerd Hoffmann
2009-09-01 7:56 ` [Qemu-devel] [PATCH 1/4] qdev: integrate reset Gerd Hoffmann
2009-09-01 16:30 ` Blue Swirl
[not found] ` <m33a76mxkc.fsf@neno.mitica>
2009-09-01 16:45 ` [Qemu-devel] " Blue Swirl
2009-09-02 6:43 ` [Qemu-devel] " Gerd Hoffmann
2009-09-01 7:56 ` [Qemu-devel] [PATCH 2/4] qdev: convert rtl8139 to reset Gerd Hoffmann
2009-09-01 7:56 ` Gerd Hoffmann [this message]
2009-09-01 7:56 ` [Qemu-devel] [PATCH 4/4] qdev: convert tcx to reset + vmsd Gerd Hoffmann
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=1251791775-5358-4-git-send-email-kraxel@redhat.com \
--to=kraxel@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).