From nobody Mon May 6 12:55:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1574133014; cv=none; d=zoho.com; s=zohoarc; b=MNis9vKTMNhcpFJR6r6xY++dcC2o0Gk4oKRBvHlbPTBVyc+bgHDxb/EZay9XU16B4uSMEmPHqLw8KiJVopnNp2XaQ2cEnrzXyE2i5EEqqMQ34v/ke2Ha0amlpLiirajATn1+fn1gJ4mNbbrMo6WDqQqJcEn9rjfqLClKoAwpCAo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574133014; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=i34Oo7GWbgLMaRioPWWxMyTFZuyFz5Xdmin/1Z00VXI=; b=Z9bdox+SNTgWNlfrlX10axF7JPJOtX1uzFI256wmocJw2OaciDe+WTZInvYsxeNQ4f/zGDq0agTkiTHrKtuS3LEZWNX2aeud3PufR2fjQnIJUGkdkTuJu4IaFrRnfSck+qvzvcaauFmSyEtOIyzL+77VP7NUGyvLqTrJxl42UXQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1574133014005545.6443801112507; Mon, 18 Nov 2019 19:10:14 -0800 (PST) Received: from localhost ([::1]:41252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWtu8-0003Zx-Jb for importer@patchew.org; Mon, 18 Nov 2019 22:10:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42687) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWtsE-0001sI-Ig for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iWtsB-0004dO-Mg for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:13 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:54865 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iWtsB-0004aV-33 for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:11 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-261-tTXBiknZOMmPZpoWTidsMA-1; Mon, 18 Nov 2019 22:08:05 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 72D40477; Tue, 19 Nov 2019 03:08:03 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-221.phx2.redhat.com [10.3.116.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6C6BF7BFAA; Tue, 19 Nov 2019 03:08:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574132887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i34Oo7GWbgLMaRioPWWxMyTFZuyFz5Xdmin/1Z00VXI=; b=gqLPjaINbKLpHnqlAi7arV+9MLrdGzgwD/FfZn0+1723/Yy2z4856iuMxOQv/YncSiWPvc 5qR68DXnYBrrjPfw/LHuyDow1yqL7mbDEFIrojU15qKweUoyoN8kL3C8cM5onmezVIvwzG kBaOK04xWnGtyFQCGVXO046uOYp6RIA= From: Eric Blake To: qemu-devel@nongnu.org Subject: [PULL 01/10] iotests: Test NBD client reconnection Date: Mon, 18 Nov 2019 21:07:50 -0600 Message-Id: <20191119030759.24907-2-eblake@redhat.com> In-Reply-To: <20191119030759.24907-1-eblake@redhat.com> References: <20191119030759.24907-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: tTXBiknZOMmPZpoWTidsMA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Vladimir Sementsov-Ogievskiy , "open list:Block layer core" , Max Reitz , "Denis V . Lunev" , Andrey Shinkevich Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Andrey Shinkevich The test for an NBD client. The NBD server is disconnected after the client write request. The NBD client should reconnect and complete the write operation. Suggested-by: Denis V. Lunev Suggested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Andrey Shinkevich Reviewed-by: Eric Blake Tested-by: Eric Blake Message-Id: <1573529976-815699-1-git-send-email-andrey.shinkevich@virtuozzo= .com> --- tests/qemu-iotests/277 | 96 ++++++++++++++++++++++++ tests/qemu-iotests/277.out | 6 ++ tests/qemu-iotests/group | 1 + tests/qemu-iotests/iotests.py | 5 ++ tests/qemu-iotests/nbd-fault-injector.py | 3 +- 5 files changed, 110 insertions(+), 1 deletion(-) create mode 100755 tests/qemu-iotests/277 create mode 100644 tests/qemu-iotests/277.out diff --git a/tests/qemu-iotests/277 b/tests/qemu-iotests/277 new file mode 100755 index 000000000000..1f72dca2d423 --- /dev/null +++ b/tests/qemu-iotests/277 @@ -0,0 +1,96 @@ +#!/usr/bin/env python +# +# Test NBD client reconnection +# +# Copyright (c) 2019 Virtuozzo International GmbH +# +# 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 . +# + +import os +import subprocess +import iotests +from iotests import file_path, log + + +nbd_sock, conf_file =3D file_path('nbd-sock', 'nbd-fault-injector.conf') + + +def make_conf_file(event): + """ + Create configuration file for the nbd-fault-injector.py + + :param event: which event the server should close a connection on + """ + with open(conf_file, 'w') as conff: + conff.write('[inject-error]\nevent=3D{}\nwhen=3Dafter'.format(even= t)) + + +def start_server_NBD(event): + make_conf_file(event) + + srv =3D subprocess.Popen(['nbd-fault-injector.py', '--classic-negotiat= ion', + nbd_sock, conf_file], stdout=3Dsubprocess.PIPE, + stderr=3Dsubprocess.STDOUT, universal_newlines= =3DTrue) + line =3D srv.stdout.readline() + if 'Listening on ' in line: + log('NBD server: started') + else: + log('NBD server: ' + line.rstrip()) + + return srv + + +def start_client_NBD(): + log('NBD client: QEMU-IO write') + args =3D iotests.qemu_io_args_no_fmt + \ + ['-c', 'write -P 0x7 0 3M', '--image-opts', + 'driver=3Dnbd,server.type=3Dunix,server.path=3D{},' + 'reconnect-delay=3D7'.format(nbd_sock)] + clt =3D subprocess.Popen(args, stdout=3Dsubprocess.PIPE, + stderr=3Dsubprocess.STDOUT, + universal_newlines=3DTrue) + return clt + + +def check_proc_NBD(proc, connector): + try: + outs, errs =3D proc.communicate(timeout=3D10) + + if proc.returncode < 0: + log('NBD {}: EXIT SIGNAL {}\n'.format(connector, proc.returnco= de)) + log(outs) + else: + msg =3D outs.split('\n', 1) + log('NBD {}: {}'.format(connector, msg[0])) + + except subprocess.TimeoutExpired: + proc.kill() + log('NBD {}: ERROR timeout expired'.format(connector)) + finally: + if connector =3D=3D 'server': + os.remove(nbd_sock) + os.remove(conf_file) + + +srv =3D start_server_NBD('data') +clt =3D start_client_NBD() +# The server should close the connection after a client write request +check_proc_NBD(srv, 'server') +# Start the NBD server again +srv =3D start_server_NBD('reply') +# The client should reconnect and complete the write operation +check_proc_NBD(clt, 'client') +# Make it sure that server terminated +check_proc_NBD(srv, 'server') diff --git a/tests/qemu-iotests/277.out b/tests/qemu-iotests/277.out new file mode 100644 index 000000000000..45404b34ebcf --- /dev/null +++ b/tests/qemu-iotests/277.out @@ -0,0 +1,6 @@ +NBD server: started +NBD client: QEMU-IO write +NBD server: Closing connection on rule match inject-error +NBD server: started +NBD client: wrote 3145728/3145728 bytes at offset 0 +NBD server: Closing connection on rule match inject-error diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index c56bb6903180..6b10a6a76214 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -285,3 +285,4 @@ 270 rw backing quick 272 rw 273 backing quick +277 rw quick diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 6a248472b9e2..df0708923d06 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -47,6 +47,11 @@ qemu_io_args =3D [os.environ.get('QEMU_IO_PROG', 'qemu-i= o')] if os.environ.get('QEMU_IO_OPTIONS'): qemu_io_args +=3D os.environ['QEMU_IO_OPTIONS'].strip().split(' ') +qemu_io_args_no_fmt =3D [os.environ.get('QEMU_IO_PROG', 'qemu-io')] +if os.environ.get('QEMU_IO_OPTIONS_NO_FMT'): + qemu_io_args_no_fmt +=3D \ + os.environ['QEMU_IO_OPTIONS_NO_FMT'].strip().split(' ') + qemu_nbd_args =3D [os.environ.get('QEMU_NBD_PROG', 'qemu-nbd')] if os.environ.get('QEMU_NBD_OPTIONS'): qemu_nbd_args +=3D os.environ['QEMU_NBD_OPTIONS'].strip().split(' ') diff --git a/tests/qemu-iotests/nbd-fault-injector.py b/tests/qemu-iotests/= nbd-fault-injector.py index 6b2d659dee1f..7e2dab6ea442 100755 --- a/tests/qemu-iotests/nbd-fault-injector.py +++ b/tests/qemu-iotests/nbd-fault-injector.py @@ -115,7 +115,8 @@ class FaultInjectionSocket(object): if rule.match(event, io): if rule.when =3D=3D 0 or bufsize is None: print('Closing connection on rule match %s' % rule.nam= e) - self.sock.flush() + self.sock.close() + sys.stdout.flush() sys.exit(0) if rule.when !=3D -1: return rule.when --=20 2.21.0 From nobody Mon May 6 12:55:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1574133124; cv=none; d=zoho.com; s=zohoarc; b=OjKg9PIcHMJH9dDJjX9Ksra2B1SNXJzlmwUAT1EgW1U+NOmwtZcLEB+lUAa/BmxOdSWARJkd+J+vNUlx3UyAMGOZgYfE7FJ17xMtZViQFaaztcbs7I0J1ASVNCOPvARDZAbjlc90sgmJCoMZa58yEEB/4cS1lyLIER2VwBM1W10= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574133124; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ty3iOaizzIaKIfYQ1vWkItHnE5AjW0/DoJRjzHF+09E=; b=iYsoKF0ai7FjjIfbUHC7ZG1QoOgCgAJ4kqp617QM7lat/OeosCfPTGHnbQ0Go1MsQ4QVxNrnai1iyXtw00QP3VvhLwTkpnHiTUsW1el8B0/5bnFzz9rjvEqVsiP5qeGDbVwV02WiAmLFLZJrB2VNX4Ne+4MQLkvJ/jBGuhIwTKE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1574133124924499.19076401614825; Mon, 18 Nov 2019 19:12:04 -0800 (PST) Received: from localhost ([::1]:41288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWtvu-0006Xl-Jo for importer@patchew.org; Mon, 18 Nov 2019 22:12:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42798) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWtsI-0001ud-JM for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iWtsH-0004mv-C3 for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:18 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:29818 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iWtsH-0004mL-7t for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:17 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-358-6j2SJ4nDPtuIV-TCyFcYAA-1; Mon, 18 Nov 2019 22:08:07 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id AB425477; Tue, 19 Nov 2019 03:08:06 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-221.phx2.redhat.com [10.3.116.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D03B60566; Tue, 19 Nov 2019 03:08:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574132896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ty3iOaizzIaKIfYQ1vWkItHnE5AjW0/DoJRjzHF+09E=; b=PeTUWIp8RO1XbbBCTSrcuFNFI4m+5b6iZUNjF0XfnsK3kWHet0ybVd4kkWj0igh+8oHl0e w/GkiWYaFqTol1UvF/36M09UHNhtX7z9bxa1+JgIj1/6ivdfSgLiUiy82O1cspx/wXurxM UbwNSxu24XvfajUI3/nNxzQqoNEeUJ0= From: Eric Blake To: qemu-devel@nongnu.org Subject: [PULL 02/10] qemu-coroutine-sleep: Silence Coverity warning Date: Mon, 18 Nov 2019 21:07:51 -0600 Message-Id: <20191119030759.24907-3-eblake@redhat.com> In-Reply-To: <20191119030759.24907-1-eblake@redhat.com> References: <20191119030759.24907-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: 6j2SJ4nDPtuIV-TCyFcYAA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Coverity warns that we store the address of a stack variable through a pointer passed in by the caller, which would let the caller trivially trigger use-after-free if that stored value is still present when we finish execution. However, the way coroutines work is that after our call to qemu_coroutine_yield(), control is temporarily continued in the caller prior to our function concluding, and in order to resume our coroutine, the caller must poll until the variable has been set to NULL. Thus, we can add an assert that we do not leak stack storage to the caller on function exit. Fixes: Coverity CID 1406474 CC: Peter Maydell Signed-off-by: Eric Blake Message-Id: <20191111203524.21912-1-eblake@redhat.com> Reviewed-by: Alex Benn=C3=A9e --- util/qemu-coroutine-sleep.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/qemu-coroutine-sleep.c b/util/qemu-coroutine-sleep.c index ae91b92b6e78..769a76e57df0 100644 --- a/util/qemu-coroutine-sleep.c +++ b/util/qemu-coroutine-sleep.c @@ -68,5 +68,12 @@ void coroutine_fn qemu_co_sleep_ns_wakeable(QEMUClockTyp= e type, int64_t ns, } timer_mod(state.ts, qemu_clock_get_ns(type) + ns); qemu_coroutine_yield(); + if (sleep_state) { + /* + * Note that *sleep_state is cleared during qemu_co_sleep_wake + * before resuming this coroutine. + */ + assert(*sleep_state =3D=3D NULL); + } timer_free(state.ts); } --=20 2.21.0 From nobody Mon May 6 12:55:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1574133111; cv=none; d=zoho.com; s=zohoarc; b=SB6XSCiEfNisbdxS+jbpY002Gq5te/QjJGFLobRrTXv4ffnBjbOxoby057/eckmdvNw4omeiyLx2Vz1qDQ2dNwkvl5P0L/ZcTviNIn+iFoJVobNFpBLvGrKiLFQMeKoIq7uFS21/2IaLIZ4fBLFrxMzjY+WWZkezIGasakEgGw4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574133111; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=k6TjX/L+saoePk/7FJ7wZ4ec27XNv3l1AI8xcJt9k9w=; b=h5TDDahKWJmLExxIpFG3fZyZJN9qu1Iu0DjyeiLKojz3gjY4PxQydezQCfADcHG5PYPqVq4oyOfacuULu8iv+uxaKeiDr1N5usBdf1sMGulnXhgvrEH6vVGOy/+Qcyt2dkyqQrFdaZpYmW9qtKp840d03YITh4Ag+yc10y/6Bm4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1574133111743741.3688035096159; Mon, 18 Nov 2019 19:11:51 -0800 (PST) Received: from localhost ([::1]:41280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWtvi-0006D1-F3 for importer@patchew.org; Mon, 18 Nov 2019 22:11:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42708) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWtsF-0001sL-C7 for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iWtsD-0004fF-ED for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:15 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:58666 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iWtsD-0004e4-AQ for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:13 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-432-_zrnzMuHNriAMQzd4RPHSw-1; Mon, 18 Nov 2019 22:08:08 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 70153802682; Tue, 19 Nov 2019 03:08:07 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-221.phx2.redhat.com [10.3.116.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id E0A9560565; Tue, 19 Nov 2019 03:08:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574132891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k6TjX/L+saoePk/7FJ7wZ4ec27XNv3l1AI8xcJt9k9w=; b=RkjOxS9j3LVWo10j/EVyrHDRL/GAk9zv5WAqwgQE4huwKBXSl17LrCX7fvfj6mXRbCmXMF Iq1JlAr0l8vF7Kp7XHEuY9sMHKZD6w+4W84O0IIYasWLwz8crHGAfo4uJzxmXrcQ1EyGM2 4wLlbQoyBqCdf55+yBq6DbW040Okazk= From: Eric Blake To: qemu-devel@nongnu.org Subject: [PULL 03/10] nbd/server: Prefer heap over stack for parsing client names Date: Mon, 18 Nov 2019 21:07:52 -0600 Message-Id: <20191119030759.24907-4-eblake@redhat.com> In-Reply-To: <20191119030759.24907-1-eblake@redhat.com> References: <20191119030759.24907-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: _zrnzMuHNriAMQzd4RPHSw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Vladimir Sementsov-Ogievskiy , Max Reitz , "open list:Network Block Dev..." , Maxim Levitsky Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" As long as we limit NBD names to 256 bytes (the bare minimum permitted by the standard), stack-allocation works for parsing a name received from the client. But as mentioned in a comment, we eventually want to permit up to the 4k maximum of the NBD standard, which is too large for stack allocation; so switch everything in the server to use heap allocation. For now, there is no change in actually supported name length. Signed-off-by: Eric Blake Message-Id: <20191114024635.11363-2-eblake@redhat.com> [eblake: fix uninit variable compile failure] Reviewed-by: Maxim Levitsky Reviewed-by: Vladimir Sementsov-Ogievskiy --- include/block/nbd.h | 10 +++++----- nbd/server.c | 25 +++++++++++++++---------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/include/block/nbd.h b/include/block/nbd.h index 316fd705a9e4..c306423dc85c 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -226,11 +226,11 @@ enum { /* Maximum size of a single READ/WRITE data buffer */ #define NBD_MAX_BUFFER_SIZE (32 * 1024 * 1024) -/* Maximum size of an export name. The NBD spec requires 256 and - * suggests that servers support up to 4096, but we stick to only the - * required size so that we can stack-allocate the names, and because - * going larger would require an audit of more code to make sure we - * aren't overflowing some other buffer. */ +/* + * Maximum size of an export name. The NBD spec requires a minimum of + * 256 and recommends that servers support up to 4096; all users use + * malloc so we can bump this constant without worry. + */ #define NBD_MAX_NAME_SIZE 256 /* Two types of reply structures */ diff --git a/nbd/server.c b/nbd/server.c index d8d1e6245532..6bbeb98f8237 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -324,18 +324,20 @@ static int nbd_opt_skip(NBDClient *client, size_t siz= e, Error **errp) * uint32_t len (<=3D NBD_MAX_NAME_SIZE) * len bytes string (not 0-terminated) * - * @name should be enough to store NBD_MAX_NAME_SIZE+1. + * On success, @name will be allocated. * If @length is non-null, it will be set to the actual string length. * * Return -errno on I/O error, 0 if option was completely handled by * sending a reply about inconsistent lengths, or 1 on success. */ -static int nbd_opt_read_name(NBDClient *client, char *name, uint32_t *leng= th, +static int nbd_opt_read_name(NBDClient *client, char **name, uint32_t *len= gth, Error **errp) { int ret; uint32_t len; + g_autofree char *local_name =3D NULL; + *name =3D NULL; ret =3D nbd_opt_read(client, &len, sizeof(len), errp); if (ret <=3D 0) { return ret; @@ -347,15 +349,17 @@ static int nbd_opt_read_name(NBDClient *client, char = *name, uint32_t *length, "Invalid name length: %" PRIu32, len); } - ret =3D nbd_opt_read(client, name, len, errp); + local_name =3D g_malloc(len + 1); + ret =3D nbd_opt_read(client, local_name, len, errp); if (ret <=3D 0) { return ret; } - name[len] =3D '\0'; + local_name[len] =3D '\0'; if (length) { *length =3D len; } + *name =3D g_steal_pointer(&local_name); return 1; } @@ -427,7 +431,7 @@ static void nbd_check_meta_export(NBDClient *client) static int nbd_negotiate_handle_export_name(NBDClient *client, bool no_zer= oes, Error **errp) { - char name[NBD_MAX_NAME_SIZE + 1]; + g_autofree char *name =3D NULL; char buf[NBD_REPLY_EXPORT_NAME_SIZE] =3D ""; size_t len; int ret; @@ -441,10 +445,11 @@ static int nbd_negotiate_handle_export_name(NBDClient= *client, bool no_zeroes, [10 .. 133] reserved (0) [unless no_zeroes] */ trace_nbd_negotiate_handle_export_name(); - if (client->optlen >=3D sizeof(name)) { + if (client->optlen > NBD_MAX_NAME_SIZE) { error_setg(errp, "Bad length received"); return -EINVAL; } + name =3D g_malloc(client->optlen + 1); if (nbd_read(client->ioc, name, client->optlen, "export name", errp) <= 0) { return -EIO; } @@ -533,7 +538,7 @@ static int nbd_reject_length(NBDClient *client, bool fa= tal, Error **errp) static int nbd_negotiate_handle_info(NBDClient *client, Error **errp) { int rc; - char name[NBD_MAX_NAME_SIZE + 1]; + g_autofree char *name =3D NULL; NBDExport *exp; uint16_t requests; uint16_t request; @@ -551,7 +556,7 @@ static int nbd_negotiate_handle_info(NBDClient *client,= Error **errp) 2 bytes: N, number of requests (can be 0) N * 2 bytes: N requests */ - rc =3D nbd_opt_read_name(client, name, &namelen, errp); + rc =3D nbd_opt_read_name(client, &name, &namelen, errp); if (rc <=3D 0) { return rc; } @@ -957,7 +962,7 @@ static int nbd_negotiate_meta_queries(NBDClient *client, NBDExportMetaContexts *meta, Error *= *errp) { int ret; - char export_name[NBD_MAX_NAME_SIZE + 1]; + g_autofree char *export_name =3D NULL; NBDExportMetaContexts local_meta; uint32_t nb_queries; int i; @@ -976,7 +981,7 @@ static int nbd_negotiate_meta_queries(NBDClient *client, memset(meta, 0, sizeof(*meta)); - ret =3D nbd_opt_read_name(client, export_name, NULL, errp); + ret =3D nbd_opt_read_name(client, &export_name, NULL, errp); if (ret <=3D 0) { return ret; } --=20 2.21.0 From nobody Mon May 6 12:55:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1574133261; cv=none; d=zoho.com; s=zohoarc; b=ZaT7qtZrDmwGp1UHmrz/pVJVaWd4L/Ho0+kG5kWvbPXFp7voQaA9WiIZ56RTqEVCoDeBUWeYhpKdBQxYpicOoB6yk/pZyW5q+Z+d43g4xs/2UWWOb9Jh0KwC2EtLnhPKJw3cm4dIKbVULqfchPO4yv9ZTYJ12cttBRH3xqbHTtM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574133261; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=doBTjuSf/M1WWLitWeCjA10upKFO1WL/k5NUkXIBqSQ=; b=n33rZuTYasv/cjV2MA2BC/tk7PDGbfKFQgdr1j5IaE8Z/2l+kklZ3d0Ff1G5Eh2zF4HCcVZspluss6CpmEJ7wLN8rmjoNiMr4zrbyHDa2HfKmqIA38vMrZsNujIPegxugZVb33CUKYEWWO0T9nE57uhE4+CUhi1R/JBiGsHRUZw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1574133261573562.8370396635288; Mon, 18 Nov 2019 19:14:21 -0800 (PST) Received: from localhost ([::1]:41310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWty8-0000hV-8p for importer@patchew.org; Mon, 18 Nov 2019 22:14:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42758) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWtsH-0001so-Eb for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iWtsG-0004kP-8n for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:17 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:51275 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iWtsG-0004jm-3h for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:16 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-237-P4jrU5TlMSaEmn-hwdIUaQ-1; Mon, 18 Nov 2019 22:08:12 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0D9D1477; Tue, 19 Nov 2019 03:08:11 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-221.phx2.redhat.com [10.3.116.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC7BE60565; Tue, 19 Nov 2019 03:08:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574132895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=doBTjuSf/M1WWLitWeCjA10upKFO1WL/k5NUkXIBqSQ=; b=AS6CzNhytMdF/TJHTfjnHRFhlWETJuNatMTwMEvrWyHls3FIo+wmg5XgkwUmkuYLUp9RE7 fydxoh4Ff8S//MhF8aUx+Mk392e4g/fdsHq4waBCXgU3QimZ++qL3DFPYxVhrX0Kc7GbA7 DFP05OeYL4hZ7giKneKXj44IET9VVRs= From: Eric Blake To: qemu-devel@nongnu.org Subject: [PULL 04/10] bitmap: Enforce maximum bitmap name length Date: Mon, 18 Nov 2019 21:07:53 -0600 Message-Id: <20191119030759.24907-5-eblake@redhat.com> In-Reply-To: <20191119030759.24907-1-eblake@redhat.com> References: <20191119030759.24907-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: P4jrU5TlMSaEmn-hwdIUaQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Vladimir Sementsov-Ogievskiy , "open list:Dirty Bitmaps" , Markus Armbruster , Max Reitz , Maxim Levitsky , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We document that for qcow2 persistent bitmaps, the name cannot exceed 1023 bytes. It is inconsistent if transient bitmaps do not have to abide by the same limit, and it is unlikely that any existing client even cares about using bitmap names this long. It's time to codify that ALL bitmaps managed by qemu (whether persistent in qcow2 or not) have a documented maximum length. Signed-off-by: Eric Blake Message-Id: <20191114024635.11363-3-eblake@redhat.com> Reviewed-by: Maxim Levitsky Reviewed-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 2 +- include/block/dirty-bitmap.h | 2 ++ block/dirty-bitmap.c | 12 +++++++++--- block/qcow2-bitmap.c | 2 ++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index aa97ee264112..0cf68fea1450 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -2042,7 +2042,7 @@ # # @node: name of device/node which the bitmap is tracking # -# @name: name of the dirty bitmap +# @name: name of the dirty bitmap (must be less than 1024 bytes) # # @granularity: the bitmap granularity, default is 64k for # block-dirty-bitmap-add diff --git a/include/block/dirty-bitmap.h b/include/block/dirty-bitmap.h index 958e7474fb51..e2b20ecab9a3 100644 --- a/include/block/dirty-bitmap.h +++ b/include/block/dirty-bitmap.h @@ -14,6 +14,8 @@ typedef enum BitmapCheckFlags { BDRV_BITMAP_INCONSISTENT) #define BDRV_BITMAP_ALLOW_RO (BDRV_BITMAP_BUSY | BDRV_BITMAP_INCONSISTENT) +#define BDRV_BITMAP_MAX_NAME_SIZE 1023 + BdrvDirtyBitmap *bdrv_create_dirty_bitmap(BlockDriverState *bs, uint32_t granularity, const char *name, diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index 4bbb251b2c9c..7039e8252009 100644 --- a/block/dirty-bitmap.c +++ b/block/dirty-bitmap.c @@ -104,9 +104,15 @@ BdrvDirtyBitmap *bdrv_create_dirty_bitmap(BlockDriverS= tate *bs, assert(is_power_of_2(granularity) && granularity >=3D BDRV_SECTOR_SIZE= ); - if (name && bdrv_find_dirty_bitmap(bs, name)) { - error_setg(errp, "Bitmap already exists: %s", name); - return NULL; + if (name) { + if (bdrv_find_dirty_bitmap(bs, name)) { + error_setg(errp, "Bitmap already exists: %s", name); + return NULL; + } + if (strlen(name) > BDRV_BITMAP_MAX_NAME_SIZE) { + error_setg(errp, "Bitmap name too long: %s", name); + return NULL; + } } bitmap_size =3D bdrv_getlength(bs); if (bitmap_size < 0) { diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c index ef9ef628a0d0..809bbc5d20c8 100644 --- a/block/qcow2-bitmap.c +++ b/block/qcow2-bitmap.c @@ -42,6 +42,8 @@ #define BME_MIN_GRANULARITY_BITS 9 #define BME_MAX_NAME_SIZE 1023 +QEMU_BUILD_BUG_ON(BME_MAX_NAME_SIZE !=3D BDRV_BITMAP_MAX_NAME_SIZE); + #if BME_MAX_TABLE_SIZE * 8ULL > INT_MAX #error In the code bitmap table physical size assumed to fit into int #endif --=20 2.21.0 From nobody Mon May 6 12:55:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1574133047; cv=none; d=zoho.com; s=zohoarc; b=EAQR3hso8TN/K+hlm0gwBHDfbmUKIVja1BHbensUXAlmHYQ13IgqFaD33yjgTEiVI/1AriVb6/G3BgLvEu+jEy8ChnjNkSlYlk9Xmft7TdmXlLwrwsiGSeDDz86Rbt6sXEGuVb+z8q3cH5wbN2HtSakq+dyzqC7lxi223hqBM6U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574133047; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3vkggM0AK/j9YNOIYCu4VAnSxct234IkL8KRBv3z/kI=; b=aC6KiqbC4RLZGREYTfZAeD2sYaOxUFte7Gt4YYZEp8NAV1ansXfJ3KE7yOpWIIhPoQ0hsI32nBqAl3BRbO14wj4tU4pHod1rWvZiyIhMMkjiJslkcC0K5extXkesF1IpPHjYISxTostt4DBqSjmu3B0EbxFTgtagHBwV5quP4hs= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1574133047981729.4441375734621; Mon, 18 Nov 2019 19:10:47 -0800 (PST) Received: from localhost ([::1]:41258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWtug-0004UY-HT for importer@patchew.org; Mon, 18 Nov 2019 22:10:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42769) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWtsH-0001t2-PK for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iWtsF-0004jE-MW for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:17 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:47791 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iWtsF-0004hY-Gj for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:15 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-335-8hJNiWWtOg27QGPlcxjMhg-1; Mon, 18 Nov 2019 22:08:13 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id CDC5D1005500; Tue, 19 Nov 2019 03:08:11 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-221.phx2.redhat.com [10.3.116.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B5F460565; Tue, 19 Nov 2019 03:08:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574132894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3vkggM0AK/j9YNOIYCu4VAnSxct234IkL8KRBv3z/kI=; b=hNwEqSRG9FQXUQrXoZFfnjMQcSnPuEjHvyeRx0b4zT5arBY1ZAJ+caYcBno4JITKJxWEmv FaY25LCRhgS0quYz/jELJ1PDGpQKHT01yAc3CZklXQsyqqQfE1jbYUXcOBCVEG2qTp2gA6 Bck7csOSG6n1ejnADdvwco0u72VFjM8= From: Eric Blake To: qemu-devel@nongnu.org Subject: [PULL 05/10] nbd: Don't send oversize strings Date: Mon, 18 Nov 2019 21:07:54 -0600 Message-Id: <20191119030759.24907-6-eblake@redhat.com> In-Reply-To: <20191119030759.24907-1-eblake@redhat.com> References: <20191119030759.24907-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: 8hJNiWWtOg27QGPlcxjMhg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Vladimir Sementsov-Ogievskiy , Max Reitz , "open list:Network Block Dev..." , Maxim Levitsky Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Qemu as server currently won't accept export names larger than 256 bytes, nor create dirty bitmap names longer than 1023 bytes, so most uses of qemu as client or server have no reason to get anywhere near the NBD spec maximum of a 4k limit per string. However, we weren't actually enforcing things, ignoring when the remote side violates the protocol on input, and also having several code paths where we send oversize strings on output (for example, qemu-nbd --description could easily send more than 4k). Tighten things up as follows: client: - Perform bounds check on export name and dirty bitmap request prior to handing it to server - Validate that copied server replies are not too long (ignoring NBD_INFO_* replies that are not copied is not too bad) server: - Perform bounds check on export name and description prior to advertising it to client - Reject client name or metadata query that is too long - Adjust things to allow full 4k name limit rather than previous 256 byte limit Signed-off-by: Eric Blake Message-Id: <20191114024635.11363-4-eblake@redhat.com> Reviewed-by: Maxim Levitsky Reviewed-by: Vladimir Sementsov-Ogievskiy --- include/block/nbd.h | 8 ++++---- block/nbd.c | 10 ++++++++++ blockdev-nbd.c | 5 +++++ nbd/client.c | 18 +++++++++++++++--- nbd/server.c | 20 +++++++++++++++----- qemu-nbd.c | 9 +++++++++ 6 files changed, 58 insertions(+), 12 deletions(-) diff --git a/include/block/nbd.h b/include/block/nbd.h index c306423dc85c..7f46932d80f1 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -227,11 +227,11 @@ enum { #define NBD_MAX_BUFFER_SIZE (32 * 1024 * 1024) /* - * Maximum size of an export name. The NBD spec requires a minimum of - * 256 and recommends that servers support up to 4096; all users use - * malloc so we can bump this constant without worry. + * Maximum size of a protocol string (export name, meta context name, + * etc.). Use malloc rather than stack allocation for storage of a + * string. */ -#define NBD_MAX_NAME_SIZE 256 +#define NBD_MAX_STRING_SIZE 4096 /* Two types of reply structures */ #define NBD_SIMPLE_REPLY_MAGIC 0x67446698 diff --git a/block/nbd.c b/block/nbd.c index 123976171cf4..5f18f78a9471 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -1832,6 +1832,10 @@ static int nbd_process_options(BlockDriverState *bs,= QDict *options, } s->export =3D g_strdup(qemu_opt_get(opts, "export")); + if (s->export && strlen(s->export) > NBD_MAX_STRING_SIZE) { + error_setg(errp, "export name too long to send to server"); + goto error; + } s->tlscredsid =3D g_strdup(qemu_opt_get(opts, "tls-creds")); if (s->tlscredsid) { @@ -1849,6 +1853,11 @@ static int nbd_process_options(BlockDriverState *bs,= QDict *options, } s->x_dirty_bitmap =3D g_strdup(qemu_opt_get(opts, "x-dirty-bitmap")); + if (s->x_dirty_bitmap && strlen(s->x_dirty_bitmap) > NBD_MAX_STRING_SI= ZE) { + error_setg(errp, "x-dirty-bitmap query too long to send to server"= ); + goto error; + } + s->reconnect_delay =3D qemu_opt_get_number(opts, "reconnect-delay", 0); ret =3D 0; @@ -1859,6 +1868,7 @@ static int nbd_process_options(BlockDriverState *bs, = QDict *options, qapi_free_SocketAddress(s->saddr); g_free(s->export); g_free(s->tlscredsid); + g_free(s->x_dirty_bitmap); } qemu_opts_del(opts); return ret; diff --git a/blockdev-nbd.c b/blockdev-nbd.c index 6a8b206e1d74..8c20baa4a4b9 100644 --- a/blockdev-nbd.c +++ b/blockdev-nbd.c @@ -162,6 +162,11 @@ void qmp_nbd_server_add(const char *device, bool has_n= ame, const char *name, name =3D device; } + if (strlen(name) > NBD_MAX_STRING_SIZE) { + error_setg(errp, "export name '%s' too long", name); + return; + } + if (nbd_export_find(name)) { error_setg(errp, "NBD server already has export named '%s'", name); return; diff --git a/nbd/client.c b/nbd/client.c index f6733962b49b..ba173108baab 100644 --- a/nbd/client.c +++ b/nbd/client.c @@ -289,8 +289,8 @@ static int nbd_receive_list(QIOChannel *ioc, char **nam= e, char **description, return -1; } len -=3D sizeof(namelen); - if (len < namelen) { - error_setg(errp, "incorrect option name length"); + if (len < namelen || namelen > NBD_MAX_STRING_SIZE) { + error_setg(errp, "incorrect name length in server's list response"= ); nbd_send_opt_abort(ioc); return -1; } @@ -303,6 +303,12 @@ static int nbd_receive_list(QIOChannel *ioc, char **na= me, char **description, local_name[namelen] =3D '\0'; len -=3D namelen; if (len) { + if (len > NBD_MAX_STRING_SIZE) { + error_setg(errp, "incorrect description length in server's " + "list response"); + nbd_send_opt_abort(ioc); + return -1; + } local_desc =3D g_malloc(len + 1); if (nbd_read(ioc, local_desc, len, "export description", errp) < 0= ) { nbd_send_opt_abort(ioc); @@ -479,6 +485,10 @@ static int nbd_opt_info_or_go(QIOChannel *ioc, uint32_= t opt, break; default: + /* + * Not worth the bother to check if NBD_INFO_NAME or + * NBD_INFO_DESCRIPTION exceed NBD_MAX_STRING_SIZE. + */ trace_nbd_opt_info_unknown(type, nbd_info_lookup(type)); if (nbd_drop(ioc, len, errp) < 0) { error_prepend(errp, "Failed to read info payload: "); @@ -645,9 +655,11 @@ static int nbd_send_meta_query(QIOChannel *ioc, uint32= _t opt, char *p; data_len =3D sizeof(export_len) + export_len + sizeof(queries); + assert(export_len <=3D NBD_MAX_STRING_SIZE); if (query) { query_len =3D strlen(query); data_len +=3D sizeof(query_len) + query_len; + assert(query_len <=3D NBD_MAX_STRING_SIZE); } else { assert(opt =3D=3D NBD_OPT_LIST_META_CONTEXT); } @@ -1009,7 +1021,7 @@ int nbd_receive_negotiate(AioContext *aio_context, QI= OChannel *ioc, bool zeroes; bool base_allocation =3D info->base_allocation; - assert(info->name); + assert(info->name && strlen(info->name) <=3D NBD_MAX_STRING_SIZE); trace_nbd_receive_negotiate_name(info->name); result =3D nbd_start_negotiate(aio_context, ioc, tlscreds, hostname, o= utioc, diff --git a/nbd/server.c b/nbd/server.c index 6bbeb98f8237..24ebc1a80571 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -321,7 +321,7 @@ static int nbd_opt_skip(NBDClient *client, size_t size,= Error **errp) /* nbd_opt_read_name * * Read a string with the format: - * uint32_t len (<=3D NBD_MAX_NAME_SIZE) + * uint32_t len (<=3D NBD_MAX_STRING_SIZE) * len bytes string (not 0-terminated) * * On success, @name will be allocated. @@ -344,7 +344,7 @@ static int nbd_opt_read_name(NBDClient *client, char **= name, uint32_t *length, } len =3D cpu_to_be32(len); - if (len > NBD_MAX_NAME_SIZE) { + if (len > NBD_MAX_STRING_SIZE) { return nbd_opt_invalid(client, errp, "Invalid name length: %" PRIu32, len); } @@ -379,6 +379,7 @@ static int nbd_negotiate_send_rep_list(NBDClient *clien= t, NBDExport *exp, trace_nbd_negotiate_send_rep_list(name, desc); name_len =3D strlen(name); desc_len =3D strlen(desc); + assert(name_len <=3D NBD_MAX_STRING_SIZE && desc_len <=3D NBD_MAX_STRI= NG_SIZE); len =3D name_len + desc_len + sizeof(len); ret =3D nbd_negotiate_send_rep_len(client, NBD_REP_SERVER, len, errp); if (ret < 0) { @@ -445,7 +446,7 @@ static int nbd_negotiate_handle_export_name(NBDClient *= client, bool no_zeroes, [10 .. 133] reserved (0) [unless no_zeroes] */ trace_nbd_negotiate_handle_export_name(); - if (client->optlen > NBD_MAX_NAME_SIZE) { + if (client->optlen > NBD_MAX_STRING_SIZE) { error_setg(errp, "Bad length received"); return -EINVAL; } @@ -613,6 +614,7 @@ static int nbd_negotiate_handle_info(NBDClient *client,= Error **errp) if (exp->description) { size_t len =3D strlen(exp->description); + assert(len <=3D NBD_MAX_STRING_SIZE); rc =3D nbd_negotiate_send_info(client, NBD_INFO_DESCRIPTION, len, exp->description, errp); if (rc < 0) { @@ -757,6 +759,7 @@ static int nbd_negotiate_send_meta_context(NBDClient *c= lient, {.iov_base =3D (void *)context, .iov_len =3D strlen(context)} }; + assert(iov[1].iov_len <=3D NBD_MAX_STRING_SIZE); if (client->opt =3D=3D NBD_OPT_LIST_META_CONTEXT) { context_id =3D 0; } @@ -905,7 +908,7 @@ static int nbd_meta_qemu_query(NBDClient *client, NBDEx= portMetaContexts *meta, * Parse namespace name and call corresponding function to parse body of t= he * query. * - * The only supported namespace now is 'base'. + * The only supported namespaces are 'base' and 'qemu'. * * The function aims not wasting time and memory to read long unknown name= space * names. @@ -931,6 +934,10 @@ static int nbd_negotiate_meta_query(NBDClient *client, } len =3D cpu_to_be32(len); + if (len > NBD_MAX_STRING_SIZE) { + trace_nbd_negotiate_meta_query_skip("length too long"); + return nbd_opt_skip(client, len, errp); + } if (len < ns_len) { trace_nbd_negotiate_meta_query_skip("length too short"); return nbd_opt_skip(client, len, errp); @@ -1492,7 +1499,7 @@ NBDExport *nbd_export_new(BlockDriverState *bs, uint6= 4_t dev_offset, * access since the export could be available before migration handove= r. * ctx was acquired in the caller. */ - assert(name); + assert(name && strlen(name) <=3D NBD_MAX_STRING_SIZE); ctx =3D bdrv_get_aio_context(bs); bdrv_invalidate_cache(bs, NULL); @@ -1518,6 +1525,7 @@ NBDExport *nbd_export_new(BlockDriverState *bs, uint6= 4_t dev_offset, assert(dev_offset <=3D INT64_MAX); exp->dev_offset =3D dev_offset; exp->name =3D g_strdup(name); + assert(!desc || strlen(desc) <=3D NBD_MAX_STRING_SIZE); exp->description =3D g_strdup(desc); exp->nbdflags =3D (NBD_FLAG_HAS_FLAGS | NBD_FLAG_SEND_FLUSH | NBD_FLAG_SEND_FUA | NBD_FLAG_SEND_CACHE); @@ -1564,8 +1572,10 @@ NBDExport *nbd_export_new(BlockDriverState *bs, uint= 64_t dev_offset, bdrv_dirty_bitmap_set_busy(bm, true); exp->export_bitmap =3D bm; + assert(strlen(bitmap) <=3D BDRV_BITMAP_MAX_NAME_SIZE); exp->export_bitmap_context =3D g_strdup_printf("qemu:dirty-bitmap:= %s", bitmap); + assert(strlen(exp->export_bitmap_context) < NBD_MAX_STRING_SIZE); } exp->close =3D close; diff --git a/qemu-nbd.c b/qemu-nbd.c index caacf0ed7379..108a51f7eb01 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -833,9 +833,18 @@ int main(int argc, char **argv) break; case 'x': export_name =3D optarg; + if (strlen(export_name) > NBD_MAX_STRING_SIZE) { + error_report("export name '%s' too long", export_name); + exit(EXIT_FAILURE); + } break; case 'D': export_description =3D optarg; + if (strlen(export_description) > NBD_MAX_STRING_SIZE) { + error_report("export description '%s' too long", + export_description); + exit(EXIT_FAILURE); + } break; case 'v': verbose =3D 1; --=20 2.21.0 From nobody Mon May 6 12:55:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1574133399; cv=none; d=zoho.com; s=zohoarc; b=AzRS0bNGAFW2CH/wSvGD+FabbMObtfoTiZ6sMirLwjNtDQW5uI/ekVkLUnyRi+65Sk4XjkwLafefIRVG+DrmrLR33M9Cmq79p0zdVwfxhxpqpAECyazTErRBbSEQeKwx13m1+ufErw1KqwForob0JIEVWhOONX4gOci9/1b+sUQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574133399; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nfIoFOf/0kvgP0rGEl7KBvgxBIHoXfQ0xlCxSK6ElbU=; b=c7ww5EA5/u9AA6FlFp1KjOtHLhowPdVM9rQk0x++kvb14lRmRS/aRSzGHu6ojLaZvomMc/xT5zPsMRUgOJ7RmMiNifPB5rm3NgawIxI9aYbkL74GKwBK2jUd+GiP8tNNODdTHiegZ1pu/8UhhfT9X8YGn5347yQBWx7eBQkBMO8= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1574133399813214.4594053022057; Mon, 18 Nov 2019 19:16:39 -0800 (PST) Received: from localhost ([::1]:41336 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWu0M-0003bB-LQ for importer@patchew.org; Mon, 18 Nov 2019 22:16:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42757) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWtsH-0001sm-E0 for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iWtsG-0004kV-8r for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:17 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:39346 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iWtsG-0004jJ-4W for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:16 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-354-waqXY2_yPWu94T4iruaucA-1; Mon, 18 Nov 2019 22:08:13 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 625F01005502; Tue, 19 Nov 2019 03:08:12 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-221.phx2.redhat.com [10.3.116.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1140E60565; Tue, 19 Nov 2019 03:08:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574132895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nfIoFOf/0kvgP0rGEl7KBvgxBIHoXfQ0xlCxSK6ElbU=; b=QifE2GN3D7BMTNnXcBhxqIkHUNqEH9y1DJU+WIDqvunT9XzTTwJyurajfIIL59t3qgjpV9 7lElitVNF0q+Ryb/BcMeKf1Z/hX/LXzM0LeEj1jn1fdetrJ2WZMpT2HOY/xaV+zVGFpXcO ozVhupFqKEsMpWrtYveU53n24s1eOIc= From: Eric Blake To: qemu-devel@nongnu.org Subject: [PULL 06/10] MAINTAINERS: add more bitmap-related to Dirty Bitmaps section Date: Mon, 18 Nov 2019 21:07:55 -0600 Message-Id: <20191119030759.24907-7-eblake@redhat.com> In-Reply-To: <20191119030759.24907-1-eblake@redhat.com> References: <20191119030759.24907-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: waqXY2_yPWu94T4iruaucA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Sementsov-Ogievskiy , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Let's add bitmaps persistence qcow2 feature and postcopy bitmaps migration to Dirty Bitmaps section. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20191026165655.14112-1-vsementsov@virtuozzo.com> Reviewed-by: John Snow Signed-off-by: Eric Blake --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ff8d0d29f4b6..dfb7932608d5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1869,6 +1869,8 @@ F: util/hbitmap.c F: block/dirty-bitmap.c F: include/qemu/hbitmap.h F: include/block/dirty-bitmap.h +F: qcow2-bitmap.c +F: migration/block-dirty-bitmap.c F: tests/test-hbitmap.c F: docs/interop/bitmaps.rst T: git https://github.com/jnsnow/qemu.git bitmaps --=20 2.21.0 From nobody Mon May 6 12:55:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1574133267; cv=none; d=zoho.com; s=zohoarc; b=VqB65sr5sXtjKsTY3HDwAHTl+AaWK+tz03+B5v1KEvnOVBBgqRRmoTVf0gusXmJv8EBYqVo2cbwg4A2iDoTr5yxKkK23/KeD1SJHuJ75ERKV7FRrKd453bSlQs4lb8Ze9RZ7L9MHjOx6IJI/ojlzHbaylauegWtkjcTUhTcQ9rA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574133267; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1sMogfW6oNSS6+OquqWXNrhtHWsI3J23eaamEA7qgMs=; b=cjgH6yWoTXB1lhtXYA8MkwvR1rjWxmxKzDvyW5bwYYblK/ti0FPd1pF/oSDhWvOn8xxTwCwj8xcvyOxVC2xFg1TZAL/+n0OGgycgLQCmTlryVAl0cJgBcQJoyakMcEVKx7eQvRZvagFZWde7d1pa1NxUYF6ZQ1/kM2rq2kZrx2Y= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1574133267369674.9572048855291; Mon, 18 Nov 2019 19:14:27 -0800 (PST) Received: from localhost ([::1]:41314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWtyE-0000sD-01 for importer@patchew.org; Mon, 18 Nov 2019 22:14:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42852) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWtsK-0001z4-W9 for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iWtsI-0004p1-UP for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:20 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:57561 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iWtsI-0004oD-QD for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:18 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-131-WyohkPpzNqeMXMeAfkm7Ew-1; Mon, 18 Nov 2019 22:08:14 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 08FD11005509; Tue, 19 Nov 2019 03:08:13 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-221.phx2.redhat.com [10.3.116.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9CF3860565; Tue, 19 Nov 2019 03:08:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574132898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1sMogfW6oNSS6+OquqWXNrhtHWsI3J23eaamEA7qgMs=; b=drRNcQev0439OigmRyhCbpBe4qVbOCSBUmNBZOF1bFD81DwnyQ7BoAR460mb1WM7QoJ/xt ZfdEEXj7ubPdOta0Ajo7aY7jtcTyBq+GbuOVgF6UPMMnl6NlqOSb4oADh9FqS5ftjeBNLE O2hLqouJYF4+reSXEQYPwvKxxNb6xEw= From: Eric Blake To: qemu-devel@nongnu.org Subject: [PULL 07/10] iotests: Fix 173 Date: Mon, 18 Nov 2019 21:07:56 -0600 Message-Id: <20191119030759.24907-8-eblake@redhat.com> In-Reply-To: <20191119030759.24907-1-eblake@redhat.com> References: <20191119030759.24907-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: WyohkPpzNqeMXMeAfkm7Ew-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , "open list:Block layer core" , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This test has been broken since 3.0. It used TEST_IMG to influence the name of a file created during _make_test_img, but commit 655ae6bb changed things so that the wrong file name is being created, which then caused _launch_qemu to fail. In the meantime, the set of events issued for the actions of the test has increased. Why haven't we noticed the failure? Because the test rarely gets run: './check -qcow2 173' is insufficient (that defaults to using file protocol) './check -nfs 173' is insufficient (that defaults to using raw format) so the test is only run with: ./check -qcow2 -nfs 173 Note that we already have a number of other problems with -nfs: ./check -nfs (fails 18/30) ./check -qcow2 -nfs (fails 45/76 after this patch, if exports does not permit 'insecure') and it's not on my priority list to fix those. Rather, I found this because of my next patch's work on tests using _send_qemu_cmd. Fixes: 655ae6b Signed-off-by: Eric Blake Reviewed-by: Max Reitz Message-Id: <20191114213415.23499-2-eblake@redhat.com> --- tests/qemu-iotests/173 | 4 ++-- tests/qemu-iotests/173.out | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/173 b/tests/qemu-iotests/173 index 9e2fa2e73cb9..29dcaa1960df 100755 --- a/tests/qemu-iotests/173 +++ b/tests/qemu-iotests/173 @@ -47,9 +47,9 @@ size=3D100M BASE_IMG=3D"${TEST_DIR}/image.base" TOP_IMG=3D"${TEST_DIR}/image.snp1" -TEST_IMG=3D"${BASE_IMG}" _make_test_img $size +TEST_IMG_FILE=3D"${BASE_IMG}" _make_test_img $size -TEST_IMG=3D"${TOP_IMG}" _make_test_img $size +TEST_IMG_FILE=3D"${TOP_IMG}" _make_test_img $size echo echo =3D=3D=3D Running QEMU, using block-stream to find backing image =3D= =3D=3D diff --git a/tests/qemu-iotests/173.out b/tests/qemu-iotests/173.out index f477a0099a32..e83d17ec2f64 100644 --- a/tests/qemu-iotests/173.out +++ b/tests/qemu-iotests/173.out @@ -7,6 +7,10 @@ Formatting 'TEST_DIR/image.snp1', fmt=3DIMGFMT size=3D1048= 57600 {"return": {}} {"return": {}} {"return": {}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "disk2"}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "disk2"}} {"return": {}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "disk2", "len": 104857600, "off= set": 104857600, "speed": 0, "type": "stream"}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "disk2"}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "pending", "id": "disk2"}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "disk2", "len": 0, "offset": 0,= "speed": 0, "type": "stream"}} *** done --=20 2.21.0 From nobody Mon May 6 12:55:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1574133405; cv=none; d=zoho.com; s=zohoarc; b=hJr/EhOd6Ra+YWeJpzYm8eeF9842bteP9tt38ghA3BRvINWaNbHZgSDBTJ+kj+ijT1t/O2sRWWO5Kc+Wue3mfh4A1iZcsGfyEZLhLA1KbNMy6seX7zZlW/4si2pfwvbNkK1RUVaPobT4EwRtHwv0kol9QZvaxSBlewK5GPhqYMo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574133405; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=I8iFHdU+8aTHXXAXwkazlFi28rTQEOwc/N1dN5I/DPo=; b=gfT3oIADu4eIHK9m0BBYQfudkHccySQfhWu460rP8AOnZV7NYejOl28V2YtKtal+WS/+EYgCdK67yBhTrChmrdSsaT2vpH1SwJymvhWd9+NgCY6ywxXxegxCepd2optquZ24bW5ypTKQYsNQeVm6LdZ3h6SIBS7vHQS8fyvcOdI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1574133405986395.0923720152565; Mon, 18 Nov 2019 19:16:45 -0800 (PST) Received: from localhost ([::1]:41338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWu0S-0003j9-Nf for importer@patchew.org; Mon, 18 Nov 2019 22:16:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42856) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWtsL-0001zX-4m for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iWtsI-0004oc-LQ for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:20 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:38657 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iWtsI-0004nr-Ge for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:18 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-141-Z4Nb_6H9PumhF2uTvPR1Tw-1; Mon, 18 Nov 2019 22:08:14 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 98D2C477; Tue, 19 Nov 2019 03:08:13 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-221.phx2.redhat.com [10.3.116.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3731F60565; Tue, 19 Nov 2019 03:08:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574132898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I8iFHdU+8aTHXXAXwkazlFi28rTQEOwc/N1dN5I/DPo=; b=VOtyCziyHDA2fV/+qHyZpMetcxlRmEC41vpdfOByzP3k2675xhYjc5JGJzIXUSwkKjbqja Vlnqz8cN7vVKYjvX4QnwNnqLu6tLN/ixPrNSXfrFhBOfwQN7kT404aNnv+yo08sHCsm7XQ d8Al34bwPi7b668bnd8DqneQawCOKXY= From: Eric Blake To: qemu-devel@nongnu.org Subject: [PULL 08/10] iotests: Switch nbd tests to use Unix rather than TCP Date: Mon, 18 Nov 2019 21:07:57 -0600 Message-Id: <20191119030759.24907-9-eblake@redhat.com> In-Reply-To: <20191119030759.24907-1-eblake@redhat.com> References: <20191119030759.24907-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: Z4Nb_6H9PumhF2uTvPR1Tw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , "open list:Block layer core" , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Up to now, all it took to cause a lot of iotest failures was to have a background process such as 'nbdkit -p 10810 null' running, because we hard-coded the TCP port. Switching to a Unix socket eliminates this contention. We still have TCP coverage in test 233, and that test is more careful to not pick a hard-coded port. Add a comment explaining where the format layer applies when using NBD as protocol (until NBD gains support for a resize extension, we only pipe raw bytes over the wire). Signed-off-by: Eric Blake Message-Id: <20191114213415.23499-3-eblake@redhat.com> [eblake: Tweak socket name per Max Reitz' review] --- tests/qemu-iotests/common.filter | 6 ++++-- tests/qemu-iotests/common.rc | 13 ++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.f= ilter index f870e00e4421..5367deea398e 100644 --- a/tests/qemu-iotests/common.filter +++ b/tests/qemu-iotests/common.filter @@ -127,7 +127,8 @@ _filter_img_create() -e "s#$TEST_DIR#TEST_DIR#g" \ -e "s#$SOCK_DIR#SOCK_DIR#g" \ -e "s#$IMGFMT#IMGFMT#g" \ - -e 's#nbd:127.0.0.1:10810#TEST_DIR/t.IMGFMT#g' \ + -e 's#nbd:127.0.0.1:[0-9]\\+#TEST_DIR/t.IMGFMT#g' \ + -e 's#nbd+unix:///\??socket=3DSOCK_DIR/nbd#TEST_DIR/t.IMGFMT#g' \ -e "s# encryption=3Doff##g" \ -e "s# cluster_size=3D[0-9]\\+##g" \ -e "s# table_size=3D[0-9]\\+##g" \ @@ -164,7 +165,8 @@ _filter_img_info() -e "s#$TEST_DIR#TEST_DIR#g" \ -e "s#$SOCK_DIR#SOCK_DIR#g" \ -e "s#$IMGFMT#IMGFMT#g" \ - -e 's#nbd://127.0.0.1:10810$#TEST_DIR/t.IMGFMT#g' \ + -e 's#nbd://127.0.0.1:[0-9]\\+$#TEST_DIR/t.IMGFMT#g' \ + -e 's#nbd+unix:///\??socket=3DSOCK_DIR/nbd#TEST_DIR/t.IMGFMT#g' \ -e 's#json.*vdisk-id.*vxhs"}}#TEST_DIR/t.IMGFMT#' \ -e "/encrypted: yes/d" \ -e "/cluster_size: [0-9]\\+/d" \ diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index fa7bae24226a..0cc8acc9edd2 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -217,7 +217,7 @@ if [ "$IMGOPTSSYNTAX" =3D "true" ]; then TEST_IMG=3D"$DRIVER,file.filename=3D$TEST_DIR/t.$IMGFMT" elif [ "$IMGPROTO" =3D "nbd" ]; then TEST_IMG_FILE=3D$TEST_DIR/t.$IMGFMT - TEST_IMG=3D"$DRIVER,file.driver=3Dnbd,file.host=3D127.0.0.1,file.p= ort=3D10810" + TEST_IMG=3D"$DRIVER,file.driver=3Dnbd,file.type=3Dunix,file.path= =3D$SOCKDIR/nbd" elif [ "$IMGPROTO" =3D "ssh" ]; then TEST_IMG_FILE=3D$TEST_DIR/t.$IMGFMT TEST_IMG=3D"$DRIVER,file.driver=3Dssh,file.host=3D127.0.0.1,file.p= ath=3D$TEST_IMG_FILE" @@ -233,7 +233,7 @@ else TEST_IMG=3D$TEST_DIR/t.$IMGFMT elif [ "$IMGPROTO" =3D "nbd" ]; then TEST_IMG_FILE=3D$TEST_DIR/t.$IMGFMT - TEST_IMG=3D"nbd:127.0.0.1:10810" + TEST_IMG=3D"nbd+unix:///?socket=3D$SOCK_DIR/nbd" elif [ "$IMGPROTO" =3D "ssh" ]; then TEST_IMG_FILE=3D$TEST_DIR/t.$IMGFMT REMOTE_TEST_DIR=3D"ssh://\\($USER@\\)\\?127.0.0.1\\(:[0-9]\\+\\)\\= ?$TEST_DIR" @@ -293,7 +293,7 @@ _stop_nbd_server() local QEMU_NBD_PID read QEMU_NBD_PID < "${QEMU_TEST_DIR}/qemu-nbd.pid" kill ${QEMU_NBD_PID} - rm -f "${QEMU_TEST_DIR}/qemu-nbd.pid" + rm -f "${QEMU_TEST_DIR}/qemu-nbd.pid" "$SOCK_DIR/nbd" fi } @@ -349,11 +349,14 @@ _make_test_img() fi ) | _filter_img_create - # Start an NBD server on the image file, which is what we'll be talkin= g to + # Start an NBD server on the image file, which is what we'll be talkin= g to. + # Once NBD gains resize support, we may also want to use -f raw at the + # server and interpret format over NBD, but for now, the format is + # interpreted at the server and raw data sent over NBD. if [ $IMGPROTO =3D "nbd" ]; then # Pass a sufficiently high number to -e that should be enough for = all # tests - eval "$QEMU_NBD -v -t -b 127.0.0.1 -p 10810 -f $IMGFMT -e 42 -x ''= $TEST_IMG_FILE >/dev/null &" + eval "$QEMU_NBD -v -t -k '$SOCK_DIR/nbd' -f $IMGFMT -e 42 -x '' $T= EST_IMG_FILE >/dev/null &" sleep 1 # FIXME: qemu-nbd needs to be listening before we continue fi --=20 2.21.0 From nobody Mon May 6 12:55:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1574133503; cv=none; d=zoho.com; s=zohoarc; b=PGLPcoQFSvPyAw7y5irZ1akvRz6EaZcOvkzRIS3CYUcnAqCmK9lGL9ImTNgoKyNxouJSplBqQQfAzue1jlRbKmCnIGsbgfoLDVpTbVQAa3byJIk/9FbheannRtBkaXtXrvlpM/XJ796KAIG9sDgNxBNtC0Fmq49NkTiMH+lom+Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574133503; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AIH6JxCAKb0IeM3U+p4Z9zTJk9uNIkdsv4zT6IjEftU=; b=OmcCkK5EjesPKiWLTqaESVuV5AjQLPcHHQKQq4GjrDrd73wCH1vSOtLE946Ds037kSMNoZj99UP017Yj2bPn2RhnkYCsmf99YPXc6wSxjGo3r2w8Pm071U4zFFsEIEGNDODyv5ULjBZVNukUvSEWoR+aSkIyJNT2t3GMZGB5oug= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1574133503746625.3855581878718; Mon, 18 Nov 2019 19:18:23 -0800 (PST) Received: from localhost ([::1]:41354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWu21-0005VU-90 for importer@patchew.org; Mon, 18 Nov 2019 22:18:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42894) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWtsU-0002Ej-I6 for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iWtsL-0004qh-AQ for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:30 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:46919 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iWtsK-0004ph-Il for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:20 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-367-9HwMJmJwOS2uBwF4T4hYww-1; Mon, 18 Nov 2019 22:08:15 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id CCAD9107ACC4; Tue, 19 Nov 2019 03:08:14 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-221.phx2.redhat.com [10.3.116.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18B9E87B1; Tue, 19 Nov 2019 03:08:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574132899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AIH6JxCAKb0IeM3U+p4Z9zTJk9uNIkdsv4zT6IjEftU=; b=OomJC6gP5AHJVgW+2OlPZv8NU3W16hIU5SWSvzzI9Sg8Mp784hg+Taq4lBFvS9305B+Y0L xxDWCkj1GwzUjK84q/AzATVVIrrdOSLD1yFr7v4fdZKQh3pDTIGUrfTwbGHwJVLnfAkamx wTusX8fiq5trBHQqPfyFjFgZtt1a5HU= From: Eric Blake To: qemu-devel@nongnu.org Subject: [PULL 09/10] iotests: Include QMP input in .out files Date: Mon, 18 Nov 2019 21:07:58 -0600 Message-Id: <20191119030759.24907-10-eblake@redhat.com> In-Reply-To: <20191119030759.24907-1-eblake@redhat.com> References: <20191119030759.24907-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: 9HwMJmJwOS2uBwF4T4hYww-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , "open list:Block layer core" , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We generally include relevant HMP input in .out files, by virtue of the fact that HMP echoes its input. But QMP does not, so we have to explicitly inject it in the output stream (appropriately filtered to keep the tests passing), in order to make it easier to read .out files to see what behavior is being tested (especially true where the output file is a sequence of {'return': {}}). Suggested-by: Max Reitz Signed-off-by: Eric Blake Message-Id: <20191114213415.23499-4-eblake@redhat.com> Reviewed-by: Max Reitz --- tests/qemu-iotests/common.qemu | 9 ++++ tests/qemu-iotests/085.out | 26 ++++++++++ tests/qemu-iotests/094.out | 4 ++ tests/qemu-iotests/095.out | 2 + tests/qemu-iotests/109.out | 88 ++++++++++++++++++++++++++++++++++ tests/qemu-iotests/117.out | 5 ++ tests/qemu-iotests/127.out | 4 ++ tests/qemu-iotests/140.out | 5 ++ tests/qemu-iotests/141.out | 26 ++++++++++ tests/qemu-iotests/143.out | 3 ++ tests/qemu-iotests/144.out | 5 ++ tests/qemu-iotests/153.out | 11 +++++ tests/qemu-iotests/156.out | 11 +++++ tests/qemu-iotests/161.out | 8 ++++ tests/qemu-iotests/173.out | 4 ++ tests/qemu-iotests/182.out | 8 ++++ tests/qemu-iotests/183.out | 11 +++++ tests/qemu-iotests/185.out | 18 +++++++ tests/qemu-iotests/191.out | 8 ++++ tests/qemu-iotests/200.out | 1 + tests/qemu-iotests/223.out | 19 ++++++++ tests/qemu-iotests/229.out | 3 ++ tests/qemu-iotests/249.out | 6 +++ 23 files changed, 285 insertions(+) diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu index 8d2021a7eb0c..de680cf1c7c9 100644 --- a/tests/qemu-iotests/common.qemu +++ b/tests/qemu-iotests/common.qemu @@ -123,6 +123,9 @@ _timed_wait_for() # until either timeout, or a response. If it is not set, or <=3D0, # then the command is only sent once. # +# If neither $silent nor $mismatch_only is set, and $cmd begins with '{', +# echo the command before sending it the first time. +# # If $qemu_error_no_exit is set, then even if the expected response # is not seen, we will not exit. $QEMU_STATUS[$1] will be set it -1 in # that case. @@ -152,6 +155,12 @@ _send_qemu_cmd() shift $(($# - 2)) fi + # Display QMP being sent, but not HMP (since HMP already echoes its + # input back to output); decide based on leading '{' + if [ -z "$silent" ] && [ -z "$mismatch_only" ] && + [ "$cmd" !=3D "${cmd#\{}" ]; then + echo "${cmd}" | _filter_testdir | _filter_imgfmt + fi while [ ${count} -gt 0 ] do echo "${cmd}" >&${QEMU_IN[${h}]} diff --git a/tests/qemu-iotests/085.out b/tests/qemu-iotests/085.out index 2a5f256cd3ec..bb50227b8265 100644 --- a/tests/qemu-iotests/085.out +++ b/tests/qemu-iotests/085.out @@ -7,48 +7,61 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D13421= 7728 =3D=3D=3D Sending capabilities =3D=3D=3D +{ 'execute': 'qmp_capabilities' } {"return": {}} =3D=3D=3D Create a single snapshot on virtio0 =3D=3D=3D +{ 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0',= 'snapshot-file':'TEST_DIR/1-snapshot-v0.IMGFMT', 'format': 'IMGFMT' } } Formatting 'TEST_DIR/1-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/t.qcow2.1 backing_fmt=3Dqcow2 cluster_size=3D65536 la= zy_refcounts=3Doff refcount_bits=3D16 {"return": {}} =3D=3D=3D Invalid command - missing device and nodename =3D=3D=3D +{ 'execute': 'blockdev-snapshot-sync', 'arguments': { 'snapshot-file':'TES= T_DIR/1-snapshot-v0.IMGFMT', 'format': 'IMGFMT' } } {"error": {"class": "GenericError", "desc": "Cannot find device=3D nor nod= e_name=3D"}} =3D=3D=3D Invalid command - missing snapshot-file =3D=3D=3D +{ 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0',= 'format': 'IMGFMT' } } {"error": {"class": "GenericError", "desc": "Parameter 'snapshot-file' is = missing"}} =3D=3D=3D Create several transactional group snapshots =3D=3D=3D +{ 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev= -snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR= /2-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { = 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/2-snapshot-v1.IMGFMT' } } ]= } } Formatting 'TEST_DIR/2-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/1-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 Formatting 'TEST_DIR/2-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/t.qcow2.2 backing_fmt=3Dqcow2 cluster_size=3D65536 la= zy_refcounts=3Doff refcount_bits=3D16 {"return": {}} +{ 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev= -snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR= /3-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { = 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/3-snapshot-v1.IMGFMT' } } ]= } } Formatting 'TEST_DIR/3-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/2-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 Formatting 'TEST_DIR/3-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/2-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 {"return": {}} +{ 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev= -snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR= /4-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { = 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/4-snapshot-v1.IMGFMT' } } ]= } } Formatting 'TEST_DIR/4-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/3-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 Formatting 'TEST_DIR/4-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/3-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 {"return": {}} +{ 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev= -snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR= /5-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { = 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/5-snapshot-v1.IMGFMT' } } ]= } } Formatting 'TEST_DIR/5-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/4-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 Formatting 'TEST_DIR/5-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/4-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 {"return": {}} +{ 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev= -snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR= /6-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { = 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/6-snapshot-v1.IMGFMT' } } ]= } } Formatting 'TEST_DIR/6-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/5-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 Formatting 'TEST_DIR/6-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/5-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 {"return": {}} +{ 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev= -snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR= /7-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { = 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/7-snapshot-v1.IMGFMT' } } ]= } } Formatting 'TEST_DIR/7-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/6-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 Formatting 'TEST_DIR/7-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/6-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 {"return": {}} +{ 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev= -snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR= /8-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { = 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/8-snapshot-v1.IMGFMT' } } ]= } } Formatting 'TEST_DIR/8-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/7-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 Formatting 'TEST_DIR/8-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/7-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 {"return": {}} +{ 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev= -snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR= /9-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { = 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/9-snapshot-v1.IMGFMT' } } ]= } } Formatting 'TEST_DIR/9-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/8-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 Formatting 'TEST_DIR/9-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/8-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 {"return": {}} +{ 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev= -snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR= /10-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : {= 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/10-snapshot-v1.IMGFMT' } }= ] } } Formatting 'TEST_DIR/10-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 b= acking_file=3DTEST_DIR/9-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 Formatting 'TEST_DIR/10-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 b= acking_file=3DTEST_DIR/9-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 {"return": {}} @@ -56,35 +69,48 @@ Formatting 'TEST_DIR/10-snapshot-v1.qcow2', fmt=3Dqcow2= size=3D134217728 backing_fil =3D=3D=3D Create a couple of snapshots using blockdev-snapshot =3D=3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 backing_file= =3DTEST_DIR/10-snapshot-v0.IMGFMT +{ 'execute': 'blockdev-add', 'arguments': { 'driver': 'IMGFMT', 'node-name= ': 'snap_11', 'backing': null, 'file': { 'driver': 'file', 'filename': 'TES= T_DIR/11-snapshot-v0.IMGFMT', 'node-name': 'file_11' } } } {"return": {}} +{ 'execute': 'blockdev-snapshot', 'arguments': { 'node': 'virtio0', 'overl= ay':'snap_11' } } {"return": {}} Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 backing_file= =3DTEST_DIR/11-snapshot-v0.IMGFMT +{ 'execute': 'blockdev-add', 'arguments': { 'driver': 'IMGFMT', 'node-name= ': 'snap_12', 'backing': null, 'file': { 'driver': 'file', 'filename': 'TES= T_DIR/12-snapshot-v0.IMGFMT', 'node-name': 'file_12' } } } {"return": {}} +{ 'execute': 'blockdev-snapshot', 'arguments': { 'node': 'virtio0', 'overl= ay':'snap_12' } } {"return": {}} =3D=3D=3D Invalid command - cannot create a snapshot using a file BDS =3D= =3D=3D +{ 'execute': 'blockdev-snapshot', 'arguments': { 'node':'virtio0', 'overla= y':'file_12' } } {"error": {"class": "GenericError", "desc": "The overlay does not support = backing images"}} =3D=3D=3D Invalid command - snapshot node used as active layer =3D=3D=3D +{ 'execute': 'blockdev-snapshot', 'arguments': { 'node': 'virtio0', 'overl= ay':'snap_12' } } {"error": {"class": "GenericError", "desc": "The overlay is already in use= "}} +{ 'execute': 'blockdev-snapshot', 'arguments': { 'node':'virtio0', 'overla= y':'virtio0' } } {"error": {"class": "GenericError", "desc": "The overlay is already in use= "}} +{ 'execute': 'blockdev-snapshot', 'arguments': { 'node':'virtio0', 'overla= y':'virtio1' } } {"error": {"class": "GenericError", "desc": "The overlay is already in use= "}} =3D=3D=3D Invalid command - snapshot node used as backing hd =3D=3D=3D +{ 'execute': 'blockdev-snapshot', 'arguments': { 'node': 'virtio0', 'overl= ay':'snap_11' } } {"error": {"class": "GenericError", "desc": "Node 'snap_11' is busy: node = is used as backing hd of 'snap_12'"}} =3D=3D=3D Invalid command - snapshot node has a backing image =3D=3D=3D Formatting 'TEST_DIR/t.IMGFMT.base', fmt=3DIMGFMT size=3D134217728 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 backing_file= =3DTEST_DIR/t.IMGFMT.base +{ 'execute': 'blockdev-add', 'arguments': { 'driver': 'IMGFMT', 'node-name= ': 'snap_13', 'file': { 'driver': 'file', 'filename': 'TEST_DIR/t.IMGFMT', = 'node-name': 'file_13' } } } {"return": {}} +{ 'execute': 'blockdev-snapshot', 'arguments': { 'node': 'virtio0', 'overl= ay':'snap_13' } } {"error": {"class": "GenericError", "desc": "The overlay already has a bac= king image"}} =3D=3D=3D Invalid command - The node does not exist =3D=3D=3D +{ 'execute': 'blockdev-snapshot', 'arguments': { 'node': 'virtio0', 'overl= ay':'snap_14' } } {"error": {"class": "GenericError", "desc": "Cannot find device=3Dsnap_14 = nor node_name=3Dsnap_14"}} +{ 'execute': 'blockdev-snapshot', 'arguments': { 'node':'nodevice', 'overl= ay':'snap_13' } } {"error": {"class": "GenericError", "desc": "Cannot find device=3Dnodevice= nor node_name=3Dnodevice"}} *** done diff --git a/tests/qemu-iotests/094.out b/tests/qemu-iotests/094.out index f3b9ecf22b73..9b6c57b3e280 100644 --- a/tests/qemu-iotests/094.out +++ b/tests/qemu-iotests/094.out @@ -1,16 +1,20 @@ QA output created by 094 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 Formatting 'TEST_DIR/source.IMGFMT', fmt=3DIMGFMT size=3D67108864 +{'execute': 'qmp_capabilities'} {"return": {}} +{'execute': 'drive-mirror', 'arguments': {'device': 'src', 'target': 'nbd+= unix:///?socket=3DSOCK_DIR/nbd', 'format': 'nbd', 'sync':'full', 'mode':'ex= isting'}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "src"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_READY", "data": {"device": "src", "len": 67108864, "offset": 6= 7108864, "speed": 0, "type": "mirror"}} +{'execute': 'block-job-complete', 'arguments': {'device': 'src'}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "pending", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 67108864, "offset= ": 67108864, "speed": 0, "type": "mirror"}} +{'execute': 'quit'} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}} {"return": {}} diff --git a/tests/qemu-iotests/095.out b/tests/qemu-iotests/095.out index d2e393fef8e1..614e5ccbbb38 100644 --- a/tests/qemu-iotests/095.out +++ b/tests/qemu-iotests/095.out @@ -10,7 +10,9 @@ virtual size: 5 MiB (5242880 bytes) =3D=3D=3D Running QEMU Live Commit Test =3D=3D=3D +{ 'execute': 'qmp_capabilities' } {"return": {}} +{ 'execute': 'block-commit', 'arguments': { 'device': 'test', 'top': 'TEST= _DIR/t.IMGFMT.snp1' } } {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "test"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "test"}} {"return": {}} diff --git a/tests/qemu-iotests/109.out b/tests/qemu-iotests/109.out index 9c1159bf08ed..884f65f18d9c 100644 --- a/tests/qemu-iotests/109.out +++ b/tests/qemu-iotests/109.out @@ -4,7 +4,9 @@ QA output created by 109 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 Formatting 'TEST_DIR/t.raw.src', fmt=3DIMGFMT size=3D67108864 +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}} WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing g= uessed raw. Automatically detecting the format is dangerous for raw images, w= rite operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. @@ -16,18 +18,24 @@ WARNING: Image format was not specified for 'TEST_DIR/t= .raw' and probing guessed {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": LEN, "offset": 0,= "speed": 0, "type": "mirror", "error": "Operation not permitted"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}} +{"execute":"query-block-jobs"} {"return": []} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "src"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_READY", "data": {"device": "src", "len": 1024, "offset": 1024,= "speed": 0, "type": "mirror"}} +{"execute":"query-block-jobs"} {"return": [{"auto-finalize": true, "io-status": "ok", "device": "src", "a= uto-dismiss": true, "busy": false, "len": 1024, "offset": 1024, "status": "= ready", "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "src"}} @@ -42,7 +50,9 @@ Images are identical. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 Formatting 'TEST_DIR/t.raw.src', fmt=3DIMGFMT size=3D67108864 +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}} WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing g= uessed raw. Automatically detecting the format is dangerous for raw images, w= rite operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. @@ -54,18 +64,24 @@ WARNING: Image format was not specified for 'TEST_DIR/t= .raw' and probing guessed {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": LEN, "offset": 51= 2, "speed": 0, "type": "mirror", "error": "Operation not permitted"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}} +{"execute":"query-block-jobs"} {"return": []} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "src"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_READY", "data": {"device": "src", "len": 197120, "offset": 197= 120, "speed": 0, "type": "mirror"}} +{"execute":"query-block-jobs"} {"return": [{"auto-finalize": true, "io-status": "ok", "device": "src", "a= uto-dismiss": true, "busy": false, "len": 197120, "offset": 197120, "status= ": "ready", "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "src"}} @@ -80,7 +96,9 @@ Images are identical. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 Formatting 'TEST_DIR/t.raw.src', fmt=3DIMGFMT size=3D67108864 +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}} WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing g= uessed raw. Automatically detecting the format is dangerous for raw images, w= rite operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. @@ -92,18 +110,24 @@ WARNING: Image format was not specified for 'TEST_DIR/= t.raw' and probing guessed {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": LEN, "offset": 26= 2144, "speed": 0, "type": "mirror", "error": "Operation not permitted"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}} +{"execute":"query-block-jobs"} {"return": []} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "src"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_READY", "data": {"device": "src", "len": 327680, "offset": 327= 680, "speed": 0, "type": "mirror"}} +{"execute":"query-block-jobs"} {"return": [{"auto-finalize": true, "io-status": "ok", "device": "src", "a= uto-dismiss": true, "busy": false, "len": 327680, "offset": 327680, "status= ": "ready", "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "src"}} @@ -118,7 +142,9 @@ Images are identical. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 Formatting 'TEST_DIR/t.raw.src', fmt=3DIMGFMT size=3D67108864 +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}} WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing g= uessed raw. Automatically detecting the format is dangerous for raw images, w= rite operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. @@ -130,18 +156,24 @@ WARNING: Image format was not specified for 'TEST_DIR= /t.raw' and probing guessed {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": LEN, "offset": 0,= "speed": 0, "type": "mirror", "error": "Operation not permitted"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}} +{"execute":"query-block-jobs"} {"return": []} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "src"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_READY", "data": {"device": "src", "len": 1024, "offset": 1024,= "speed": 0, "type": "mirror"}} +{"execute":"query-block-jobs"} {"return": [{"auto-finalize": true, "io-status": "ok", "device": "src", "a= uto-dismiss": true, "busy": false, "len": 1024, "offset": 1024, "status": "= ready", "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "src"}} @@ -156,7 +188,9 @@ Images are identical. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 Formatting 'TEST_DIR/t.raw.src', fmt=3DIMGFMT size=3D67108864 +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}} WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing g= uessed raw. Automatically detecting the format is dangerous for raw images, w= rite operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. @@ -168,18 +202,24 @@ WARNING: Image format was not specified for 'TEST_DIR= /t.raw' and probing guessed {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": LEN, "offset": 0,= "speed": 0, "type": "mirror", "error": "Operation not permitted"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}} +{"execute":"query-block-jobs"} {"return": []} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "src"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_READY", "data": {"device": "src", "len": 65536, "offset": 6553= 6, "speed": 0, "type": "mirror"}} +{"execute":"query-block-jobs"} {"return": [{"auto-finalize": true, "io-status": "ok", "device": "src", "a= uto-dismiss": true, "busy": false, "len": 65536, "offset": 65536, "status":= "ready", "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "src"}} @@ -194,7 +234,9 @@ Images are identical. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 Formatting 'TEST_DIR/t.raw.src', fmt=3DIMGFMT size=3D67108864 +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}} WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing g= uessed raw. Automatically detecting the format is dangerous for raw images, w= rite operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. @@ -206,18 +248,24 @@ WARNING: Image format was not specified for 'TEST_DIR= /t.raw' and probing guessed {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": LEN, "offset": 0,= "speed": 0, "type": "mirror", "error": "Operation not permitted"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}} +{"execute":"query-block-jobs"} {"return": []} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "src"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_READY", "data": {"device": "src", "len": 2560, "offset": 2560,= "speed": 0, "type": "mirror"}} +{"execute":"query-block-jobs"} {"return": [{"auto-finalize": true, "io-status": "ok", "device": "src", "a= uto-dismiss": true, "busy": false, "len": 2560, "offset": 2560, "status": "= ready", "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "src"}} @@ -231,7 +279,9 @@ Images are identical. =3D=3D=3D Copying sample image empty.bochs into raw =3D=3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}} WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing g= uessed raw. Automatically detecting the format is dangerous for raw images, w= rite operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. @@ -243,18 +293,24 @@ WARNING: Image format was not specified for 'TEST_DIR= /t.raw' and probing guessed {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": LEN, "offset": OF= FSET, "speed": 0, "type": "mirror", "error": "Operation not permitted"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}} +{"execute":"query-block-jobs"} {"return": []} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "src"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_READY", "data": {"device": "src", "len": 2560, "offset": 2560,= "speed": 0, "type": "mirror"}} +{"execute":"query-block-jobs"} {"return": [{"auto-finalize": true, "io-status": "ok", "device": "src", "a= uto-dismiss": true, "busy": false, "len": 2560, "offset": 2560, "status": "= ready", "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "src"}} @@ -268,7 +324,9 @@ Images are identical. =3D=3D=3D Copying sample image iotest-dirtylog-10G-4M.vhdx into raw =3D=3D= =3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}} WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing g= uessed raw. Automatically detecting the format is dangerous for raw images, w= rite operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. @@ -280,18 +338,24 @@ WARNING: Image format was not specified for 'TEST_DIR= /t.raw' and probing guessed {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": LEN, "offset": OF= FSET, "speed": 0, "type": "mirror", "error": "Operation not permitted"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}} +{"execute":"query-block-jobs"} {"return": []} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "src"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_READY", "data": {"device": "src", "len": 31457280, "offset": 3= 1457280, "speed": 0, "type": "mirror"}} +{"execute":"query-block-jobs"} {"return": [{"auto-finalize": true, "io-status": "ok", "device": "src", "a= uto-dismiss": true, "busy": false, "len": 31457280, "offset": 31457280, "st= atus": "ready", "paused": false, "speed": 0, "ready": true, "type": "mirror= "}]} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "src"}} @@ -305,7 +369,9 @@ Images are identical. =3D=3D=3D Copying sample image parallels-v1 into raw =3D=3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}} WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing g= uessed raw. Automatically detecting the format is dangerous for raw images, w= rite operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. @@ -317,18 +383,24 @@ WARNING: Image format was not specified for 'TEST_DIR= /t.raw' and probing guessed {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": LEN, "offset": OF= FSET, "speed": 0, "type": "mirror", "error": "Operation not permitted"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}} +{"execute":"query-block-jobs"} {"return": []} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "src"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_READY", "data": {"device": "src", "len": 327680, "offset": 327= 680, "speed": 0, "type": "mirror"}} +{"execute":"query-block-jobs"} {"return": [{"auto-finalize": true, "io-status": "ok", "device": "src", "a= uto-dismiss": true, "busy": false, "len": 327680, "offset": 327680, "status= ": "ready", "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "src"}} @@ -342,7 +414,9 @@ Images are identical. =3D=3D=3D Copying sample image simple-pattern.cloop into raw =3D=3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}} WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing g= uessed raw. Automatically detecting the format is dangerous for raw images, w= rite operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. @@ -354,18 +428,24 @@ WARNING: Image format was not specified for 'TEST_DIR= /t.raw' and probing guessed {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": LEN, "offset": OF= FSET, "speed": 0, "type": "mirror", "error": "Operation not permitted"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}} +{"execute":"query-block-jobs"} {"return": []} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "src"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_READY", "data": {"device": "src", "len": 2048, "offset": 2048,= "speed": 0, "type": "mirror"}} +{"execute":"query-block-jobs"} {"return": [{"auto-finalize": true, "io-status": "ok", "device": "src", "a= uto-dismiss": true, "busy": false, "len": 2048, "offset": 2048, "status": "= ready", "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "src"}} @@ -379,7 +459,9 @@ Images are identical. =3D=3D=3D Write legitimate MBR into raw =3D=3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}} WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing g= uessed raw. Automatically detecting the format is dangerous for raw images, w= rite operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. @@ -388,7 +470,9 @@ WARNING: Image format was not specified for 'TEST_DIR/t= .raw' and probing guessed {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_READY", "data": {"device": "src", "len": 512, "offset": 512, "= speed": 0, "type": "mirror"}} +{"execute":"query-block-jobs"} {"return": [{"auto-finalize": true, "io-status": "ok", "device": "src", "a= uto-dismiss": true, "busy": false, "len": 512, "offset": 512, "status": "re= ady", "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "src"}} @@ -398,13 +482,17 @@ WARNING: Image format was not specified for 'TEST_DIR= /t.raw' and probing guessed {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}} Warning: Image size mismatch! Images are identical. +{ 'execute': 'qmp_capabilities' } {"return": {}} +{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_= DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "src"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_READY", "data": {"device": "src", "len": 512, "offset": 512, "= speed": 0, "type": "mirror"}} +{"execute":"query-block-jobs"} {"return": [{"auto-finalize": true, "io-status": "ok", "device": "src", "a= uto-dismiss": true, "busy": false, "len": 512, "offset": 512, "status": "re= ady", "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "src"}} diff --git a/tests/qemu-iotests/117.out b/tests/qemu-iotests/117.out index 57079af167a5..bb623dcc0a49 100644 --- a/tests/qemu-iotests/117.out +++ b/tests/qemu-iotests/117.out @@ -1,11 +1,16 @@ QA output created by 117 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D65536 +{ 'execute': 'qmp_capabilities' } {"return": {}} +{ 'execute': 'blockdev-add', 'arguments': { 'node-name': 'protocol', 'driv= er': 'file', 'filename': 'TEST_DIR/t.IMGFMT' } } {"return": {}} +{ 'execute': 'blockdev-add', 'arguments': { 'node-name': 'format', 'driver= ': 'IMGFMT', 'file': 'protocol' } } {"return": {}} +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'qemu= -io format "write -P 42 0 64k"' } } wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) {"return": ""} +{ 'execute': 'quit' } {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} No errors were found on the image. diff --git a/tests/qemu-iotests/127.out b/tests/qemu-iotests/127.out index 6c98b1824ea6..623d52bbd150 100644 --- a/tests/qemu-iotests/127.out +++ b/tests/qemu-iotests/127.out @@ -4,16 +4,20 @@ Formatting 'TEST_DIR/t.IMGFMT.overlay0', fmt=3DIMGFMT siz= e=3D65536 backing_file=3DTEST Formatting 'TEST_DIR/t.IMGFMT.overlay1', fmt=3DIMGFMT size=3D65536 backing= _file=3DTEST_DIR/t.IMGFMT wrote 42/42 bytes at offset 0 42 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ 'execute': 'qmp_capabilities' } {"return": {}} +{ 'execute': 'drive-mirror', 'arguments': { 'job-id': 'mirror', 'device': = 'source', 'target': 'TEST_DIR/t.IMGFMT.overlay1', 'mode': 'existing', 'sync= ': 'top' } } {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "mirror"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "mirror"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "mirror"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_READY", "data": {"device": "mirror", "len": 65536, "offset": 6= 5536, "speed": 0, "type": "mirror"}} +{ 'execute': 'block-job-complete', 'arguments': { 'device': 'mirror' } } {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "mirror"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "pending", "id": "mirror"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "mirror", "len": 65536, "offset= ": 65536, "speed": 0, "type": "mirror"}} +{ 'execute': 'quit' } {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "mirror"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "mirror"}} {"return": {}} diff --git a/tests/qemu-iotests/140.out b/tests/qemu-iotests/140.out index 2511eb7369e4..86b985da75be 100644 --- a/tests/qemu-iotests/140.out +++ b/tests/qemu-iotests/140.out @@ -2,14 +2,19 @@ QA output created by 140 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D65536 wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ 'execute': 'qmp_capabilities' } {"return": {}} +{ 'execute': 'nbd-server-start', 'arguments': { 'addr': { 'type': 'unix', = 'data': { 'path': 'SOCK_DIR/nbd' }}}} {"return": {}} +{ 'execute': 'nbd-server-add', 'arguments': { 'device': 'drv' }} {"return": {}} read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ 'execute': 'eject', 'arguments': { 'device': 'drv' }} {"return": {}} qemu-io: can't open device nbd+unix:///drv?socket=3DSOCK_DIR/nbd: Requeste= d export not available server reported: export 'drv' not present +{ 'execute': 'quit' } {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} *** done diff --git a/tests/qemu-iotests/141.out b/tests/qemu-iotests/141.out index e3b578282da4..3645675ce83c 100644 --- a/tests/qemu-iotests/141.out +++ b/tests/qemu-iotests/141.out @@ -2,82 +2,108 @@ QA output created by 141 Formatting 'TEST_DIR/b.IMGFMT', fmt=3DIMGFMT size=3D1048576 Formatting 'TEST_DIR/m.IMGFMT', fmt=3DIMGFMT size=3D1048576 backing_file= =3DTEST_DIR/b.IMGFMT Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1048576 backing_file= =3DTEST_DIR/m.IMGFMT +{'execute': 'qmp_capabilities'} {"return": {}} =3D=3D=3D Testing drive-backup =3D=3D=3D +{'execute': 'blockdev-add', 'arguments': { 'node-name': 'drv0', 'driver': = 'IMGFMT', 'file': { 'driver': 'file', 'filename': 'TEST_DIR/t.IMGFMT' }}} {"return": {}} +{'execute': 'drive-backup', 'arguments': {'job-id': 'job0', 'device': 'drv= 0', 'target': 'TEST_DIR/o.IMGFMT', 'format': 'IMGFMT', 'sync': 'none'}} Formatting 'TEST_DIR/o.IMGFMT', fmt=3DIMGFMT size=3D1048576 backing_file= =3DTEST_DIR/t.IMGFMT backing_fmt=3DIMGFMT {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "job0"}} +{'execute': 'blockdev-del', 'arguments': {'node-name': 'drv0'}} {"error": {"class": "GenericError", "desc": "Node 'drv0' is busy: node is = used as backing hd of 'NODE_NAME'"}} +{'execute': 'block-job-cancel', 'arguments': {'device': 'job0'}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "aborting", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_CANCELLED", "data": {"device": "job0", "len": 1048576, "offset= ": 0, "speed": 0, "type": "backup"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "job0"}} +{'execute': 'blockdev-del', 'arguments': {'node-name': 'drv0'}} {"return": {}} =3D=3D=3D Testing drive-mirror =3D=3D=3D +{'execute': 'blockdev-add', 'arguments': { 'node-name': 'drv0', 'driver': = 'IMGFMT', 'file': { 'driver': 'file', 'filename': 'TEST_DIR/t.IMGFMT' }}} {"return": {}} +{'execute': 'drive-mirror', 'arguments': {'job-id': 'job0', 'device': 'drv= 0', 'target': 'TEST_DIR/o.IMGFMT', 'format': 'IMGFMT', 'sync': 'none'}} Formatting 'TEST_DIR/o.IMGFMT', fmt=3DIMGFMT size=3D1048576 backing_file= =3DTEST_DIR/t.IMGFMT backing_fmt=3DIMGFMT {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_READY", "data": {"device": "job0", "len": 0, "offset": 0, "spe= ed": 0, "type": "mirror"}} +{'execute': 'blockdev-del', 'arguments': {'node-name': 'drv0'}} {"error": {"class": "GenericError", "desc": "Node 'drv0' is busy: block de= vice is in use by block job: mirror"}} +{'execute': 'block-job-cancel', 'arguments': {'device': 'job0'}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "pending", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "job0", "len": 0, "offset": 0, = "speed": 0, "type": "mirror"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "job0"}} +{'execute': 'blockdev-del', 'arguments': {'node-name': 'drv0'}} {"return": {}} =3D=3D=3D Testing active block-commit =3D=3D=3D +{'execute': 'blockdev-add', 'arguments': { 'node-name': 'drv0', 'driver': = 'IMGFMT', 'file': { 'driver': 'file', 'filename': 'TEST_DIR/t.IMGFMT' }}} {"return": {}} +{'execute': 'block-commit', 'arguments': {'job-id': 'job0', 'device': 'drv= 0'}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_READY", "data": {"device": "job0", "len": 0, "offset": 0, "spe= ed": 0, "type": "commit"}} +{'execute': 'blockdev-del', 'arguments': {'node-name': 'drv0'}} {"error": {"class": "GenericError", "desc": "Node 'drv0' is busy: block de= vice is in use by block job: commit"}} +{'execute': 'block-job-cancel', 'arguments': {'device': 'job0'}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "pending", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "job0", "len": 0, "offset": 0, = "speed": 0, "type": "commit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "job0"}} +{'execute': 'blockdev-del', 'arguments': {'node-name': 'drv0'}} {"return": {}} =3D=3D=3D Testing non-active block-commit =3D=3D=3D wrote 1048576/1048576 bytes at offset 0 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{'execute': 'blockdev-add', 'arguments': { 'node-name': 'drv0', 'driver': = 'IMGFMT', 'file': { 'driver': 'file', 'filename': 'TEST_DIR/t.IMGFMT' }}} {"return": {}} +{'execute': 'block-commit', 'arguments': {'job-id': 'job0', 'device': 'drv= 0', 'top': 'TEST_DIR/m.IMGFMT', 'speed': 1}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "job0"}} +{'execute': 'blockdev-del', 'arguments': {'node-name': 'drv0'}} {"error": {"class": "GenericError", "desc": "Node drv0 is in use"}} +{'execute': 'block-job-cancel', 'arguments': {'device': 'job0'}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "aborting", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_CANCELLED", "data": {"device": "job0", "len": 1048576, "offset= ": 524288, "speed": 1, "type": "commit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "job0"}} +{'execute': 'blockdev-del', 'arguments': {'node-name': 'drv0'}} {"return": {}} =3D=3D=3D Testing block-stream =3D=3D=3D wrote 1048576/1048576 bytes at offset 0 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{'execute': 'blockdev-add', 'arguments': { 'node-name': 'drv0', 'driver': = 'IMGFMT', 'file': { 'driver': 'file', 'filename': 'TEST_DIR/t.IMGFMT' }}} {"return": {}} +{'execute': 'block-stream', 'arguments': {'job-id': 'job0', 'device': 'drv= 0', 'speed': 1}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "job0"}} +{'execute': 'blockdev-del', 'arguments': {'node-name': 'drv0'}} {"error": {"class": "GenericError", "desc": "Node drv0 is in use"}} +{'execute': 'block-job-cancel', 'arguments': {'device': 'job0'}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "aborting", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_CANCELLED", "data": {"device": "job0", "len": 1048576, "offset= ": 524288, "speed": 1, "type": "stream"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "job0"}} +{'execute': 'blockdev-del', 'arguments': {'node-name': 'drv0'}} {"return": {}} *** done diff --git a/tests/qemu-iotests/143.out b/tests/qemu-iotests/143.out index 037d34a40988..1f4001c60131 100644 --- a/tests/qemu-iotests/143.out +++ b/tests/qemu-iotests/143.out @@ -1,8 +1,11 @@ QA output created by 143 +{ 'execute': 'qmp_capabilities' } {"return": {}} +{ 'execute': 'nbd-server-start', 'arguments': { 'addr': { 'type': 'unix', = 'data': { 'path': 'SOCK_DIR/nbd' }}}} {"return": {}} qemu-io: can't open device nbd+unix:///no_such_export?socket=3DSOCK_DIR/nb= d: Requested export not available server reported: export 'no_such_export' not present +{ 'execute': 'quit' } {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} *** done diff --git a/tests/qemu-iotests/144.out b/tests/qemu-iotests/144.out index a9a8216beac7..c7aa2e482000 100644 --- a/tests/qemu-iotests/144.out +++ b/tests/qemu-iotests/144.out @@ -6,17 +6,21 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D53687= 0912 =3D=3D=3D Performing Live Snapshot 1 =3D=3D=3D +{ 'execute': 'qmp_capabilities' } {"return": {}} +{ 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0',= 'snapshot-file':'TEST_DIR/tmp.IMGFMT', 'format': 'IMGFMT' } } Formatting 'TEST_DIR/tmp.qcow2', fmt=3Dqcow2 size=3D536870912 backing_file= =3DTEST_DIR/t.qcow2 backing_fmt=3Dqcow2 cluster_size=3D65536 lazy_refcounts= =3Doff refcount_bits=3D16 {"return": {}} =3D=3D=3D Performing block-commit on active layer =3D=3D=3D +{ 'execute': 'block-commit', 'arguments': { 'device': 'virtio0' } } {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "virtio0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "virtio0"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "virtio0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_READY", "data": {"device": "virtio0", "len": 0, "offset": 0, "= speed": 0, "type": "commit"}} +{ 'execute': 'block-job-complete', 'arguments': { 'device': 'virtio0' } } {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "virtio0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "pending", "id": "virtio0"}} @@ -26,6 +30,7 @@ Formatting 'TEST_DIR/tmp.qcow2', fmt=3Dqcow2 size=3D53687= 0912 backing_file=3DTEST_DIR/ =3D=3D=3D Performing Live Snapshot 2 =3D=3D=3D +{ 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0',= 'snapshot-file':'TEST_DIR/tmp2.IMGFMT', 'format': 'IMGFMT' } } Formatting 'TEST_DIR/tmp2.qcow2', fmt=3Dqcow2 size=3D536870912 backing_fil= e=3DTEST_DIR/t.qcow2 backing_fmt=3Dqcow2 cluster_size=3D65536 lazy_refcount= s=3Doff refcount_bits=3D16 {"return": {}} *** done diff --git a/tests/qemu-iotests/153.out b/tests/qemu-iotests/153.out index e96942000662..f7464dd8d345 100644 --- a/tests/qemu-iotests/153.out +++ b/tests/qemu-iotests/153.out @@ -144,6 +144,7 @@ _qemu_img_wrapper bench -U -c 1 TEST_DIR/t.qcow2 _qemu_img_wrapper bench -U -w -c 1 TEST_DIR/t.qcow2 qemu-img: Could not open 'TEST_DIR/t.qcow2': force-share=3Don can only be = used with read-only images +{ 'execute': 'quit' } Round done @@ -266,6 +267,7 @@ _qemu_img_wrapper bench -U -c 1 TEST_DIR/t.qcow2 _qemu_img_wrapper bench -U -w -c 1 TEST_DIR/t.qcow2 qemu-img: Could not open 'TEST_DIR/t.qcow2': force-share=3Don can only be = used with read-only images +{ 'execute': 'quit' } Round done @@ -367,6 +369,7 @@ _qemu_img_wrapper bench -U -c 1 TEST_DIR/t.qcow2 _qemu_img_wrapper bench -U -w -c 1 TEST_DIR/t.qcow2 qemu-img: Could not open 'TEST_DIR/t.qcow2': force-share=3Don can only be = used with read-only images +{ 'execute': 'quit' } Round done @@ -412,11 +415,14 @@ QEMU_PROG: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2: = Failed to get "write" lock Is another process using the image [TEST_DIR/t.qcow2]? =3D=3D Active commit to intermediate layer should work when base in use = =3D=3D +{ 'execute': 'qmp_capabilities' } {"return": {}} _qemu_img_wrapper commit -b TEST_DIR/t.qcow2.b TEST_DIR/t.qcow2.c +{ 'execute': 'qmp_capabilities' } {"return": {}} Adding drive +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'driv= e_add 0 if=3Dnone,id=3Dd0,file=3DTEST_DIR/t.IMGFMT' } } {"return": "OKrn"} _qemu_io_wrapper TEST_DIR/t.qcow2 -c write 0 512 @@ -426,20 +432,25 @@ Creating overlay with qemu-img when the guest is runn= ing should be allowed _qemu_img_wrapper create -f qcow2 -b TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.ove= rlay =3D=3D Closing an image should unlock it =3D=3D +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'driv= e_del d0' } } {"return": ""} _qemu_io_wrapper TEST_DIR/t.qcow2 -c write 0 512 Adding two and closing one +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'driv= e_add 0 if=3Dnone,id=3Dd0,file=3DTEST_DIR/t.IMGFMT,readonly=3Don' } } {"return": "OKrn"} +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'driv= e_add 0 if=3Dnone,id=3Dd1,file=3DTEST_DIR/t.IMGFMT,readonly=3Don' } } {"return": "OKrn"} _qemu_img_wrapper info TEST_DIR/t.qcow2 +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'driv= e_del d0' } } {"return": ""} _qemu_io_wrapper TEST_DIR/t.qcow2 -c write 0 512 qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock Is another process using the image [TEST_DIR/t.qcow2]? Closing the other +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'driv= e_del d1' } } {"return": ""} _qemu_io_wrapper TEST_DIR/t.qcow2 -c write 0 512 diff --git a/tests/qemu-iotests/156.out b/tests/qemu-iotests/156.out index 4c391a760371..084be5ad7151 100644 --- a/tests/qemu-iotests/156.out +++ b/tests/qemu-iotests/156.out @@ -5,21 +5,27 @@ wrote 262144/262144 bytes at offset 0 256 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 196608/196608 bytes at offset 65536 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ 'execute': 'qmp_capabilities' } {"return": {}} Formatting 'TEST_DIR/t.IMGFMT.overlay', fmt=3DIMGFMT size=3D1048576 backin= g_file=3DTEST_DIR/t.IMGFMT +{ 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'source', = 'snapshot-file': 'TEST_DIR/t.IMGFMT.overlay', 'format': 'IMGFMT', 'mode': '= existing' } } {"return": {}} +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'qemu= -io source "write -P 3 128k 128k"' } } wrote 131072/131072 bytes at offset 131072 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) {"return": ""} Formatting 'TEST_DIR/t.IMGFMT.target.overlay', fmt=3DIMGFMT size=3D1048576= backing_file=3DTEST_DIR/t.IMGFMT.target +{ 'execute': 'drive-mirror', 'arguments': { 'device': 'source', 'target': = 'TEST_DIR/t.IMGFMT.target.overlay', 'mode': 'existing', 'sync': 'top' } } {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "source"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "source"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "source"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_READY", "data": {"device": "source", "len": 131072, "offset": = 131072, "speed": 0, "type": "mirror"}} +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'qemu= -io source "write -P 4 192k 64k"' } } wrote 65536/65536 bytes at offset 196608 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) {"return": ""} +{ 'execute': 'block-job-complete', 'arguments': { 'device': 'source' } } {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "source"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "pending", "id": "source"}} @@ -27,19 +33,24 @@ wrote 65536/65536 bytes at offset 196608 {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "source"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "source"}} +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'qemu= -io source "read -P 1 0k 64k"' } } read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) {"return": ""} +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'qemu= -io source "read -P 2 64k 64k"' } } read 65536/65536 bytes at offset 65536 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) {"return": ""} +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'qemu= -io source "read -P 3 128k 64k"' } } read 65536/65536 bytes at offset 131072 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) {"return": ""} +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'qemu= -io source "read -P 4 192k 64k"' } } read 65536/65536 bytes at offset 196608 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) {"return": ""} +{ 'execute': 'quit' } {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} diff --git a/tests/qemu-iotests/161.out b/tests/qemu-iotests/161.out index 39951993ee84..aef9741ed31c 100644 --- a/tests/qemu-iotests/161.out +++ b/tests/qemu-iotests/161.out @@ -5,15 +5,20 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D10485= 76 backing_file=3DTEST_DIR/t. *** Change an option on the backing file +{ 'execute': 'qmp_capabilities' } {"return": {}} +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'qemu= -io none0 "reopen -o backing.detect-zeroes=3Don"' } } {"return": ""} *** Stream and then change an option on the backing file +{ 'execute': 'qmp_capabilities' } {"return": {}} +{ 'execute': 'block-stream', 'arguments': { 'device': 'none0', 'base': 'TE= ST_DIR/t.IMGFMT.base' } } {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "none0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "none0"}} {"return": {}} +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'qemu= -io none0 "reopen -o backing.detect-zeroes=3Don"' } } {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "none0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "pending", "id": "none0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "none0", "len": 1048576, "offse= t": 1048576, "speed": 0, "type": "stream"}} @@ -26,10 +31,13 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D104= 8576 backing_file=3DTEST_DIR/t. Formatting 'TEST_DIR/t.IMGFMT.base', fmt=3DIMGFMT size=3D1048576 Formatting 'TEST_DIR/t.IMGFMT.int', fmt=3DIMGFMT size=3D1048576 backing_fi= le=3DTEST_DIR/t.IMGFMT.base Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1048576 backing_file= =3DTEST_DIR/t.IMGFMT.int +{ 'execute': 'qmp_capabilities' } {"return": {}} +{ 'execute': 'block-commit', 'arguments': { 'device': 'none0', 'top': 'TES= T_DIR/t.IMGFMT.int' } } {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "none0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "none0"}} {"return": {}} +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'qemu= -io none0 "reopen -o backing.detect-zeroes=3Don"' } } {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "none0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "pending", "id": "none0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_COMPLETED", "data": {"device": "none0", "len": 1048576, "offse= t": 1048576, "speed": 0, "type": "commit"}} diff --git a/tests/qemu-iotests/173.out b/tests/qemu-iotests/173.out index e83d17ec2f64..b5114b5c7952 100644 --- a/tests/qemu-iotests/173.out +++ b/tests/qemu-iotests/173.out @@ -4,9 +4,13 @@ Formatting 'TEST_DIR/image.snp1', fmt=3DIMGFMT size=3D1048= 57600 =3D=3D=3D Running QEMU, using block-stream to find backing image =3D=3D=3D +{ 'execute': 'qmp_capabilities' } {"return": {}} +{ 'arguments': { 'device': 'disk2', 'format': 'IMGFMT', 'mode': 'existing'= , 'snapshot-file': 'TEST_DIR/image.snp1', 'snapshot-node-name': 'snp1' }, '= execute': 'blockdev-snapshot-sync' } {"return": {}} +{ 'arguments': { 'backing-file': 'image.base', 'device': 'disk2', 'image-n= ode-name': 'snp1' }, 'execute': 'change-backing-file' } {"return": {}} +{ 'arguments': { 'base': 'TEST_DIR/image.base', 'device': 'disk2' }, 'exec= ute': 'block-stream' } {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "disk2"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "disk2"}} {"return": {}} diff --git a/tests/qemu-iotests/182.out b/tests/qemu-iotests/182.out index ffef23e32bc2..a8eea166c305 100644 --- a/tests/qemu-iotests/182.out +++ b/tests/qemu-iotests/182.out @@ -8,17 +8,25 @@ Is another process using the image [TEST_DIR/t.qcow2]? =3D=3D=3D Testing reopen =3D=3D=3D +{'execute': 'qmp_capabilities'} {"return": {}} +{'execute': 'blockdev-add', 'arguments': { 'node-name': 'node0', 'driver':= 'file', 'filename': 'TEST_DIR/t.IMGFMT', 'locking': 'on' } } {"return": {}} +{'execute': 'blockdev-snapshot-sync', 'arguments': { 'node-name': 'node0',= 'snapshot-file': 'TEST_DIR/t.IMGFMT.overlay', 'snapshot-node-name': 'node1= ' } } Formatting 'TEST_DIR/t.qcow2.overlay', fmt=3Dqcow2 size=3D197120 backing_f= ile=3DTEST_DIR/t.qcow2 backing_fmt=3Dfile cluster_size=3D65536 lazy_refcoun= ts=3Doff refcount_bits=3D16 {"return": {}} +{'execute': 'blockdev-add', 'arguments': { 'node-name': 'node1', 'driver':= 'file', 'filename': 'TEST_DIR/t.IMGFMT', 'locking': 'on' } } {"return": {}} +{'execute': 'nbd-server-start', 'arguments': { 'addr': { 'type': 'unix', '= data': { 'path': 'SOCK_DIR/nbd.socket' } } } } {"return": {}} +{'execute': 'nbd-server-add', 'arguments': { 'device': 'node1' } } {"return": {}} =3D=3D=3D Testing failure to loosen restrictions =3D=3D=3D +{'execute': 'qmp_capabilities'} {"return": {}} +{'execute': 'quit'} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} *** done diff --git a/tests/qemu-iotests/183.out b/tests/qemu-iotests/183.out index 112cf31f8bd6..d4be2cb2de5f 100644 --- a/tests/qemu-iotests/183.out +++ b/tests/qemu-iotests/183.out @@ -4,37 +4,48 @@ Formatting 'TEST_DIR/t.IMGFMT.dest', fmt=3DIMGFMT size=3D= 67108864 =3D=3D=3D Starting VMs =3D=3D=3D +{ 'execute': 'qmp_capabilities' } {"return": {}} +{ 'execute': 'qmp_capabilities' } {"return": {}} =3D=3D=3D Write something on the source =3D=3D=3D +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': '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) {"return": ""} +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': '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) {"return": ""} =3D=3D=3D Do block migration to destination =3D=3D=3D +{ 'execute': 'migrate', 'arguments': { 'uri': 'unix:SOCK_DIR/migrate', 'bl= k': true } } {"return": {}} +{ 'execute': 'query-status' } {"return": {"status": "postmigrate", "singlestep": false, "running": false= }} =3D=3D=3D Do some I/O on the destination =3D=3D=3D +{ 'execute': 'query-status' } {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "RESUME"} {"return": {"status": "running", "singlestep": false, "running": true}} +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': '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) {"return": ""} +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': '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) {"return": ""} =3D=3D=3D Shut down and check image =3D=3D=3D +{"execute":"quit"} {"return": {}} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} diff --git a/tests/qemu-iotests/185.out b/tests/qemu-iotests/185.out index ddfbf3c76548..8379ac585422 100644 --- a/tests/qemu-iotests/185.out +++ b/tests/qemu-iotests/185.out @@ -3,65 +3,83 @@ Formatting 'TEST_DIR/t.IMGFMT.base', fmt=3DIMGFMT size=3D= 67108864 =3D=3D=3D Starting VM =3D=3D=3D +{ 'execute': 'qmp_capabilities' } {"return": {}} =3D=3D=3D Creating backing chain =3D=3D=3D +{ 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'disk', 's= napshot-file': 'TEST_DIR/t.IMGFMT.mid', 'format': 'IMGFMT', 'mode': 'absolu= te-paths' } } Formatting 'TEST_DIR/t.qcow2.mid', fmt=3Dqcow2 size=3D67108864 backing_fil= e=3DTEST_DIR/t.qcow2.base backing_fmt=3Dqcow2 cluster_size=3D65536 lazy_ref= counts=3Doff refcount_bits=3D16 {"return": {}} +{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'qemu= -io disk "write 0 4M"' } } wrote 4194304/4194304 bytes at offset 0 4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) {"return": ""} +{ 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'disk', 's= napshot-file': 'TEST_DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'absolute-p= aths' } } Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 backing_file=3D= TEST_DIR/t.qcow2.mid backing_fmt=3Dqcow2 cluster_size=3D65536 lazy_refcount= s=3Doff refcount_bits=3D16 {"return": {}} =3D=3D=3D Start commit job and exit qemu =3D=3D=3D +{ 'execute': 'block-commit', 'arguments': { 'device': 'disk', 'base':'TEST= _DIR/t.IMGFMT.base', 'top': 'TEST_DIR/t.IMGFMT.mid', 'speed': 65536 } } {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "disk"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "disk"}} {"return": {}} +{ 'execute': 'quit' } {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_CANCELLED", "data": {"device": "disk", "len": 67108864, "offse= t": 524288, "speed": 65536, "type": "commit"}} =3D=3D=3D Start active commit job and exit qemu =3D=3D=3D +{ 'execute': 'qmp_capabilities' } {"return": {}} +{ 'execute': 'block-commit', 'arguments': { 'device': 'disk', 'base':'TEST= _DIR/t.IMGFMT.base', 'speed': 65536 } } {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "disk"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "disk"}} {"return": {}} +{ 'execute': 'quit' } {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_CANCELLED", "data": {"device": "disk", "len": 4194304, "offset= ": 4194304, "speed": 65536, "type": "commit"}} =3D=3D=3D Start mirror job and exit qemu =3D=3D=3D +{ 'execute': 'qmp_capabilities' } {"return": {}} +{ 'execute': 'drive-mirror', 'arguments': { 'device': 'disk', 'target': 'T= EST_DIR/t.IMGFMT.copy', 'format': 'IMGFMT', 'sync': 'full', 'speed': 65536 = } } Formatting 'TEST_DIR/t.qcow2.copy', fmt=3Dqcow2 size=3D67108864 cluster_si= ze=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "disk"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "disk"}} {"return": {}} +{ 'execute': 'quit' } {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_CANCELLED", "data": {"device": "disk", "len": 4194304, "offset= ": 4194304, "speed": 65536, "type": "mirror"}} =3D=3D=3D Start backup job and exit qemu =3D=3D=3D +{ 'execute': 'qmp_capabilities' } {"return": {}} +{ 'execute': 'drive-backup', 'arguments': { 'device': 'disk', 'target': 'T= EST_DIR/t.IMGFMT.copy', 'format': 'IMGFMT', 'sync': 'full', 'speed': 65536 = } } Formatting 'TEST_DIR/t.qcow2.copy', fmt=3Dqcow2 size=3D67108864 cluster_si= ze=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "disk"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "disk"}} {"return": {}} +{ 'execute': 'quit' } {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_CANCELLED", "data": {"device": "disk", "len": 67108864, "offse= t": 65536, "speed": 65536, "type": "backup"}} =3D=3D=3D Start streaming job and exit qemu =3D=3D=3D +{ 'execute': 'qmp_capabilities' } {"return": {}} +{ 'execute': 'block-stream', 'arguments': { 'device': 'disk', 'speed': 655= 36 } } {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "disk"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "disk"}} {"return": {}} +{ 'execute': 'quit' } {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_CANCELLED", "data": {"device": "disk", "len": 67108864, "offse= t": 524288, "speed": 65536, "type": "stream"}} diff --git a/tests/qemu-iotests/191.out b/tests/qemu-iotests/191.out index 3fc92bb56e57..34cec7b9ecf3 100644 --- a/tests/qemu-iotests/191.out +++ b/tests/qemu-iotests/191.out @@ -8,6 +8,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D6710886= 4 backing_file=3DTEST_DIR/t Formatting 'TEST_DIR/t.IMGFMT.ovl2', fmt=3DIMGFMT size=3D67108864 backing_= file=3DTEST_DIR/t.IMGFMT.mid wrote 65536/65536 bytes at offset 1048576 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ 'execute': 'qmp_capabilities' } { "return": { } @@ -15,6 +16,7 @@ wrote 65536/65536 bytes at offset 1048576 =3D=3D=3D Perform commit job =3D=3D=3D +{ 'execute': 'block-commit', 'arguments': { 'job-id': 'commit0', 'device':= 'top', 'base':'TEST_DIR/t.IMGFMT.base', 'top': 'TEST_DIR/t.IMGFMT.mid' } } { "timestamp": { "seconds": TIMESTAMP, @@ -102,6 +104,7 @@ wrote 65536/65536 bytes at offset 1048576 =3D=3D=3D Check that both top and top2 point to base now =3D=3D=3D +{ 'execute': 'query-named-block-nodes' } { "return": [ { @@ -378,6 +381,7 @@ wrote 65536/65536 bytes at offset 1048576 } ] } +{ 'execute': 'quit' } { "return": { } @@ -415,6 +419,7 @@ Formatting 'TEST_DIR/t.IMGFMT.ovl2', fmt=3DIMGFMT size= =3D67108864 backing_file=3DTEST_ Formatting 'TEST_DIR/t.IMGFMT.ovl3', fmt=3DIMGFMT size=3D67108864 backing_= file=3DTEST_DIR/t.IMGFMT.ovl2 wrote 65536/65536 bytes at offset 1048576 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ 'execute': 'qmp_capabilities' } { "return": { } @@ -422,6 +427,7 @@ wrote 65536/65536 bytes at offset 1048576 =3D=3D=3D Perform commit job =3D=3D=3D +{ 'execute': 'block-commit', 'arguments': { 'job-id': 'commit0', 'device':= 'top', 'base':'TEST_DIR/t.IMGFMT.base', 'top': 'TEST_DIR/t.IMGFMT.mid' } } { "timestamp": { "seconds": TIMESTAMP, @@ -509,6 +515,7 @@ wrote 65536/65536 bytes at offset 1048576 =3D=3D=3D Check that both top and top2 point to base now =3D=3D=3D +{ 'execute': 'query-named-block-nodes' } { "return": [ { @@ -796,6 +803,7 @@ wrote 65536/65536 bytes at offset 1048576 } ] } +{ 'execute': 'quit' } { "return": { } diff --git a/tests/qemu-iotests/200.out b/tests/qemu-iotests/200.out index af6a809e309d..a6776070e4d6 100644 --- a/tests/qemu-iotests/200.out +++ b/tests/qemu-iotests/200.out @@ -6,6 +6,7 @@ wrote 314572800/314572800 bytes at offset 512 =3D=3D=3D Starting QEMU VM =3D=3D=3D +{ 'execute': 'qmp_capabilities' } {"return": {}} =3D=3D=3D Sending stream/cancel, checking for SIGSEGV only =3D=3D=3D diff --git a/tests/qemu-iotests/223.out b/tests/qemu-iotests/223.out index 23b34fcd202e..861ddbd9e0a4 100644 --- a/tests/qemu-iotests/223.out +++ b/tests/qemu-iotests/223.out @@ -24,19 +24,32 @@ wrote 2097152/2097152 bytes at offset 2097152 =3D=3D=3D End dirty bitmaps, and start serving image over NBD =3D=3D=3D +{"execute":"qmp_capabilities"} {"return": {}} +{"execute":"blockdev-add", "arguments":{"driver":"IMGFMT", "node-name":"n"= , "file":{"driver":"file", "filename":"TEST_DIR/t.IMGFMT"}}} {"return": {}} +{"execute":"x-blockdev-set-iothread", "arguments":{"node-name":"n", "iothr= ead":"io0"}} {"return": {}} +{"execute":"block-dirty-bitmap-disable", "arguments":{"node":"n", "name":"= b"}} {"return": {}} +{"execute":"nbd-server-add", "arguments":{"device":"n"}} {"error": {"class": "GenericError", "desc": "NBD server not running"}} +{"execute":"nbd-server-start", "arguments":{"addr":{"type":"unix", "data":= {"path":"SOCK_DIR/nbd"}}}} {"return": {}} +{"execute":"nbd-server-start", "arguments":{"addr":{"type":"unix", "data":= {"path":"SOCK_DIR/nbd1"}}}} {"error": {"class": "GenericError", "desc": "NBD server already running"}} exports available: 0 +{"execute":"nbd-server-add", "arguments":{"device":"n", "bitmap":"b"}} {"return": {}} +{"execute":"nbd-server-add", "arguments":{"device":"nosuch"}} {"error": {"class": "GenericError", "desc": "Cannot find device=3Dnosuch n= or node_name=3Dnosuch"}} +{"execute":"nbd-server-add", "arguments":{"device":"n"}} {"error": {"class": "GenericError", "desc": "NBD server already has export= named 'n'"}} +{"execute":"nbd-server-add", "arguments":{"device":"n", "name":"n2", "bitm= ap":"b2"}} {"error": {"class": "GenericError", "desc": "Enabled bitmap 'b2' incompati= ble with readonly export"}} +{"execute":"nbd-server-add", "arguments":{"device":"n", "name":"n2", "bitm= ap":"b3"}} {"error": {"class": "GenericError", "desc": "Bitmap 'b3' is not found"}} +{"execute":"nbd-server-add", "arguments":{"device":"n", "name":"n2", "writ= able":true, "bitmap":"b2"}} {"return": {}} exports available: 2 export: 'n' @@ -84,11 +97,17 @@ read 2097152/2097152 bytes at offset 2097152 =3D=3D=3D End qemu NBD server =3D=3D=3D +{"execute":"nbd-server-remove", "arguments":{"name":"n"}} {"return": {}} +{"execute":"nbd-server-remove", "arguments":{"name":"n2"}} {"return": {}} +{"execute":"nbd-server-remove", "arguments":{"name":"n2"}} {"error": {"class": "GenericError", "desc": "Export 'n2' is not found"}} +{"execute":"nbd-server-stop"} {"return": {}} +{"execute":"nbd-server-stop"} {"error": {"class": "GenericError", "desc": "NBD server not running"}} +{"execute":"quit"} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} diff --git a/tests/qemu-iotests/229.out b/tests/qemu-iotests/229.out index a3eb33788a6f..22350d75d7b1 100644 --- a/tests/qemu-iotests/229.out +++ b/tests/qemu-iotests/229.out @@ -3,10 +3,12 @@ Formatting 'TEST_DIR/b.IMGFMT', fmt=3DIMGFMT size=3D20971= 52 Formatting 'TEST_DIR/d.IMGFMT', fmt=3DIMGFMT size=3D1048576 wrote 2097152/2097152 bytes at offset 0 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{'execute': 'qmp_capabilities'} {"return": {}} =3D=3D=3D Starting drive-mirror, causing error & stop =3D=3D=3D +{'execute': 'drive-mirror', 'arguments': {'device': 'testdisk', 'format': = 'IMGFMT', 'target': 'TEST_DIR/d.IMGFMT', 'sync': 'full', 'mode': 'existing'= , 'on-source-error': 'stop', 'on-target-error': 'stop' }} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "testdisk"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "testdisk"}} {"return": {}} @@ -15,6 +17,7 @@ wrote 2097152/2097152 bytes at offset 0 =3D=3D=3D Force cancel job paused in error state =3D=3D=3D +{'execute': 'block-job-cancel', 'arguments': { 'device': 'testdisk', 'forc= e': true}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "testdisk"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "aborting", "id": "testdisk"}} diff --git a/tests/qemu-iotests/249.out b/tests/qemu-iotests/249.out index 1c93164e84be..51307ed0f795 100644 --- a/tests/qemu-iotests/249.out +++ b/tests/qemu-iotests/249.out @@ -2,24 +2,29 @@ QA output created by 249 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=3DIMGFMT size=3D1048576 Formatting 'TEST_DIR/t.IMGFMT.int', fmt=3DIMGFMT size=3D1048576 backing_fi= le=3DTEST_DIR/t.IMGFMT.base Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1048576 backing_file= =3DTEST_DIR/t.IMGFMT.int +{ 'execute': 'qmp_capabilities' } {"return": {}} =3D=3D=3D Send a write command to a drive opened in read-only mode (1) +{ 'execute': 'human-monitor-command', 'arguments': {'command-line': 'qemu-= io none0 "aio_write 0 2k"'}} {"return": "Block node is read-onlyrn"} =3D=3D=3D Run block-commit on base using an invalid filter node name +{ 'execute': 'block-commit', 'arguments': {'job-id': 'job0', 'device': 'no= ne1', 'top-node': 'int', 'filter-node-name': '1234'}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "job0"}} {"error": {"class": "GenericError", "desc": "Invalid node name"}} =3D=3D=3D Send a write command to a drive opened in read-only mode (2) +{ 'execute': 'human-monitor-command', 'arguments': {'command-line': 'qemu-= io none0 "aio_write 0 2k"'}} {"return": "Block node is read-onlyrn"} =3D=3D=3D Run block-commit on base using the default filter node name +{ 'execute': 'block-commit', 'arguments': {'job-id': 'job0', 'device': 'no= ne1', 'top-node': 'int'}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "job0"}} {"return": {}} @@ -31,5 +36,6 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D10485= 76 backing_file=3DTEST_DIR/t. =3D=3D=3D Send a write command to a drive opened in read-only mode (3) +{ 'execute': 'human-monitor-command', 'arguments': {'command-line': 'qemu-= io none0 "aio_write 0 2k"'}} {"return": "Block node is read-onlyrn"} *** done --=20 2.21.0 From nobody Mon May 6 12:55:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1574133493; cv=none; d=zoho.com; s=zohoarc; b=ihB/25HugWpbhK+1aXXewhmwGnLABfEciG1ZEQnh1fbeIZ61bZyOHdUpWHRM/olmbGhKmMwUuVB4HfklpFODhvPi+RUyIGefNjYs5B4GZmJSuBlfFvcKANMqNhJbT3CXWbye/C0fG5AGTcobuhRITc3Cq6PP4qrYSAjh9WFDdkg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574133493; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ujtplviA/x8uN9i/qtZrm2+sdifmXmyfmx4eOWXFTso=; b=ejHm/AVrmxJ280BF8nnMmXfuC8caFIoJaEJSUjcDCo+9VCfA+nL437L94oG89zE79+lG/sDwMnAFEJJ3prmev8tMR1G6fpQmXelIfNi74DiKNhfrw4Ogezsg7JPcSFk0DPuV1rbKR/EKuVEV8FBlBxrgrp0ZJlBZoLlj0MzQdVo= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157413349360146.064193572015256; Mon, 18 Nov 2019 19:18:13 -0800 (PST) Received: from localhost ([::1]:41352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWu1s-0005Ng-Df for importer@patchew.org; Mon, 18 Nov 2019 22:18:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42845) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWtsK-0001xj-8o for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iWtsI-0004oK-IG for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:20 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:41197 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iWtsI-0004ne-D3 for qemu-devel@nongnu.org; Mon, 18 Nov 2019 22:08:18 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-41-v8tF2K64OiGj27LLTKr1gA-1; Mon, 18 Nov 2019 22:08:16 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7661D2EDA; Tue, 19 Nov 2019 03:08:15 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-221.phx2.redhat.com [10.3.116.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 01AC787B1; Tue, 19 Nov 2019 03:08:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574132897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ujtplviA/x8uN9i/qtZrm2+sdifmXmyfmx4eOWXFTso=; b=K3w9L0Rpc1WtbKaZZLIzcJpHlwN3SJIhJgWax7Nc1FEL1zXMU8I+7iH75Ds9ihoWE/lDTm c6Bv7LHaVK+cKyqsHYx/SzAPeTzjlwzr1h3xKtYLh6V3IpND2RVwg7haAN0pOv98MxQqdK Eof6lc0mYry4ZP4DUM2pz1plahdF94E= From: Eric Blake To: qemu-devel@nongnu.org Subject: [PULL 10/10] tests: More iotest 223 improvements Date: Mon, 18 Nov 2019 21:07:59 -0600 Message-Id: <20191119030759.24907-11-eblake@redhat.com> In-Reply-To: <20191119030759.24907-1-eblake@redhat.com> References: <20191119030759.24907-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: v8tF2K64OiGj27LLTKr1gA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nir Soffer , Kevin Wolf , "open list:Block layer core" , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Run the core of the test twice, once without iothreads, and again with, for more coverage of both setups. Suggested-by: Nir Soffer Signed-off-by: Eric Blake Reviewed-by: Max Reitz Message-Id: <20191114213415.23499-5-eblake@redhat.com> --- tests/qemu-iotests/223 | 16 ++++++- tests/qemu-iotests/223.out | 85 +++++++++++++++++++++++++++++++++++++- 2 files changed, 97 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/223 b/tests/qemu-iotests/223 index b5a80e50bbc1..ea69cd4b8b5e 100755 --- a/tests/qemu-iotests/223 +++ b/tests/qemu-iotests/223 @@ -117,10 +117,19 @@ _send_qemu_cmd $QEMU_HANDLE '{"execute":"qmp_capabili= ties"}' "return" _send_qemu_cmd $QEMU_HANDLE '{"execute":"blockdev-add", "arguments":{"driver":"qcow2", "node-name":"n", "file":{"driver":"file", "filename":"'"$TEST_IMG"'"}}}' "return" -_send_qemu_cmd $QEMU_HANDLE '{"execute":"x-blockdev-set-iothread", - "arguments":{"node-name":"n", "iothread":"io0"}}' "return" _send_qemu_cmd $QEMU_HANDLE '{"execute":"block-dirty-bitmap-disable", "arguments":{"node":"n", "name":"b"}}' "return" + +for attempt in normal iothread; do + +echo +echo "=3D=3D=3D Set up NBD with $attempt access =3D=3D=3D" +echo +if [ $attempt =3D iothread ]; then +_send_qemu_cmd $QEMU_HANDLE '{"execute":"x-blockdev-set-iothread", + "arguments":{"node-name":"n", "iothread":"io0"}}' "return" +fi + _send_qemu_cmd $QEMU_HANDLE '{"execute":"nbd-server-add", "arguments":{"device":"n"}}' "error" # Attempt add without server _send_qemu_cmd $QEMU_HANDLE '{"execute":"nbd-server-start", @@ -180,6 +189,9 @@ _send_qemu_cmd $QEMU_HANDLE '{"execute":"nbd-server-rem= ove", "arguments":{"name":"n2"}}' "error" # Attempt duplicate clean _send_qemu_cmd $QEMU_HANDLE '{"execute":"nbd-server-stop"}' "return" _send_qemu_cmd $QEMU_HANDLE '{"execute":"nbd-server-stop"}' "error" # Again + +done + _send_qemu_cmd $QEMU_HANDLE '{"execute":"quit"}' "return" wait=3Dyes _cleanup_qemu diff --git a/tests/qemu-iotests/223.out b/tests/qemu-iotests/223.out index 861ddbd9e0a4..f17559880268 100644 --- a/tests/qemu-iotests/223.out +++ b/tests/qemu-iotests/223.out @@ -28,10 +28,91 @@ wrote 2097152/2097152 bytes at offset 2097152 {"return": {}} {"execute":"blockdev-add", "arguments":{"driver":"IMGFMT", "node-name":"n"= , "file":{"driver":"file", "filename":"TEST_DIR/t.IMGFMT"}}} {"return": {}} -{"execute":"x-blockdev-set-iothread", "arguments":{"node-name":"n", "iothr= ead":"io0"}} -{"return": {}} {"execute":"block-dirty-bitmap-disable", "arguments":{"node":"n", "name":"= b"}} {"return": {}} + +=3D=3D=3D Set up NBD with normal access =3D=3D=3D + +{"execute":"nbd-server-add", "arguments":{"device":"n"}} +{"error": {"class": "GenericError", "desc": "NBD server not running"}} +{"execute":"nbd-server-start", "arguments":{"addr":{"type":"unix", "data":= {"path":"SOCK_DIR/nbd"}}}} +{"return": {}} +{"execute":"nbd-server-start", "arguments":{"addr":{"type":"unix", "data":= {"path":"SOCK_DIR/nbd1"}}}} +{"error": {"class": "GenericError", "desc": "NBD server already running"}} +exports available: 0 +{"execute":"nbd-server-add", "arguments":{"device":"n", "bitmap":"b"}} +{"return": {}} +{"execute":"nbd-server-add", "arguments":{"device":"nosuch"}} +{"error": {"class": "GenericError", "desc": "Cannot find device=3Dnosuch n= or node_name=3Dnosuch"}} +{"execute":"nbd-server-add", "arguments":{"device":"n"}} +{"error": {"class": "GenericError", "desc": "NBD server already has export= named 'n'"}} +{"execute":"nbd-server-add", "arguments":{"device":"n", "name":"n2", "bitm= ap":"b2"}} +{"error": {"class": "GenericError", "desc": "Enabled bitmap 'b2' incompati= ble with readonly export"}} +{"execute":"nbd-server-add", "arguments":{"device":"n", "name":"n2", "bitm= ap":"b3"}} +{"error": {"class": "GenericError", "desc": "Bitmap 'b3' is not found"}} +{"execute":"nbd-server-add", "arguments":{"device":"n", "name":"n2", "writ= able":true, "bitmap":"b2"}} +{"return": {}} +exports available: 2 + export: 'n' + size: 4194304 + flags: 0x58f ( readonly flush fua df multi cache ) + min block: 1 + opt block: 4096 + max block: 33554432 + available meta contexts: 2 + base:allocation + qemu:dirty-bitmap:b + export: 'n2' + size: 4194304 + flags: 0xced ( flush fua trim zeroes df cache fast-zero ) + min block: 1 + opt block: 4096 + max block: 33554432 + available meta contexts: 2 + base:allocation + qemu:dirty-bitmap:b2 + +=3D=3D=3D Contrast normal status to large granularity dirty-bitmap =3D=3D= =3D + +read 512/512 bytes at offset 512 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 524288/524288 bytes at offset 524288 +512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 1048576/1048576 bytes at offset 1048576 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 2097152/2097152 bytes at offset 2097152 +2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[{ "start": 0, "length": 4096, "depth": 0, "zero": false, "data": true, "o= ffset": OFFSET}, +{ "start": 4096, "length": 1044480, "depth": 0, "zero": true, "data": fals= e, "offset": OFFSET}, +{ "start": 1048576, "length": 3145728, "depth": 0, "zero": false, "data": = true, "offset": OFFSET}] +[{ "start": 0, "length": 65536, "depth": 0, "zero": false, "data": false}, +{ "start": 65536, "length": 2031616, "depth": 0, "zero": false, "data": tr= ue, "offset": OFFSET}, +{ "start": 2097152, "length": 2097152, "depth": 0, "zero": false, "data": = false}] + +=3D=3D=3D Contrast to small granularity dirty-bitmap =3D=3D=3D + +[{ "start": 0, "length": 512, "depth": 0, "zero": false, "data": true, "of= fset": OFFSET}, +{ "start": 512, "length": 512, "depth": 0, "zero": false, "data": false}, +{ "start": 1024, "length": 2096128, "depth": 0, "zero": false, "data": tru= e, "offset": OFFSET}, +{ "start": 2097152, "length": 2097152, "depth": 0, "zero": false, "data": = false}] + +=3D=3D=3D End qemu NBD server =3D=3D=3D + +{"execute":"nbd-server-remove", "arguments":{"name":"n"}} +{"return": {}} +{"execute":"nbd-server-remove", "arguments":{"name":"n2"}} +{"return": {}} +{"execute":"nbd-server-remove", "arguments":{"name":"n2"}} +{"error": {"class": "GenericError", "desc": "Export 'n2' is not found"}} +{"execute":"nbd-server-stop"} +{"return": {}} +{"execute":"nbd-server-stop"} +{"error": {"class": "GenericError", "desc": "NBD server not running"}} + +=3D=3D=3D Set up NBD with iothread access =3D=3D=3D + +{"execute":"x-blockdev-set-iothread", "arguments":{"node-name":"n", "iothr= ead":"io0"}} +{"return": {}} {"execute":"nbd-server-add", "arguments":{"device":"n"}} {"error": {"class": "GenericError", "desc": "NBD server not running"}} {"execute":"nbd-server-start", "arguments":{"addr":{"type":"unix", "data":= {"path":"SOCK_DIR/nbd"}}}} --=20 2.21.0