From nobody Tue Apr 30 07:17:04 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563467514; cv=none; d=zoho.com; s=zohoarc; b=GcLLyUoRb2Y5LzvUSgX4Hulsxk4V+0q7XjHSlm9gt4/h1Fvh6tGrSpjRc+IQ72nGgSWPRLe8hm7SR6hORAtIka3eBRegRvwsbHbO1JRHBPXYeCO+cdvwYDjum6Tg0yu6wiIfKbftkATbYiqFL8PbGmgEJLfIF/mCn3Y7Ritxj/o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563467514; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=PQOJ4C2INbFQW8t1FyPlXsNaNS5b3KQDDnIVnb8V2AI=; b=PXuxi++Qhn9SWeuW7koIV/kypQHtXTX3HFeaUgYbJ6eIXZAVxV7XLWnBalqEsu2MfzxC9AEJ/4TqFzqk6wQ4hPltrrw0O8FlgCDPsnPp1roS9IGV2XTlWh+gPlRWS4Ycm/GElQPgnAey2RFB2xBRhTtTtDR+hnklEcZYxMnhnPs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563467514012679.1195095052775; Thu, 18 Jul 2019 09:31:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1218E3092666; Thu, 18 Jul 2019 16:31:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C9FD75C220; Thu, 18 Jul 2019 16:31:51 +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 DA6534E58E; Thu, 18 Jul 2019 16:31:49 +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 x6IGVl9K005170 for ; Thu, 18 Jul 2019 12:31:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id D8406608A6; Thu, 18 Jul 2019 16:31:47 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6216060A35 for ; Thu, 18 Jul 2019 16:31:47 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 18 Jul 2019 18:31:36 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/8] qemu: driver: blockdevize qemuDomainGetBlockJobInfo 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 18 Jul 2019 16:31:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Use the stored job name rather than passing in the disk alias when refering to the job which allows the same code to work also when -blockdev will be used. Note that this API does not require the change to use 'query-job' as it will ever only work with blockjobs bound to disks due to the arguments which allow only refering to a disk. For the disk-less jobs we'll need to add a separate API later. The change to qemuMonitorGetBlockJobInfo is required as the API was striping the 'drive-' prefix when returning the data which is not desired any more. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 9 +++++++-- src/qemu/qemu_monitor.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 329c166255..739cbc5ed3 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17292,6 +17292,7 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom, virDomainDiskDefPtr disk; int ret =3D -1; qemuMonitorBlockJobInfo rawInfo; + VIR_AUTOUNREF(qemuBlockJobDataPtr) job =3D NULL; virCheckFlags(VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES, -1); @@ -17314,9 +17315,13 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom, goto endjob; } + if (!(job =3D qemuBlockJobDiskGetJob(disk))) { + ret =3D 0; + goto endjob; + } + qemuDomainObjEnterMonitor(driver, vm); - ret =3D qemuMonitorGetBlockJobInfo(qemuDomainGetMonitor(vm), - disk->info.alias, &rawInfo); + ret =3D qemuMonitorGetBlockJobInfo(qemuDomainGetMonitor(vm), job->name= , &rawInfo); if (qemuDomainObjExitMonitor(driver, vm) < 0) ret =3D -1; if (ret <=3D 0) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 5ad66d1dca..a880da3ab6 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3463,7 +3463,7 @@ qemuMonitorGetBlockJobInfo(qemuMonitorPtr mon, VIR_DEBUG("alias=3D%s, info=3D%p", alias, info); - if (!(all =3D qemuMonitorGetAllBlockJobInfo(mon, false))) + if (!(all =3D qemuMonitorGetAllBlockJobInfo(mon, true))) return -1; if ((data =3D virHashLookup(all, alias))) { --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 07:17:04 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563467521; cv=none; d=zoho.com; s=zohoarc; b=BBE57/68+ol/0VNHYGrqLFsY+71/W9gebA3gT693uBwo+HCRg0D1OmOXA3MTfwMKE+sLHi5y+dESeR3V6dfRYo+hdtsxZ5mP6PPd+1A7zsTyboRTJjvq4oznoSv3uvn4oT/sHiEpk66WTHRz1CJuzPGJAsR9SKsym/8rv/sLa+A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563467521; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=FPHJamqAbeIeOJKrbStCWx4kU9VVA4ME4dRMugotdEk=; b=CWlSf7iHBE+cP4m+oX6GirePjHiakVo97Xs1n4Vini3/poCd4o3x+ImfJyrMDktSR2G6vBxVIUeec5kddnTTSxhsCJnZigSBlFBdnuGKQe5iHYFXG5pm5a0jXIr13aUgy70hMM2vPd4HKCIG/RWsK7zTYYVY5TtazcMRSKaWEfA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563467521728554.6090353970711; Thu, 18 Jul 2019 09:32:01 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EBC9830C62A3; Thu, 18 Jul 2019 16:31:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C522C5C22F; Thu, 18 Jul 2019 16:31:59 +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 84F934EA6C; Thu, 18 Jul 2019 16:31:59 +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 x6IGVmlH005178 for ; Thu, 18 Jul 2019 12:31:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id A5983608A6; Thu, 18 Jul 2019 16:31:48 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2FB2E60A35 for ; Thu, 18 Jul 2019 16:31:48 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 18 Jul 2019 18:31:37 +0200 Message-Id: <30d922078011626251ece853b31e4e422f08ce06.1563467440.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/8] qemu: Make checks in qemuDomainBlockPivot depend on data of the job 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 18 Jul 2019 16:32:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Do decisions based on the configuration of the job rather than the data stored with the disk. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 739cbc5ed3..fa9e3c2bfc 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16982,17 +16982,26 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, int ret =3D -1; qemuDomainObjPrivatePtr priv =3D vm->privateData; - if (!disk->mirror) { + switch ((qemuBlockJobType) job->type) { + case QEMU_BLOCKJOB_TYPE_NONE: + case QEMU_BLOCKJOB_TYPE_PULL: + case QEMU_BLOCKJOB_TYPE_COMMIT: + case QEMU_BLOCKJOB_TYPE_INTERNAL: + case QEMU_BLOCKJOB_TYPE_LAST: virReportError(VIR_ERR_OPERATION_INVALID, - _("pivot of disk '%s' requires an active copy job"), - disk->dst); + _("job type '%s' does not support pivot"), + NULLSTR(qemuBlockjobTypeToString(job->type))); goto cleanup; + + case QEMU_BLOCKJOB_TYPE_COPY: + case QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT: + break; } - if (disk->mirrorState !=3D VIR_DOMAIN_DISK_MIRROR_STATE_READY) { + if (job->state !=3D QEMU_BLOCKJOB_STATE_READY) { virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, - _("disk '%s' not ready for pivot yet"), - disk->dst); + _("block job '%s' not ready for pivot yet"), + job->name); goto cleanup; } @@ -17017,7 +17026,8 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, if (ret < 0) goto cleanup; - disk->mirrorState =3D VIR_DOMAIN_DISK_MIRROR_STATE_PIVOT; + if (disk && disk->mirror) + disk->mirrorState =3D VIR_DOMAIN_DISK_MIRROR_STATE_PIVOT; cleanup: return ret; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 07:17:04 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563467525; cv=none; d=zoho.com; s=zohoarc; b=dFNof5J4gKoO5nqY5vOIFiwKD6j+wG1zCemVaTFyhOBNUrtnkZocwPn0b/P8ym4VQgnupdaRpEZ0U3dIjOAN14lH7F73Vrdeh8++4kpUa3QM+XIsjcCbt/t/+SwM9hV9L158jbnaox48WYoNi9Puhwuf/kG0/3lc8MYaT+FqoyI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563467525; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=oy0dOhf6hB1lh0/RosZYwld9IG06IM8VvJbloZ2vGLg=; b=n9lTxcna034sVu3VWux2I/9mHFpRJAE91uI/SMDnDaPYycxGvhiBwJedS4fcqjR6Yp9c5oR/zM2hsHFnLMphpgJ8aOS2u1a4gxfCTKG5A161wSCgvE7d4v15pvqI4DPmSc5Z+qXpMiM+wBuHfZo6B9u4HYbK2DWlQx5Tw4nLvlY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563467525347548.0283363042903; Thu, 18 Jul 2019 09:32:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 93BBEB283C; Thu, 18 Jul 2019 16:32:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6429E60D7C; Thu, 18 Jul 2019 16:32:03 +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 226CC41F40; Thu, 18 Jul 2019 16:32:03 +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 x6IGVnM0005185 for ; Thu, 18 Jul 2019 12:31:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 71940608A6; Thu, 18 Jul 2019 16:31:49 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id F0C1760A35 for ; Thu, 18 Jul 2019 16:31:48 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 18 Jul 2019 18:31:38 +0200 Message-Id: <77cba7fac7cfca77f992df54b987a9cbd2d45071.1563467440.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/8] qemu: blockjob: Add block job states for abort and pivot operations 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 18 Jul 2019 16:32:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" When initiating a pivot or abort of a block job we need to track which one was initiated. Currently it was done via data stashed in virDomainDiskDef. Add possibility to track this also together with the job itself. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_blockjob.c | 9 ++++++++- src/qemu/qemu_blockjob.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 292610d089..fe0114bf26 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -53,7 +53,9 @@ VIR_ENUM_IMPL(qemuBlockjobState, "ready", "new", "running", - "concluded"); + "concluded", + "aborting", + "pivoting"); VIR_ENUM_IMPL(qemuBlockjob, QEMU_BLOCKJOB_TYPE_LAST, @@ -599,6 +601,8 @@ qemuBlockJobEventProcessConcludedTransition(qemuBlockJo= bDataPtr job, case QEMU_BLOCKJOB_STATE_NEW: case QEMU_BLOCKJOB_STATE_RUNNING: case QEMU_BLOCKJOB_STATE_CONCLUDED: + case QEMU_BLOCKJOB_STATE_ABORTING: + case QEMU_BLOCKJOB_STATE_PIVOTING: case QEMU_BLOCKJOB_STATE_LAST: default: break; @@ -724,6 +728,9 @@ qemuBlockJobEventProcess(virQEMUDriverPtr driver, case QEMU_BLOCKJOB_STATE_NEW: case QEMU_BLOCKJOB_STATE_RUNNING: case QEMU_BLOCKJOB_STATE_LAST: + /* these are never processed as 'newstate' */ + case QEMU_BLOCKJOB_STATE_ABORTING: + case QEMU_BLOCKJOB_STATE_PIVOTING: default: job->newstate =3D -1; } diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h index d07ab75c8b..1f353116c8 100644 --- a/src/qemu/qemu_blockjob.h +++ b/src/qemu/qemu_blockjob.h @@ -40,6 +40,8 @@ typedef enum { QEMU_BLOCKJOB_STATE_RUNNING, QEMU_BLOCKJOB_STATE_CONCLUDED, /* job has finished, but it's unknown whether it has failed or not */ + QEMU_BLOCKJOB_STATE_ABORTING, + QEMU_BLOCKJOB_STATE_PIVOTING, QEMU_BLOCKJOB_STATE_LAST } qemuBlockjobState; verify((int)QEMU_BLOCKJOB_STATE_NEW =3D=3D VIR_DOMAIN_BLOCK_JOB_LAST); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 07:17:04 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563467520; cv=none; d=zoho.com; s=zohoarc; b=FRuQKYyBnbpEqnEwgx98IZQSckGxI6nbyVsnoGu6RTM3oqA0o0Hmc8ydEelbZ1VaZrFNxpfg+OzP9Po1c08n/lH1VLUJgEtGd4updZ9519A9MaRWH9DHfqrhqtmiq99dCBYHJ0hjaiQ7Y/ms4ifpJsYiweASwqvZtoB3zcVrCjg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563467520; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ALN48KqG6SQPmDBQGiCnmZFKO8mte9rxn8yg1Q4tnbo=; b=e/efggJLuXFxlNaoSDe/4qbYM6d5GbquaJ+ITMVyWYqN27yhmaE5h1R3jx29rMfYKfZUrDcdfl37QLCdxqUoEVTV6dyb8LY+0KET7MZBdIR0FqS1f2n/Bx5rn8DH2EY3g/on4D4XqM2rL7FaM6NbsB6eU/WYD3sTl2Yho9YbzOU= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563467520525577.3853893236255; Thu, 18 Jul 2019 09:32:00 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E4E3A5D674; Thu, 18 Jul 2019 16:31:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BBF6C5C22F; Thu, 18 Jul 2019 16:31:58 +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 781464EA31; Thu, 18 Jul 2019 16:31:58 +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 x6IGVo19005193 for ; Thu, 18 Jul 2019 12:31:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3F06360A35; Thu, 18 Jul 2019 16:31:50 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD477608A6 for ; Thu, 18 Jul 2019 16:31:49 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 18 Jul 2019 18:31:39 +0200 Message-Id: <2108374ad66c4d0d0647336e27d697090953d90b.1563467440.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/8] qemu: Use QEMU_BLOCKJOB_STATE_PIVOTING/ABORTING in qemuDomainBlockJobAbort 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 18 Jul 2019 16:31:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Set the correct job states after the operation is requested in qemu. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_blockjob.c | 4 +++- src/qemu/qemu_driver.c | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index fe0114bf26..0f08cf7967 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -256,7 +256,9 @@ bool qemuBlockJobIsRunning(qemuBlockJobDataPtr job) { return job->state =3D=3D QEMU_BLOCKJOB_STATE_RUNNING || - job->state =3D=3D QEMU_BLOCKJOB_STATE_READY; + job->state =3D=3D QEMU_BLOCKJOB_STATE_READY || + job->state =3D=3D QEMU_BLOCKJOB_STATE_ABORTING || + job->state =3D=3D QEMU_BLOCKJOB_STATE_PIVOTING; } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index fa9e3c2bfc..39b5ea5e7e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17028,6 +17028,7 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, if (disk && disk->mirror) disk->mirrorState =3D VIR_DOMAIN_DISK_MIRROR_STATE_PIVOT; + job->state =3D QEMU_BLOCKJOB_STATE_PIVOTING; cleanup: return ret; @@ -17182,10 +17183,10 @@ qemuDomainBlockJobAbort(virDomainPtr dom, goto endjob; } - if (disk->mirrorState !=3D VIR_DOMAIN_DISK_MIRROR_STATE_NONE && - disk->mirrorState !=3D VIR_DOMAIN_DISK_MIRROR_STATE_READY) { + if (job->state =3D=3D QEMU_BLOCKJOB_STATE_ABORTING || + job->state =3D=3D QEMU_BLOCKJOB_STATE_PIVOTING) { virReportError(VIR_ERR_OPERATION_INVALID, - _("another job on disk '%s' is still being ended"), + _("block job on disk '%s' is still being ended"), disk->dst); goto endjob; } @@ -17209,6 +17210,7 @@ qemuDomainBlockJobAbort(virDomainPtr dom, if (disk->mirror) disk->mirrorState =3D VIR_DOMAIN_DISK_MIRROR_STATE_ABORT; + job->state =3D QEMU_BLOCKJOB_STATE_ABORTING; } ignore_value(virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, dr= iver->caps)); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 07:17:04 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563467528; cv=none; d=zoho.com; s=zohoarc; b=cbKAqRNXEcBC0H7icnUYyjAZ82LNjva1OHqQoKTmxO+Hp4NFX9RDrMmIfA3d3DYLDRFckqvYkcsEGNZBYJzgETi8LVqwUL1DiJ+Gt6mw+vMZtR5E9LNXSTA+AKBSVM8wAXDmSSj1H7eb1UXksP9SRadDRF+A6HpZoBsgceu1k04= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563467528; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=xKaodhhCWOiwsGDU72lt1wp6fdgcWDXnWZAWqXXlNxs=; b=RdhmUAoMKyS6NSzIVA+MGy2KU/SAIuupvd8Svm1rlVARZIgwNs1FYQlC7pxG2+Cv7AFzCtRWBJrQpFdA6+mJzU3qw95ZDXl0FF4nVNQCOnCR6wdYecVUbCKfpmn3d8kHt8joP+kZGwKbfAKGW5Svlgg7o53hsx7ZvP26vBZBsyQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563467528760443.99868986000945; Thu, 18 Jul 2019 09:32:08 -0700 (PDT) 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 0279130C746E; Thu, 18 Jul 2019 16:32:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C2EFA5D71A; Thu, 18 Jul 2019 16:32:06 +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 75F8D3CBB; Thu, 18 Jul 2019 16:32:06 +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 x6IGVpdu005203 for ; Thu, 18 Jul 2019 12:31:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0BF37608A6; Thu, 18 Jul 2019 16:31:51 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A19060A35 for ; Thu, 18 Jul 2019 16:31:50 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 18 Jul 2019 18:31:40 +0200 Message-Id: <0cf022ef535605751a9bc69db308cc846af82e86.1563467440.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/8] qemu: driver: Report error if pivoting fails in qemuDomainBlockJobAbort 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.46]); Thu, 18 Jul 2019 16:32:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" As the error message is now available and we know whether the job failed we can report an error straight away rather than having the user check the event. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 39b5ea5e7e..7a69a0e084 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17230,6 +17230,21 @@ qemuDomainBlockJobAbort(virDomainPtr dom, } qemuBlockJobUpdate(vm, job, QEMU_ASYNC_JOB_NONE); } + + if (pivot && + job->state =3D=3D QEMU_BLOCKJOB_STATE_FAILED) { + if (job->errmsg) + virReportError(VIR_ERR_OPERATION_FAILED, + _("block job '%s' failed while pivoting"), + job->name); + else + virReportError(VIR_ERR_OPERATION_FAILED, + _("block job '%s' failed while pivoting: %s= "), + job->name, NULLSTR(job->errmsg)); + + ret =3D -1; + goto endjob; + } } endjob: --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 07:17:04 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563467532; cv=none; d=zoho.com; s=zohoarc; b=YIjctPfGf/mpIYQ6y5Fei4YfY1K3m/W2VVOuBwcbnaTbYWeCRl/XIN36qr9wvZgjU23j2GSMy0shpfsT/LsROSPEjRjuh8L1pBPkNnWHmWW7pyQASQObx5iaCeqpuPQc9TiLeNqo4B4jCYjf92tY/8Mguuh4g1SO/vKh/aeF9dc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563467532; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=JmLnD57I8O+1nWyQM7ubv8BtpzczsNX2Ht5NCfESONA=; b=FC/nk2S6OgMlP2hCi2TMSKG++Rr1gTESWJcwxhSv2n52ciW4AKWgBpo+tbaIEMa6Zx0gITlPLMD6C5esIbAHMyFO0HkLnv7MKvq0wEadHnkiHYPfeRFsxA/4v8Qw26ptwE3JW14OaVxgkBmpDR9PbPYJ2LdTjppo6aTXTYqZ4hE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563467532334243.21136782450253; Thu, 18 Jul 2019 09:32:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB0A530C34F8; Thu, 18 Jul 2019 16:32:10 +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 7FD3760657; Thu, 18 Jul 2019 16:32:10 +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 3840D180020A; Thu, 18 Jul 2019 16:32:10 +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 x6IGVpf9005210 for ; Thu, 18 Jul 2019 12:31:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id CCC65608A6; Thu, 18 Jul 2019 16:31:51 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 57C3960A35 for ; Thu, 18 Jul 2019 16:31:51 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 18 Jul 2019 18:31:41 +0200 Message-Id: <9bdb1e41d483baa9ce095992ed50c288b4aa731f.1563467440.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/8] qemu: driver: Blockdevize qemuDomainBlockJobAbort/Pivot 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 18 Jul 2019 16:32:11 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Use job-complete/job-abort instead of the blockjob-* variants for blockdev. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 7a69a0e084..12ae31b9a7 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16981,6 +16981,7 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, { int ret =3D -1; qemuDomainObjPrivatePtr priv =3D vm->privateData; + bool blockdev =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); switch ((qemuBlockJobType) job->type) { case QEMU_BLOCKJOB_TYPE_NONE: @@ -17016,7 +17017,10 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, * that pivot failed, we need to reflect that failure into the * overall return value. */ qemuDomainObjEnterMonitor(driver, vm); - ret =3D qemuMonitorDrivePivot(priv->mon, job->name); + if (blockdev) + ret =3D qemuMonitorJobComplete(priv->mon, job->name); + else + ret =3D qemuMonitorDrivePivot(priv->mon, job->name); if (qemuDomainObjExitMonitor(driver, vm) < 0) { ret =3D -1; goto cleanup; @@ -17157,6 +17161,8 @@ qemuDomainBlockJobAbort(virDomainPtr dom, bool async =3D !!(flags & VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC); qemuBlockJobDataPtr job =3D NULL; virDomainObjPtr vm; + qemuDomainObjPrivatePtr priv =3D NULL; + bool blockdev =3D false; int ret =3D -1; virCheckFlags(VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC | @@ -17183,6 +17189,9 @@ qemuDomainBlockJobAbort(virDomainPtr dom, goto endjob; } + priv =3D vm->privateData; + blockdev =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); + if (job->state =3D=3D QEMU_BLOCKJOB_STATE_ABORTING || job->state =3D=3D QEMU_BLOCKJOB_STATE_PIVOTING) { virReportError(VIR_ERR_OPERATION_INVALID, @@ -17199,7 +17208,10 @@ qemuDomainBlockJobAbort(virDomainPtr dom, goto endjob; } else { qemuDomainObjEnterMonitor(driver, vm); - ret =3D qemuMonitorBlockJobCancel(qemuDomainGetMonitor(vm), job->n= ame); + if (blockdev) + ret =3D qemuMonitorJobCancel(priv->mon, job->name, false); + else + ret =3D qemuMonitorBlockJobCancel(priv->mon, job->name); if (qemuDomainObjExitMonitor(driver, vm) < 0) { ret =3D -1; goto endjob; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 07:17:04 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563467525; cv=none; d=zoho.com; s=zohoarc; b=MP0VaVwmFilpQwpe0VKD4JxhmxAqSkHxDbca98D2dUvEFERamXsARgEQxwfdtSXPtZ5xgyLtyKrzMYcpChIotpiA4fZoCo6pI2yys3t+KyAsSsoVG+XFgq1ROCfFcbm9b8QRVRKS40ETqIh3L/Bh2GlFlOO0bU8yQOi1F4txGE0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563467525; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=KQpoAdgKsLQIDKr/IBUDj+rpgMSbdS1PkM1pplTtIK0=; b=HjCoMUztQAkcsRih7exRkdnmBvhiBxZG3/f1Wuyl4NpEALnE9zmWCCSjRs2pAf9dxFgU4RIPhoubGr9wzUhWZ8wVKAwxXrC9PKEmaLOhlfWlP+DjTcbIgho3uYDqnTRyJ7lZtEcPaoQIvApb7090VM0iU1DP5ktEdlWekz/JetI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563467525336646.9249632957655; Thu, 18 Jul 2019 09:32:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 94B15308C381; Thu, 18 Jul 2019 16:32:02 +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 69C68605C6; Thu, 18 Jul 2019 16:32:02 +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 2207A1800206; Thu, 18 Jul 2019 16:32:02 +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 x6IGVqJw005215 for ; Thu, 18 Jul 2019 12:31:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 99F1160A35; Thu, 18 Jul 2019 16:31:52 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 249BF608A6 for ; Thu, 18 Jul 2019 16:31:51 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 18 Jul 2019 18:31:42 +0200 Message-Id: <64d0bddf83976ddbd448de88aa4d966b1ebbec7a.1563467441.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 7/8] qemu: Remove stale comment outlining how to extend qemuDomainBlockPivot 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 18 Jul 2019 16:32:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" With -blockdev: - we track the job and check it after restart - have the ability to ask qemu to persist it to collect result - have the ability to report errors. This solves all points the comment outlined so remove it. Also all jobs handle the disk state modification along with the event so there's nothing special the comment says. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 12ae31b9a7..cd0e1d5cf8 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17006,16 +17006,6 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, goto cleanup; } - /* Attempt the pivot. Record the attempt now, to prevent duplicate - * attempts; but the actual disk change will be made when emitting - * the event. - * XXX On libvirtd restarts, if we missed the qemu event, we need - * to double check what state qemu is in. - * XXX We should be using qemu's rerror flag to make sure the job - * remains alive until we know its final state. - * XXX If the abort command is synchronous but the qemu event says - * that pivot failed, we need to reflect that failure into the - * overall return value. */ qemuDomainObjEnterMonitor(driver, vm); if (blockdev) ret =3D qemuMonitorJobComplete(priv->mon, job->name); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 07:17:04 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563467539; cv=none; d=zoho.com; s=zohoarc; b=FrmDciZba8cyF9qHWYn04gQf2fmaKCdSjT8N3DCDxvdAK9HaaT41lMOZy5OKqZRwHbQmbrxbcJen54B2YHpqCoEwLzXADMT6tT7N5qpoX9mNqhy4gypQpfoeU4d9CZt8os68YlUwta6uGZWPcBL+nn1O9bWQo/vqt3LfCtNUSWc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563467539; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=tSWKl2a6HzUIH6j5Tgoa5M5tm497ZM8x2ZPbyVVW40E=; b=iYW5kBDYnD+TmStwiG09PptsU1tzUfG/aCL0YMuKWewiMXBJ5C3ewTkkMDj1iXcEWQy6mivlQJ91hXLa59jg5JnW4+/6HgECMcn6EFU/56jqW95IUyYJAlF5yg7e6Ot2M3kqTw8i+qX0UPtUOOsBNjQGYhRsmosuSj607p/wsi8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563467539108748.5889916332403; Thu, 18 Jul 2019 09:32:19 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C6FFC06513B; Thu, 18 Jul 2019 16:32:17 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3361660635; Thu, 18 Jul 2019 16:32:17 +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 9D59B264CB; Thu, 18 Jul 2019 16:32:16 +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 x6IGVrgV005229 for ; Thu, 18 Jul 2019 12:31:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6682A608A6; Thu, 18 Jul 2019 16:31:53 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id E58FA60A35 for ; Thu, 18 Jul 2019 16:31:52 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 18 Jul 2019 18:31:43 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 8/8] qemu: driver: Remove semi-stale comment about asynchronous job abort 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 18 Jul 2019 16:32:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Now that we track the job separately we watch only for the abort of the one single block job so the comment is no longer accurate. Also describing asynchronous operation is not really necessary. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index cd0e1d5cf8..22166c0745 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17217,12 +17217,6 @@ qemuDomainBlockJobAbort(virDomainPtr dom, ignore_value(virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, dr= iver->caps)); - /* - * With the ABORT_ASYNC flag we don't need to do anything, the event w= ill - * come from qemu and will update the XML as appropriate, but without = the - * ABORT_ASYNC flag, we must block to guarantee synchronous operation.= We - * do the waiting while still holding the VM job, to prevent newly - * scheduled block jobs from confusing us. */ if (!async) { qemuBlockJobUpdate(vm, job, QEMU_ASYNC_JOB_NONE); while (qemuBlockJobIsRunning(job)) { --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list