From nobody Tue Apr 30 04:17:26 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1529390298898221.08271787249976; Mon, 18 Jun 2018 23:38:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 595613082A33; Tue, 19 Jun 2018 06:38: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 078922010D5E; Tue, 19 Jun 2018 06:38: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 1A9CB180613A; Tue, 19 Jun 2018 06:38:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5J6cATr023883 for ; Tue, 19 Jun 2018 02:38:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 73255111AF2E; Tue, 19 Jun 2018 06:38:10 +0000 (UTC) Received: from localhost.localdomain (ovpn-204-34.brq.redhat.com [10.40.204.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id E769C111AF2D for ; Tue, 19 Jun 2018 06:38:09 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 19 Jun 2018 08:38:00 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [v2 RESEND 1/3] qemu: Introduce qemuDomainAgentJob 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.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 19 Jun 2018 06:38:14 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Introduce guest agent specific job categories to allow threads to run agent monitor specific jobs while normal monitor jobs can also be running. Alter _qemuDomainJobObj in order to duplicate certain fields that will be used for guest agent specific tasks to increase concurrency and throughput and reduce serialization. Signed-off-by: Michal Privoznik Reviewed-by: Jiri Denemark --- src/qemu/qemu_domain.c | 6 ++++++ src/qemu/qemu_domain.h | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 8a2d4750a5..91f3c6d236 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -93,6 +93,12 @@ VIR_ENUM_IMPL(qemuDomainJob, QEMU_JOB_LAST, "async nested", ); =20 +VIR_ENUM_IMPL(qemuDomainAgentJob, QEMU_AGENT_JOB_LAST, + "none", + "query", + "modify", +); + VIR_ENUM_IMPL(qemuDomainAsyncJob, QEMU_ASYNC_JOB_LAST, "none", "migration out", diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 9e2da0a37c..12573e5f86 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -82,6 +82,15 @@ typedef enum { } qemuDomainJob; VIR_ENUM_DECL(qemuDomainJob) =20 +typedef enum { + QEMU_AGENT_JOB_NONE =3D 0, /* No agent job. */ + QEMU_AGENT_JOB_QUERY, /* Does not change state of domain */ + QEMU_AGENT_JOB_MODIFY, /* May change state of domain */ + + QEMU_AGENT_JOB_LAST +} qemuDomainAgentJob; +VIR_ENUM_DECL(qemuDomainAgentJob) + /* Async job consists of a series of jobs that may change state. Independe= nt * jobs that do not change state (and possibly others if explicitly allowe= d by * current async job) are allowed to be run even if async job is active. @@ -158,11 +167,20 @@ typedef struct _qemuDomainJobObj qemuDomainJobObj; typedef qemuDomainJobObj *qemuDomainJobObjPtr; struct _qemuDomainJobObj { virCond cond; /* Use to coordinate jobs */ + + /* The following members are for QEMU_JOB_* */ qemuDomainJob active; /* Currently running job */ unsigned long long owner; /* Thread id which set current job= */ const char *ownerAPI; /* The API which owns the job */ unsigned long long started; /* When the current job started */ =20 + /* The following members are for QEMU_AGENT_JOB_* */ + qemuDomainAgentJob agentActive; /* Currently running agent job */ + unsigned long long agentOwner; /* Thread id which set current age= nt job */ + const char *agentOwnerAPI; /* The API which owns the agent jo= b */ + unsigned long long agentStarted; /* When the current agent job star= ted */ + + /* The following members are for QEMU_ASYNC_JOB_* */ virCond asyncCond; /* Use to coordinate with async jo= bs */ qemuDomainAsyncJob asyncJob; /* Currently active async job */ unsigned long long asyncOwner; /* Thread which set current async = job */ --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 04:17:26 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1529390307527545.6901931554; Mon, 18 Jun 2018 23:38:27 -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 0105130832D3; Tue, 19 Jun 2018 06:38:26 +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 A05B6600C0; Tue, 19 Jun 2018 06:38:25 +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 12512180053A; Tue, 19 Jun 2018 06:38:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5J6cBCc023891 for ; Tue, 19 Jun 2018 02:38:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 64CAF111AF2E; Tue, 19 Jun 2018 06:38:11 +0000 (UTC) Received: from localhost.localdomain (ovpn-204-34.brq.redhat.com [10.40.204.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD327111AF2D for ; Tue, 19 Jun 2018 06:38:10 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 19 Jun 2018 08:38:01 +0200 Message-Id: <9b443d9878b083d79c206f26331e3bf6de9d998a.1529390159.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [v2 RESEND 2/3] qemu: Introduce APIs for manipulating qemuDomainAgentJob 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.44]); Tue, 19 Jun 2018 06:38:26 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The point is to break QEMU_JOB_* into smaller pieces which enables us to achieve higher throughput. For instance, if there are two threads, one is trying to query something on qemu monitor while the other is trying to query something on agent monitor these two threads would serialize. There is not much reason for that. Signed-off-by: Michal Privoznik Reviewed-by: Jiri Denemark --- src/qemu/THREADS.txt | 112 ++++++++++++++++++++++++++--- src/qemu/qemu_domain.c | 187 +++++++++++++++++++++++++++++++++++++++------= ---- src/qemu/qemu_domain.h | 12 ++++ 3 files changed, 264 insertions(+), 47 deletions(-) diff --git a/src/qemu/THREADS.txt b/src/qemu/THREADS.txt index 7243161fe3..d17f3f4e0c 100644 --- a/src/qemu/THREADS.txt +++ b/src/qemu/THREADS.txt @@ -51,8 +51,8 @@ There are a number of locks on various objects Since virDomainObjPtr lock must not be held during sleeps, the job conditions provide additional protection for code making updates. =20 - QEMU driver uses two kinds of job conditions: asynchronous and - normal. + QEMU driver uses three kinds of job conditions: asynchronous, agent + and normal. =20 Asynchronous job condition is used for long running jobs (such as migration) that consist of several monitor commands and it is @@ -69,16 +69,23 @@ There are a number of locks on various objects it needs to wait until the asynchronous job ends and try to acquire the job again. =20 + Agent job condition is then used when thread wishes to talk to qemu + agent monitor. It is possible to acquire just agent job + (qemuDomainObjBeginAgentJob), or only normal job + (qemuDomainObjBeginJob) or both at the same time + (qemuDomainObjBeginJobWithAgent). Which type of job to grab depends + whether caller wishes to communicate only with agent socket, or only + with qemu monitor socket or both, respectively. + Immediately after acquiring the virDomainObjPtr lock, any method - which intends to update state must acquire either asynchronous or - normal job condition. The virDomainObjPtr lock is released while - blocking on these condition variables. Once the job condition is - acquired, a method can safely release the virDomainObjPtr lock - whenever it hits a piece of code which may sleep/wait, and - re-acquire it after the sleep/wait. Whenever an asynchronous job - wants to talk to the monitor, it needs to acquire nested job (a - special kind of normal job) to obtain exclusive access to the - monitor. + which intends to update state must acquire asynchronous, normal or + agent job . The virDomainObjPtr lock is released while blocking on + these condition variables. Once the job condition is acquired, a + method can safely release the virDomainObjPtr lock whenever it hits + a piece of code which may sleep/wait, and re-acquire it after the + sleep/wait. Whenever an asynchronous job wants to talk to the + monitor, it needs to acquire nested job (a special kind of normal + job) to obtain exclusive access to the monitor. =20 Since the virDomainObjPtr lock was dropped while waiting for the job condition, it is possible that the domain is no longer active @@ -132,6 +139,30 @@ To acquire the normal job condition =20 =20 =20 +To acquire the agent job condition + + qemuDomainObjBeginAgentJob() + - Waits until there is no other agent job set + - Sets job.agentActive tp the job type + + qemuDomainObjEndAgentJob() + - Sets job.agentActive to 0 + - Signals on job.cond condition + + + +To acquire both normal and agent job condition + + qemuDomainObjBeginJobWithAgent() + - Waits until there is no normal and no agent job set + - Sets both job.active and job.agentActive with required job types + + qemuDomainObjEndJobWithAgent() + - Sets both job.active and job.agentActive to 0 + - Signals on job.cond condition + + + To acquire the asynchronous job condition =20 qemuDomainObjBeginAsyncJob() @@ -247,6 +278,65 @@ Design patterns virDomainObjEndAPI(&obj); =20 =20 + * Invoking an agent command on a virDomainObjPtr + + virDomainObjPtr obj; + qemuAgentPtr agent; + + obj =3D qemuDomObjFromDomain(dom); + + qemuDomainObjBeginAgentJob(obj, QEMU_AGENT_JOB_TYPE); + + ...do prep work... + + if (!qemuDomainAgentAvailable(obj, true)) + goto cleanup; + + agent =3D qemuDomainObjEnterAgent(obj); + qemuAgentXXXX(agent, ..); + qemuDomainObjExitAgent(obj, agent); + + ...do final work... + + qemuDomainObjEndAgentJob(obj); + virDomainObjEndAPI(&obj); + + + * Invoking both monitor and agent commands on a virDomainObjPtr + + virDomainObjPtr obj; + qemuAgentPtr agent; + + obj =3D qemuDomObjFromDomain(dom); + + qemuDomainObjBeginJobWithAgent(obj, QEMU_JOB_TYPE, QEMU_AGENT_JOB_TYP= E); + + if (!virDomainObjIsActive(dom)) + goto cleanup; + + ...do prep work... + + if (!qemuDomainAgentAvailable(obj, true)) + goto cleanup; + + agent =3D qemuDomainObjEnterAgent(obj); + qemuAgentXXXX(agent, ..); + qemuDomainObjExitAgent(obj, agent); + + ... + + qemuDomainObjEnterMonitor(obj); + qemuMonitorXXXX(priv->mon); + qemuDomainObjExitMonitor(obj); + + /* Alternatively, talk to the monitor first and then talk to the agen= t. */ + + ...do final work... + + qemuDomainObjEndJobWithAgent(obj); + virDomainObjEndAPI(&obj); + + * Running asynchronous job =20 virDomainObjPtr obj; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 91f3c6d236..30a06a1575 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -313,6 +313,19 @@ qemuDomainObjResetJob(qemuDomainObjPrivatePtr priv) job->started =3D 0; } =20 + +static void +qemuDomainObjResetAgentJob(qemuDomainObjPrivatePtr priv) +{ + qemuDomainJobObjPtr job =3D &priv->job; + + job->agentActive =3D QEMU_AGENT_JOB_NONE; + job->agentOwner =3D 0; + job->agentOwnerAPI =3D NULL; + job->agentStarted =3D 0; +} + + static void qemuDomainObjResetAsyncJob(qemuDomainObjPrivatePtr priv) { @@ -6356,6 +6369,15 @@ qemuDomainJobAllowed(qemuDomainObjPrivatePtr priv, q= emuDomainJob job) return !priv->job.active && qemuDomainNestedJobAllowed(priv, job); } =20 +static bool +qemuDomainObjCanSetJob(qemuDomainObjPrivatePtr priv, + qemuDomainJob job, + qemuDomainAgentJob agentJob) +{ + return (job =3D=3D QEMU_JOB_NONE || !priv->job.active) && + (agentJob =3D=3D QEMU_AGENT_JOB_NONE || !priv->job.agentActive); +} + /* Give up waiting for mutex after 30 seconds */ #define QEMU_JOB_WAIT_TIME (1000ull * 30) =20 @@ -6385,6 +6407,7 @@ static int ATTRIBUTE_NONNULL(1) qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver, virDomainObjPtr obj, qemuDomainJob job, + qemuDomainAgentJob agentJob, qemuDomainAsyncJob asyncJob, bool nowait) { @@ -6398,16 +6421,15 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driv= er, int ret =3D -1; unsigned long long duration =3D 0; unsigned long long asyncDuration =3D 0; - const char *jobStr; =20 - if (async) - jobStr =3D qemuDomainAsyncJobTypeToString(asyncJob); - else - jobStr =3D qemuDomainJobTypeToString(job); - - VIR_DEBUG("Starting %s: %s (vm=3D%p name=3D%s, current job=3D%s async= =3D%s)", - async ? "async job" : "job", jobStr, obj, obj->def->name, + VIR_DEBUG("Starting job: job=3D%s agentJob=3D%s asyncJob=3D%s " + "(vm=3D%p name=3D%s, current job=3D%s agentJob=3D%s async=3D= %s)", + qemuDomainJobTypeToString(job), + qemuDomainAgentJobTypeToString(agentJob), + qemuDomainAsyncJobTypeToString(asyncJob), + obj, obj->def->name, qemuDomainJobTypeToString(priv->job.active), + qemuDomainAgentJobTypeToString(priv->job.agentActive), qemuDomainAsyncJobTypeToString(priv->job.asyncJob)); =20 if (virTimeMillisNow(&now) < 0) { @@ -6434,10 +6456,9 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr drive= r, goto error; } =20 - while (priv->job.active) { + while (!qemuDomainObjCanSetJob(priv, job, agentJob)) { if (nowait) goto cleanup; - VIR_DEBUG("Waiting for job (vm=3D%p name=3D%s)", obj, obj->def->na= me); if (virCondWaitUntil(&priv->job.cond, &obj->parent.lock, then) < 0) goto error; @@ -6448,32 +6469,48 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driv= er, if (!nested && !qemuDomainNestedJobAllowed(priv, job)) goto retry; =20 - qemuDomainObjResetJob(priv); - ignore_value(virTimeMillisNow(&now)); =20 - if (job !=3D QEMU_JOB_ASYNC) { - VIR_DEBUG("Started job: %s (async=3D%s vm=3D%p name=3D%s)", - qemuDomainJobTypeToString(job), - qemuDomainAsyncJobTypeToString(priv->job.asyncJob), - obj, obj->def->name); - priv->job.active =3D job; - priv->job.owner =3D virThreadSelfID(); - priv->job.ownerAPI =3D virThreadJobGet(); + if (job) { + qemuDomainObjResetJob(priv); + + if (job !=3D QEMU_JOB_ASYNC) { + VIR_DEBUG("Started job: %s (async=3D%s vm=3D%p name=3D%s)", + qemuDomainJobTypeToString(job), + qemuDomainAsyncJobTypeToString(priv->job.asyncJob), + obj, obj->def->name); + priv->job.active =3D job; + priv->job.owner =3D virThreadSelfID(); + priv->job.ownerAPI =3D virThreadJobGet(); + priv->job.started =3D now; + } else { + VIR_DEBUG("Started async job: %s (vm=3D%p name=3D%s)", + qemuDomainAsyncJobTypeToString(asyncJob), + obj, obj->def->name); + qemuDomainObjResetAsyncJob(priv); + if (VIR_ALLOC(priv->job.current) < 0) + goto cleanup; + priv->job.current->status =3D QEMU_DOMAIN_JOB_STATUS_ACTIVE; + priv->job.asyncJob =3D asyncJob; + priv->job.asyncOwner =3D virThreadSelfID(); + priv->job.asyncOwnerAPI =3D virThreadJobGet(); + priv->job.asyncStarted =3D now; + priv->job.current->started =3D now; + } + } + + if (agentJob) { + qemuDomainObjResetAgentJob(priv); + + VIR_DEBUG("Started agent job: %s (vm=3D%p name=3D%s job=3D%s async= =3D%s)", + qemuDomainAgentJobTypeToString(agentJob), + obj, obj->def->name, + qemuDomainJobTypeToString(priv->job.active), + qemuDomainAsyncJobTypeToString(priv->job.asyncJob)); + priv->job.agentActive =3D agentJob; + priv->job.agentOwner =3D virThreadSelfID(); + priv->job.agentOwnerAPI =3D virThreadJobGet(); priv->job.started =3D now; - } else { - VIR_DEBUG("Started async job: %s (vm=3D%p name=3D%s)", - qemuDomainAsyncJobTypeToString(asyncJob), - obj, obj->def->name); - qemuDomainObjResetAsyncJob(priv); - if (VIR_ALLOC(priv->job.current) < 0) - goto cleanup; - priv->job.current->status =3D QEMU_DOMAIN_JOB_STATUS_ACTIVE; - priv->job.asyncJob =3D asyncJob; - priv->job.asyncOwner =3D virThreadSelfID(); - priv->job.asyncOwnerAPI =3D virThreadJobGet(); - priv->job.asyncStarted =3D now; - priv->job.current->started =3D now; } =20 if (qemuDomainTrackJob(job)) @@ -6554,12 +6591,46 @@ int qemuDomainObjBeginJob(virQEMUDriverPtr driver, qemuDomainJob job) { if (qemuDomainObjBeginJobInternal(driver, obj, job, + QEMU_AGENT_JOB_NONE, QEMU_ASYNC_JOB_NONE, false) < 0) return -1; else return 0; } =20 +/** + * qemuDomainObjBeginAgentJob: + * + * Grabs agent type of job. Use if caller talks to guest agent only. + * + * To end job call qemuDomainObjEndAgentJob. + */ +int qemuDomainObjBeginAgentJob(virQEMUDriverPtr driver, + virDomainObjPtr obj, + qemuDomainAgentJob agentJob) +{ + return qemuDomainObjBeginJobInternal(driver, obj, QEMU_JOB_NONE, + agentJob, + QEMU_ASYNC_JOB_NONE, false); +} + +/** + * qemuDomainObjBeginJobWithAgent: + * + * Grabs both monitor and agent types of job. Use if caller talks to both + * monitor and guest agent. + * + * To end job call qemuDomainObjEndJobWithAgent. + */ +int qemuDomainObjBeginJobWithAgent(virQEMUDriverPtr driver, + virDomainObjPtr obj, + qemuDomainJob job, + qemuDomainAgentJob agentJob) +{ + return qemuDomainObjBeginJobInternal(driver, obj, job, + agentJob, QEMU_ASYNC_JOB_NONE, fal= se); +} + int qemuDomainObjBeginAsyncJob(virQEMUDriverPtr driver, virDomainObjPtr obj, qemuDomainAsyncJob asyncJob, @@ -6569,6 +6640,7 @@ int qemuDomainObjBeginAsyncJob(virQEMUDriverPtr drive= r, qemuDomainObjPrivatePtr priv; =20 if (qemuDomainObjBeginJobInternal(driver, obj, QEMU_JOB_ASYNC, + QEMU_AGENT_JOB_NONE, asyncJob, false) < 0) return -1; =20 @@ -6598,6 +6670,7 @@ qemuDomainObjBeginNestedJob(virQEMUDriverPtr driver, =20 return qemuDomainObjBeginJobInternal(driver, obj, QEMU_JOB_ASYNC_NESTED, + QEMU_AGENT_JOB_NONE, QEMU_ASYNC_JOB_NONE, false); } @@ -6621,6 +6694,7 @@ qemuDomainObjBeginJobNowait(virQEMUDriverPtr driver, qemuDomainJob job) { return qemuDomainObjBeginJobInternal(driver, obj, job, + QEMU_AGENT_JOB_NONE, QEMU_ASYNC_JOB_NONE, true); } =20 @@ -6646,7 +6720,47 @@ qemuDomainObjEndJob(virQEMUDriverPtr driver, virDoma= inObjPtr obj) qemuDomainObjResetJob(priv); if (qemuDomainTrackJob(job)) qemuDomainObjSaveJob(driver, obj); - virCondSignal(&priv->job.cond); + virCondBroadcast(&priv->job.cond); +} + +void +qemuDomainObjEndAgentJob(virDomainObjPtr obj) +{ + qemuDomainObjPrivatePtr priv =3D obj->privateData; + qemuDomainAgentJob agentJob =3D priv->job.agentActive; + + priv->jobs_queued--; + + VIR_DEBUG("Stopping agent job: %s (async=3D%s vm=3D%p name=3D%s)", + qemuDomainAgentJobTypeToString(agentJob), + qemuDomainAsyncJobTypeToString(priv->job.asyncJob), + obj, obj->def->name); + + qemuDomainObjResetAgentJob(priv); + virCondBroadcast(&priv->job.cond); +} + +void +qemuDomainObjEndJobWithAgent(virQEMUDriverPtr driver, + virDomainObjPtr obj) +{ + qemuDomainObjPrivatePtr priv =3D obj->privateData; + qemuDomainJob job =3D priv->job.active; + qemuDomainAgentJob agentJob =3D priv->job.agentActive; + + priv->jobs_queued--; + + VIR_DEBUG("Stopping both jobs: %s %s (async=3D%s vm=3D%p name=3D%s)", + qemuDomainJobTypeToString(job), + qemuDomainAgentJobTypeToString(agentJob), + qemuDomainAsyncJobTypeToString(priv->job.asyncJob), + obj, obj->def->name); + + qemuDomainObjResetJob(priv); + qemuDomainObjResetAgentJob(priv); + if (qemuDomainTrackJob(job)) + qemuDomainObjSaveJob(driver, obj); + virCondBroadcast(&priv->job.cond); } =20 void @@ -6800,8 +6914,9 @@ qemuDomainObjEnterMonitorAsync(virQEMUDriverPtr drive= r, * obj must be locked before calling * * To be called immediately before any QEMU agent API call. - * Must have already called qemuDomainObjBeginJob() and checked - * that the VM is still active. + * Must have already called qemuDomainObjBeginAgentJob() or + * qemuDomainObjBeginJobWithAgent() and checked that the VM is + * still active. * * To be followed with qemuDomainObjExitAgent() once complete */ diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 12573e5f86..0a9af756b8 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -518,6 +518,15 @@ int qemuDomainObjBeginJob(virQEMUDriverPtr driver, virDomainObjPtr obj, qemuDomainJob job) ATTRIBUTE_RETURN_CHECK; +int qemuDomainObjBeginAgentJob(virQEMUDriverPtr driver, + virDomainObjPtr obj, + qemuDomainAgentJob agentJob) + ATTRIBUTE_RETURN_CHECK; +int qemuDomainObjBeginJobWithAgent(virQEMUDriverPtr driver, + virDomainObjPtr obj, + qemuDomainJob job, + qemuDomainAgentJob agentJob) + ATTRIBUTE_RETURN_CHECK; int qemuDomainObjBeginAsyncJob(virQEMUDriverPtr driver, virDomainObjPtr obj, qemuDomainAsyncJob asyncJob, @@ -535,6 +544,9 @@ int qemuDomainObjBeginJobNowait(virQEMUDriverPtr driver, =20 void qemuDomainObjEndJob(virQEMUDriverPtr driver, virDomainObjPtr obj); +void qemuDomainObjEndAgentJob(virDomainObjPtr obj); +void qemuDomainObjEndJobWithAgent(virQEMUDriverPtr driver, + virDomainObjPtr obj); void qemuDomainObjEndAsyncJob(virQEMUDriverPtr driver, virDomainObjPtr obj); void qemuDomainObjAbortAsyncJob(virDomainObjPtr obj); --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 04:17:26 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1529390313259143.31125277234878; Mon, 18 Jun 2018 23:38:33 -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 B05C0C04AC50; Tue, 19 Jun 2018 06:38:31 +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 7210A5C1B2; Tue, 19 Jun 2018 06:38:31 +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 EF91E180053D; Tue, 19 Jun 2018 06:38:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5J6cCQ5023901 for ; Tue, 19 Jun 2018 02:38:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4D41B111AF2E; Tue, 19 Jun 2018 06:38:12 +0000 (UTC) Received: from localhost.localdomain (ovpn-204-34.brq.redhat.com [10.40.204.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id BAD17111AF2D for ; Tue, 19 Jun 2018 06:38:11 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 19 Jun 2018 08:38:02 +0200 Message-Id: <327f9a5f8cbc0d584c688d74cf4f23f2a186407c.1529390159.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [v2 RESEND 3/3] qemu: Switch code to use new agent job APIs 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 19 Jun 2018 06:38:32 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" There are two sets of functions here: 1) some functions talk on both monitor and agent monitor, 2) some functions only talk on agent monitor. For functions from set 1) we need to use qemuDomainObjBeginJobWithAgent() and for functions from set 2) we need to use qemuDomainObjBeginAgentJob() only. Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 91 ++++++++++++++++++++++++++++++++--------------= ---- 1 file changed, 58 insertions(+), 33 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 3abbe41895..cffd4c928a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1954,6 +1954,7 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, = unsigned int flags) bool useAgent =3D false, agentRequested, acpiRequested; bool isReboot =3D false; bool agentForced; + bool agentJob =3D false; int agentFlag =3D QEMU_AGENT_SHUTDOWN_POWERDOWN; =20 virCheckFlags(VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN | @@ -1980,9 +1981,14 @@ static int qemuDomainShutdownFlags(virDomainPtr dom,= unsigned int flags) if (virDomainShutdownFlagsEnsureACL(dom->conn, vm->def, flags) < 0) goto cleanup; =20 - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) + if ((!useAgent && qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) <= 0) || + (useAgent && qemuDomainObjBeginJobWithAgent(driver, vm, + QEMU_JOB_MODIFY, + QEMU_AGENT_JOB_MODIFY)= < 0)) goto cleanup; =20 + agentJob =3D useAgent; + if (virDomainObjGetState(vm, NULL) !=3D VIR_DOMAIN_RUNNING) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("domain is not running")); @@ -2026,7 +2032,10 @@ static int qemuDomainShutdownFlags(virDomainPtr dom,= unsigned int flags) } =20 endjob: - qemuDomainObjEndJob(driver, vm); + if (agentJob) + qemuDomainObjEndJobWithAgent(driver, vm); + else + qemuDomainObjEndJob(driver, vm); =20 cleanup: virDomainObjEndAPI(&vm); @@ -2049,6 +2058,7 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags) bool useAgent =3D false, agentRequested, acpiRequested; bool isReboot =3D true; bool agentForced; + bool agentJob =3D false; int agentFlag =3D QEMU_AGENT_SHUTDOWN_REBOOT; =20 virCheckFlags(VIR_DOMAIN_REBOOT_ACPI_POWER_BTN | @@ -2075,9 +2085,14 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flag= s) if (virDomainRebootEnsureACL(dom->conn, vm->def, flags) < 0) goto cleanup; =20 - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) + if ((!useAgent && qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) <= 0) || + (useAgent && qemuDomainObjBeginJobWithAgent(driver, vm, + QEMU_JOB_MODIFY, + QEMU_AGENT_JOB_MODIFY)= < 0)) goto cleanup; =20 + agentJob =3D useAgent; + agentForced =3D agentRequested && !acpiRequested; if (!qemuDomainAgentAvailable(vm, agentForced)) { if (agentForced) @@ -2115,7 +2130,10 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flag= s) } =20 endjob: - qemuDomainObjEndJob(driver, vm); + if (agentJob) + qemuDomainObjEndJobWithAgent(driver, vm); + else + qemuDomainObjEndJob(driver, vm); =20 cleanup: virDomainObjEndAPI(&vm); @@ -4949,6 +4967,7 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, virDomainDefPtr def; virDomainDefPtr persistentDef; bool hotpluggable =3D !!(flags & VIR_DOMAIN_VCPU_HOTPLUGGABLE); + bool useAgent =3D !!(flags & VIR_DOMAIN_VCPU_GUEST); int ret =3D -1; =20 virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -4963,13 +4982,14 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, if (virDomainSetVcpusFlagsEnsureACL(dom->conn, vm->def, flags) < 0) goto cleanup; =20 - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) + if ((!useAgent && qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) <= 0) || + (useAgent && qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB= _MODIFY) < 0)) goto cleanup; =20 if (virDomainObjGetDefs(vm, flags, &def, &persistentDef) < 0) goto endjob; =20 - if (flags & VIR_DOMAIN_VCPU_GUEST) + if (useAgent) ret =3D qemuDomainSetVcpusAgent(vm, nvcpus); else if (flags & VIR_DOMAIN_VCPU_MAXIMUM) ret =3D qemuDomainSetVcpusMax(driver, def, persistentDef, nvcpus); @@ -4978,7 +4998,10 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, nvcpus, hotpluggable); =20 endjob: - qemuDomainObjEndJob(driver, vm); + if (useAgent) + qemuDomainObjEndAgentJob(vm); + else + qemuDomainObjEndJob(driver, vm); =20 cleanup: virDomainObjEndAPI(&vm); @@ -5429,7 +5452,7 @@ qemuDomainGetVcpusFlags(virDomainPtr dom, unsigned in= t flags) goto cleanup; =20 if (flags & VIR_DOMAIN_VCPU_GUEST) { - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0) + if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_QUERY) <= 0) goto cleanup; =20 if (!virDomainObjIsActive(vm)) { @@ -5447,7 +5470,7 @@ qemuDomainGetVcpusFlags(virDomainPtr dom, unsigned in= t flags) qemuDomainObjExitAgent(vm, agent); =20 endjob: - qemuDomainObjEndJob(driver, vm); + qemuDomainObjEndAgentJob(vm); =20 if (ncpuinfo < 0) goto cleanup; @@ -18954,7 +18977,7 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom, if (virDomainPMSuspendForDurationEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) + if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_MODIFY) < 0) goto cleanup; =20 if (virDomainObjCheckActive(vm) < 0) @@ -18985,7 +19008,7 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom, qemuDomainObjExitAgent(vm, agent); =20 endjob: - qemuDomainObjEndJob(driver, vm); + qemuDomainObjEndAgentJob(vm); =20 cleanup: virDomainObjEndAPI(&vm); @@ -19070,7 +19093,7 @@ qemuDomainQemuAgentCommand(virDomainPtr domain, if (virDomainQemuAgentCommandEnsureACL(domain->conn, vm->def) < 0) goto cleanup; =20 - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) + if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_MODIFY) < 0) goto cleanup; =20 if (virDomainObjCheckActive(vm) < 0) @@ -19088,7 +19111,7 @@ qemuDomainQemuAgentCommand(virDomainPtr domain, VIR_FREE(result); =20 endjob: - qemuDomainObjEndJob(driver, vm); + qemuDomainObjEndAgentJob(vm); =20 cleanup: virDomainObjEndAPI(&vm); @@ -19170,7 +19193,7 @@ qemuDomainFSTrim(virDomainPtr dom, if (virDomainFSTrimEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) + if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_MODIFY) < 0) goto cleanup; =20 if (!qemuDomainAgentAvailable(vm, true)) @@ -19184,7 +19207,7 @@ qemuDomainFSTrim(virDomainPtr dom, qemuDomainObjExitAgent(vm, agent); =20 endjob: - qemuDomainObjEndJob(driver, vm); + qemuDomainObjEndAgentJob(vm); =20 cleanup: virDomainObjEndAPI(&vm); @@ -19352,7 +19375,7 @@ qemuDomainGetTime(virDomainPtr dom, if (virDomainGetTimeEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0) + if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_QUERY) < 0) goto cleanup; =20 if (virDomainObjCheckActive(vm) < 0) @@ -19371,7 +19394,7 @@ qemuDomainGetTime(virDomainPtr dom, ret =3D 0; =20 endjob: - qemuDomainObjEndJob(driver, vm); + qemuDomainObjEndAgentJob(vm); =20 cleanup: virDomainObjEndAPI(&vm); @@ -19402,7 +19425,9 @@ qemuDomainSetTime(virDomainPtr dom, =20 priv =3D vm->privateData; =20 - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) + if (qemuDomainObjBeginJobWithAgent(driver, vm, + QEMU_JOB_MODIFY, + QEMU_AGENT_JOB_MODIFY) < 0) goto cleanup; =20 if (virDomainObjCheckActive(vm) < 0) @@ -19447,7 +19472,7 @@ qemuDomainSetTime(virDomainPtr dom, ret =3D 0; =20 endjob: - qemuDomainObjEndJob(driver, vm); + qemuDomainObjEndJobWithAgent(driver, vm); =20 cleanup: virDomainObjEndAPI(&vm); @@ -19473,7 +19498,7 @@ qemuDomainFSFreeze(virDomainPtr dom, if (virDomainFSFreezeEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) + if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_MODIFY) < 0) goto cleanup; =20 if (virDomainObjCheckActive(vm) < 0) @@ -19482,7 +19507,7 @@ qemuDomainFSFreeze(virDomainPtr dom, ret =3D qemuDomainSnapshotFSFreeze(driver, vm, mountpoints, nmountpoin= ts); =20 endjob: - qemuDomainObjEndJob(driver, vm); + qemuDomainObjEndAgentJob(vm); =20 cleanup: virDomainObjEndAPI(&vm); @@ -19514,7 +19539,7 @@ qemuDomainFSThaw(virDomainPtr dom, if (virDomainFSThawEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) + if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_MODIFY) < 0) goto cleanup; =20 if (virDomainObjCheckActive(vm) < 0) @@ -19523,7 +19548,7 @@ qemuDomainFSThaw(virDomainPtr dom, ret =3D qemuDomainSnapshotFSThaw(driver, vm, true); =20 endjob: - qemuDomainObjEndJob(driver, vm); + qemuDomainObjEndAgentJob(vm); =20 cleanup: virDomainObjEndAPI(&vm); @@ -20547,7 +20572,7 @@ qemuDomainGetFSInfo(virDomainPtr dom, if (virDomainGetFSInfoEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0) + if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_QUERY) < 0) goto cleanup; =20 if (virDomainObjCheckActive(vm) < 0) @@ -20567,7 +20592,7 @@ qemuDomainGetFSInfo(virDomainPtr dom, qemuDomainObjExitAgent(vm, agent); =20 endjob: - qemuDomainObjEndJob(driver, vm); + qemuDomainObjEndAgentJob(vm); =20 cleanup: virDomainObjEndAPI(&vm); @@ -20604,7 +20629,7 @@ qemuDomainInterfaceAddresses(virDomainPtr dom, break; =20 case VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT: - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0) + if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_QUERY) <= 0) goto cleanup; =20 if (!qemuDomainAgentAvailable(vm, true)) @@ -20615,7 +20640,7 @@ qemuDomainInterfaceAddresses(virDomainPtr dom, qemuDomainObjExitAgent(vm, agent); =20 endjob: - qemuDomainObjEndJob(driver, vm); + qemuDomainObjEndAgentJob(vm); =20 break; =20 @@ -20816,7 +20841,7 @@ qemuDomainSetUserPassword(virDomainPtr dom, if (virDomainSetUserPasswordEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) + if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_MODIFY) < 0) goto cleanup; =20 if (virDomainObjCheckActive(vm) < 0) @@ -20836,7 +20861,7 @@ qemuDomainSetUserPassword(virDomainPtr dom, ret =3D 0; =20 endjob: - qemuDomainObjEndJob(driver, vm); + qemuDomainObjEndAgentJob(vm); =20 cleanup: virDomainObjEndAPI(&vm); @@ -21077,7 +21102,7 @@ qemuDomainGetGuestVcpus(virDomainPtr dom, if (virDomainGetGuestVcpusEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) + if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_QUERY) < 0) goto cleanup; =20 if (!qemuDomainAgentAvailable(vm, true)) @@ -21096,7 +21121,7 @@ qemuDomainGetGuestVcpus(virDomainPtr dom, ret =3D 0; =20 endjob: - qemuDomainObjEndJob(driver, vm); + qemuDomainObjEndAgentJob(vm); =20 cleanup: VIR_FREE(info); @@ -21136,7 +21161,7 @@ qemuDomainSetGuestVcpus(virDomainPtr dom, if (virDomainSetGuestVcpusEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) + if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_MODIFY) < 0) goto cleanup; =20 if (!qemuDomainAgentAvailable(vm, true)) @@ -21182,7 +21207,7 @@ qemuDomainSetGuestVcpus(virDomainPtr dom, qemuDomainObjExitAgent(vm, agent); =20 endjob: - qemuDomainObjEndJob(driver, vm); + qemuDomainObjEndAgentJob(vm); =20 cleanup: VIR_FREE(info); --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list