From nobody Sun Feb 8 06:00:17 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=1654088058; cv=none; d=zohomail.com; s=zohoarc; b=kstpjsUyog93nVOzeLtoVAXSKzCMoxZCqnDuxxHj6I5bxNOdOZXf30ubCNOkcuOlxckyGevWK7BCdnRWMeI51LnHtDapUhRsfmYq/W8QUs6nRKo/ucmB7qdte/kfC+oG7bUur7RZF63GELtK7LdPzsD5c+VeK1picBCw17W8Cy0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654088058; 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=az2a1Kk2C1dToQBElOes7CjycEHtDHQTF9qqKNCYd3A=; b=J6EmMdDj++q9qf6SRhdQ5uQq/opvXLtV1uY55J42+sPvCP0Q3E7BK46S8RNSLR9NY2aGdW7iRikshAEgh2MGu76MgZ5VzLwik8jvdoOfU6+Ikd+pv6BHlEUqlEHllWCg6KzUYZwC+20o7gt1SDStUsj0XZuWvO/TGmPYmvMAG58= 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 165408805887986.28750494273402; Wed, 1 Jun 2022 05:54:18 -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-615-PTeS-JFiPtGAyxVTsa0bUA-1; Wed, 01 Jun 2022 08:51:44 -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 97EE7933C06; Wed, 1 Jun 2022 12:50:54 +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 80CAA1731B; 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 C49021932219; Wed, 1 Jun 2022 12:50:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7F49E1947B91 for ; Wed, 1 Jun 2022 12:50:32 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6258241637E; 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 3FD8840314B; Wed, 1 Jun 2022 12:50:32 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id C4317245B98; 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=1654088057; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=az2a1Kk2C1dToQBElOes7CjycEHtDHQTF9qqKNCYd3A=; b=W1HPrZ1GwBzks1Y2MmfpSYYsMvMsuhUACc3jeFgUzpKna38vMcfZ4vbOWiEXbBKlI+YGEB M5WT9Lq/7B/zyc9l0nz9EFTr8ZhWj14drPu1stD9T17bAUnRWqfSIUxIXB8BXz9f1Er9h8 6Z/XpP7lPLOiTJcV3YgacwNBkBEuta4= X-MC-Unique: PTeS-JFiPtGAyxVTsa0bUA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH v2 75/81] Add VIR_DOMAIN_ABORT_JOB_POSTCOPY flag for virDomainAbortJobFlags Date: Wed, 1 Jun 2022 14:50:15 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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: , Cc: Peter Krempa , Pavel Hrdina 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: 1654088060781100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: Peter Krempa Reviewed-by: Pavel Hrdina --- Notes: Version 2: - no change include/libvirt/libvirt-domain.h | 16 ++++++++++++++++ src/libvirt-domain.c | 10 ++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index 0b321f364a..2aec69bc54 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -4099,6 +4099,22 @@ int virDomainGetJobStats(virDomainPtr domain, unsigned int flags); int virDomainAbortJob(virDomainPtr dom); =20 +/** + * virDomainAbortJobFlagsValues: + * + * Flags OR'ed together to provide specific behavior when aborting a domai= n job. + * + * Since: 8.5.0 + */ +typedef enum { + /* Interrupt post-copy migration. Since migration in a post-copy phase + * cannot be aborted without losing the domain (none of the hosts invo= lved + * in migration has a complete state of the domain), the migration wil= l be + * suspended and it can later be resumed using virDomainMigrate* APIs = with + * VIR_MIGRATE_POSTCOPY_RESUME flag. (Since: 8.5.0) */ + VIR_DOMAIN_ABORT_JOB_POSTCOPY =3D 1 << 0, +} virDomainAbortJobFlagsValues; + int virDomainAbortJobFlags(virDomainPtr dom, unsigned int flags); =20 diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 1b367ca9ba..4a4f6424d7 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -9473,12 +9473,12 @@ virDomainAbortJob(virDomainPtr domain) /** * virDomainAbortJobFlags: * @domain: a domain object - * @flags: extra flags; not used yet, callers should always pass 0 + * @flags: bitwise-OR of virDomainAbortJobFlagsValues * * Requests that the current background job be aborted at the * soonest opportunity. In case the job is a migration in a post-copy mode, - * this function will report an error (see virDomainMigrateStartPostCopy f= or - * more details). + * this function will report an error unless VIR_DOMAIN_ABORT_JOB_POSTCOPY + * flag is used (see virDomainMigrateStartPostCopy for more details). * * Returns 0 in case of success and -1 in case of failure. * @@ -9820,7 +9820,9 @@ virDomainMigrateGetMaxSpeed(virDomainPtr domain, * VIR_DOMAIN_PAUSED_POSTCOPY_FAILED if even the connection between QEMU * processes gets broken. It's up to the upper layer to decide what to do = in * such case. Because of this, libvirt will refuse to cancel post-copy - * migration via virDomainAbortJob. + * migration via virDomainAbortJobFlags unless it is called with + * VIR_DOMAIN_ABORT_JOB_POSTCOPY, in which case the post-copy migration wi= ll be + * paused. * * Failed post-copy migration can be recovered once the cause for the fail= ure * (e.g., a network issue) is resolved by repeating the migration with an --=20 2.35.1