qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-7.1 v2 0/1] use dc->vmsd with spapr devices vmstate
@ 2022-04-09 12:09 Daniel Henrique Barboza
  2022-04-09 12:09 ` [PATCH for-7.1 v2 1/1] hw/ppc: use qdev to register spapr_nvdimm vmsd Daniel Henrique Barboza
  2022-05-04 18:51 ` [PATCH for-7.1 v2 0/1] use dc->vmsd with spapr devices vmstate Daniel Henrique Barboza
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Henrique Barboza @ 2022-04-09 12:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel Henrique Barboza, qemu-ppc, clg, david

Hi,

This v2 contains only the last patch from v1, patch 4, given that all
other patches are breaking backward migration due to how
qdev_set_legacy_instance_id() works when vmstate_register() is passing
an id to the vmsds.

Changes from v1:
- patches 1-3: removed
- v1 link: https://lists.gnu.org/archive/html/qemu-devel/2022-03/msg05615.html

Daniel Henrique Barboza (1):
  hw/ppc: use qdev to register spapr_nvdimm vmsd

 hw/ppc/spapr_nvdimm.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

-- 
2.35.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH for-7.1 v2 1/1] hw/ppc: use qdev to register spapr_nvdimm vmsd
  2022-04-09 12:09 [PATCH for-7.1 v2 0/1] use dc->vmsd with spapr devices vmstate Daniel Henrique Barboza
@ 2022-04-09 12:09 ` Daniel Henrique Barboza
  2022-05-04 18:51 ` [PATCH for-7.1 v2 0/1] use dc->vmsd with spapr devices vmstate Daniel Henrique Barboza
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Henrique Barboza @ 2022-04-09 12:09 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel Henrique Barboza, qemu-ppc, clg, Shivaprasad G Bhat, david

Make the code a little more maintainable by using dc->vmsd to register
the vmstate instead of using vmstate_(un)register calls.

'instance_id' was being set to VMSTATE_INSTANCE_ID_ANY so there is no need
for qdev_set_legacy_instance_id() calls.

spapr_nvdimm_unrealize() was removed since it was only being used to
call vmstate_unregister().

Cc: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 hw/ppc/spapr_nvdimm.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/hw/ppc/spapr_nvdimm.c b/hw/ppc/spapr_nvdimm.c
index c4c97da5de..973e9d0fbe 100644
--- a/hw/ppc/spapr_nvdimm.c
+++ b/hw/ppc/spapr_nvdimm.c
@@ -866,14 +866,6 @@ static void spapr_nvdimm_realize(NVDIMMDevice *dimm, Error **errp)
     if (!is_pmem || pmem_override) {
         s_nvdimm->hcall_flush_required = true;
     }
-
-    vmstate_register(NULL, VMSTATE_INSTANCE_ID_ANY,
-                     &vmstate_spapr_nvdimm_states, dimm);
-}
-
-static void spapr_nvdimm_unrealize(NVDIMMDevice *dimm)
-{
-    vmstate_unregister(NULL, &vmstate_spapr_nvdimm_states, dimm);
 }
 
 static Property spapr_nvdimm_properties[] = {
@@ -888,8 +880,9 @@ static void spapr_nvdimm_class_init(ObjectClass *oc, void *data)
     DeviceClass *dc = DEVICE_CLASS(oc);
     NVDIMMClass *nvc = NVDIMM_CLASS(oc);
 
+    dc->vmsd = &vmstate_spapr_nvdimm_states;
+
     nvc->realize = spapr_nvdimm_realize;
-    nvc->unrealize = spapr_nvdimm_unrealize;
 
     device_class_set_props(dc, spapr_nvdimm_properties);
 }
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH for-7.1 v2 0/1] use dc->vmsd with spapr devices vmstate
  2022-04-09 12:09 [PATCH for-7.1 v2 0/1] use dc->vmsd with spapr devices vmstate Daniel Henrique Barboza
  2022-04-09 12:09 ` [PATCH for-7.1 v2 1/1] hw/ppc: use qdev to register spapr_nvdimm vmsd Daniel Henrique Barboza
@ 2022-05-04 18:51 ` Daniel Henrique Barboza
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Henrique Barboza @ 2022-05-04 18:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc, david, clg

Ping

On 4/9/22 09:09, Daniel Henrique Barboza wrote:
> Hi,
> 
> This v2 contains only the last patch from v1, patch 4, given that all
> other patches are breaking backward migration due to how
> qdev_set_legacy_instance_id() works when vmstate_register() is passing
> an id to the vmsds.
> 
> Changes from v1:
> - patches 1-3: removed
> - v1 link: https://lists.gnu.org/archive/html/qemu-devel/2022-03/msg05615.html
> 
> Daniel Henrique Barboza (1):
>    hw/ppc: use qdev to register spapr_nvdimm vmsd
> 
>   hw/ppc/spapr_nvdimm.c | 11 ++---------
>   1 file changed, 2 insertions(+), 9 deletions(-)
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-04 18:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-09 12:09 [PATCH for-7.1 v2 0/1] use dc->vmsd with spapr devices vmstate Daniel Henrique Barboza
2022-04-09 12:09 ` [PATCH for-7.1 v2 1/1] hw/ppc: use qdev to register spapr_nvdimm vmsd Daniel Henrique Barboza
2022-05-04 18:51 ` [PATCH for-7.1 v2 0/1] use dc->vmsd with spapr devices vmstate Daniel Henrique Barboza

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).