blockdev: unify qmp_drive_backup and drive-backup transaction paths
commit2288ccfac96281c316db942d10e3f921c1373064
authorSergio Lopez <slp@redhat.com>
Wed, 8 Jan 2020 14:31:32 +0000 (8 15:31 +0100)
committerKevin Wolf <kwolf@redhat.com>
Mon, 27 Jan 2020 16:19:53 +0000 (27 17:19 +0100)
treee9b915de5b7e8c9e1d839cc1d8a6f69663d6accb
parent471ded690e19689018535e3f48480507ed073e22
blockdev: unify qmp_drive_backup and drive-backup transaction paths

Issuing a drive-backup from qmp_drive_backup takes a slightly
different path than when it's issued from a transaction. In the code,
this is manifested as some redundancy between do_drive_backup() and
drive_backup_prepare().

This change unifies both paths, merging do_drive_backup() and
drive_backup_prepare(), and changing qmp_drive_backup() to create a
transaction instead of calling do_backup_common() direcly.

As a side-effect, now qmp_drive_backup() is executed inside a drained
section, as it happens when creating a drive-backup transaction. This
change is visible from the user's perspective, as the job gets paused
and immediately resumed before starting the actual work.

Also fix tests 141, 185 and 219 to cope with the extra
JOB_STATUS_CHANGE lines.

Signed-off-by: Sergio Lopez <slp@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev.c
tests/qemu-iotests/141.out
tests/qemu-iotests/185.out
tests/qemu-iotests/219
tests/qemu-iotests/219.out