qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 5/9] hw/timer: QOM'ify m48txx_sysbus (pass 2)


From: hitmoon
Subject: Re: [Qemu-devel] [PATCH v4 5/9] hw/timer: QOM'ify m48txx_sysbus (pass 2)
Date: Mon, 22 Feb 2016 18:28:43 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0



在 2016年02月22日 17:24, Peter Maydell 写道:
On 22 February 2016 at 09:11, xiaoqiang zhao <address@hidden> wrote:
assign DeviceClass::vmsd instead of using vmstate_register function

Signed-off-by: xiaoqiang zhao <address@hidden>
---
  hw/timer/m48t59.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/timer/m48t59.c b/hw/timer/m48t59.c
index 3c683aa..b0cf79d 100644
--- a/hw/timer/m48t59.c
+++ b/hw/timer/m48t59.c
@@ -742,8 +742,6 @@ static void m48t59_realize_common(M48t59State *s, Error 
**errp)
          s->wd_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, &watchdog_cb, s);
      }
      qemu_get_timedate(&s->alarm, 0);
-
-    vmstate_register(NULL, -1, &vmstate_m48t59, s);
  }

  static void m48t59_isa_realize(DeviceState *dev, Error **errp)
@@ -822,6 +820,7 @@ static void m48txx_isa_class_init(ObjectClass *klass, void 
*data)
      dc->realize = m48t59_isa_realize;
      dc->reset = m48t59_reset_isa;
      dc->props = m48t59_isa_properties;
+    dc->vmsd = &vmstate_m48t59;
      nc->read = m48txx_isa_read;
      nc->write = m48txx_isa_write;
      nc->toggle_lock = m48txx_isa_toggle_lock;
@@ -866,6 +865,7 @@ static void m48txx_sysbus_class_init(ObjectClass *klass, 
void *data)
      dc->realize = m48t59_realize;
      dc->reset = m48t59_reset_sysbus;
      dc->props = m48t59_sysbus_properties;
+    dc->vmsd = &vmstate_m48t59;
      nc->read = m48txx_sysbus_read;
      nc->write = m48txx_sysbus_write;
      nc->toggle_lock = m48txx_sysbus_toggle_lock;
--
2.1.4

Just noticed this won't work as it is -- the vmstate
struct is for the M48t59State*, but the ISA and
Sysbus wrappers have their own structs which are
what the dc->vmsd will be wanting to operate on.
You'd need extra VMState structs I think and
somebody who knows migration better than me to say
whether that is a migration compat break.

thanks
-- PMM
It seems that the old code also use the same vmstate structure. Maybe it's a common structure which will not be used at the same time.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]