From nobody Wed May 1 12:51:15 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=1563466935; cv=none; d=zoho.com; s=zohoarc; b=f2eHD7dAEra+lUSaBpJuUJPYX5iKX6TpJq969mjnen2ZXX/HrNJm73q0zlTEa1wKfmVQh4lhoJKxcNnLX9ypCbjzTBL8FG5uZf5QC5vnYVaIdSwi2lX+SoSk8XARVo6duHZRIrSQgmRJwehHzJOoT/b0zLpxBer1ccL9kXL+Ysg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563466935; 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=C2CXcEexZSb4BXOsgfzjoWLoVSKU1jLtkblyhHsssIM=; b=Qfdnm59yJHgy9Uk8GidiL7nSQxqaO//ieC879M/pRVGfLxq1VpVoG1hDLSbh8djQM5IXg3jq1dMY/Y0FU/AtxjNlJo14Dqdc2IQWAGJZT3728zisTGUp5DvADSjecgITeWFYDxXcgECos1vfrpPZn33HGP61akwzMP8TaTSfoJM= 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 1563466935330115.18101452197504; Thu, 18 Jul 2019 09:22:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7A57A7FDF5; Thu, 18 Jul 2019 16:22:13 +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 2DC1A19C65; Thu, 18 Jul 2019 16:22:13 +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 D5C951800206; Thu, 18 Jul 2019 16:22:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6IGMAvE003858 for ; Thu, 18 Jul 2019 12:22:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 31A101001B32; Thu, 18 Jul 2019 16:22:10 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF18F10190A9 for ; Thu, 18 Jul 2019 16:22:09 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 18 Jul 2019 18:22:06 +0200 Message-Id: <9091b0444acefc7ca2418512dd9b0210dfff2577.1563466802.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] qemu: process: Don't use qemuBlockJobStartupFinalize in qemuProcessHandleBlockJob 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 18 Jul 2019 16:22:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The block job event handler qemuProcessHandleBlockJob looks at the block job data to see whether the job requires synchronous handling. Since the block job event may arrive before we continue the job handling (if the job has no data to copy) we could hit the state when the job is still set as QEMU_BLOCKJOB_STATE_NEW (as we move it to the QEMU_BLOCKJOB_STATE_RUNNING state only after returning from monitor). If the event handler uses qemuBlockJobStartupFinalize it would unregister and free the job. Thankfully this is not a big problem for legacy blockjobs as we don't need much data for them but since we'd re-instantiate the job data structure we'd report wrong job type for active commit as qemu reports it as a regular commit job. Fix it by not using qemuBlockJobStartupFinalize function in qemuProcessHandleBlockJob as it is not starting the job anyways. https://bugzilla.redhat.com/show_bug.cgi?id=3D1721375 Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index f3ffd76259..75205bc121 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -936,7 +936,7 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon ATTRIBUTE_= UNUSED, virQEMUDriverPtr driver =3D opaque; struct qemuProcessEvent *processEvent =3D NULL; virDomainDiskDefPtr disk; - qemuBlockJobDataPtr job =3D NULL; + VIR_AUTOUNREF(qemuBlockJobDataPtr) job =3D NULL; char *data =3D NULL; virObjectLock(vm); @@ -983,7 +983,6 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon ATTRIBUTE_= UNUSED, } cleanup: - qemuBlockJobStartupFinalize(vm, job); qemuProcessEventFree(processEvent); virObjectUnlock(vm); return 0; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 1 12:51:15 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=1563466945; cv=none; d=zoho.com; s=zohoarc; b=HKsom5ttXTVLozUMOG96eVePy2aV/Ah8DMCCHXggDgFo243o69RV1j3WEmnO0y3AG45AEDo9GZS1m+2Q1exsKWfg2ikq7FJP3VRZt1A/6E1px72+ncIfdFDT4Wslbm8mWd4qNJ/TpqzL56AWR4EfCAw4rP90kfOPsY4vZQNWe6Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563466945; 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=bZb6CZktUJl6I9x0jq4f8nqyEDEgJSD0EAXr2IBpA+Q=; b=VwrsdGlsyP08OITGc/Fd0z4Js05RmQ9f1ryK8VIJOe+b35+5AWaJbOSfGALoRBK5heEdenU/fZ/RPtIRCPosVERfPgBteMCd9/qR7WJcO20pnedkPSPGG0BRkigvSRAqufr2wbX30EQKo/8SgDpYZ5rNfTAe00eCXOwNoctJwkU= 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 1563466945256913.4987777766918; Thu, 18 Jul 2019 09:22:25 -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 541A030B8DE4; Thu, 18 Jul 2019 16:22:23 +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 3065F1001B32; Thu, 18 Jul 2019 16:22:23 +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 DC4374EA6C; Thu, 18 Jul 2019 16:22:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6IGMBmr003866 for ; Thu, 18 Jul 2019 12:22:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id F3B861001B12; Thu, 18 Jul 2019 16:22:10 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D5EF1001B0C for ; Thu, 18 Jul 2019 16:22:10 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 18 Jul 2019 18:22:07 +0200 Message-Id: <6f9f37d0d0f8bfb30646c38cceaee82f175f7a29.1563466802.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] qemu: driver: Don't use qemuBlockJobStartupFinalize in processBlockJobEvent 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.47]); Thu, 18 Jul 2019 16:22:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" While this function does start a block job in case when we'd not be able to get our internal data for it, the handler sets the job state to QEMU_BLOCKJOB_STATE_RUNNING anyways, thus qemuBlockJobStartupFinalize would just unref the job. Since the other usage of qemuBlockJobStartupFinalize in the other part of the event handler was a bug replace this one anyways even if it would not cause problems. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 329c166255..0438dd2878 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -4686,7 +4686,7 @@ processBlockJobEvent(virQEMUDriverPtr driver, int status) { virDomainDiskDefPtr disk; - qemuBlockJobDataPtr job =3D NULL; + VIR_AUTOUNREF(qemuBlockJobDataPtr) job =3D NULL; if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) return; @@ -4712,7 +4712,6 @@ processBlockJobEvent(virQEMUDriverPtr driver, qemuBlockJobUpdate(vm, job, QEMU_ASYNC_JOB_NONE); endjob: - qemuBlockJobStartupFinalize(vm, job); qemuDomainObjEndJob(driver, vm); } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 1 12:51:15 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=1563466936; cv=none; d=zoho.com; s=zohoarc; b=XSmFk+ESbFMVFDL1CSXBXl9fA0fYpmEWzzzTdZQyQjiZ7ByAxTDOSae/KF+lCwFZVOP7DcXJVS9/dnFqCDV3d2UBTcAOjieh5GwnG7Dst+xIszI97RzBRn8ZDdkyE+IxoCSmosADknO7RP/XhkPDaDnUJ2cFqAdvSxgU1PnwIYo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563466936; 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=ct+4R+nez685BK7fSO0sBBcYLr5xPfzZ4o4KSpToprA=; b=adYzZMOWZxLaleNt2mEUmCESRS1/Y9fU7dFuS+nSw0PNKPxYDMXWPi5ufWyEsLTCOVZnum77SsP+zkhCJRtNpC89UulskmD2apyAqkZX+Q9n0E++lHLDrW3NUkZgFdwdW/+rSzdfNa9px89rPmgIv5Ne3KRGMte8Jpnh3sQyjM0= 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 1563466936251933.4785262931817; Thu, 18 Jul 2019 09:22:16 -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 64E3C3082AEF; Thu, 18 Jul 2019 16:22:14 +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 3C3C01001B32; Thu, 18 Jul 2019 16:22:14 +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 E9F721800207; Thu, 18 Jul 2019 16:22:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6IGMBfa003875 for ; Thu, 18 Jul 2019 12:22:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id BF4C31001B12; Thu, 18 Jul 2019 16:22:11 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4ACFD1001B0C for ; Thu, 18 Jul 2019 16:22:11 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 18 Jul 2019 18:22:08 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] qemu: driver: Add debug message when we conjure block job data object 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.45]); Thu, 18 Jul 2019 16:22:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Report in logs when we don't find existing block job data and create it just to handle the job. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 0438dd2878..482f915b67 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -4702,6 +4702,7 @@ processBlockJobEvent(virQEMUDriverPtr driver, } if (!(job =3D qemuBlockJobDiskGetJob(disk))) { + VIR_DEBUG("creating new block job object for '%s'", diskAlias); if (!(job =3D qemuBlockJobDiskNew(vm, disk, type, diskAlias))) goto endjob; job->state =3D QEMU_BLOCKJOB_STATE_RUNNING; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list