enable sharing of the function between migration and bitmap dump

Signed-off-by: Sanidhya Kashyap <sanidhya.iiith@gmail.com>