From nobody Sun Feb 8 21:37:13 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1659530696; cv=none; d=zohomail.com; s=zohoarc; b=ZUf5kgnrT7XLoQaoo/drAndYg6ObIE+DTkabfYTRyEkuePQtm0CKqaBoQ9qdFUIMp6bqerPyUJOjzMEcJmgIJpUT5uMQMsXR707iO7RjLM4ZOPfilfyx+cXLUwdZFSmgyOQFiU6wrEpx1JBhTj4FeHQM7+ZiY1JSdOTQe/aDwKY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659530696; 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=Trqj5pB0Wu08RtfA3ekwLkkN9x1MFlkjnKXkm0SfvcA=; b=XkJKX00ma+2lvoS33zHgF9ZUaFpLN3OaA94Uv5XzrFqyXZJj76bM114JggAWn7O4qIobhWO+O8Jr75Qzrlm5ty+H8f3Sg/1WQI1UzgSUbl4/2L/uG7ks7j+dKktEkEXo0xGMMHhg4T1k9ZpVOAHcF0jQpdV2TB/b0gMiIzrb5ig= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1659530696274944.6193023423954; Wed, 3 Aug 2022 05:44:56 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-249-pkzKx3M3Pry1YYPec_tmUA-1; Wed, 03 Aug 2022 08:44:48 -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 EEE728039B7; Wed, 3 Aug 2022 12:44:45 +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 D2F63945D7; Wed, 3 Aug 2022 12:44:45 +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 A61AE1946A65; Wed, 3 Aug 2022 12:44:45 +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 6CB2B1946A70 for ; Wed, 3 Aug 2022 12:44:44 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5CD4AC28136; Wed, 3 Aug 2022 12:44:44 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0822FC23DBF for ; Wed, 3 Aug 2022 12:44:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659530695; 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=Trqj5pB0Wu08RtfA3ekwLkkN9x1MFlkjnKXkm0SfvcA=; b=Hrgfjs7OMoNyYUOlPmWt5cxcXxTQu/C9L3qz8TiRciuyDqm1zvnpCQxOqyiw4XQKylpXkd yV1PH+b4s3a26RwYuxWn7dd46+wb8s44ZZ7VRq2WVMTV1ofwQskCKkH5EW/Ns+S3TlDAzs W5EkUx+xpxPqMUG/7aK1SnvlAdaQjT0= X-MC-Unique: pkzKx3M3Pry1YYPec_tmUA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 03/11] qemu: propagate virDomainJobObj into qemuDomainObjPreserveJob() Date: Wed, 3 Aug 2022 14:43:14 +0200 Message-Id: <738733992606e707e03aa2c8e5fc46cf2203d9d9.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: 1659530698021100001 Content-Type: text/plain; charset="utf-8"; x-default="true" It does not make sense to propagate virDomainObj and get qemuDomainObjPrivate from it, when it is already accessible in the only function qemuDomainObjPreserveJob() is called from. That being said, we can also propagate virDomainJobObj directly and avoid using qemu private structure. Signed-off-by: Kristina Hanicova --- src/qemu/qemu_domainjob.c | 31 ++++++++++++++----------------- src/qemu/qemu_domainjob.h | 2 +- src/qemu/qemu_process.c | 2 +- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c index 132f2a0025..260717aa88 100644 --- a/src/qemu/qemu_domainjob.c +++ b/src/qemu/qemu_domainjob.c @@ -160,28 +160,25 @@ qemuDomainEventEmitJobCompleted(virQEMUDriver *driver, * Returns 0 on success, -1 on failure. */ int -qemuDomainObjPreserveJob(virDomainObj *obj, +qemuDomainObjPreserveJob(virDomainJobObj *currJob, virDomainJobObj *job) { - qemuDomainObjPrivate *priv =3D obj->privateData; - memset(job, 0, sizeof(*job)); - job->active =3D priv->job.active; - job->owner =3D priv->job.owner; - job->asyncJob =3D priv->job.asyncJob; - job->asyncOwner =3D priv->job.asyncOwner; - job->asyncStarted =3D priv->job.asyncStarted; - job->phase =3D priv->job.phase; - job->privateData =3D g_steal_pointer(&priv->job.privateData); - job->apiFlags =3D priv->job.apiFlags; - - if (priv->job.cb && - !(priv->job.privateData =3D priv->job.cb->allocJobPrivate())) + job->active =3D currJob->active; + job->owner =3D currJob->owner; + job->asyncJob =3D currJob->asyncJob; + job->asyncOwner =3D currJob->asyncOwner; + job->phase =3D currJob->phase; + job->privateData =3D g_steal_pointer(&currJob->privateData); + job->apiFlags =3D currJob->apiFlags; + + if (currJob->cb && + !(currJob->privateData =3D currJob->cb->allocJobPrivate())) return -1; - job->cb =3D priv->job.cb; + job->cb =3D currJob->cb; =20 - virDomainObjResetJob(&priv->job); - virDomainObjResetAsyncJob(&priv->job); + virDomainObjResetJob(currJob); + virDomainObjResetAsyncJob(currJob); return 0; } =20 diff --git a/src/qemu/qemu_domainjob.h b/src/qemu/qemu_domainjob.h index 36747154c6..a0cd79c705 100644 --- a/src/qemu/qemu_domainjob.h +++ b/src/qemu/qemu_domainjob.h @@ -105,7 +105,7 @@ qemuDomainObjStartJobPhase(virDomainObj *obj, int phase); void qemuDomainObjSetAsyncJobMask(virDomainObj *obj, unsigned long long allowedJobs); -int qemuDomainObjPreserveJob(virDomainObj *obj, +int qemuDomainObjPreserveJob(virDomainJobObj *currJob, virDomainJobObj *job); void qemuDomainObjRestoreAsyncJob(virDomainObj *vm, diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index d29da63242..fc42434a0d 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8874,7 +8874,7 @@ qemuProcessReconnect(void *opaque) cfg =3D virQEMUDriverGetConfig(driver); priv =3D obj->privateData; =20 - qemuDomainObjPreserveJob(obj, &oldjob); + qemuDomainObjPreserveJob(&priv->job, &oldjob); if (oldjob.asyncJob =3D=3D VIR_ASYNC_JOB_MIGRATION_IN) stopFlags |=3D VIR_QEMU_PROCESS_STOP_MIGRATED; if (oldjob.asyncJob =3D=3D VIR_ASYNC_JOB_BACKUP && priv->backup) --=20 2.37.1