From nobody Sun Feb 8 14:07:19 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=1654087994; cv=none; d=zohomail.com; s=zohoarc; b=G9gF6IyuihTKKnpXAMZSQl6msgIRVmADnZwMTr4fP77GGWMgVYP0SD7iYv0NjIYu0zuGr7HR7Wi7Sr6she5MzFSkCmrKNerdS9dtwwqg6TAG/JrVTorxPSzOVCMg1tHHhET04s7CcsHsoQC+Pu+6kFOqmffYlGMNLvXbuqr6cMI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654087994; 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=vfr9U5otNR9N7TrcTy6uFqs0XQShzAu7vxr291mtMWw=; b=KU4QddKsX9+iVX+Q/OOpkQKmDKRrTKs2lnQpc+qbLP0UHH7MvYmbf442OqY79VRvuALqoqEFCtxws10vgFkF7OkcepQLmaf9IM/fVdEW52A7FkAgSMd8JEfeXtyhubxyJs4iRmFdL+H+qbQPrvUgITHI3zCAj/HMWC02HS3YHUk= 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 1654087994689913.8936204152253; Wed, 1 Jun 2022 05:53:14 -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-549-dcT5qXBsOtup3J53QhbLbg-1; Wed, 01 Jun 2022 08:51:40 -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 085BD39F9CD4; Wed, 1 Jun 2022 12:50:55 +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 E538782882; Wed, 1 Jun 2022 12:50:54 +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 811CF194F4BE; Wed, 1 Jun 2022 12:50:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 93E151947B97 for ; Wed, 1 Jun 2022 12:50:32 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 63F0C2026D2D; Wed, 1 Jun 2022 12:50:32 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.227]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 41D342026985 for ; Wed, 1 Jun 2022 12:50:32 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id C96F5245BA9; Wed, 1 Jun 2022 14:50:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654087993; 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=vfr9U5otNR9N7TrcTy6uFqs0XQShzAu7vxr291mtMWw=; b=fM310WP9vsj88ZG5rsr7GAGGjudXyq6/RLXg956AOFoddxvpCmno7wHOuhuO2TcyBzA8Ny Nnp+moWZRR/22qu7/5XnCVTQGvnh2lZwfslQO9fpeE/TYdJV9on7SnT+RyDTQ0Y1oZYGgm C1nJrIMMflJYDwDDc0D0VM7ttB+opik= X-MC-Unique: dcT5qXBsOtup3J53QhbLbg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH v2 79/81] Introduce VIR_JOB_MIGRATION_SAFE job type Date: Wed, 1 Jun 2022 14:50:19 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1654087996417100002 Content-Type: text/plain; charset="utf-8" This is a special job for operations that need to modify domain state during an active migration. The modification must not affect any state that could conflict with the migration code. This is useful mainly for event handlers that need to be processed during migration and which could otherwise time out on acquiring a normal MODIFY job. Signed-off-by: Jiri Denemark Reviewed-by: Peter Krempa --- Notes: Version 2: - new patch src/hypervisor/domain_job.c | 1 + src/hypervisor/domain_job.h | 4 ++++ src/qemu/qemu_migration.c | 1 + src/qemu/qemu_process.c | 7 +++++++ 4 files changed, 13 insertions(+) diff --git a/src/hypervisor/domain_job.c b/src/hypervisor/domain_job.c index 49867c3982..191dc1c700 100644 --- a/src/hypervisor/domain_job.c +++ b/src/hypervisor/domain_job.c @@ -18,6 +18,7 @@ VIR_ENUM_IMPL(virDomainJob, "modify", "abort", "migration operation", + "migration safe", "none", /* async job is never stored in job.active */ "async nested", ); diff --git a/src/hypervisor/domain_job.h b/src/hypervisor/domain_job.h index fce35ffbf5..24bb93c59f 100644 --- a/src/hypervisor/domain_job.h +++ b/src/hypervisor/domain_job.h @@ -31,6 +31,10 @@ typedef enum { VIR_JOB_MODIFY, /* May change state */ VIR_JOB_ABORT, /* Abort current async job */ VIR_JOB_MIGRATION_OP, /* Operation influencing outgoing migration */ + VIR_JOB_MIGRATION_SAFE, /* Internal only job for event handlers which = need + to be processed even during migration. The = code + may only change state in a way that does not + affect migration. */ =20 /* The following two items must always be the last items before JOB_LA= ST */ VIR_JOB_ASYNC, /* Asynchronous job */ diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 4bf942e6ab..0314fb1148 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -127,6 +127,7 @@ qemuMigrationJobStart(virQEMUDriver *driver, JOB_MASK(VIR_JOB_SUSPEND) | JOB_MASK(VIR_JOB_MIGRATION_OP); } + mask |=3D JOB_MASK(VIR_JOB_MIGRATION_SAFE); =20 if (qemuDomainObjBeginAsyncJob(driver, vm, job, op, apiFlags) < 0) return -1; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 8a98c03395..ad529dabb4 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3472,6 +3472,7 @@ qemuProcessRestoreMigrationJob(virDomainObj *vm, op =3D VIR_DOMAIN_JOB_OPERATION_MIGRATION_OUT; allowedJobs =3D VIR_JOB_DEFAULT_MASK | JOB_MASK(VIR_JOB_MIGRATION_= OP); } + allowedJobs |=3D JOB_MASK(VIR_JOB_MIGRATION_SAFE); =20 qemuDomainObjRestoreAsyncJob(vm, job->asyncJob, job->phase, job->asyncStarted, op, @@ -3834,6 +3835,12 @@ qemuProcessRecoverJob(virQEMUDriver *driver, */ break; =20 + case VIR_JOB_MIGRATION_SAFE: + /* event handlers, the reconnection code already handles them as we + * might as well just missed the event while we were not running + */ + break; + case VIR_JOB_MIGRATION_OP: case VIR_JOB_ABORT: case VIR_JOB_ASYNC: --=20 2.35.1