mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
blockjob: Fix a error checking of blockjob status in some case
Commit id 'bc444666f' added a check if the returned data buffer had an error, but failed to adjust the event from VIR_DOMAIN_BLOCK_JOB_COMPLETED to VIR_DOMAIN_BLOCK_JOB_FAILED in order to propagate an error such as "File descriptor in bad state" that may be returned from QEMU when both @offset and @len are set to 0 such as is the case when performing an async block job read on a read only filesystem. Signed-off-by: Jie Wang <wangjie88@huawei.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
10e1d5e276
commit
75fd48b945
@ -889,7 +889,7 @@ qemuMonitorJSONHandleBlockJobImpl(qemuMonitorPtr mon,
|
||||
case VIR_DOMAIN_BLOCK_JOB_COMPLETED:
|
||||
error = virJSONValueObjectGetString(data, "error");
|
||||
/* Make sure the whole device has been processed */
|
||||
if (offset != len)
|
||||
if (offset != len || error)
|
||||
event = VIR_DOMAIN_BLOCK_JOB_FAILED;
|
||||
break;
|
||||
case VIR_DOMAIN_BLOCK_JOB_CANCELED:
|
||||
|
Loading…
x
Reference in New Issue
Block a user