From nobody Sun Feb 8 19:57:10 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=1652196252; cv=none; d=zohomail.com; s=zohoarc; b=ii1ISDszVaO+4PEDsW4puw4llPVHvuRG+NOa11n9Vk105WDFiRvDv04LXW3B7+sPmbLz3STnA0VUaa29a1mSjhWzqF7+8bKGS7nKSsaoZXctvg+qf+64MV/p5VJl62jUhdT76/GLmTn6oL/4eXEISxdfMX3zzl544xzEZ1F7n94= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652196252; 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=JCB2+Kw9AS+ASZmkuZ7hakZ/Qv1aId4VlAKjJU8ef/I=; b=a0wRsLuBAa+ot2aQAs5kvD4NX9edtHf0Fryg8sQ8FCCa4Dm49lrJw2/S/UZo9euq8wvPIWqDUMc6icLe2fk3cNsaW9DcSTNb4roaomjnTVkrVip/vlVe9PzRGx8Br0sHE6GRh7wKFmifvDtlQUGpTNSNBaLrXmtEF7YSzafG7OE= 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 1652196252919551.833290311031; Tue, 10 May 2022 08:24:12 -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-166-xYRRLH_EM7ShEFazax8DCw-1; Tue, 10 May 2022 11:23:22 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D236D80660F; Tue, 10 May 2022 15:22:17 +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 BE210401E77; Tue, 10 May 2022 15:22:17 +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 AC12C194E009; Tue, 10 May 2022 15:22:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4045C194704D for ; Tue, 10 May 2022 15:22:05 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 33244FFDC; Tue, 10 May 2022 15:22:05 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.187]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 12F399E60 for ; Tue, 10 May 2022 15:21:51 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id D83EE24463F; 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=1652196251; 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=JCB2+Kw9AS+ASZmkuZ7hakZ/Qv1aId4VlAKjJU8ef/I=; b=RrFmxeou3brPDQ6J/l251akAcKsfDwCWGj9jv+yrSpxbhA+b1J4CeemvnsJFcO6Tlyg6tr kVB0hDa/7N+F3wlgX7EB/t/n7YOhGyJ2+Eh6NMXbccsTuL1QctHIbyb6HEvD5YoV/ttlRf T/C6pACHBHTP3uuE6OEqTwsO3Inkb6g= X-MC-Unique: xYRRLH_EM7ShEFazax8DCw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 79/80] virsh: Add --postcopy option for domjobabort command Date: Tue, 10 May 2022 17:21:40 +0200 Message-Id: <0dee3bfe3b15428ab9c2a5da277a3acfefaadb42.1652196064.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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.10 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: 1652196255115100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: Peter Krempa --- 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 e36d64c164..1bb9044e0a 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 b0d5b15dff..63a5ee7a34 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