From nobody Sun Feb 8 12:14:21 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=1652196605; cv=none; d=zohomail.com; s=zohoarc; b=kPakpj1QrE7E8ztt4385iOmRq0AjEaTaQW1/Cs5vWPDayRuwWAS9oRj3gLDTvUTs2SgktZSdN5c9RCgiIM9aU4oU68gzFAoWuIxdMWuC+pifroSklwgOvvrTuXlkJ/Fl/PRCQuBIYoHKBNfzqd8BDxNrAyzKKEf3Up25e2uLDq4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652196605; 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=WbqxdlzbWIh2FUV0V1M4ni2BT/3Hvd/qw2IofLalAN0=; b=EadysWT3Bqr47BltQTrysHdSuxChGnYA5OFrLvOyNuGRamdCPlrgv2ZuJ2+VO3zwr6oPhnI9xnyZjkb7DGTq8qSwupU8wepBXF646EUyx/23SpsHuuOudI0Ikxvq3EJB9rMgt27u1vg5vTaXTD7m623/oZYWXn94QOvB9e3j/VM= 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 1652196605585602.5757365229304; Tue, 10 May 2022 08:30:05 -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-213-hoGH0DpwNiCotmTgaTF3zA-1; Tue, 10 May 2022 11:29:06 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A6F733C92FD6; Tue, 10 May 2022 15:29:01 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 915BBC27E80; Tue, 10 May 2022 15:29:01 +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 3CED61947064; Tue, 10 May 2022 15:29:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5816C1947059 for ; Tue, 10 May 2022 15:28:01 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4C58640C1421; Tue, 10 May 2022 15:28:01 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.187]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2C006403D165 for ; Tue, 10 May 2022 15:28:01 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id D5C4624463D; Tue, 10 May 2022 17:21:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652196604; 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=WbqxdlzbWIh2FUV0V1M4ni2BT/3Hvd/qw2IofLalAN0=; b=fyDeYzBFRNbhIOqs7f+qSfEK+mTn+FPP+GpiilMIuXlrVJRsiyjsP6RKlYVbNC3D6cpC40 1rjW2S7m6t6j7+G+VhiRGbkCalkfEsCvvHeWwqCZ1MgJ0OaN8lHP/KN7aNYa+6WUM2PX2X X+7XntoXXKPSSV89n9A6u4tFtszs9hI= X-MC-Unique: hoGH0DpwNiCotmTgaTF3zA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 77/80] Add VIR_DOMAIN_ABORT_JOB_POSTCOPY flag for virDomainAbortJobFlags Date: Tue, 10 May 2022 17:21:38 +0200 Message-Id: <134af0d3cd5b85a93c1bf33603596cbbf6e6cf3d.1652196064.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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.85 on 10.11.54.8 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: 1652196607031100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: Peter Krempa --- 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 af4406cb61..bcd377b74f 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.4.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.4.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 1e1b378361..5f0f60781a 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -9462,12 +9462,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. * @@ -9807,7 +9807,9 @@ virDomainMigrateGetMaxSpeed(virDomainPtr domain, * running, individual tasks in the guest may be blocked waiting for a pag= e that * has not been migrated yet. 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