From nobody Sat Feb 7 08:28:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1580733829636542.5001151922684; Mon, 3 Feb 2020 04:43:49 -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-3-s1Ui0uyDM_GCOBiLbI2fYg-1; Mon, 03 Feb 2020 07:43:45 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 626001098D17; Mon, 3 Feb 2020 12:43:40 +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 0F81A90505; Mon, 3 Feb 2020 12:43:40 +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 95CA418089CF; Mon, 3 Feb 2020 12:43:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 013ChcpM006050 for ; Mon, 3 Feb 2020 07:43:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 399C5610E1; Mon, 3 Feb 2020 12:43:38 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-57.ams2.redhat.com [10.36.112.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42D0E50227; Mon, 3 Feb 2020 12:43:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580733828; 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=d4vVjg3Uo9MXjonWZu8j6XfW1Gw6y7vC5pKe8JYrc/o=; b=TZEFtF9v1U7GY59vBPA3MkCAMAaEhD6llSB59c/UmokoLz+wx+jdrGvGP+STD+YwNZjscg nY1xWdCmiqPDkhFkcEXPXw4i+r1sHYHL/mPeHndsfTpzzTQg4x/ftx0rzBPwZvj67zT0QG aX8H1OivdZedMHZEKiEUzPdb5x6YbEg= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/6] Add VIR_MIGRATE_LOCAL flag to virsh migrate command Date: Mon, 3 Feb 2020 12:43:28 +0000 Message-Id: <20200203124333.1925908-2-berrange@redhat.com> In-Reply-To: <20200203124333.1925908-1-berrange@redhat.com> References: <20200203124333.1925908-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Shaju Abraham 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.13 X-MC-Unique: s1Ui0uyDM_GCOBiLbI2fYg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Shaju Abraham In order to support the local migration, the migration framework should distinguish between local and non local migrations. Add a flag to the 'virsh migrate' command so that framework can easily identify a local migration attempt. Signed-off-by: Shaju Abraham --- include/libvirt/libvirt-domain.h | 6 ++++++ tools/virsh-domain.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index 5846e93d98..018635b4f1 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -849,6 +849,12 @@ typedef enum { */ VIR_MIGRATE_PARALLEL =3D (1 << 17), =20 + /* Setting the VIR_MIGRATE_LOCAL flag tells libvirt that the migration + * is within the host and bypass checks which refuses local host migra= tion.It + * indicates that the same UUID and name will be used for different do= mains. + */ + VIR_MIGRATE_LOCAL =3D (1 << 18), + } virDomainMigrateFlags; =20 =20 diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index e64e08e5da..b91117a6a2 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -10421,6 +10421,10 @@ static const vshCmdOptDef opts_migrate[] =3D { .type =3D VSH_OT_BOOL, .help =3D N_("peer-2-peer migration") }, + {.name =3D "local", + .type =3D VSH_OT_BOOL, + .help =3D N_("local migration") + }, {.name =3D "direct", .type =3D VSH_OT_BOOL, .help =3D N_("direct migration") @@ -10820,6 +10824,9 @@ doMigrate(void *opaque) flags |=3D VIR_MIGRATE_LIVE; if (vshCommandOptBool(cmd, "p2p")) flags |=3D VIR_MIGRATE_PEER2PEER; + + if (vshCommandOptBool(cmd, "local")) + flags |=3D VIR_MIGRATE_LOCAL; if (vshCommandOptBool(cmd, "tunnelled")) flags |=3D VIR_MIGRATE_TUNNELLED; =20 --=20 2.24.1