From nobody Mon Apr 29 21:32:11 2024 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 1492104323559525.0614041885833; Thu, 13 Apr 2017 10:25:23 -0700 (PDT) Received: from localhost ([::1]:50160 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cyiUk-00008g-Dr for importer@patchew.org; Thu, 13 Apr 2017 13:25:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cyiTQ-0007cg-9f for qemu-devel@nongnu.org; Thu, 13 Apr 2017 13:24:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cyiTP-0005Bd-EG for qemu-devel@nongnu.org; Thu, 13 Apr 2017 13:24:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41872) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cyiTN-0005AT-Fp; Thu, 13 Apr 2017 13:23:57 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 79F1EC0827A5; Thu, 13 Apr 2017 17:23:56 +0000 (UTC) Received: from noname.redhat.com (ovpn-117-185.ams2.redhat.com [10.36.117.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D2FE5C542; Thu, 13 Apr 2017 17:23:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 79F1EC0827A5 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kwolf@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 79F1EC0827A5 From: Kevin Wolf To: qemu-block@nongnu.org Date: Thu, 13 Apr 2017 19:23:32 +0200 Message-Id: <1492104214-29994-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1492104214-29994-1-git-send-email-kwolf@redhat.com> References: <1492104214-29994-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 13 Apr 2017 17:23:56 +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] [PATCH 1/3] migration: Call blk_resume_after_migration() for postcopy 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, lvivier@redhat.com, quintela@redhat.com, qemu-devel@nongnu.org, dgilbert@redhat.com, mreitz@redhat.com, stefanha@redhat.com 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" Commit d35ff5e6 ('block: Ignore guest dev permissions during incoming migration') added blk_resume_after_migration() to the precopy migration path, but neglected to add it to the duplicated code that is used for postcopy migration. This means that the guest device doesn't request the necessary permissions, which ultimately led to failing assertions. Add the missing blk_resume_after_migration() to the postcopy path. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- migration/savevm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/migration/savevm.c b/migration/savevm.c index 3b19a4a..43fa9bf 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1623,6 +1623,14 @@ static void loadvm_postcopy_handle_run_bh(void *opaq= ue) error_report_err(local_err); } =20 + /* If we get an error here, just don't restart the VM yet. */ + blk_resume_after_migration(&local_err); + if (local_err) { + error_free(local_err); + local_err =3D NULL; + autostart =3D false; + } + trace_loadvm_postcopy_handle_run_cpu_sync(); cpu_synchronize_all_post_init(); =20 --=20 1.8.3.1 From nobody Mon Apr 29 21:32:11 2024 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 1492104333817781.2373724059279; Thu, 13 Apr 2017 10:25:33 -0700 (PDT) Received: from localhost ([::1]:50163 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cyiUu-0000M7-MK for importer@patchew.org; Thu, 13 Apr 2017 13:25:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cyiTZ-0007mr-7x for qemu-devel@nongnu.org; Thu, 13 Apr 2017 13:24:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cyiTT-0005D8-2R for qemu-devel@nongnu.org; Thu, 13 Apr 2017 13:24:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45770) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cyiTQ-0005Bh-6m; Thu, 13 Apr 2017 13:24:00 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2DDA490E58; Thu, 13 Apr 2017 17:23:59 +0000 (UTC) Received: from noname.redhat.com (ovpn-117-185.ams2.redhat.com [10.36.117.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id C41CD5C3FD; Thu, 13 Apr 2017 17:23:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2DDA490E58 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kwolf@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2DDA490E58 From: Kevin Wolf To: qemu-block@nongnu.org Date: Thu, 13 Apr 2017 19:23:33 +0200 Message-Id: <1492104214-29994-3-git-send-email-kwolf@redhat.com> In-Reply-To: <1492104214-29994-1-git-send-email-kwolf@redhat.com> References: <1492104214-29994-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 13 Apr 2017 17:23:59 +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] [PATCH 2/3] qemu-iotests: Filter HMP readline escape characters 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, lvivier@redhat.com, quintela@redhat.com, qemu-devel@nongnu.org, dgilbert@redhat.com, mreitz@redhat.com, stefanha@redhat.com 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" The only thing the escape characters achieve is making the reference output unreadable and lines that are potentially so long that git doesn't want to put them into an email any more. Let's filter them out. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/028.out | 2 +- tests/qemu-iotests/130.out | 4 ++-- tests/qemu-iotests/common.filter | 7 +++++++ tests/qemu-iotests/common.qemu | 4 ++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/028.out b/tests/qemu-iotests/028.out index acd2870..7d54aeb 100644 --- a/tests/qemu-iotests/028.out +++ b/tests/qemu-iotests/028.out @@ -469,7 +469,7 @@ No errors were found on the image. block-backup =20 Formatting 'TEST_DIR/t.IMGFMT.copy', fmt=3DIMGFMT size=3D4294968832 backin= g_file=3DTEST_DIR/t.IMGFMT.base backing_fmt=3DIMGFMT -(qemu) i=1B[K=1B[Din=1B[K=1B[D=1B[Dinf=1B[K=1B[D=1B[D=1B[Dinfo=1B[K=1B[D= =1B[D=1B[D=1B[Dinfo =1B[K=1B[D=1B[D=1B[D=1B[D=1B[Dinfo b=1B[K=1B[D=1B[D=1B[= D=1B[D=1B[D=1B[Dinfo bl=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dinfo blo=1B[= K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dinfo bloc=1B[K=1B[D=1B[D=1B[D=1B[D= =1B[D=1B[D=1B[D=1B[D=1B[Dinfo block=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D= =1B[D=1B[D=1B[Dinfo block-=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[= D=1B[D=1B[Dinfo block-j=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D= =1B[D=1B[D=1B[Dinfo block-jo=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D= =1B[D=1B[D=1B[D=1B[D=1B[Dinfo block-job=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D= =1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dinfo block-jobs=1B[K +(qemu) info block-jobs No active jobs =3D=3D=3D IO: pattern 195 read 512/512 bytes at offset 3221194240 diff --git a/tests/qemu-iotests/130.out b/tests/qemu-iotests/130.out index ae95b50..93020c3 100644 --- a/tests/qemu-iotests/130.out +++ b/tests/qemu-iotests/130.out @@ -9,14 +9,14 @@ virtual size: 64M (67108864 bytes) =3D=3D=3D HMP commit =3D=3D=3D =20 QEMU X.Y.Z monitor - type 'help' for more information -(qemu) c=1B[K=1B[Dco=1B[K=1B[D=1B[Dcom=1B[K=1B[D=1B[D=1B[Dcomm=1B[K=1B[D= =1B[D=1B[D=1B[Dcommi=1B[K=1B[D=1B[D=1B[D=1B[D=1B[Dcommit=1B[K=1B[D=1B[D=1B[= D=1B[D=1B[D=1B[Dcommit =1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dcommit t=1B[= K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dcommit te=1B[K=1B[D=1B[D=1B[D=1B[D= =1B[D=1B[D=1B[D=1B[D=1B[Dcommit tes=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D= =1B[D=1B[D=1B[Dcommit test=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[= D=1B[D=1B[Dcommit testd=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D= =1B[D=1B[D=1B[Dcommit testdi=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D= =1B[D=1B[D=1B[D=1B[D=1B[Dcommit testdis=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D= =1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dcommit testdisk=1B[K +(qemu) commit testdisk (qemu)=20 image: TEST_DIR/t.IMGFMT file format: IMGFMT virtual size: 64M (67108864 bytes) Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 backing_file= =3DTEST_DIR/t.IMGFMT.orig backing_fmt=3Draw QEMU X.Y.Z monitor - type 'help' for more information -(qemu) c=1B[K=1B[Dco=1B[K=1B[D=1B[Dcom=1B[K=1B[D=1B[D=1B[Dcomm=1B[K=1B[D= =1B[D=1B[D=1B[Dcommi=1B[K=1B[D=1B[D=1B[D=1B[D=1B[Dcommit=1B[K=1B[D=1B[D=1B[= D=1B[D=1B[D=1B[Dcommit =1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dcommit t=1B[= K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dcommit te=1B[K=1B[D=1B[D=1B[D=1B[D= =1B[D=1B[D=1B[D=1B[D=1B[Dcommit tes=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D= =1B[D=1B[D=1B[Dcommit test=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[= D=1B[D=1B[Dcommit testd=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D= =1B[D=1B[D=1B[Dcommit testdi=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D= =1B[D=1B[D=1B[D=1B[D=1B[Dcommit testdis=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D= =1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dcommit testdisk=1B[K +(qemu) commit testdisk (qemu)=20 image: TEST_DIR/t.IMGFMT file format: IMGFMT diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.f= ilter index 1040013..78b7bfa 100644 --- a/tests/qemu-iotests/common.filter +++ b/tests/qemu-iotests/common.filter @@ -86,6 +86,13 @@ _filter_qmp() -e ' QMP_VERSION' } =20 +# readline makes HMP command strings so long that git complains +_filter_hmp() +{ + sed -e 's/(qemu).*\o33\[D/(qemu) /g' \ + -e 's/\o33\[K//g' +} + # replace block job offset _filter_block_job_offset() { diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu index 4278789..7a78a00 100644 --- a/tests/qemu-iotests/common.qemu +++ b/tests/qemu-iotests/common.qemu @@ -59,7 +59,7 @@ function _timed_wait_for() do if [ -z "${silent}" ]; then echo "${resp}" | _filter_testdir | _filter_qemu \ - | _filter_qemu_io | _filter_qmp + | _filter_qemu_io | _filter_qmp | _filter_hmp fi grep -q "${*}" < <(echo ${resp}) if [ $? -eq 0 ]; then @@ -217,7 +217,7 @@ function _cleanup_qemu() =20 if [ -n "${wait}" ]; then cat <&${QEMU_OUT[$i]} | _filter_testdir | _filter_qemu \ - | _filter_qemu_io | _filter_qmp + | _filter_qemu_io | _filter_qmp | _filte= r_hmp fi rm -f "${QEMU_FIFO_IN}_${i}" "${QEMU_FIFO_OUT}_${i}" eval "exec ${QEMU_IN[$i]}<&-" # close file descriptors --=20 1.8.3.1 From nobody Mon Apr 29 21:32:11 2024 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 1492104410869100.94102841229937; Thu, 13 Apr 2017 10:26:50 -0700 (PDT) Received: from localhost ([::1]:50167 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cyiW9-0001K7-NX for importer@patchew.org; Thu, 13 Apr 2017 13:26:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cyiTZ-0007ms-8D for qemu-devel@nongnu.org; Thu, 13 Apr 2017 13:24:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cyiTY-0005Eh-0E for qemu-devel@nongnu.org; Thu, 13 Apr 2017 13:24:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36716) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cyiTS-0005Cm-Tm; Thu, 13 Apr 2017 13:24:03 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E0E07C0A1B1E; Thu, 13 Apr 2017 17:24:01 +0000 (UTC) Received: from noname.redhat.com (ovpn-117-185.ams2.redhat.com [10.36.117.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id 792AF5C541; Thu, 13 Apr 2017 17:23:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E0E07C0A1B1E Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kwolf@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E0E07C0A1B1E From: Kevin Wolf To: qemu-block@nongnu.org Date: Thu, 13 Apr 2017 19:23:34 +0200 Message-Id: <1492104214-29994-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1492104214-29994-1-git-send-email-kwolf@redhat.com> References: <1492104214-29994-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 13 Apr 2017 17:24:02 +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] [PATCH 3/3] 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, lvivier@redhat.com, quintela@redhat.com, qemu-devel@nongnu.org, dgilbert@redhat.com, mreitz@redhat.com, stefanha@redhat.com 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 | 117 +++++++++++++++++++++++++++++++++++++++++= ++++ tests/qemu-iotests/181.out | 38 +++++++++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 156 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..563aee7 --- /dev/null +++ b/tests/qemu-iotests/181 @@ -0,0 +1,117 @@ +#!/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},id=3Ddisk +src=3D$QEMU_HANDLE + +_launch_qemu -drive file=3D"${TEST_IMG}",cache=3D${CACHEMODE},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