From nobody Sun Feb 8 18:10:51 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=1654088045; cv=none; d=zohomail.com; s=zohoarc; b=eDbb+dYBx+yQ+GDJLWJHdud9QOKyJ/96u0EBisgUf2dS6A772PEDl5XYaLXFbgTe2jKOA2SEE+CeAaod5juxV+VZwR6mlv9OFod5fuc1RAvPpCe2RofygRhlC40XqlfNfbnKOo4fekxKFZMRGEcIdk5Dcdg4Z3csYCkapHqwFXU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654088045; 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=HxR+TwJxe7rhku8wf29uL6AGKOX7dUeaX6M3nkfTXX0=; b=e+j1lRcNwIspyRT8BMwqXuahS+z8kbYgB73CmD3KfYKoAcQIyqRv8h0GNxbJfGzRbWuua3Babcpgv0NbatxOLo/k3zIc+vOJQzcl5X3p5wT8ER24YIP9W02zOniUAMTe6+9xEgoEOiN2nTFXa9IcA1XuFtkGJfqcDNcO6b9yNRk= 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 1654088045559515.7294808992134; Wed, 1 Jun 2022 05:54: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-463-RhRn7ahuMNaQqghQxEUptQ-1; Wed, 01 Jun 2022 08:51:35 -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 5E46C39F9CC4; Wed, 1 Jun 2022 12:50:42 +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 4A19AC27E8F; Wed, 1 Jun 2022 12:50:42 +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 0BF5B1955EDE; Wed, 1 Jun 2022 12:50:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8B4E21947B95 for ; Wed, 1 Jun 2022 12:50:32 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 63D91492CA5; 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 3F91C492CA2; Wed, 1 Jun 2022 12:50:32 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id C6CAE245BA7; 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=1654088044; 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=HxR+TwJxe7rhku8wf29uL6AGKOX7dUeaX6M3nkfTXX0=; b=JBSxP84Vs2NruKGSZt31H00nVI0p/uPecCYUBtLXq/tzD7ilWjMuNJsX3Tj/wijiY9vtFy 8zVyD42WtWIyw3/IaUJmPMFSV/RICZ7X5uMSVvwJTPFI+bBjuu9m9v9lun/GAIB7ie5eD/ 8Wa5lWq2wnNwDGUDhakbp/1nYQFdHBE= X-MC-Unique: RhRn7ahuMNaQqghQxEUptQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH v2 77/81] virsh: Add --postcopy option for domjobabort command Date: Wed, 1 Jun 2022 14:50:17 +0200 Message-Id: <675eba38f221bf943deb61dc9340e2905f91324d.1654087150.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 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.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: 1654088046708100003 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 docs/manpages/virsh.rst | 8 +++++++- tools/virsh-domain.c | 16 +++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index ecdb54fcd5..faac996536 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -2053,10 +2053,16 @@ domjobabort =20 :: =20 - domjobabort domain + domjobabort domain [--postcopy] =20 Abort the currently running domain job. =20 +When the job to be aborted is a migration which entered post-copy mode, it +cannot be aborted as none of the hosts involved in migration has a complete +state of the domain. Optional *--postcopy* can be used to interrupt such +migration although doing so may effectively suspend the domain until the +migration is resumed (see also *--postcopy-resume* option of ``migrate``). + =20 domjobinfo ---------- diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index dd7862b5e5..5c4a7d7b8d 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -6477,6 +6477,10 @@ static const vshCmdInfo info_domjobabort[] =3D { =20 static const vshCmdOptDef opts_domjobabort[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), + {.name =3D "postcopy", + .type =3D VSH_OT_BOOL, + .help =3D N_("interrupt post-copy migration") + }, {.name =3D NULL} }; =20 @@ -6484,11 +6488,21 @@ static bool cmdDomjobabort(vshControl *ctl, const vshCmd *cmd) { g_autoptr(virshDomain) dom =3D NULL; + unsigned int flags =3D 0; + int rc; =20 if (!(dom =3D virshCommandOptDomain(ctl, cmd, NULL))) return false; =20 - if (virDomainAbortJob(dom) < 0) + if (vshCommandOptBool(cmd, "postcopy")) + flags |=3D VIR_DOMAIN_ABORT_JOB_POSTCOPY; + + if (flags =3D=3D 0) + rc =3D virDomainAbortJob(dom); + else + rc =3D virDomainAbortJobFlags(dom, flags); + + if (rc < 0) return false; =20 return true; --=20 2.35.1