From nobody Sun Feb 8 18:09:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1659530707; cv=none; d=zohomail.com; s=zohoarc; b=h046Y5x4XAwJyCgY65/kQn6jvu0iZQSJfOPiWiJaT/tqfZUs++0s5FIqVD99bBet8skIjDOwlbK2mb9ctmiRf/3SGPbZU/tpDe22OjjLj2qC2nT0lpTYfVPmbj1CeN82Ye5ydZGs4R3c9DSMTzs3W1vCPKejC5ez3cldDqsFlsg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659530707; 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; bh=ErA71Z7tQWMOo1MY2hzOicHwZkLkPDzIpWXzmPTS1DY=; b=CUPoeTaNi2fW0XFHfchpzR359QQqOxQqDu72K/SvEHeIDSmkGVgI/nzrfpt8d+3MusvZtLxD9yrYvquWGMd4aZP+zDcvOOLKqAkAoQc/Uy+RnssoHoKc+jqRB7WNvAmehZeuHOd1LB/mqpuJe1FGnkaPHKhw2/+zmZCAbTikOmQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1659530707065577.8679033231596; Wed, 3 Aug 2022 05:45:07 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-328-OegtxgNMPHaOhITIiFVKaQ-1; Wed, 03 Aug 2022 08:44:58 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A8B4D2804001; Wed, 3 Aug 2022 12:44:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 962B590A04; Wed, 3 Aug 2022 12:44:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 405B01946A78; Wed, 3 Aug 2022 12:44:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 088AF1946A5C for ; Wed, 3 Aug 2022 12:44:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id DFC1BC27DB3; Wed, 3 Aug 2022 12:44:48 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C001C23DBF for ; Wed, 3 Aug 2022 12:44:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659530706; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ErA71Z7tQWMOo1MY2hzOicHwZkLkPDzIpWXzmPTS1DY=; b=M3dh5rQTkQ9te/pALGibx3ADlVX/bNPLVFO09xSB5INjN6sDTUaWG05MmPA1lxmFMMzkXP 956NG4MDtZYktIJq124KOuMfWLq/kXww/EI1QjmQTUXN5QS4zxWXHGq44fv66v6F6LopYd Mt1dcbh5ix+x+6Ck0xQmymNZ54fsRUM= X-MC-Unique: OegtxgNMPHaOhITIiFVKaQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 11/11] qemu: move virDomainObjCanSetJob() into hypervisor Date: Wed, 3 Aug 2022 14:43:22 +0200 Message-Id: <43c10ee6e746d676de7daefe63580bdaa7bf66a0.1659530249.git.khanicov@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1659530708262100002 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Kristina Hanicova --- src/hypervisor/domain_job.c | 11 +++++++++++ src/hypervisor/domain_job.h | 4 ++++ src/libvirt_private.syms | 1 + src/qemu/qemu_domainjob.c | 13 +------------ 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/hypervisor/domain_job.c b/src/hypervisor/domain_job.c index 6a7116fb2a..0afed46418 100644 --- a/src/hypervisor/domain_job.c +++ b/src/hypervisor/domain_job.c @@ -234,3 +234,14 @@ virDomainNestedJobAllowed(virDomainJobObj *jobs, virDo= mainJob newJob) newJob =3D=3D VIR_JOB_NONE || (jobs->mask & JOB_MASK(newJob)); } + +bool +virDomainObjCanSetJob(virDomainJobObj *job, + virDomainJob newJob, + virDomainAgentJob newAgentJob) +{ + return ((newJob =3D=3D VIR_JOB_NONE || + job->active =3D=3D VIR_JOB_NONE) && + (newAgentJob =3D=3D VIR_AGENT_JOB_NONE || + job->agentActive =3D=3D VIR_AGENT_JOB_NONE)); +} diff --git a/src/hypervisor/domain_job.h b/src/hypervisor/domain_job.h index 618fba45bd..30893dabc3 100644 --- a/src/hypervisor/domain_job.h +++ b/src/hypervisor/domain_job.h @@ -224,3 +224,7 @@ G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virDomainJobObj, virDo= mainObjClearJob); bool virDomainTrackJob(virDomainJob job); =20 bool virDomainNestedJobAllowed(virDomainJobObj *jobs, virDomainJob newJob); + +bool virDomainObjCanSetJob(virDomainJobObj *job, + virDomainJob newJob, + virDomainAgentJob newAgentJob); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 16117970f2..9f6389ae63 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1591,6 +1591,7 @@ virDomainJobStatusToType; virDomainJobTypeFromString; virDomainJobTypeToString; virDomainNestedJobAllowed; +virDomainObjCanSetJob; virDomainObjClearJob; virDomainObjInitJob; virDomainObjPreserveJob; diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c index 46fb2d704b..d682f7be38 100644 --- a/src/qemu/qemu_domainjob.c +++ b/src/qemu/qemu_domainjob.c @@ -697,17 +697,6 @@ qemuDomainObjReleaseAsyncJob(virDomainObj *obj) priv->job.asyncOwner =3D 0; } =20 -static bool -qemuDomainObjCanSetJob(virDomainJobObj *job, - virDomainJob newJob, - virDomainAgentJob newAgentJob) -{ - return ((newJob =3D=3D VIR_JOB_NONE || - job->active =3D=3D VIR_JOB_NONE) && - (newAgentJob =3D=3D VIR_AGENT_JOB_NONE || - job->agentActive =3D=3D VIR_AGENT_JOB_NONE)); -} - /* Give up waiting for mutex after 30 seconds */ #define QEMU_JOB_WAIT_TIME (1000ull * 30) =20 @@ -788,7 +777,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriver *driver, goto error; } =20 - while (!qemuDomainObjCanSetJob(&priv->job, job, agentJob)) { + while (!virDomainObjCanSetJob(&priv->job, job, agentJob)) { if (nowait) goto cleanup; =20 --=20 2.37.1