[libvirt] [PATCH 4/8] qemu: Use QEMU_BLOCKJOB_STATE_PIVOTING/ABORTING in qemuDomainBlockJobAbort

Ján Tomko jtomko at redhat.com
Mon Jul 22 16:37:09 UTC 2019


On Mon, Jul 22, 2019 at 06:24:43PM +0200, Peter Krempa wrote:
>On Thu, Jul 18, 2019 at 18:31:39 +0200, Peter Krempa wrote:
>> Set the correct job states after the operation is requested in qemu.
>>
>> Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>> ---
>>  src/qemu/qemu_blockjob.c | 4 +++-
>>  src/qemu/qemu_driver.c   | 8 +++++---
>>  2 files changed, 8 insertions(+), 4 deletions(-)
>
>later in my blockdev branch I found the following hunk which is needed
>to correctly transition into the cancelled state when aborting the job
>which I forgot to merge into this patch:
>
>diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
>index 0f08cf7967..575292ada2 100644
>--- a/src/qemu/qemu_blockjob.c
>+++ b/src/qemu/qemu_blockjob.c
>@@ -673,6 +673,10 @@ qemuBlockJobEventProcessConcluded(qemuBlockJobDataPtr job,
>     if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
>         goto cleanup;
>
>+    if (job->newstate == QEMU_BLOCKJOB_STATE_COMPLETED &&
>+        job->state == QEMU_BLOCKJOB_STATE_ABORTING)
>+        job->newstate = QEMU_BLOCKJOB_STATE_CANCELLED;
>+
>     if (refreshed)
>         qemuDomainSaveStatus(vm);
>


Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190722/06e9f9c9/attachment-0001.sig>


More information about the libvir-list mailing list