From nobody Sat Feb 7 08:45:19 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=1655992718; cv=none; d=zohomail.com; s=zohoarc; b=NYDtXuceOeEBO/2BooT7ELX+fn8UQE8kfiNNxcugB/TNl5ND0tFi7kRAmFEj3qWYfnYPev0YbeMluwV4fjxml6k2+PcPRW07VUDxtl4M8ncK8W8zELrh6dJN+ton2dpcKFMUSEAEZ24v/DWijkIBe8c78PSH3TdZyPXUJ7501VI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655992718; 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=GOM7uFHTG4rJF6yyhB4+bEK8VgzTN3QOe86tnfsKsPU=; b=cFJzpyZBPfiijaP6MOb2xP5y0fYBtCIidh6vQOtG9HU6NqGgix/VGBe2//rMSGpVhTxdUqu+T3PU2zVMvm8LmjIorw8+SadmsasAcgxQ3ruZJaqHmEf4LyN9F5nibENh9Q614/RG8mhPYd9QYnRFJGne4jPso05ykEyNdUAorfI= 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 1655992718072880.9334602392948; Thu, 23 Jun 2022 06:58:38 -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-595-7X19Ti3tPB68BDVSBIuFrQ-1; Thu, 23 Jun 2022 09:58:32 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B9068181881B; Thu, 23 Jun 2022 13:58:28 +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 A50961121315; Thu, 23 Jun 2022 13:58:28 +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 8D21D1926297; Thu, 23 Jun 2022 13:58:18 +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 80162194B972 for ; Thu, 23 Jun 2022 13:58:16 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 62C3C18EAA; Thu, 23 Jun 2022 13:58:16 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.227]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 433FA18EB0 for ; Thu, 23 Jun 2022 13:58:16 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 1E712241E42; Thu, 23 Jun 2022 15:58:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655992716; 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=GOM7uFHTG4rJF6yyhB4+bEK8VgzTN3QOe86tnfsKsPU=; b=NWNRCsl/9EcQSYHCCqdjRB9Z1XwvGNVXXsc77TxHO0ppbHggFanRyH6vUhnUkt312IcHaM +LoufvdPUlTlKGcJ/buETp0/20Hqyi5CZYi07uywBNbp7i15/mOXlE53kpGv7sVpjgPQiM qCnNlXzpgyA9T51eR5y7y7I4it9Xnx0= X-MC-Unique: 7X19Ti3tPB68BDVSBIuFrQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 6/7] virsh: Add support for VIR_MIGRATE_ZEROCOPY flag Date: Thu, 23 Jun 2022 15:58:11 +0200 Message-Id: <0e1126645ebdff6a320229a8967ef643eae82b09.1655992592.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.78 on 10.11.54.3 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: 1655992718328100004 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark --- docs/manpages/virsh.rst | 7 ++++++- tools/virsh-domain.c | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 4701791b04..45469f2f35 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -3285,7 +3285,7 @@ migrate [--persistent] [--undefinesource] [--suspend] [--copy-storage-all] [--copy-storage-inc] [--change-protection] [--unsafe] [--verbose] [--rdma-pin-all] [--abort-on-error] [--postcopy] - [--postcopy-after-precopy] [--postcopy-resume] + [--postcopy-after-precopy] [--postcopy-resume] [--zerocopy] domain desturi [migrateuri] [graphicsuri] [listen-address] [dname] [--timeout seconds [--timeout-suspend | --timeout-postcopy]] [--xml file] [--migrate-disks disk-list] [--disks-port port] @@ -3362,6 +3362,11 @@ high (and thus allowing the domain to lock most of t= he host's memory). Doing so may be dangerous to both the domain and the host itself since the host's k= ernel may run out of memory. =20 +*--zerocopy* requests zero-copy mechanism to be used for migrating memory = pages. +For QEMU/KVM this means QEMU will be temporarily allowed to lock all guest +pages in host's memory, although only those that are queued for transfer w= ill +be locked at the same time. + ``Note``: Individual hypervisors usually do not support all possible types= of migration. For example, QEMU does not support direct migration. =20 diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 1d71ac5a67..43034f2f81 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -10890,6 +10890,10 @@ static const vshCmdOptDef opts_migrate[] =3D { .type =3D VSH_OT_BOOL, .help =3D N_("resume failed post-copy migration") }, + {.name =3D "zerocopy", + .type =3D VSH_OT_BOOL, + .help =3D N_("use zero-copy mechanism for migrating memory pages") + }, {.name =3D "migrateuri", .type =3D VSH_OT_STRING, .completer =3D virshCompleteEmpty, @@ -11296,6 +11300,9 @@ doMigrate(void *opaque) if (vshCommandOptBool(cmd, "postcopy-resume")) flags |=3D VIR_MIGRATE_POSTCOPY_RESUME; =20 + if (vshCommandOptBool(cmd, "zerocopy")) + flags |=3D VIR_MIGRATE_ZEROCOPY; + if (vshCommandOptBool(cmd, "tls")) flags |=3D VIR_MIGRATE_TLS; =20 --=20 2.35.1