From nobody Fri May 3 22:28:29 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=1563373359; cv=none; d=zoho.com; s=zohoarc; b=BFwpToxz1WuejmPVVcj2tPRujzIk/1oilkm2/FGQDrkcU2nxTrKEVWY9T3dR4rCTW4R7N/5+7ys8GmNMpD0Cr/h5LyPDoM0VCH0WthMMwYwjq6I0W6yGXQnPjJ/pVF0BS2XRrjfTa6001kC4xXWDf8scjismQZsxuYJ3q2bxGfM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563373359; 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=ZmWvbIn91xr32bUQYxVuONmmpE5b2NDypzScWqFaiVA=; b=ehPUtRp3Mt//XH3mO3/0a66G0J8AOeGQQ6u8AIHg8Zc0zF2jf+fWBllvOvDSd++2JZVu+XQH5V6TblDEJapnWyk95OqUtzINoF5xRdShIdYQjKCnMCXn/jgcL9ubhkiTuE3QOZEuqTvE15Y4Ds5wDrKNHLvXZiK1W7Q2Z49tlUs= 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 156337335923775.43014599761386; Wed, 17 Jul 2019 07:22:39 -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 241DC59465; Wed, 17 Jul 2019 14:22:37 +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 F1ACC5D720; Wed, 17 Jul 2019 14:22:36 +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 BABB41800208; Wed, 17 Jul 2019 14:22:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6HEMOFZ032185 for ; Wed, 17 Jul 2019 10:22:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6EF735B68A; Wed, 17 Jul 2019 14:22:24 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED62B5B686 for ; Wed, 17 Jul 2019 14:22:23 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 17 Jul 2019 16:22:16 +0200 Message-Id: <554046d2f739327529587049934193a4bd403be4.1563373168.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] qemu: blockjob: Save config only in qemuBlockJobEventProcessLegacyCompleted 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.39]); Wed, 17 Jul 2019 14:22:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" There's no need to do it if the job is not completed. The new helper allows to do this with much less hassle in the correct place. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_blockjob.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index c102417e43..097d87f663 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -315,6 +315,7 @@ qemuBlockJobEventProcessLegacyCompleted(virQEMUDriverPt= r driver, ignore_value(qemuDomainDetermineDiskChain(driver, vm, disk, NULL, true= )); ignore_value(qemuBlockNodeNamesDetect(driver, vm, asyncJob)); qemuBlockJobUnregister(job); + qemuDomainSaveConfig(vm); } @@ -381,12 +382,6 @@ qemuBlockJobEventProcessLegacy(virQEMUDriverPtr driver, if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->cap= s) < 0) VIR_WARN("Unable to save status on vm %s after block job", vm->def= ->name); - - if (job->state =3D=3D VIR_DOMAIN_BLOCK_JOB_COMPLETED && vm->newDef) { - if (virDomainSaveConfig(cfg->configDir, driver->caps, vm->newDef) = < 0) - VIR_WARN("Unable to update persistent definition on vm %s " - "after block job", vm->def->name); - } } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 22:28:29 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=1563373351; cv=none; d=zoho.com; s=zohoarc; b=A9+yaWiZrzBYh9E5a7Pak1BNOF1ZcY6FhABZCTHtcvIX28K+pzv92nI5EV80CjPGqlfFDnJ4h87WUjkqm3xW5BuGr36ctsiOChv3l2xXpJ4gzm+bHdsQWX347eX1mmOFYIlK83AbYfArB5Nxd/GOe1xe8c+Dd5CrUg/Bm2ZMALU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563373351; 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=gsUcceUrFMeWehup5fF7a0Sz/jCWHy7ubM1szxgVUeg=; b=ZwAWIw3LFqEq/9iEMMShpP6skj5WE6eWA7d0yqVa+2ZGSQvYd+3XEKEXLgFEUldEpcqoomopady0vJlrmZobQP25tVCEf2zeq1c3tVZab42Z3WigejPnWOKUceJUHmDSl58pE8Y3Z9PzU+P3sZ+iljdPluvuC5VEuafOyIiJjvI= 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 156337335107561.751026233586344; Wed, 17 Jul 2019 07:22:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 352C3300CB2E; Wed, 17 Jul 2019 14:22:29 +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 0E5271001DDE; Wed, 17 Jul 2019 14:22:29 +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 41B5B1800202; Wed, 17 Jul 2019 14:22:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6HEMPnF032190 for ; Wed, 17 Jul 2019 10:22:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3CB165B687; Wed, 17 Jul 2019 14:22:25 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB9145B686 for ; Wed, 17 Jul 2019 14:22:24 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 17 Jul 2019 16:22:17 +0200 Message-Id: <599ee1b40187cf231d68d3cdb25fc84fe6884256.1563373168.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] qemu: blockjob: Update new job state earlier in qemuBlockJobEventProcessLegacy 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 17 Jul 2019 14:22:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The legacy job handler does not look at the old job state so we can update it earlier. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_blockjob.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 097d87f663..08d131ca2b 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -350,9 +350,12 @@ qemuBlockJobEventProcessLegacy(virQEMUDriverPtr driver, qemuBlockJobEmitEvents(driver, vm, disk, job->type, job->newstate); + job->state =3D job->newstate; + job->newstate =3D -1; + /* If we completed a block pull or commit, then update the XML * to match. */ - switch ((virConnectDomainEventBlockJobStatus) job->newstate) { + switch ((virConnectDomainEventBlockJobStatus) job->state) { case VIR_DOMAIN_BLOCK_JOB_COMPLETED: qemuBlockJobEventProcessLegacyCompleted(driver, vm, job, asyncJob); break; @@ -377,9 +380,6 @@ qemuBlockJobEventProcessLegacy(virQEMUDriverPtr driver, break; } - job->state =3D job->newstate; - job->newstate =3D -1; - if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->cap= s) < 0) VIR_WARN("Unable to save status on vm %s after block job", vm->def= ->name); } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list