Skip to content
  • Kevin Wolf's avatar
    migration: Fail migration on bdrv_flush_all() error · 0e1146a7
    Kevin Wolf authored
    
    
    If bdrv_flush_all() returns an error, there is an inconsistency in the
    view of an image file between the source and the destination host.
    Completing the migration would lead to corruption. Better abort
    migration in this case.
    
    To reproduce this case, try the following (ensures that there is
    something to flush, and then fails that flush):
    
    $ qemu-img create -f qcow2 test.qcow2 1G
    $ cat blkdebug.cfg
    [inject-error]
    event = "flush_to_os"
    errno = "5"
    $ qemu-system-x86_64 -hda blkdebug:blkdebug.cfg:test.qcow2 -monitor stdio
    (qemu) qemu-io ide0-hd0 "write 0 4k"
    (qemu) migrate ...
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    0e1146a7