From: malc <av1474@comtv.ru>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [4766] Add calls to pci_device_save/load
Date: Sat, 21 Jun 2008 17:14:52 +0000 [thread overview]
Message-ID: <E1KA6fr-0003Gj-Vd@cvs.savannah.gnu.org> (raw)
Revision: 4766
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4766
Author: malc
Date: 2008-06-21 17:14:50 +0000 (Sat, 21 Jun 2008)
Log Message:
-----------
Add calls to pci_device_save/load
Modified Paths:
--------------
trunk/hw/ac97.c
trunk/hw/es1370.c
Modified: trunk/hw/ac97.c
===================================================================
--- trunk/hw/ac97.c 2008-06-20 17:42:20 UTC (rev 4765)
+++ trunk/hw/ac97.c 2008-06-21 17:14:50 UTC (rev 4766)
@@ -1190,6 +1190,8 @@
uint8_t active[LAST_INDEX];
AC97LinkState *s = opaque;
+ pci_device_save (s->pci_dev, f);
+
qemu_put_be32s (f, &s->glob_cnt);
qemu_put_be32s (f, &s->glob_sta);
qemu_put_be32s (f, &s->cas);
@@ -1217,13 +1219,18 @@
static int ac97_load (QEMUFile *f, void *opaque, int version_id)
{
+ int ret;
size_t i;
uint8_t active[LAST_INDEX];
AC97LinkState *s = opaque;
- if (version_id != 1)
+ if (version_id != 2)
return -EINVAL;
+ ret = pci_device_load (s->pci_dev, f);
+ if (ret)
+ return ret;
+
qemu_get_be32s (f, &s->glob_cnt);
qemu_get_be32s (f, &s->glob_sta);
qemu_get_be32s (f, &s->cas);
@@ -1370,7 +1377,7 @@
pci_register_io_region (&d->dev, 0, 256 * 4, PCI_ADDRESS_SPACE_IO, ac97_map);
pci_register_io_region (&d->dev, 1, 64 * 4, PCI_ADDRESS_SPACE_IO, ac97_map);
- register_savevm ("ac97", 0, 1, ac97_save, ac97_load, s);
+ register_savevm ("ac97", 0, 2, ac97_save, ac97_load, s);
qemu_register_reset (ac97_on_reset, s);
AUD_register_card (audio, "ac97", &s->card);
ac97_on_reset (s);
Modified: trunk/hw/es1370.c
===================================================================
--- trunk/hw/es1370.c 2008-06-20 17:42:20 UTC (rev 4765)
+++ trunk/hw/es1370.c 2008-06-21 17:14:50 UTC (rev 4766)
@@ -936,6 +936,7 @@
ES1370State *s = opaque;
size_t i;
+ pci_device_save (s->pci_dev, f);
for (i = 0; i < NB_CHANNELS; ++i) {
struct chan *d = &s->chan[i];
qemu_put_be32s (f, &d->shift);
@@ -953,13 +954,18 @@
static int es1370_load (QEMUFile *f, void *opaque, int version_id)
{
+ int ret;
uint32_t ctl, sctl;
ES1370State *s = opaque;
size_t i;
- if (version_id != 1)
+ if (version_id != 2)
return -EINVAL;
+ ret = pci_device_load (s->pci_dev, f);
+ if (ret)
+ return ret;
+
for (i = 0; i < NB_CHANNELS; ++i) {
struct chan *d = &s->chan[i];
qemu_get_be32s (f, &d->shift);
@@ -1056,7 +1062,7 @@
s->pci_dev = &d->dev;
pci_register_io_region (&d->dev, 0, 256, PCI_ADDRESS_SPACE_IO, es1370_map);
- register_savevm ("es1370", 0, 1, es1370_save, es1370_load, s);
+ register_savevm ("es1370", 0, 2, es1370_save, es1370_load, s);
qemu_register_reset (es1370_on_reset, s);
AUD_register_card (audio, "es1370", &s->card);
reply other threads:[~2008-06-21 17:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=E1KA6fr-0003Gj-Vd@cvs.savannah.gnu.org \
--to=av1474@comtv.ru \
--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).