Skip to contentSkip to conversation

spapr: Provide an error message when migration fails due to htab_shift mismatch

RFC PATCH In review Bharata B Rao 2 participants 2 messages Jul 30, 2015 – Jul 31, 2015

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 spapr: Provide an error message when migration fails due to htab_shift mismatch

Include an error message when migration fails due to mismatch in htab_shift values at source and target. This should provide a bit more verbose message in addition to the current migration failure message that reads like:

qemu-system-ppc64: error while loading state for instance 0x0 of device 'spapr/htab'

After this patch, the failure message will look like this:

qemu-system-ppc64: htab_shift mismatch: source 29 target 24
qemu-system-ppc64: error while loading state for instance 0x0 of device 'spapr/htab'

---
Applies against spapr-next branch of David Gibson's tree.

 hw/ppc/spapr.c | 2 ++
 1 file changed, 2 insertions(+)
hw/ppc/spapr.c +2 -0
index dfd808f..2dcab34 100644
@@ -1471,6 +1471,8 @@ static int htab_load(QEMUFile *f, void *opaque, int version_id)
     if (section_hdr) {
         /* First section, just the hash shift */
         if (spapr->htab_shift != section_hdr) {
+            error_report("htab_shift mismatch: source %d target %d",
+                         section_hdr, spapr->htab_shift);
             return -EINVAL;
         }
         return 0;
Signature · 1 line
2.1.0
#1 lore raw
Quoted 5 lines · Bharata B Rao

Include an error message when migration fails due to mismatch in htab_shift values at source and target. This should provide a bit more verbose message in addition to the current migration failure message that reads like:

Quoted 8 lines

qemu-system-ppc64: error while loading state for instance 0x0 of device 'spapr/htab'

After this patch, the failure message will look like this:

qemu-system-ppc64: htab_shift mismatch: source 29 target 24
qemu-system-ppc64: error while loading state for instance 0x0 of device 'spapr/htab'

I've applied this to spapr-next and a new spapr-fix tree (intended for fixes which should go to the current feature-frozen qemu, not just the next one). It's certainly better than the current cryptic failure.

Longer term I think we need to work harder to try to get the hash table size the same at both ends though - we should rearrange things so we get the size from the migration stream and then use that to feed the hint to the kernel allocation.

Sorry I haven't looked properly yet at the patch you sent which works towards that.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson