From nobody Sat Feb 7 15:11:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1597640880; cv=none; d=zohomail.com; s=zohoarc; b=CgGSUOOPcP9bYmo3dda9Adfws8ltek/4u2j0k4I7kRno0iopYS11lue26cLayBxy8g8XfX9YunQ+mLiYOQsq262W05iw8LKQbG0g/SUn1NavCP3PCVDvvbSoD7u2lPoNAwRY7q46y9dYI3PP8PPK5/Rt7ncFLY9HuzdhrrtpHeI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597640880; h=Content-Type:Content-Transfer-Encoding:Cc: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; bh=9DW6Blc0M/yxqPxc41lRscGJ4fOhjY62wWHZgoph7TI=; b=kdNgh5qLo/lDNO3p5LW1uBAjB85kGwBTMrOGtgDnd7Yl//UllFxThlD4s44j0biHJ0dPugG9qOVK12Paf9pwcynkJQboeTArklYwQ/U40G4YbehmdnsTwy4q7VS9jYgFV+qujnEnMmL11JE12TKr37I5LljjRYVSa/nwSqb8adA= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1597640880816850.0404094559025; Sun, 16 Aug 2020 22:08:00 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-347-aRnxvE8tPTey00sW7UrR0A-1; Mon, 17 Aug 2020 01:07:57 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 90D9C2ED8; Mon, 17 Aug 2020 05:07:51 +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 71BF95C1DC; Mon, 17 Aug 2020 05:07: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 3D9D2180B658; Mon, 17 Aug 2020 05:07:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07H57jqp021753 for ; Mon, 17 Aug 2020 01:07:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4916D2026F94; Mon, 17 Aug 2020 05:07:45 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 444F820227B1 for ; Mon, 17 Aug 2020 05:07:42 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D6E52186E136 for ; Mon, 17 Aug 2020 05:07:42 +0000 (UTC) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-513-Kr7QHEdtP0KbZJfHP_dEag-1; Mon, 17 Aug 2020 01:07:40 -0400 Received: by mail-pg1-f196.google.com with SMTP id o13so7570228pgf.0 for ; Sun, 16 Aug 2020 22:07:40 -0700 (PDT) Received: from localhost.localdomain ([125.99.150.200]) by smtp.gmail.com with ESMTPSA id s64sm18091678pfs.111.2020.08.16.22.07.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Aug 2020 22:07:38 -0700 (PDT) X-MC-Unique: aRnxvE8tPTey00sW7UrR0A-1 X-MC-Unique: Kr7QHEdtP0KbZJfHP_dEag-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9DW6Blc0M/yxqPxc41lRscGJ4fOhjY62wWHZgoph7TI=; b=cZmrcO7N8xtupODs4B+1lDYh2j39OA60qQ41xGVDmP8R8citt0UtZQky+LuGU5i+GL w7Ndz3nlujOQSO4/IuMpf99kFk2+9spei19Zp1qoTQXDPS2YmulxCTYU7fy3akxZ811U 7Vtbm45PMpXD41dcPJ2Q0edrJAwBE0WZvT8QtYbVZFhQ/yvoG305WjCzdXw3LNmx+IFy 76rlgkYPnSsSllykbNR9XZOJ+XefxIIJ+idhhABWqzp7mV/I83o8iJjCsfAaAkcwOXqa yhwdaPFqAqIpwGGTP46Im1iPGuYD4cGZT/2ffv7RT2dcBNml4JbGGRPud+U+f6qOk3Df smRw== X-Gm-Message-State: AOAM532jNE+u6vlaovR/Jd0krTIIXWY45gbtov7iLu4Cvk/VrAMHGw0Q oNz50nUENXDHq+MSzw6bpJPbKppmPwwJqQ== X-Google-Smtp-Source: ABdhPJwW4HlhqksiFsoX7LJdzt7SqtqMFSzeuyRwOBwu0SPby5lHfD3WqxS8E5Ycx7ubt4QzledgOw== X-Received: by 2002:a62:4e96:: with SMTP id c144mr10244960pfb.27.1597640858932; Sun, 16 Aug 2020 22:07:38 -0700 (PDT) From: Prathamesh Chavan To: libvir-list@redhat.com Subject: [GSoC][PATCH v2 2/6] qemu_domainjob: jobs_queued parameter added to `qemuDomainJobPrivate` Date: Mon, 17 Aug 2020 10:37:17 +0530 Message-Id: <20200817050721.7063-3-pc44800@gmail.com> In-Reply-To: <20200817050721.7063-1-pc44800@gmail.com> References: <20200817050721.7063-1-pc44800@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false; X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: Prathamesh Chavan 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.003 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since the attribute `jobs_queued` was specific to jobs, we decided to move this from `qemuDomainObjPrivate` to `qemuDomainJobObj` structure. Signed-off-by: Prathamesh Chavan --- src/qemu/qemu_domain.h | 2 -- src/qemu/qemu_domainjob.c | 14 +++++++------- src/qemu/qemu_domainjob.h | 2 ++ src/qemu/qemu_process.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 386ae17272..507f710200 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -161,8 +161,6 @@ struct _qemuDomainObjPrivate { bool pausedShutdown; virTristateBool allowReboot; =20 - int jobs_queued; - unsigned long migMaxBandwidth; char *origname; int nbdPort; /* Port used for migration with NBD */ diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c index 503a87bb12..7cd1aabd9e 100644 --- a/src/qemu/qemu_domainjob.c +++ b/src/qemu/qemu_domainjob.c @@ -365,13 +365,13 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver, if (virTimeMillisNow(&now) < 0) return -1; =20 - priv->jobs_queued++; + priv->job.jobs_queued++; then =3D now + QEMU_JOB_WAIT_TIME; =20 retry: if ((!async && job !=3D QEMU_JOB_DESTROY) && cfg->maxQueuedJobs && - priv->jobs_queued > cfg->maxQueuedJobs) { + priv->job.jobs_queued > cfg->maxQueuedJobs) { goto error; } =20 @@ -502,7 +502,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver, } ret =3D -2; } else if (cfg->maxQueuedJobs && - priv->jobs_queued > cfg->maxQueuedJobs) { + priv->job.jobs_queued > cfg->maxQueuedJobs) { if (blocker && agentBlocker) { virReportError(VIR_ERR_OPERATION_FAILED, _("cannot acquire state change " @@ -532,7 +532,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver, } =20 cleanup: - priv->jobs_queued--; + priv->job.jobs_queued--; return ret; } =20 @@ -653,7 +653,7 @@ qemuDomainObjEndJob(virQEMUDriverPtr driver, virDomainO= bjPtr obj) qemuDomainObjPrivatePtr priv =3D obj->privateData; qemuDomainJob job =3D priv->job.active; =20 - priv->jobs_queued--; + priv->job.jobs_queued--; =20 VIR_DEBUG("Stopping job: %s (async=3D%s vm=3D%p name=3D%s)", qemuDomainJobTypeToString(job), @@ -674,7 +674,7 @@ qemuDomainObjEndAgentJob(virDomainObjPtr obj) qemuDomainObjPrivatePtr priv =3D obj->privateData; qemuDomainAgentJob agentJob =3D priv->job.agentActive; =20 - priv->jobs_queued--; + priv->job.jobs_queued--; =20 VIR_DEBUG("Stopping agent job: %s (async=3D%s vm=3D%p name=3D%s)", qemuDomainAgentJobTypeToString(agentJob), @@ -692,7 +692,7 @@ qemuDomainObjEndAsyncJob(virQEMUDriverPtr driver, virDo= mainObjPtr obj) { qemuDomainObjPrivatePtr priv =3D obj->privateData; =20 - priv->jobs_queued--; + priv->job.jobs_queued--; =20 VIR_DEBUG("Stopping async job: %s (vm=3D%p name=3D%s)", qemuDomainAsyncJobTypeToString(priv->job.asyncJob), diff --git a/src/qemu/qemu_domainjob.h b/src/qemu/qemu_domainjob.h index 88051d099a..0696b79fe3 100644 --- a/src/qemu/qemu_domainjob.h +++ b/src/qemu/qemu_domainjob.h @@ -152,6 +152,8 @@ struct _qemuDomainJobObj { char *error; /* job event completion error */ unsigned long apiFlags; /* flags passed to the API which started the a= sync job */ =20 + int jobs_queued; + void *privateData; /* job specific collection of data= */ qemuDomainObjPrivateJobCallbacksPtr cb; }; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 652d217b5c..e114e4c4ce 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3644,7 +3644,7 @@ qemuProcessRecoverJob(virQEMUDriverPtr driver, ignore_value(virTimeMillisNow(&now)); =20 /* Restore the config of the async job which is not persisted */ - priv->jobs_queued++; + priv->job.jobs_queued++; priv->job.asyncJob =3D QEMU_ASYNC_JOB_BACKUP; priv->job.asyncOwnerAPI =3D virThreadJobGet(); priv->job.asyncStarted =3D now; --=20 2.25.1