提交 75fd48b9 编写于 作者: J Jie Wang 提交者: John Ferlan

blockjob: Fix a error checking of blockjob status in some case

Commit id 'bc444666' 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: NJie Wang <wangjie88@huawei.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 10e1d5e2
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册