From patchwork Mon Oct 30 13:16:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Perevalov X-Patchwork-Id: 10032631 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C2C58603B4 for ; Mon, 30 Oct 2017 13:18:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB5272887E for ; Mon, 30 Oct 2017 13:18:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A047B288AD; Mon, 30 Oct 2017 13:18:12 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 935C42887E for ; Mon, 30 Oct 2017 13:18:10 +0000 (UTC) Received: from localhost ([::1]:40677 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e99xB-0002Gi-FI for patchwork-qemu-devel@patchwork.kernel.org; Mon, 30 Oct 2017 09:18:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e99w2-0002GL-7I for qemu-devel@nongnu.org; Mon, 30 Oct 2017 09:16:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e99vx-00045a-IP for qemu-devel@nongnu.org; Mon, 30 Oct 2017 09:16:58 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:35979) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e99vx-00044o-Cd for qemu-devel@nongnu.org; Mon, 30 Oct 2017 09:16:53 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20171030131651euoutp0299c9ab2bad06251c762135a63a226301~yW3uyI2ZT2108521085euoutp02k; Mon, 30 Oct 2017 13:16:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20171030131651euoutp0299c9ab2bad06251c762135a63a226301~yW3uyI2ZT2108521085euoutp02k DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1509369411; bh=ywYP+3087aMW+bRqHjZuaEG21zhvHhw8JQkmWQHrVVA=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=r7r6ISnJKoK+VAcjIhsNIp6GJ/+uYQ5AQF6CQiYnRHDq9nFAFWsdj0OEUi2J+fnDs krWC1guqSPWDVmk0WQdDdIJCYuB9awG3bL4GWanFw2w/gFmO1UNQjMyddNpkbgBHWi fMq83pqp6IXxEcClywia+xYodD1NnAD6m51GY/B8= Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20171030131651eucas1p284aaab40bd3b3894a8a17f1339e72411~yW3uBDmAh3254932549eucas1p2J; Mon, 30 Oct 2017 13:16:51 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1.samsung.com (EUCPMTA) with SMTP id A4.03.12576.24627F95; Mon, 30 Oct 2017 13:16:50 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20171030131650eucas1p11e65153f114fd66677a37751e4e82b2d~yW3tSKVnU0722607226eucas1p1t; Mon, 30 Oct 2017 13:16:50 +0000 (GMT) X-AuditID: cbfec7ef-f79ee6d000003120-63-59f72642d32e Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 56.C1.18832.24627F95; Mon, 30 Oct 2017 13:16:50 +0000 (GMT) Received: from aperevalov-ubuntu.rnd.samsung.ru ([106.109.129.199]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OYN00A7O0VNBHD0@eusync3.samsung.com>; Mon, 30 Oct 2017 13:16:50 +0000 (GMT) From: Alexey Perevalov To: qemu-devel@nongnu.org Date: Mon, 30 Oct 2017 16:16:29 +0300 Message-id: <1509369390-8285-6-git-send-email-a.perevalov@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1509369390-8285-1-git-send-email-a.perevalov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrEIsWRmVeSWpSXmKPExsWy7djPc7pOat8jDS6fNbGYe/c8i0Xvtnvs FtM+32a3uNL+k91iy/5v7BbHe3ewWNzZ0sfkwO7x5NpmJo/3+66yefRtWcUYwBzFZZOSmpNZ llqkb5fAlfHtdhNjQb9gxZWJm1kbGM/zdjFycEgImEismZfXxcgJZIpJXLi3nq2LkYtDSGAZ o8SEJ91sIAkhgc+MEnt6BGDq29ZZwdUs+NHKCuF0M0n0zT/EClLEJmAgse+eLUiviICkxO+u 08wgNcwCCxklpux/DjZUWCBYYtWrfWwg9SwCqhJ3b4qAhHkF3CS6Xh5ngzhITuLmuU5mEJtT wF3i1oEPTCBzJAQ62CQ+f/7NDnGQi0TH6TiIemGJV8e3sEPYMhKdHQeh6tsZJbp3drJCOBMY Jc5M/wtVZS9x6uZVJhCbWYBPYtK26cwQQ3klOtqEIEo8JNat7WWFsB0lFsxuhobQLEaJ6YvO ME9glF7AyLCKUSS1tDg3PbXYUK84Mbe4NC9dLzk/dxMjMCZP/zv+fgfj0+aQ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fd66677a37751e4e82b2d X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20171030131650eucas1p11e65153f114fd66677a37751e4e82b2d X-RootMTR: 20171030131650eucas1p11e65153f114fd66677a37751e4e82b2d References: <1509369390-8285-1-git-send-email-a.perevalov@samsung.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 210.118.77.12 Subject: [Qemu-devel] [PATCH v12 5/6] migration: add blocktime calculation into migration-test 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: heetae82.ahn@samsung.com, quintela@redhat.com, dgilbert@redhat.com, peterx@redhat.com, Alexey Perevalov , i.maximets@samsung.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch just requests blocktime calculation, and check it in case when UFFD_FEATURE_THREAD_ID feature is set on the host. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Alexey Perevalov Reviewed-by: Juan Quintela --- tests/migration-test.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/migration-test.c b/tests/migration-test.c index db30b38..3b4d88a 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -25,6 +25,7 @@ const unsigned start_address = 1024 * 1024; const unsigned end_address = 100 * 1024 * 1024; bool got_stop; +static bool uffd_feature_thread_id; #if defined(__linux__) #include @@ -54,6 +55,7 @@ static bool ufd_version_check(void) g_test_message("Skipping test: UFFDIO_API failed"); return false; } + uffd_feature_thread_id = api_struct.features & UFFD_FEATURE_THREAD_ID; ioctl_mask = (__u64)1 << _UFFDIO_REGISTER | (__u64)1 << _UFFDIO_UNREGISTER; @@ -266,6 +268,16 @@ static uint64_t get_migration_pass(QTestState *who) return result; } +static void read_blocktime(QTestState *who) +{ + QDict *rsp, *rsp_return; + + rsp = wait_command(who, "{ 'execute': 'query-migrate' }"); + rsp_return = qdict_get_qdict(rsp, "return"); + g_assert(qdict_haskey(rsp_return, "postcopy-blocktime")); + QDECREF(rsp); +} + static void wait_for_migration_complete(QTestState *who) { QDict *rsp, *rsp_return; @@ -540,6 +552,7 @@ static void test_postcopy(void) migrate_set_capability(from, "postcopy-ram", "true"); migrate_set_capability(to, "postcopy-ram", "true"); + migrate_set_capability(to, "postcopy-blocktime", "true"); /* We want to pick a speed slow enough that the test completes * quickly, but that it doesn't complete precopy even on a slow @@ -568,6 +581,9 @@ static void test_postcopy(void) wait_for_serial("dest_serial"); wait_for_migration_complete(from); + if (uffd_feature_thread_id) { + read_blocktime(to); + } g_free(uri); test_migrate_end(from, to);