From nobody Fri Apr 11 16:01:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1493411939471171.3633026033059; Fri, 28 Apr 2017 13:38:59 -0700 (PDT) Received: from localhost ([::1]:38717 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d4CfK-0005Uz-2p for importer@patchew.org; Fri, 28 Apr 2017 16:38:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d4Cai-0001Zg-6D for qemu-devel@nongnu.org; Fri, 28 Apr 2017 16:34:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d4Cae-0001Ad-Im for qemu-devel@nongnu.org; Fri, 28 Apr 2017 16:34:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55490) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d4Cab-00018z-Cc; Fri, 28 Apr 2017 16:34:05 -0400 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 mx1.redhat.com (Postfix) with ESMTPS id 4AF737FD61; Fri, 28 Apr 2017 20:34:04 +0000 (UTC) Received: from noname.redhat.com (ovpn-117-227.ams2.redhat.com [10.36.117.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id E46299533F; Fri, 28 Apr 2017 20:34:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4AF737FD61 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kwolf@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4AF737FD61 From: Kevin Wolf To: qemu-block@nongnu.org Date: Fri, 28 Apr 2017 22:33:16 +0200 Message-Id: <1493411622-5343-9-git-send-email-kwolf@redhat.com> In-Reply-To: <1493411622-5343-1-git-send-email-kwolf@redhat.com> References: <1493411622-5343-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 28 Apr 2017 20:34:04 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 08/34] qemu-iotests: Test postcopy migration 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: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Kevin Wolf Reviewed-by: Dr. David Alan Gilbert --- tests/qemu-iotests/181 | 119 +++++++++++++++++++++++++++++++++++++++++= ++++ tests/qemu-iotests/181.out | 38 +++++++++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 158 insertions(+) create mode 100755 tests/qemu-iotests/181 create mode 100644 tests/qemu-iotests/181.out diff --git a/tests/qemu-iotests/181 b/tests/qemu-iotests/181 new file mode 100755 index 0000000..e969a2a --- /dev/null +++ b/tests/qemu-iotests/181 @@ -0,0 +1,119 @@ +#!/bin/bash +# +# Test postcopy live migration with shared storage +# +# Copyright (C) 2017 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# creator +owner=3Dkwolf@redhat.com + +seq=3D`basename $0` +echo "QA output created by $seq" + +here=3D`pwd` +status=3D1 # failure is the default! + +MIG_SOCKET=3D"${TEST_DIR}/migrate" + +_cleanup() +{ + rm -f "${MIG_SOCKET}" + _cleanup_test_img + _cleanup_qemu +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter +. ./common.qemu + +_supported_fmt generic +_supported_proto generic +_supported_os Linux + +size=3D64M +_make_test_img $size + +echo +echo =3D=3D=3D Starting VMs =3D=3D=3D +echo + +qemu_comm_method=3D"monitor" + +_launch_qemu \ + -drive file=3D"${TEST_IMG}",cache=3D${CACHEMODE},driver=3D$IMGFMT,id= =3Ddisk +src=3D$QEMU_HANDLE + +_launch_qemu \ + -drive file=3D"${TEST_IMG}",cache=3D${CACHEMODE},driver=3D$IMGFMT,id= =3Ddisk \ + -incoming "unix:${MIG_SOCKET}" +dest=3D$QEMU_HANDLE + +echo +echo =3D=3D=3D Write something on the source =3D=3D=3D +echo + +silent=3D +_send_qemu_cmd $src 'qemu-io disk "write -P 0x55 0 64k"' "(qemu)" +_send_qemu_cmd $src "" "ops/sec" +_send_qemu_cmd $src 'qemu-io disk "read -P 0x55 0 64k"' "(qemu)" +_send_qemu_cmd $src "" "ops/sec" + +echo +echo =3D=3D=3D Do postcopy migration to destination =3D=3D=3D +echo + +# Slow down migration so much that it definitely won't finish before we can +# switch to postcopy +silent=3Dyes +_send_qemu_cmd $src 'migrate_set_speed 4k' "(qemu)" +_send_qemu_cmd $src 'migrate_set_capability postcopy-ram on' "(qemu)" +_send_qemu_cmd $src "migrate -d unix:${MIG_SOCKET}" "(qemu)" +_send_qemu_cmd $src 'migrate_start_postcopy' "(qemu)" + +QEMU_COMM_TIMEOUT=3D1 qemu_cmd_repeat=3D10 silent=3Dyes \ + _send_qemu_cmd $src "info migrate" "completed\|failed" +silent=3Dyes _send_qemu_cmd $src "" "(qemu)" + +echo +echo =3D=3D=3D Do some I/O on the destination =3D=3D=3D +echo + +# It is important that we use the BlockBackend of the guest device here in= stead +# of the node name, which would create a new BlockBackend and not test whe= ther +# the guest has the necessary permissions to access the image now +silent=3D +_send_qemu_cmd $dest 'qemu-io disk "read -P 0x55 0 64k"' "(qemu)" +_send_qemu_cmd $dest "" "ops/sec" +_send_qemu_cmd $dest 'qemu-io disk "write -P 0x66 1M 64k"' "(qemu)" +_send_qemu_cmd $dest "" "ops/sec" + +echo +echo =3D=3D=3D Shut down and check image =3D=3D=3D +echo + +_send_qemu_cmd $src 'quit' "" +_send_qemu_cmd $dest 'quit' "" +wait=3D1 _cleanup_qemu + +_check_test_img + +# success, all done +echo "*** done" +rm -f $seq.full +status=3D0 diff --git a/tests/qemu-iotests/181.out b/tests/qemu-iotests/181.out new file mode 100644 index 0000000..6534ba2 --- /dev/null +++ b/tests/qemu-iotests/181.out @@ -0,0 +1,38 @@ +QA output created by 181 +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 + +=3D=3D=3D Starting VMs =3D=3D=3D + + +=3D=3D=3D Write something on the source =3D=3D=3D + +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qemu-io disk "write -P 0x55 0 64k" +wrote 65536/65536 bytes at offset 0 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +(qemu)=20 +(qemu) qemu-io disk "read -P 0x55 0 64k" +read 65536/65536 bytes at offset 0 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D Do postcopy migration to destination =3D=3D=3D + + +=3D=3D=3D Do some I/O on the destination =3D=3D=3D + +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qemu-io disk "read -P 0x55 0 64k" +read 65536/65536 bytes at offset 0 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +(qemu)=20 +(qemu) qemu-io disk "write -P 0x66 1M 64k" +wrote 65536/65536 bytes at offset 1048576 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D Shut down and check image =3D=3D=3D + +(qemu) quit +(qemu)=20 +(qemu) quit +No errors were found on the image. +*** done diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index 43142dd..893962d 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -169,3 +169,4 @@ 174 auto 175 auto quick 176 rw auto backing +181 rw auto migration --=20 1.8.3.1