From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 08/10] ide: add save/restore support for isa
Date: Thu, 20 Aug 2009 15:22:24 +0200 [thread overview]
Message-ID: <1250774546-18951-9-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1250774546-18951-1-git-send-email-kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/ide-isa.c | 33 +++++++++++++++++++++++++++++----
1 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/hw/ide-isa.c b/hw/ide-isa.c
index 705c24d..279474b 100644
--- a/hw/ide-isa.c
+++ b/hw/ide-isa.c
@@ -33,13 +33,38 @@
/***********************************************************/
/* ISA IDE definitions */
+typedef struct ISAIDEState {
+ IDEBus *bus;
+} ISAIDEState;
+
+static void isa_ide_save(QEMUFile* f, void *opaque)
+{
+ ISAIDEState *s = opaque;
+
+ idebus_save(f, s->bus);
+ ide_save(f, &s->bus->ifs[0]);
+ ide_save(f, &s->bus->ifs[1]);
+}
+
+static int isa_ide_load(QEMUFile* f, void *opaque, int version_id)
+{
+ ISAIDEState *s = opaque;
+
+ idebus_load(f, s->bus, version_id);
+ ide_load(f, &s->bus->ifs[0], version_id);
+ ide_load(f, &s->bus->ifs[1], version_id);
+ return 0;
+}
+
void isa_ide_init(int iobase, int iobase2, qemu_irq irq,
BlockDriverState *hd0, BlockDriverState *hd1)
{
- IDEBus *bus;
+ ISAIDEState *s;
- bus = qemu_mallocz(sizeof(*bus));
+ s = qemu_mallocz(sizeof(*s));
+ s->bus = qemu_mallocz(sizeof(IDEBus));
- ide_init2(bus, hd0, hd1, irq);
- ide_init_ioport(bus, iobase, iobase2);
+ ide_init2(s->bus, hd0, hd1, irq);
+ ide_init_ioport(s->bus, iobase, iobase2);
+ register_savevm("isa-ide", 0, 3, isa_ide_save, isa_ide_load, s);
}
--
1.6.2.5
next prev parent reply other threads:[~2009-08-20 13:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-20 13:22 [Qemu-devel] [PATCH 0/10] ide: cleanup and splitting Gerd Hoffmann
2009-08-20 13:22 ` [Qemu-devel] [PATCH 01/10] ide: add IDEBus struct, cleanups Gerd Hoffmann
2009-08-20 13:22 ` [Qemu-devel] [PATCH 02/10] ide: split away ide-internal.h Gerd Hoffmann
2009-08-20 23:40 ` Natalia Portillo
2009-08-21 7:21 ` Gerd Hoffmann
2009-08-20 13:22 ` [Qemu-devel] [PATCH 03/10] ide: split away ide-isa.c Gerd Hoffmann
2009-08-20 13:22 ` [Qemu-devel] [PATCH 04/10] ide: split away ide-pci.c Gerd Hoffmann
2009-08-20 13:22 ` [Qemu-devel] [PATCH 05/10] ide: split away ide-macio.c Gerd Hoffmann
2009-08-20 13:22 ` [Qemu-devel] [PATCH 06/10] ide: split away ide-mmio.c Gerd Hoffmann
2009-08-20 13:22 ` [Qemu-devel] [PATCH 07/10] ide: split away ide-microdrive.c Gerd Hoffmann
2009-08-20 13:22 ` Gerd Hoffmann [this message]
2009-08-20 13:22 ` [Qemu-devel] [PATCH 09/10] ide: add save/restore support for mmio Gerd Hoffmann
2009-08-20 13:22 ` [Qemu-devel] [PATCH 10/10] ide: move code to hw/ide/ Gerd Hoffmann
2009-08-20 16:39 ` [Qemu-devel] Re: [PATCH 0/10] ide: cleanup and splitting Juan Quintela
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=1250774546-18951-9-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).