From patchwork Thu Jan 10 12:01:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Kotov X-Patchwork-Id: 10755629 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 504E013BF for ; Thu, 10 Jan 2019 12:09:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FC252926D for ; Thu, 10 Jan 2019 12:09:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 338E529277; Thu, 10 Jan 2019 12:09:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BC7A22926D for ; Thu, 10 Jan 2019 12:09:38 +0000 (UTC) Received: from localhost ([127.0.0.1]:53630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghZ9V-0006aJ-Uh for patchwork-qemu-devel@patchwork.kernel.org; Thu, 10 Jan 2019 07:09:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghZ1r-0001H9-D6 for qemu-devel@nongnu.org; Thu, 10 Jan 2019 07:01:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghZ1l-000061-6x for qemu-devel@nongnu.org; Thu, 10 Jan 2019 07:01:43 -0500 Received: from forwardcorp1j.cmail.yandex.net ([5.255.227.105]:58902) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghZ1k-0008SD-AS for qemu-devel@nongnu.org; Thu, 10 Jan 2019 07:01:37 -0500 Received: from mxbackcorp1g.mail.yandex.net (mxbackcorp1g.mail.yandex.net [IPv6:2a02:6b8:0:1402::301]) by forwardcorp1j.cmail.yandex.net (Yandex) with ESMTP id 3CCF420CC8; Thu, 10 Jan 2019 15:01:27 +0300 (MSK) Received: from smtpcorp1j.mail.yandex.net (smtpcorp1j.mail.yandex.net [2a02:6b8:0:1619::137]) by mxbackcorp1g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Sat8erZ66h-1QRicxYM; Thu, 10 Jan 2019 15:01:27 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1547121687; bh=64wxyjrPXfxH4sw6PhBnScJxvo91y98Q/9GITsBOlA8=; h=From:To:Cc:Subject:Date:Message-Id; b=RdOc3cDuqZubU7eZ0caLeYIxOoYLMNeLFVA10RD92KmfxP3tFuhhSRyaS6eKntTtX 1VEZ8x4Aw5TCaoVSEN4R2BrVwuUIStpxLmmvD6zMbgjau+updebi/ifCL78zcWMggd ue9LnkK7wTCbc4WlpO0qHP+QuRzwUBL84wsxLTlg= Authentication-Results: mxbackcorp1g.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from dynamic-red.dhcp.yndx.net (dynamic-red.dhcp.yndx.net [2a02:6b8:0:40c:e1bb:a1a7:a235:d6b4]) by smtpcorp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id v4PGSBu40N-1QhiRuqo; Thu, 10 Jan 2019 15:01:26 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Yury Kotov To: qemu-devel@nongnu.org, Eduardo Habkost , Igor Mammedov , Paolo Bonzini , Peter Crosthwaite , Richard Henderson , Juan Quintela , "Dr. David Alan Gilbert" , Eric Blake , Markus Armbruster , Thomas Huth , Laurent Vivier Date: Thu, 10 Jan 2019 15:01:16 +0300 Message-Id: <20190110120120.9943-1-yury-kotov@yandex-team.ru> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 5.255.227.105 Subject: [Qemu-devel] [PATCH 0/4] Add ignore-external migration capability X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: wrfsh@yandex-team.ru Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi, The series adds migration capability which allows to skip 'external' RAM blocks during migration. External block is a RAMBlock which available from the outside of current QEMU process (e.g. file in /dev/shm). It's useful for fast local migration to update QEMU for the running guests. Patches: 1. Add offset validation to make sure that external RAM block has the same physical offset on target side, 2. Add RAM_EXTERNAL flag to determine external RAM blocks, 3. Add ignore-external migration capability, 4. Add a test. Usage example: 1. Start source VM: qemu-system-x86 \ -m 4G \ -object memory-backend-file,id=mem0,size=4G,share=on,mem-path=/dev/shm/mem0 \ -numa node,memdev=mem0 \ -qmp unix:/tmp/qemu-qmp-1.sock,server,nowait \ 2. Start target VM: qemu-system-x86 \ -m 4G \ -object memory-backend-file,id=mem0,size=4G,share=on,mem-path=/dev/shm/mem0 \ -numa node,memdev=mem0 \ -qmp unix:/tmp/qemu-qmp-2.sock,server,nowait \ -incoming defer 3. Enable ignore-external capability on both VMs: { "execute": "migrate-set-capabilities" , "arguments": { "capabilities": [ { "capability": "x-ignore-external", "state": true } ] } } 4. Start migration. Regards, Yury Yury Kotov (4): migration: add RAMBlock's offset validation exec: add RAM_EXTERNAL flag to mark non-QEMU allocated blocks migration: introduce ignore-external capability tests/migration-test: Add a test for ignore-external capability backends/hostmem-file.c | 3 +- exec.c | 7 ++- include/exec/cpu-common.h | 1 + include/exec/memory.h | 3 ++ migration/migration.c | 9 ++++ migration/migration.h | 1 + migration/ram.c | 52 ++++++++++++++++-- numa.c | 4 +- qapi/migration.json | 6 ++- tests/migration-test.c | 109 +++++++++++++++++++++++++++++++------- 10 files changed, 165 insertions(+), 30 deletions(-)