ram_load: Factor out host_from_stream_offset call and check
commita776aa15a7e3e08964c6c537314b9590dde27b4d
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Thu, 5 Nov 2015 18:10:39 +0000 (5 18:10 +0000)
committerJuan Quintela <quintela@redhat.com>
Tue, 10 Nov 2015 13:51:49 +0000 (10 14:51 +0100)
treeea702a9603f3c9de9d1b09bb2cefad43467234e1
parent4f2e425267327719ee71ba6f191f7d66507a6c02
ram_load: Factor out host_from_stream_offset call and check

The main RAM load loop has a call to host_from_stream_offset for
each page type that actually loads data with the same test;
factor it out before the switch.

The host = NULL is to silence a bogus gcc warning of
an unitialised in the RAM_SAVE_COMPRESS_PAGE case, it
doesn't seem to realise that host is always initialised by the if at
the top in the cases the switch takes.

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