migration: ide: drop ide_pci_post_load()

Submitted by Jason Wang on Dec. 9, 2010, 11:24 a.m.

Details

Message ID 20101209112428.5497.45417.stgit@dhcp-91-7.nay.redhat.com.englab.nay.redhat.com
State New
Headers show

Commit Message

Jason Wang Dec. 9, 2010, 11:24 a.m.
When the bmdma transfering ended, the unit were set to -1(0xFF), but
after migration ide_pci_post_load() would change it to 1. This is not
intended and it also would break the migration stability that we
could not get exactly the same exec file before and after migration.

So this patch drop the ide_pci_post_load() and it would also make
possible to debugging of migration through comparing the exec files.

Signed-off-by: Jason Wang <jasowang@redhat.com>

I'm not sure whether this is the best way to handle this issue. Should
we still care about the migration from old guest?
---
 hw/ide/pci.c |   14 --------------
 1 files changed, 0 insertions(+), 14 deletions(-)

Comments

Juan Quintela Dec. 9, 2010, 12:42 p.m.
Jason Wang <jasowang@redhat.com> wrote:
> When the bmdma transfering ended, the unit were set to -1(0xFF), but
> after migration ide_pci_post_load() would change it to 1. This is not
> intended and it also would break the migration stability that we
> could not get exactly the same exec file before and after migration.
>
> So this patch drop the ide_pci_post_load() and it would also make
> possible to debugging of migration through comparing the exec files.
>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
>
> I'm not sure whether this is the best way to handle this issue. Should
> we still care about the migration from old guest?

Basically we have unit=-1 when there is an error/we ended an operation.
Stable image migration are having trouble with it, and we only generate
0/1/-1 nowadays.

Acked-by: Juan Quintela <quintela@redhat.com>

Patch hide | download patch | download mbox

diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index ec90f26..b9ef122 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -186,25 +186,11 @@  static const VMStateDescription vmstate_bmdma = {
     }
 };
 
-static int ide_pci_post_load(void *opaque, int version_id)
-{
-    PCIIDEState *d = opaque;
-    int i;
-
-    for(i = 0; i < 2; i++) {
-        /* current versions always store 0/1, but older version
-           stored bigger values. We only need last bit */
-        d->bmdma[i].unit &= 1;
-    }
-    return 0;
-}
-
 const VMStateDescription vmstate_ide_pci = {
     .name = "ide",
     .version_id = 3,
     .minimum_version_id = 0,
     .minimum_version_id_old = 0,
-    .post_load = ide_pci_post_load,
     .fields      = (VMStateField []) {
         VMSTATE_PCI_DEVICE(dev, PCIIDEState),
         VMSTATE_STRUCT_ARRAY(bmdma, PCIIDEState, 2, 0,