From nobody Tue Feb 10 17:08:28 2026 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.zohomail.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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1512677931857669.5653558401989; Thu, 7 Dec 2017 12:18:51 -0800 (PST) Received: from localhost ([::1]:34111 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eN2d3-0002vn-CU for importer@patchew.org; Thu, 07 Dec 2017 15:18:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eN2YI-0007dY-NG for qemu-devel@nongnu.org; Thu, 07 Dec 2017 15:13:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eN2YF-0006yB-II for qemu-devel@nongnu.org; Thu, 07 Dec 2017 15:13:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58072) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eN2YC-0006uM-Kd; Thu, 07 Dec 2017 15:13:44 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DD353C04575A; Thu, 7 Dec 2017 20:13:43 +0000 (UTC) Received: from localhost (ovpn-116-107.ams2.redhat.com [10.36.116.107]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A4D07B90A; Thu, 7 Dec 2017 20:13:43 +0000 (UTC) From: Stefan Hajnoczi To: Date: Thu, 7 Dec 2017 20:13:20 +0000 Message-Id: <20171207201320.19284-7-stefanha@redhat.com> In-Reply-To: <20171207201320.19284-1-stefanha@redhat.com> References: <20171207201320.19284-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 07 Dec 2017 20:13:43 +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 v2 6/6] qemu-iotests: add 203 savevm with IOThreads 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: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi , qemu-block@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" This test case will prevent future regressions with savevm and IOThreads. Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/203 | 59 ++++++++++++++++++++++++++++++++++++++++++= ++++ tests/qemu-iotests/203.out | 6 +++++ tests/qemu-iotests/group | 1 + 3 files changed, 66 insertions(+) create mode 100755 tests/qemu-iotests/203 create mode 100644 tests/qemu-iotests/203.out diff --git a/tests/qemu-iotests/203 b/tests/qemu-iotests/203 new file mode 100755 index 0000000000..2c811917d8 --- /dev/null +++ b/tests/qemu-iotests/203 @@ -0,0 +1,59 @@ +#!/usr/bin/env python +# +# 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: Stefan Hajnoczi +# +# Check that QMP 'migrate' with multiple drives on a single IOThread compl= etes +# successfully. This particular command triggered a hang in the source QE= MU +# process due to recursive AioContext locking in bdrv_invalidate_all() and +# BDRV_POLL_WHILE(). + +import iotests + +iotests.verify_image_format(supported_fmts=3D['qcow2']) +iotests.verify_platform(['linux']) + +with iotests.FilePath('disk0.img') as disk0_img_path, \ + iotests.FilePath('disk1.img') as disk1_img_path, \ + iotests.VM() as vm: + + img_size =3D '10M' + iotests.qemu_img_pipe('create', '-f', iotests.imgfmt, disk0_img_path, = img_size) + iotests.qemu_img_pipe('create', '-f', iotests.imgfmt, disk1_img_path, = img_size) + + iotests.log('Launching VM...') + (vm.add_object('iothread,id=3Diothread0') + .add_drive(disk0_img_path, 'node-name=3Ddrive0-node', interface=3D'= none') + .add_drive(disk1_img_path, 'node-name=3Ddrive1-node', interface=3D'= none') + .launch()) + + iotests.log('Setting IOThreads...') + iotests.log(vm.qmp('x-blockdev-set-iothread', + node_name=3D'drive0-node', iothread=3D'iothread0', + force=3DTrue)) + iotests.log(vm.qmp('x-blockdev-set-iothread', + node_name=3D'drive1-node', iothread=3D'iothread0', + force=3DTrue)) + + iotests.log('Starting migration...') + iotests.log(vm.qmp('migrate', uri=3D'exec:cat >/dev/null')) + while True: + vm.get_qmp_event(wait=3D60.0) + result =3D vm.qmp('query-migrate') + status =3D result.get('return', {}).get('status', None) + if status =3D=3D 'completed': + break diff --git a/tests/qemu-iotests/203.out b/tests/qemu-iotests/203.out new file mode 100644 index 0000000000..3f1ff900e4 --- /dev/null +++ b/tests/qemu-iotests/203.out @@ -0,0 +1,6 @@ +Launching VM... +Setting IOThreads... +{u'return': {}} +{u'return': {}} +Starting migration... +{u'return': {}} diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index d0ee1e2e55..93d96fb22f 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -198,3 +198,4 @@ 198 rw auto 200 rw auto 202 rw auto quick +203 rw auto --=20 2.14.3