]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: blockjob: Add functions for block job state control
authorPeter Krempa <pkrempa@redhat.com>
Mon, 19 Nov 2018 15:48:09 +0000 (16:48 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 17 Jan 2019 16:12:50 +0000 (17:12 +0100)
commite0c4d4fcf005edb43d3390dba1f055be09a3fde5
tree4518fa81615bb46f85d7bca8fc6dcdc9c6a4e237
parentb44f1cd7d71d317449e048d331a4c80a65247233
qemu: blockjob: Add functions for block job state control

Rather than directly modifying fields in the qemuBlockJobDataPtr
structure add a bunch of fields which allow to do the transitions.

This will help later when adding more complexity to the job handling.

APIs introduced in this patch are:

qemuBlockJobDiskNew - prepare for starting a new blockjob on a disk
qemuBlockJobDiskGetJob - get the block job data structure for a disk

For individual job state manipulation the following APIs are added:
qemuBlockJobStarted - Sets the job as started with qemu. Until that
                      the job can be cancelled without asking qemu.

qemuBlockJobStartupFinalize - finalize job startup. If the job was
                              started in qemu already, just releases
                              reference to the job object. Otherwise
                              clears everything as if the job was never
                              started.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_blockjob.c
src/qemu/qemu_blockjob.h
src/qemu/qemu_driver.c
src/qemu/qemu_migration.c
src/qemu/qemu_process.c