From nobody Mon Feb 9 08:31:32 2026 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1529906531402445.7454588760834; Sun, 24 Jun 2018 23:02:11 -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 C98A930820CB; Mon, 25 Jun 2018 06:02:08 +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 E83586049E; Mon, 25 Jun 2018 06:02:07 +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 566974A460; Mon, 25 Jun 2018 06:02:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5P623b2004055 for ; Mon, 25 Jun 2018 02:02:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 552877C42; Mon, 25 Jun 2018 06:02:03 +0000 (UTC) Received: from localhost.localdomain (ovpn-204-25.brq.redhat.com [10.40.204.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 822DD7C41; Mon, 25 Jun 2018 06:02:00 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 25 Jun 2018 08:01:53 +0200 Message-Id: <068328ecf58079637d93fe0e10ac0e347299f8f6.1529906392.git.mprivozn@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2] qemuDomainObjBeginJobInternal: Report agent job in error message 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: , MIME-Version: 1.0 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.47]); Mon, 25 Jun 2018 06:02:10 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" If a thread is unable to acquire a job (e.g. because of timeout) an error is reported and the error message contains reference to the other thread holding the job. Well, the error message should report agent job too as it is yet another source of possible failure. Signed-off-by: Michal Privoznik Reviewed-by: John Ferlan --- diff to v1: - Expand messages to cover all @blocker and @agentBlocker possibilities (as Jira requested in review) src/qemu/qemu_domain.c | 46 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 95c3e3a8aa..3410774781 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6420,6 +6420,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver, bool async =3D job =3D=3D QEMU_JOB_ASYNC; virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); const char *blocker =3D NULL; + const char *agentBlocker =3D NULL; int ret =3D -1; unsigned long long duration =3D 0; unsigned long long agentDuration =3D 0; @@ -6549,16 +6550,32 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driv= er, priv->job.apiFlags, duration / 1000, agentDuration / 1000, asyncDuration / 1000); =20 - if (nested || qemuDomainNestedJobAllowed(priv, job)) - blocker =3D priv->job.ownerAPI; - else - blocker =3D priv->job.asyncOwnerAPI; + if (job) { + if (nested || qemuDomainNestedJobAllowed(priv, job)) + blocker =3D priv->job.ownerAPI; + else + blocker =3D priv->job.asyncOwnerAPI; + } + + if (agentJob) + agentBlocker =3D priv->job.agentOwnerAPI; =20 if (errno =3D=3D ETIMEDOUT) { - if (blocker) { + if (blocker && agentBlocker) { virReportError(VIR_ERR_OPERATION_TIMEOUT, - _("cannot acquire state change lock (held by %s= )"), + _("cannot acquire state change " + "lock (held by monitor=3D%s agent=3D%s)"), + blocker, agentBlocker); + } else if (blocker) { + virReportError(VIR_ERR_OPERATION_TIMEOUT, + _("cannot acquire state change " + "lock (held by monitor=3D%s)"), blocker); + } else if (agentBlocker) { + virReportError(VIR_ERR_OPERATION_TIMEOUT, + _("cannot acquire state change " + "lock (held by agent=3D%s)"), + agentBlocker); } else { virReportError(VIR_ERR_OPERATION_TIMEOUT, "%s", _("cannot acquire state change lock")); @@ -6566,11 +6583,24 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driv= er, ret =3D -2; } else if (cfg->maxQueuedJobs && priv->jobs_queued > cfg->maxQueuedJobs) { - if (blocker) { + if (blocker && agentBlocker) { virReportError(VIR_ERR_OPERATION_FAILED, - _("cannot acquire state change lock (held by %s= ) " + _("cannot acquire state change " + "lock (held by monitor=3D%s agent=3D%s) " + "due to max_queued limit"), + blocker, agentBlocker); + } else if (blocker) { + virReportError(VIR_ERR_OPERATION_FAILED, + _("cannot acquire state change " + "lock (held by monitor=3D%s) " "due to max_queued limit"), blocker); + } else if (agentBlocker) { + virReportError(VIR_ERR_OPERATION_FAILED, + _("cannot acquire state change " + "lock (held by agent=3D%s) " + "due to max_queued limit"), + agentBlocker); } else { virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("cannot acquire state change lock " --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list