From nobody Wed May 1 15:06:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1516378214163402.53206382684925; Fri, 19 Jan 2018 08:10:14 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1684FD2EFF; Fri, 19 Jan 2018 16:10:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5AEF15D6B2; Fri, 19 Jan 2018 16:10:09 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 631CF1800B61; Fri, 19 Jan 2018 16:10:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w0JGA5Dp023190 for ; Fri, 19 Jan 2018 11:10:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id ECEA6614E6; Fri, 19 Jan 2018 16:10:05 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B17F060933; Fri, 19 Jan 2018 16:09:59 +0000 (UTC) Received: from huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7156BC074EF4; Fri, 19 Jan 2018 16:09:57 +0000 (UTC) Received: from DGGEML401-HUB.china.huawei.com (unknown [172.30.72.56]) by Forcepoint Email with ESMTP id E513BC6924F3B; Sat, 20 Jan 2018 00:09:49 +0800 (CST) Received: from localhost.localdomain (10.175.104.211) by DGGEML401-HUB.china.huawei.com (10.3.17.32) with Microsoft SMTP Server id 14.3.361.1; Sat, 20 Jan 2018 00:09:44 +0800 From: Jie Wang To: , , , , , , Date: Fri, 19 Jan 2018 22:03:05 +0800 Message-ID: <1516370585-81510-1-git-send-email-wangjie88@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.104.211] X-CFilter-Loop: Reflected X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 19 Jan 2018 16:09:59 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 19 Jan 2018 16:09:59 +0000 (UTC) for IP:'45.249.212.187' DOMAIN:'szxga01-in.huawei.com' HELO:'huawei.com' FROM:'wangjie88@huawei.com' RCPT:'' X-RedHat-Spam-Score: -0.022 (RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD) 45.249.212.187 szxga01-in.huawei.com 45.249.212.187 szxga01-in.huawei.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: caoxinhua@huawei.com, wangjie88@huawei.com, eric.fangyi@huawei.com Subject: [libvirt] [PATCH] blockjob: Fix a error checking of blockjob status in some case X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 19 Jan 2018 16:10:12 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" offset and len can also be equal to 0 on failed if blockjob return status:"BLOCK_JOB_COMPLETED" with error:"File descriptor in bad state", this bug can be reproduced easily if you perform a async block job on read only filesystem, so it's very worthwhile for us to check 'error' in this case. Reviewed-by: John Ferlan --- src/qemu/qemu_monitor_json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 5ddd855..442b218 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -889,7 +889,7 @@ qemuMonitorJSONHandleBlockJobImpl(qemuMonitorPtr mon, case VIR_DOMAIN_BLOCK_JOB_COMPLETED: error =3D virJSONValueObjectGetString(data, "error"); /* Make sure the whole device has been processed */ - if (offset !=3D len) + if (offset !=3D len || error) event =3D VIR_DOMAIN_BLOCK_JOB_FAILED; break; case VIR_DOMAIN_BLOCK_JOB_CANCELED: --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list