Skip to contentSkip to conversation

spapr_iommu: Replace @instance_id with LIOBN for migration

PATCH Applied Alexey Kardashevskiy 2 participants 3 messages May 12, 2014 – May 23, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spapr_iommu: Replace @instance_id with LIOBN for migration

SPAPR IOMMU is a bus-less device and therefore its only ID in migration stream is an instance id which is not reliable ID as it depends on the command line parameters order. Since libvirt may change the order, we need something better than that.

This removes VMSD descriptor from the class definitiion and registers it with @liobn as an intance ID to let the destination side find the right device to receive migration data.

---
 hw/ppc/spapr_iommu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
hw/ppc/spapr_iommu.c +3 -1
index 72493d8..7c3f8c2 100644
@@ -140,6 +140,9 @@ static int spapr_tce_table_realize(DeviceState *dev)
 
     QLIST_INSERT_HEAD(&spapr_tce_tables, tcet, list);
 
+    vmstate_register(DEVICE(tcet), tcet->liobn, &vmstate_spapr_tce_table,
+                     tcet);
+
     return 0;
 }
 
@@ -323,7 +326,6 @@ int spapr_tcet_dma_dt(void *fdt, int node_off, const char *propname,
 static void spapr_tce_table_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
-    dc->vmsd = &vmstate_spapr_tce_table;
     dc->init = spapr_tce_table_realize;
     dc->reset = spapr_tce_reset;
 
Signature · 1 line
1.9.rc0
#1 lore raw
Quoted 8 lines · Alexey Kardashevskiy

SPAPR IOMMU is a bus-less device and therefore its only ID in migration stream is an instance id which is not reliable ID as it depends on the command line parameters order. Since libvirt may change the order, we need something better than that.

This removes VMSD descriptor from the class definitiion and registers it with @liobn as an intance ID to let the destination side find the right device to receive migration data.

Ping?

Quoted 29 lines
---
 hw/ppc/spapr_iommu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
hw/ppc/spapr_iommu.c +3 -1
index 72493d8..7c3f8c2 100644
@@ -140,6 +140,9 @@ static int spapr_tce_table_realize(DeviceState *dev)
 
     QLIST_INSERT_HEAD(&spapr_tce_tables, tcet, list);
 
+    vmstate_register(DEVICE(tcet), tcet->liobn, &vmstate_spapr_tce_table,
+                     tcet);
+
     return 0;
 }
 
@@ -323,7 +326,6 @@ int spapr_tcet_dma_dt(void *fdt, int node_off, const char *propname,
 static void spapr_tce_table_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
-    dc->vmsd = &vmstate_spapr_tce_table;
     dc->init = spapr_tce_table_realize;
     dc->reset = spapr_tce_reset;
 
Signature · 1 line
Alexey
#2 lore raw
In reply to Alexey Kardashevskiy
Quoted 10 lines · Alexey Kardashevskiy

SPAPR IOMMU is a bus-less device and therefore its only ID in migration stream is an instance id which is not reliable ID as it depends on the command line parameters order. Since libvirt may change the order, we need something better than that.

This removes VMSD descriptor from the class definitiion and registers it with @liobn as an intance ID to let the destination side find the right device to receive migration data.

Thanks, applied to ppc-next.

Alex