migration: Guard ram_bytes_remaining against early call
commitbae416e5ba65701d3c5238164517158066d615e5
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Fri, 15 Dec 2017 11:51:23 +0000 (15 11:51 +0000)
committerJuan Quintela <quintela@redhat.com>
Mon, 15 Jan 2018 11:48:04 +0000 (15 12:48 +0100)
tree6d202a56245f3b63c311757527c823f18d377121
parentca6011c2329121ecc25081f884a5d9016acc6572
migration: Guard ram_bytes_remaining against early call

Calling ram_bytes_remaining during the early part of setup is unsafe
because the ram_state isn't yet initialised.

This can happen in the sequence:
   migrate
   migrate_cancel
   info migrate

if the migrate sticks trying to connect (e.g. to an unresponsive
destination due to the connect timeout).  Here 'info migrate' sees
a state of CANCELLING and so assumes the migrate has partially happened.

partial fix for:
RH bz: https://bugzilla.redhat.com/show_bug.cgi?id=1525899
Reported-by: Xianxian Wang <xianwang@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
migration/ram.c