From nobody Mon Feb 9 12:11:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1575546917; cv=none; d=zohomail.com; s=zohoarc; b=IPHvhfMkEAWpoCTtsCey5JjSxwYmImX9jnsP95uYPKSn3vTNcUAlfCjbgjO21JG3VD1acaoF4umujwA2V/egmLcw3TBPBIn/UibsuYw6dAby63Tme/x4NFFED5Px7D7yRNXOXemsQgkVdX2wToFb8SVuEugq4bPI7EzfwBl7gRY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575546917; 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=4QvbHSYnhCjNJ/MaAX5F9mKWkVoxrLuIzRU0j7lFvZU=; b=BBg6+JGeRECfdK1khaH/8mYAtgxxi6P7eCEit2AomeO+7R7dA4MLaZT0s7aYvsZuorafSVmXeXKvQTwMkvqZkz5obUXPyK2H1V3yBSGBpQlgsrskjLkihxyGyG52PhH/SGimEtH5inpUletAziodCs4UJyB2E72/CZipCOZWhII= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 157554691717077.88287908437792; Thu, 5 Dec 2019 03:55:17 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-259-XhhEK5X4P9CTlbONkup_yQ-1; Thu, 05 Dec 2019 06:55:13 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 253A7800D54; Thu, 5 Dec 2019 11:55:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EAFCD5D6A5; Thu, 5 Dec 2019 11:55:07 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 85A7518089CD; Thu, 5 Dec 2019 11:55:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xB5Bskfq009480 for ; Thu, 5 Dec 2019 06:54:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id D5EDC60126; Thu, 5 Dec 2019 11:54:46 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5EE4B600F0 for ; Thu, 5 Dec 2019 11:54:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575546916; 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=4QvbHSYnhCjNJ/MaAX5F9mKWkVoxrLuIzRU0j7lFvZU=; b=Yu91JJhJojC/OjtfH0oes69gJ48cKJ3x100dOYBeILbOb0ZmpD2uM4QUjB+BCLQvRB+WA7 qG5It8q4Pv/LL5u3CgzeuVcxC8H2fNkL0VzXM+4MH6cpxGIeD+4bJ8HPPgbAa3h1/dOf8X ZVPcpyUcqd8z+lOI/w0EiGIiETCVpN8= From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 5 Dec 2019 12:54:38 +0100 Message-Id: <9acd0054eda3153262e94d4310d406f163e26dc7.1575546793.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] qemu: driver: Split out cancellation of migration from qemuDomainAbortJob X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: XhhEK5X4P9CTlbONkup_yQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Following patch will refactor qemuDomainAbortJob to use a per-job-type switch where we will need to abort a migration job in various branches. Save some code duplication by introducing a helper. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1911073f3e..4cfc1ca9e7 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13996,6 +13996,24 @@ qemuDomainGetJobStats(virDomainPtr dom, } +static int +qemuDomainAbortJobMigration(virDomainObjPtr vm) +{ + qemuDomainObjPrivatePtr priv =3D vm->privateData; + int ret; + + VIR_DEBUG("Cancelling migration job at client request"); + + qemuDomainObjAbortAsyncJob(vm); + qemuDomainObjEnterMonitor(priv->driver, vm); + ret =3D qemuMonitorMigrateCancel(priv->mon); + if (qemuDomainObjExitMonitor(priv->driver, vm) < 0) + ret =3D -1; + + return ret; +} + + static int qemuDomainAbortJob(virDomainPtr dom) { virQEMUDriverPtr driver =3D dom->conn->privateData; @@ -14047,12 +14065,7 @@ static int qemuDomainAbortJob(virDomainPtr dom) goto endjob; } - VIR_DEBUG("Cancelling job at client request"); - qemuDomainObjAbortAsyncJob(vm); - qemuDomainObjEnterMonitor(driver, vm); - ret =3D qemuMonitorMigrateCancel(priv->mon); - if (qemuDomainObjExitMonitor(driver, vm) < 0) - ret =3D -1; + ret =3D qemuDomainAbortJobMigration(vm); endjob: qemuDomainObjEndJob(driver, vm); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list