From nobody Thu Nov 13 19:09:41 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.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=1582592394; cv=none; d=zohomail.com; s=zohoarc; b=lcQW/CUgSN245v3iR9K4jTdhyN7r3miMJV34h9O4B0PS06lnYblc09PrdIVjx+kNMhS1atJw/zHWdLlDaBT6vHkL0zqNMjjuV0HUfjcvm04Fu9+CEHxQyKJSZiVPI9wKp+0P/Mhh9300VHoez/rHRdNfUmn4S/uxG2/cwK6fZKE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582592394; 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=sQpawlHWZj8fgnURexlifL0mL4tgU/O1hJjXHfeC4Vk=; b=G6DYUcudR3fEzhgw0W0z0WaObjCdodIDjc/2JgFi80QuRmzaKrC0ONcObTh9Qeirieb2/10YNu5ulxn+Y3EK6+hlfL9HsOajpm3Ccmb/m5ixn+Noka34WsUk28FH3jmxaraTALkLTBwnQWPKNoLlsaoxIs3yQW6C30/Z+HghCFw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 1582592394676647.9226100511188; Mon, 24 Feb 2020 16:59:54 -0800 (PST) Received: from localhost ([::1]:46886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6OZl-0006XM-H0 for importer@patchew.org; Mon, 24 Feb 2020 19:59:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55720) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6OWp-00023t-Vj for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:56:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6OWo-0007n2-6m for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:56:51 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:25039 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 1j6OWo-0007kJ-2L for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:56:50 -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-213-2PM4ifuYPqiLesVt0jISZw-1; Mon, 24 Feb 2020 19:56:45 -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 86E7C107ACC4; Tue, 25 Feb 2020 00:56:44 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-182.bos.redhat.com [10.18.17.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5DD6A1CB; Tue, 25 Feb 2020 00:56:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582592209; 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=sQpawlHWZj8fgnURexlifL0mL4tgU/O1hJjXHfeC4Vk=; b=AEZz3vpU/B1FurBPefhVC8AHpuAw6Z7mLXWyAD7PN5/i5CyrmE4WU4OXkBObag8lt7vYen 7IG+kZNB5zjHISkrkQVAWGEKdlr19pFztSHfGIjkw0H/KygNoWQo+8y2nbXfYTP/vFpDR4 jfkq6kOojbKwbcdM3p5QzvxHzk8ubIU= X-MC-Unique: 2PM4ifuYPqiLesVt0jISZw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 1/6] block: add bitmap-populate job Date: Mon, 24 Feb 2020 19:56:36 -0500 Message-Id: <20200225005641.5478-2-jsnow@redhat.com> In-Reply-To: <20200225005641.5478-1-jsnow@redhat.com> References: <20200225005641.5478-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 , vsementsov@virtuozzo.com, Eduardo Habkost , qemu-block@nongnu.org, Markus Armbruster , Max Reitz , pkrempa@redhat.com, Cleber Rosa , 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" This job copies the allocation map into a bitmap. It's a job because there's no guarantee that allocation interrogation will be quick (or won't hang), so it cannot be retrofit into block-dirty-bitmap-merge. It was designed with different possible population patterns in mind, but only top layer allocation was implemented for now. Signed-off-by: John Snow --- qapi/block-core.json | 48 +++++++++ qapi/job.json | 2 +- include/block/block_int.h | 21 ++++ block/bitmap-alloc.c | 207 ++++++++++++++++++++++++++++++++++++++ blockjob.c | 3 +- block/Makefile.objs | 1 + 6 files changed, 280 insertions(+), 2 deletions(-) create mode 100644 block/bitmap-alloc.c diff --git a/qapi/block-core.json b/qapi/block-core.json index 85e27bb61f..df1797681a 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -2245,6 +2245,54 @@ { 'command': 'block-dirty-bitmap-merge', 'data': 'BlockDirtyBitmapMerge' } =20 +## +# @BitmapPattern: +# +# An enumeration of possible patterns that can be written into a bitmap. +# +# @allocation-top: The allocation status of the top layer +# of the attached storage node. +# +# Since: 5.0 +## +{ 'enum': 'BitmapPattern', + 'data': ['allocation-top'] } + +## +# @BlockDirtyBitmapPopulate: +# +# @job-id: identifier for the newly-created block job. +# +# @pattern: What pattern should be written into the bitmap? +# +# @on-error: the action to take if an error is encountered on a bitmap's +# attached node, default 'report'. +# 'stop' and 'enospc' can only be used if the block device supp= orts +# io-status (see BlockInfo). +# +# @auto-finalize: When false, this job will wait in a PENDING state after = it has +# finished its work, waiting for @block-job-finalize before +# making any block graph changes. +# When true, this job will automatically +# perform its abort or commit actions. +# Defaults to true. +# +# @auto-dismiss: When false, this job will wait in a CONCLUDED state after= it +# has completely ceased all work, and awaits @block-job-dis= miss. +# When true, this job will automatically disappear from the= query +# list without user intervention. +# Defaults to true. +# +# Since: 5.0 +## +{ 'struct': 'BlockDirtyBitmapPopulate', + 'base': 'BlockDirtyBitmap', + 'data': { 'job-id': 'str', + 'pattern': 'BitmapPattern', + '*on-error': 'BlockdevOnError', + '*auto-finalize': 'bool', + '*auto-dismiss': 'bool' } } + ## # @BlockDirtyBitmapSha256: # diff --git a/qapi/job.json b/qapi/job.json index 5e658281f5..5f496d4630 100644 --- a/qapi/job.json +++ b/qapi/job.json @@ -22,7 +22,7 @@ # Since: 1.7 ## { 'enum': 'JobType', - 'data': ['commit', 'stream', 'mirror', 'backup', 'create'] } + 'data': ['commit', 'stream', 'mirror', 'backup', 'create', 'bitmap-popul= ate'] } =20 ## # @JobStatus: diff --git a/include/block/block_int.h b/include/block/block_int.h index 6f9fd5e20e..a5884b597e 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -1215,6 +1215,27 @@ BlockJob *backup_job_create(const char *job_id, Bloc= kDriverState *bs, BlockCompletionFunc *cb, void *opaque, JobTxn *txn, Error **errp); =20 +/* + * bitpop_job_create: Create a new bitmap population job. + * + * @job_id: The id of the newly-created job. + * @bs: Block device associated with the @target_bitmap. + * @target_bitmap: The bitmap to populate. + * @on_error: What to do if an error on @bs is encountered. + * @creation_flags: Flags that control the behavior of the Job lifetime. + * See @BlockJobCreateFlags + * @cb: Completion function for the job. + * @opaque: Opaque pointer value passed to @cb. + * @txn: Transaction that this job is part of (may be NULL). + */ +BlockJob *bitpop_job_create(const char *job_id, BlockDriverState *bs, + BdrvDirtyBitmap *target_bitmap, + BitmapPattern pattern, + BlockdevOnError on_error, + int creation_flags, + BlockCompletionFunc *cb, void *opaque, + JobTxn *txn, Error **errp); + void hmp_drive_add_node(Monitor *mon, const char *optstr); =20 BdrvChild *bdrv_root_attach_child(BlockDriverState *child_bs, diff --git a/block/bitmap-alloc.c b/block/bitmap-alloc.c new file mode 100644 index 0000000000..47d542dc12 --- /dev/null +++ b/block/bitmap-alloc.c @@ -0,0 +1,207 @@ +/* + * Async Dirty Bitmap Populator + * + * Copyright (C) 2020 Red Hat, Inc. + * + * Authors: + * John Snow + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + * + */ + +#include "qemu/osdep.h" + +#include "trace.h" +#include "block/block.h" +#include "block/block_int.h" +#include "block/blockjob_int.h" +#include "block/block_backup.h" +#include "block/block-copy.h" +#include "qapi/error.h" +#include "qapi/qmp/qerror.h" +#include "qemu/ratelimit.h" +#include "qemu/cutils.h" +#include "sysemu/block-backend.h" +#include "qemu/bitmap.h" +#include "qemu/error-report.h" + +typedef struct BitpopBlockJob { + BlockJob common; + BlockDriverState *bs; + BdrvDirtyBitmap *target_bitmap; + BdrvDirtyBitmap *new_bitmap; + BlockdevOnError on_error; + uint64_t len; +} BitpopBlockJob; + +static const BlockJobDriver bitpop_job_driver; + +static void bitpop_commit(Job *job) +{ + BitpopBlockJob *s =3D container_of(job, BitpopBlockJob, common.job); + + bdrv_dirty_bitmap_merge_internal(s->target_bitmap, s->new_bitmap, + NULL, true); +} + +/* no abort needed; just clean without committing. */ + +static void bitpop_clean(Job *job) +{ + BitpopBlockJob *s =3D container_of(job, BitpopBlockJob, common.job); + + bdrv_release_dirty_bitmap(s->new_bitmap); + bdrv_dirty_bitmap_set_busy(s->target_bitmap, false); +} + +static BlockErrorAction bitpop_error_action(BitpopBlockJob *job, int error) +{ + return block_job_error_action(&job->common, job->on_error, true, error= ); +} + +static bool coroutine_fn yield_and_check(Job *job) +{ + if (job_is_cancelled(job)) { + return true; + } + + job_sleep_ns(job, 0); + + if (job_is_cancelled(job)) { + return true; + } + + return false; +} + +static int coroutine_fn bitpop_run(Job *job, Error **errp) +{ + BitpopBlockJob *s =3D container_of(job, BitpopBlockJob, common.job); + int ret =3D 0; + int64_t offset; + int64_t count; + int64_t bytes; + + for (offset =3D 0; offset < s->len; ) { + if (yield_and_check(job)) { + ret =3D -ECANCELED; + break; + } + + bytes =3D s->len - offset; + ret =3D bdrv_is_allocated(s->bs, offset, bytes, &count); + if (ret < 0) { + if (bitpop_error_action(s, -ret) =3D=3D BLOCK_ERROR_ACTION_REP= ORT) { + break; + } + continue; + } + + if (!count) { + ret =3D 0; + break; + } + + if (ret) { + bdrv_set_dirty_bitmap(s->new_bitmap, offset, count); + ret =3D 0; + } + + job_progress_update(job, count); + offset +=3D count; + } + + return ret; +} + +static const BlockJobDriver bitpop_job_driver =3D { + .job_driver =3D { + .instance_size =3D sizeof(BitpopBlockJob), + .job_type =3D JOB_TYPE_BITMAP_POPULATE, + .free =3D block_job_free, + .user_resume =3D block_job_user_resume, + .run =3D bitpop_run, + .commit =3D bitpop_commit, + .clean =3D bitpop_clean, + } +}; + + +BlockJob *bitpop_job_create( + const char *job_id, + BlockDriverState *bs, + BdrvDirtyBitmap *target_bitmap, + BitmapPattern pattern, + BlockdevOnError on_error, + int creation_flags, + BlockCompletionFunc *cb, + void *opaque, + JobTxn *txn, + Error **errp) +{ + int64_t len; + BitpopBlockJob *job =3D NULL; + int64_t cluster_size; + BdrvDirtyBitmap *new_bitmap =3D NULL; + + assert(bs); + assert(target_bitmap); + + if (!bdrv_is_inserted(bs)) { + error_setg(errp, "Device is not inserted: %s", + bdrv_get_device_name(bs)); + return NULL; + } + + if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_BACKUP_SOURCE, errp)) { + return NULL; + } + + if (bdrv_dirty_bitmap_check(target_bitmap, BDRV_BITMAP_DEFAULT, errp))= { + return NULL; + } + + if (pattern !=3D BITMAP_PATTERN_ALLOCATION_TOP) { + error_setg(errp, "Unrecognized bitmap pattern"); + return NULL; + } + + len =3D bdrv_getlength(bs); + if (len < 0) { + error_setg_errno(errp, -len, "unable to get length for '%s'", + bdrv_get_device_name(bs)); + return NULL; + } + + /* NB: new bitmap is anonymous and enabled */ + cluster_size =3D bdrv_dirty_bitmap_granularity(target_bitmap); + new_bitmap =3D bdrv_create_dirty_bitmap(bs, cluster_size, NULL, errp); + if (!new_bitmap) { + return NULL; + } + + /* Take ownership; we reserve the right to write into this on-commit. = */ + bdrv_dirty_bitmap_set_busy(target_bitmap, true); + + job =3D block_job_create(job_id, &bitpop_job_driver, txn, bs, + BLK_PERM_CONSISTENT_READ, + BLK_PERM_ALL & ~BLK_PERM_RESIZE, + 0, creation_flags, + cb, opaque, errp); + if (!job) { + bdrv_dirty_bitmap_set_busy(target_bitmap, false); + bdrv_release_dirty_bitmap(new_bitmap); + return NULL; + } + + job->bs =3D bs; + job->on_error =3D on_error; + job->target_bitmap =3D target_bitmap; + job->new_bitmap =3D new_bitmap; + job->len =3D len; + job_progress_set_remaining(&job->common.job, job->len); + + return &job->common; +} diff --git a/blockjob.c b/blockjob.c index 5d63b1e89d..7e450372bd 100644 --- a/blockjob.c +++ b/blockjob.c @@ -56,7 +56,8 @@ static bool is_block_job(Job *job) return job_type(job) =3D=3D JOB_TYPE_BACKUP || job_type(job) =3D=3D JOB_TYPE_COMMIT || job_type(job) =3D=3D JOB_TYPE_MIRROR || - job_type(job) =3D=3D JOB_TYPE_STREAM; + job_type(job) =3D=3D JOB_TYPE_STREAM || + job_type(job) =3D=3D JOB_TYPE_BITMAP_POPULATE; } =20 BlockJob *block_job_next(BlockJob *bjob) diff --git a/block/Makefile.objs b/block/Makefile.objs index 3bcb35c81d..f3cfc89d90 100644 --- a/block/Makefile.objs +++ b/block/Makefile.objs @@ -36,6 +36,7 @@ block-obj-$(CONFIG_LIBSSH) +=3D ssh.o block-obj-y +=3D accounting.o dirty-bitmap.o block-obj-y +=3D write-threshold.o block-obj-y +=3D backup.o +block-obj-y +=3D bitmap-alloc.o block-obj-$(CONFIG_REPLICATION) +=3D replication.o block-obj-y +=3D throttle.o copy-on-read.o block-obj-y +=3D block-copy.o --=20 2.21.1 From nobody Thu Nov 13 19:09:41 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.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=1582592293; cv=none; d=zohomail.com; s=zohoarc; b=NClYuxGlgn1gfbQ2UURpNIDESQi0Td7fy1ttxFaMwJVmCAKR6YbJlO3luNq8swtB9/vcsElaUxys0vGOr3rcMNIyPyw4kGOUxYkI92zmOYqOSOdLiAh6Uhgs6/c9ES4qh5lMz4YnSY+3malYUhd0ef4y1/WTPySRDHkBBpLDrrc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582592293; 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=DQ6DxV6jZ9EhK0MmlKoFdt0A7LnpMjVQOlhjqUq1BYs=; b=K6TxVW2x0ct9g2VoqFHhq2Lm7oDFnPVPsue0smZrYckoGvwAkMelcgL9crHUWExf+mkMzp/t4pPxkbeJa5Fq1WdttMS05n2ozYGcgqtLD5wlonK6sD9q63jRJqkrJ5P75uJSmo6tuoHRmxVDctD2/dF1Ny+cfoVOm6sBDhYgXds= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 158259229320714.101797911207768; Mon, 24 Feb 2020 16:58:13 -0800 (PST) Received: from localhost ([::1]:46855 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6OY7-0003nh-Nv for importer@patchew.org; Mon, 24 Feb 2020 19:58:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55721) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6OWp-00023u-VO for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:56:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6OWo-0007oB-Mx for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:56:51 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:57914 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 1j6OWo-0007nR-Jg for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:56:50 -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-192-S5Qm0YZuMzWDVuhvBuNnoQ-1; Mon, 24 Feb 2020 19:56:46 -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 90194800D50; Tue, 25 Feb 2020 00:56:45 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-182.bos.redhat.com [10.18.17.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id A25121CB; Tue, 25 Feb 2020 00:56:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582592210; 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=DQ6DxV6jZ9EhK0MmlKoFdt0A7LnpMjVQOlhjqUq1BYs=; b=NQxqH2uiq+fYhN0FsVGtMBeX6DX/kYk7+cI77/5gLhazl7E8GQXUt5YKGZXZlt+q4eHCgx CpTwYVMfqG6dCw2otdx1UOZeR34KXI/BOfoGwN0lkomkG2hH/1s6WrAXR2JYSAISXTkDYY eda0P9+gGSeoSJnq/z+N/g9liapJPok= X-MC-Unique: S5Qm0YZuMzWDVuhvBuNnoQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 2/6] qmp: expose block-dirty-bitmap-populate Date: Mon, 24 Feb 2020 19:56:37 -0500 Message-Id: <20200225005641.5478-3-jsnow@redhat.com> In-Reply-To: <20200225005641.5478-1-jsnow@redhat.com> References: <20200225005641.5478-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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 , vsementsov@virtuozzo.com, Eduardo Habkost , qemu-block@nongnu.org, Markus Armbruster , Max Reitz , pkrempa@redhat.com, Cleber Rosa , 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" This is a new job-creating command. Signed-off-by: John Snow --- qapi/block-core.json | 18 ++++++++++ qapi/transaction.json | 2 ++ blockdev.c | 78 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+) diff --git a/qapi/block-core.json b/qapi/block-core.json index df1797681a..a8be1fb36b 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -2293,6 +2293,24 @@ '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } } =20 +## +# @block-dirty-bitmap-populate: +# +# Creates a new job that writes a pattern into a dirty bitmap. +# +# Since: 5.0 +# +# Example: +# +# -> { "execute": "block-dirty-bitmap-populate", +# "arguments": { "node": "drive0", "target": "bitmap0", +# "job-id": "job0", "pattern": "allocate-top" } } +# <- { "return": {} } +# +## +{ 'command': 'block-dirty-bitmap-populate', 'boxed': true, + 'data': 'BlockDirtyBitmapPopulate' } + ## # @BlockDirtyBitmapSha256: # diff --git a/qapi/transaction.json b/qapi/transaction.json index 04301f1be7..28521d5c7f 100644 --- a/qapi/transaction.json +++ b/qapi/transaction.json @@ -50,6 +50,7 @@ # - @block-dirty-bitmap-enable: since 4.0 # - @block-dirty-bitmap-disable: since 4.0 # - @block-dirty-bitmap-merge: since 4.0 +# - @block-dirty-bitmap-populate: since 5.0 # - @blockdev-backup: since 2.3 # - @blockdev-snapshot: since 2.5 # - @blockdev-snapshot-internal-sync: since 1.7 @@ -67,6 +68,7 @@ 'block-dirty-bitmap-enable': 'BlockDirtyBitmap', 'block-dirty-bitmap-disable': 'BlockDirtyBitmap', 'block-dirty-bitmap-merge': 'BlockDirtyBitmapMerge', + 'block-dirty-bitmap-populate': 'BlockDirtyBitmapPopulate', 'blockdev-backup': 'BlockdevBackup', 'blockdev-snapshot': 'BlockdevSnapshot', 'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal', diff --git a/blockdev.c b/blockdev.c index 011dcfec27..33c0e35399 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2314,6 +2314,67 @@ static void block_dirty_bitmap_remove_commit(BlkActi= onState *common) bdrv_release_dirty_bitmap(state->bitmap); } =20 +static void block_dirty_bitmap_populate_prepare(BlkActionState *common, Er= ror **errp) +{ + BlockdevBackupState *state =3D DO_UPCAST(BlockdevBackupState, common, = common); + BlockDirtyBitmapPopulate *bitpop; + BlockDriverState *bs; + AioContext *aio_context; + BdrvDirtyBitmap *bmap =3D NULL; + int job_flags =3D JOB_DEFAULT; + + assert(common->action->type =3D=3D TRANSACTION_ACTION_KIND_BLOCK_DIRTY= _BITMAP_POPULATE); + bitpop =3D common->action->u.block_dirty_bitmap_populate.data; + + bs =3D bdrv_lookup_bs(bitpop->node, bitpop->node, errp); + if (!bs) { + return; + } + + aio_context =3D bdrv_get_aio_context(bs); + aio_context_acquire(aio_context); + state->bs =3D bs; + + bmap =3D bdrv_find_dirty_bitmap(bs, bitpop->name); + if (!bmap) { + error_setg(errp, "Bitmap '%s' could not be found", bitpop->name); + return; + } + + /* Paired with .clean() */ + bdrv_drained_begin(state->bs); + + if (!bitpop->has_on_error) { + bitpop->on_error =3D BLOCKDEV_ON_ERROR_REPORT; + } + if (!bitpop->has_auto_finalize) { + bitpop->auto_finalize =3D true; + } + if (!bitpop->has_auto_dismiss) { + bitpop->auto_dismiss =3D true; + } + + if (!bitpop->auto_finalize) { + job_flags |=3D JOB_MANUAL_FINALIZE; + } + if (!bitpop->auto_dismiss) { + job_flags |=3D JOB_MANUAL_DISMISS; + } + + state->job =3D bitpop_job_create( + bitpop->job_id, + bs, + bmap, + bitpop->pattern, + bitpop->on_error, + job_flags, + NULL, NULL, + common->block_job_txn, + errp); + + aio_context_release(aio_context); +} + static void abort_prepare(BlkActionState *common, Error **errp) { error_setg(errp, "Transaction aborted using Abort action"); @@ -2397,6 +2458,13 @@ static const BlkActionOps actions[] =3D { .commit =3D block_dirty_bitmap_remove_commit, .abort =3D block_dirty_bitmap_remove_abort, }, + [TRANSACTION_ACTION_KIND_BLOCK_DIRTY_BITMAP_POPULATE] =3D { + .instance_size =3D sizeof(BlockdevBackupState), + .prepare =3D block_dirty_bitmap_populate_prepare, + .commit =3D blockdev_backup_commit, + .abort =3D blockdev_backup_abort, + .clean =3D blockdev_backup_clean, + }, /* Where are transactions for MIRROR, COMMIT and STREAM? * Although these blockjobs use transaction callbacks like the backup = job, * these jobs do not necessarily adhere to transaction semantics. @@ -3225,6 +3293,16 @@ void qmp_block_dirty_bitmap_merge(const char *node, = const char *target, do_block_dirty_bitmap_merge(node, target, bitmaps, NULL, errp); } =20 +void qmp_block_dirty_bitmap_populate(BlockDirtyBitmapPopulate *bitpop, + Error **errp) +{ + TransactionAction action =3D { + .type =3D TRANSACTION_ACTION_KIND_BLOCK_DIRTY_BITMAP_POPULATE, + .u.block_dirty_bitmap_populate.data =3D bitpop, + }; + blockdev_do_action(&action, errp); +} + BlockDirtyBitmapSha256 *qmp_x_debug_block_dirty_bitmap_sha256(const char *= node, const char *= name, Error **errp) --=20 2.21.1 From nobody Thu Nov 13 19:09:41 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.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=1582592302; cv=none; d=zohomail.com; s=zohoarc; b=K7SpnYqwEIOLD2DZ+OF6IH0MDAemV+H8ICJ7Nq/v9l+A0uNgoTeHFde3rfHQMAzThJuhh+3rUthkHVW6zikt2Y5nahRoEhBOFZCIZW5vkOIZ1Hk0VmbutlVMaD3W3A4K5fUM1i8iKyDMj43GswajdQD/OMT3Wh695gQJC11McR0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582592302; 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=c/wCudtQMl0134+X0MXUafJH6n/tbZq25GtZ65dP+LY=; b=fVzlc0AEqt5rd1P3tzPW+Hhn86tuXLa5OKS3z7UFPTiPQvHaK6txbRaR9/FXr+dGmH6Zdg8P/9iZKlBTH3B5fHGD89XeZUMvJs4HeH7hbwG5dOnSsMYERUOLLfw7rixzw4+Coj1YBg2DSM+XY+vY4DHnzvj7Kk3f5yRM8WpEnk0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 1582592302500806.2427155508012; Mon, 24 Feb 2020 16:58:22 -0800 (PST) Received: from localhost ([::1]:46858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6OYH-00044R-4S for importer@patchew.org; Mon, 24 Feb 2020 19:58:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55816) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6OWw-0002Cx-7S for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:56:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6OWt-00086N-6a for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:56:58 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:36082 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 1j6OWt-00084t-2S for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:56:55 -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-388-MieQXN5tOp-L7Ka33cXJeQ-1; Mon, 24 Feb 2020 19:56:47 -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 9A23D1007268; Tue, 25 Feb 2020 00:56:46 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-182.bos.redhat.com [10.18.17.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC7911CB; Tue, 25 Feb 2020 00:56:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582592214; 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=c/wCudtQMl0134+X0MXUafJH6n/tbZq25GtZ65dP+LY=; b=JMMc3oxIdahjK+MgfXJU7IGqsZkYnhthMiMU4NmRlEfUmY8gQzWuUCvTr6MZ0DF9OdQED8 gKzXXWdEkEpJcPslU1A4IMeoeYIZ+2rbwyDacL+NvInkwRdSZItC/blqN1aNUrD2h8iRot /x5KVj7JcssWQkBBeS7dYOEzSJSJvaU= X-MC-Unique: MieQXN5tOp-L7Ka33cXJeQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 3/6] iotests: move bitmap helpers into their own file Date: Mon, 24 Feb 2020 19:56:38 -0500 Message-Id: <20200225005641.5478-4-jsnow@redhat.com> In-Reply-To: <20200225005641.5478-1-jsnow@redhat.com> References: <20200225005641.5478-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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 , vsementsov@virtuozzo.com, Eduardo Habkost , qemu-block@nongnu.org, Markus Armbruster , Max Reitz , pkrempa@redhat.com, Cleber Rosa , 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" Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/257 | 110 +--------------------------- tests/qemu-iotests/bitmaps.py | 131 ++++++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 109 deletions(-) create mode 100644 tests/qemu-iotests/bitmaps.py diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index 004a433b8b..2a81f9e30c 100755 --- a/tests/qemu-iotests/257 +++ b/tests/qemu-iotests/257 @@ -24,120 +24,12 @@ import os =20 import iotests from iotests import log, qemu_img +from bitmaps import EmulatedBitmap, GROUPS =20 SIZE =3D 64 * 1024 * 1024 GRANULARITY =3D 64 * 1024 =20 =20 -class Pattern: - def __init__(self, byte, offset, size=3DGRANULARITY): - self.byte =3D byte - self.offset =3D offset - self.size =3D size - - def bits(self, granularity): - lower =3D self.offset // granularity - upper =3D (self.offset + self.size - 1) // granularity - return set(range(lower, upper + 1)) - - -class PatternGroup: - """Grouping of Pattern objects. Initialize with an iterable of Pattern= s.""" - def __init__(self, patterns): - self.patterns =3D patterns - - def bits(self, granularity): - """Calculate the unique bits dirtied by this pattern grouping""" - res =3D set() - for pattern in self.patterns: - res |=3D pattern.bits(granularity) - return res - - -GROUPS =3D [ - PatternGroup([ - # Batch 0: 4 clusters - Pattern('0x49', 0x0000000), - Pattern('0x6c', 0x0100000), # 1M - Pattern('0x6f', 0x2000000), # 32M - Pattern('0x76', 0x3ff0000)]), # 64M - 64K - PatternGroup([ - # Batch 1: 6 clusters (3 new) - Pattern('0x65', 0x0000000), # Full overwrite - Pattern('0x77', 0x00f8000), # Partial-left (1M-32K) - Pattern('0x72', 0x2008000), # Partial-right (32M+32K) - Pattern('0x69', 0x3fe0000)]), # Adjacent-left (64M - 128K) - PatternGroup([ - # Batch 2: 7 clusters (3 new) - Pattern('0x74', 0x0010000), # Adjacent-right - Pattern('0x69', 0x00e8000), # Partial-left (1M-96K) - Pattern('0x6e', 0x2018000), # Partial-right (32M+96K) - Pattern('0x67', 0x3fe0000, - 2*GRANULARITY)]), # Overwrite [(64M-128K)-64M) - PatternGroup([ - # Batch 3: 8 clusters (5 new) - # Carefully chosen such that nothing re-dirties the one cluster - # that copies out successfully before failure in Group #1. - Pattern('0xaa', 0x0010000, - 3*GRANULARITY), # Overwrite and 2x Adjacent-right - Pattern('0xbb', 0x00d8000), # Partial-left (1M-160K) - Pattern('0xcc', 0x2028000), # Partial-right (32M+160K) - Pattern('0xdd', 0x3fc0000)]), # New; leaving a gap to the right -] - - -class EmulatedBitmap: - def __init__(self, granularity=3DGRANULARITY): - self._bits =3D set() - self.granularity =3D granularity - - def dirty_bits(self, bits): - self._bits |=3D set(bits) - - def dirty_group(self, n): - self.dirty_bits(GROUPS[n].bits(self.granularity)) - - def clear(self): - self._bits =3D set() - - def clear_bits(self, bits): - self._bits -=3D set(bits) - - def clear_bit(self, bit): - self.clear_bits({bit}) - - def clear_group(self, n): - self.clear_bits(GROUPS[n].bits(self.granularity)) - - @property - def first_bit(self): - return sorted(self.bits)[0] - - @property - def bits(self): - return self._bits - - @property - def count(self): - return len(self.bits) - - def compare(self, qmp_bitmap): - """ - Print a nice human-readable message checking that a bitmap as repo= rted - by the QMP interface has as many bits set as we expect it to. - """ - - name =3D qmp_bitmap.get('name', '(anonymous)') - log("=3D Checking Bitmap {:s} =3D".format(name)) - - want =3D self.count - have =3D qmp_bitmap['count'] // qmp_bitmap['granularity'] - - log("expecting {:d} dirty sectors; have {:d}. {:s}".format( - want, have, "OK!" if want =3D=3D have else "ERROR!")) - log('') - - class Drive: """Represents, vaguely, a drive attached to a VM. Includes format, graph, and device information.""" diff --git a/tests/qemu-iotests/bitmaps.py b/tests/qemu-iotests/bitmaps.py new file mode 100644 index 0000000000..522fc25171 --- /dev/null +++ b/tests/qemu-iotests/bitmaps.py @@ -0,0 +1,131 @@ +# Bitmap-related helper utilities +# +# Copyright (c) 2020 John Snow for Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# owner=3Djsnow@redhat.com + +from iotests import log + +GRANULARITY =3D 64 * 1024 + + +class Pattern: + def __init__(self, byte, offset, size=3DGRANULARITY): + self.byte =3D byte + self.offset =3D offset + self.size =3D size + + def bits(self, granularity): + lower =3D self.offset // granularity + upper =3D (self.offset + self.size - 1) // granularity + return set(range(lower, upper + 1)) + + +class PatternGroup: + """Grouping of Pattern objects. Initialize with an iterable of Pattern= s.""" + def __init__(self, patterns): + self.patterns =3D patterns + + def bits(self, granularity): + """Calculate the unique bits dirtied by this pattern grouping""" + res =3D set() + for pattern in self.patterns: + res |=3D pattern.bits(granularity) + return res + + +GROUPS =3D [ + PatternGroup([ + # Batch 0: 4 clusters + Pattern('0x49', 0x0000000), + Pattern('0x6c', 0x0100000), # 1M + Pattern('0x6f', 0x2000000), # 32M + Pattern('0x76', 0x3ff0000)]), # 64M - 64K + PatternGroup([ + # Batch 1: 6 clusters (3 new) + Pattern('0x65', 0x0000000), # Full overwrite + Pattern('0x77', 0x00f8000), # Partial-left (1M-32K) + Pattern('0x72', 0x2008000), # Partial-right (32M+32K) + Pattern('0x69', 0x3fe0000)]), # Adjacent-left (64M - 128K) + PatternGroup([ + # Batch 2: 7 clusters (3 new) + Pattern('0x74', 0x0010000), # Adjacent-right + Pattern('0x69', 0x00e8000), # Partial-left (1M-96K) + Pattern('0x6e', 0x2018000), # Partial-right (32M+96K) + Pattern('0x67', 0x3fe0000, + 2*GRANULARITY)]), # Overwrite [(64M-128K)-64M) + PatternGroup([ + # Batch 3: 8 clusters (5 new) + # Carefully chosen such that nothing re-dirties the one cluster + # that copies out successfully before failure in Group #1. + Pattern('0xaa', 0x0010000, + 3*GRANULARITY), # Overwrite and 2x Adjacent-right + Pattern('0xbb', 0x00d8000), # Partial-left (1M-160K) + Pattern('0xcc', 0x2028000), # Partial-right (32M+160K) + Pattern('0xdd', 0x3fc0000)]), # New; leaving a gap to the right +] + + +class EmulatedBitmap: + def __init__(self, granularity=3DGRANULARITY): + self._bits =3D set() + self.granularity =3D granularity + + def dirty_bits(self, bits): + self._bits |=3D set(bits) + + def dirty_group(self, n): + self.dirty_bits(GROUPS[n].bits(self.granularity)) + + def clear(self): + self._bits =3D set() + + def clear_bits(self, bits): + self._bits -=3D set(bits) + + def clear_bit(self, bit): + self.clear_bits({bit}) + + def clear_group(self, n): + self.clear_bits(GROUPS[n].bits(self.granularity)) + + @property + def first_bit(self): + return sorted(self.bits)[0] + + @property + def bits(self): + return self._bits + + @property + def count(self): + return len(self.bits) + + def compare(self, qmp_bitmap): + """ + Print a nice human-readable message checking that a bitmap as repo= rted + by the QMP interface has as many bits set as we expect it to. + """ + + name =3D qmp_bitmap.get('name', '(anonymous)') + log("=3D Checking Bitmap {:s} =3D".format(name)) + + want =3D self.count + have =3D qmp_bitmap['count'] // qmp_bitmap['granularity'] + + log("expecting {:d} dirty sectors; have {:d}. {:s}".format( + want, have, "OK!" if want =3D=3D have else "ERROR!")) + log('') --=20 2.21.1 From nobody Thu Nov 13 19:09:41 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.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=1582592293; cv=none; d=zohomail.com; s=zohoarc; b=kFLpEgn+BxmrePdHZh94StbNC7BHncguqQT25VNSa4nlyqC9/BH+A9bDrfl+HauBCQpWCwqX8UWixzRI6uJ/7zKGHcJhsRExDeM2DaBqM1w01aX++GxB5Dqf2O1TfJ7uzsXhAXLtEC3gR7q6BEhcrTKAbdsPVNz3eeyUnk1NHx4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582592293; 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=ioKiR0424ftBjD7lpbVOIDL2uezKt3IXhOhLa6WO5o4=; b=hDtgRnJinrY7lvaU7ngYQWDTbUaH5/Sus6kkjJRy7XYn9MJjaq4XJK25UBfF/V3tvvmXw+ZSuEjWk/qMYH0nBU6OPI8hgYkXsxB+9r0L86a4kaPxoBivwyaCmt1A2Mmym9ru12iP4T9cuYsJq9rJSz7x5Oyd+P7rjQ1w9aN1l7U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 1582592293210549.3758269489766; Mon, 24 Feb 2020 16:58:13 -0800 (PST) Received: from localhost ([::1]:46856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6OY7-0003oh-7l for importer@patchew.org; Mon, 24 Feb 2020 19:58:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55724) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6OWq-00023v-1R for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:56:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6OWo-0007p4-RF for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:56:51 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:24148 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 1j6OWo-0007ni-MA for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:56:50 -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-410-yjBk6Y9WNzCmdhx0L8enYw-1; Mon, 24 Feb 2020 19:56:48 -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 A45E213E2; Tue, 25 Feb 2020 00:56:47 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-182.bos.redhat.com [10.18.17.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id B647289F30; Tue, 25 Feb 2020 00:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582592210; 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=ioKiR0424ftBjD7lpbVOIDL2uezKt3IXhOhLa6WO5o4=; b=O58cOD03zsNR/gpyUvhkds2cTDjX3Qr8U8hkvv/s9JsB0GzorAZk/AGdufZnM3E4cWL7Az 2WunkYktjRu1atFBX7h6/v3FCcZV9CO468yR1id+3IkF3Mubv2tMlUNR/KNvYiA6iEvyfP fRHqw3P1kjzizhgKMtbb3LyYu+ZUors= X-MC-Unique: yjBk6Y9WNzCmdhx0L8enYw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 4/6] iotests: add hmp helper with logging Date: Mon, 24 Feb 2020 19:56:39 -0500 Message-Id: <20200225005641.5478-5-jsnow@redhat.com> In-Reply-To: <20200225005641.5478-1-jsnow@redhat.com> References: <20200225005641.5478-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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 , vsementsov@virtuozzo.com, Eduardo Habkost , qemu-block@nongnu.org, Markus Armbruster , Max Reitz , pkrempa@redhat.com, Cleber Rosa , 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" Just a mild cleanup while I was here. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 8815052eb5..5d2990a0e4 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -525,23 +525,27 @@ def add_incoming(self, addr): self._args.append(addr) return self =20 + def hmp(self, command_line, log=3DFalse): + cmd =3D 'human-monitor-command' + kwargs =3D { 'command-line': command_line } + if log: + return self.qmp_log(cmd, **kwargs) + return self.qmp(cmd, **kwargs) + def pause_drive(self, drive, event=3DNone): '''Pause drive r/w operations''' if not event: self.pause_drive(drive, "read_aio") self.pause_drive(drive, "write_aio") return - self.qmp('human-monitor-command', - command_line=3D'qemu-io %s "break %s bp_%s"' % (drive,= event, drive)) + self.hmp('qemu-io %s "break %s bp_%s"' % (drive, event, drive)) =20 def resume_drive(self, drive): - self.qmp('human-monitor-command', - command_line=3D'qemu-io %s "remove_break bp_%s"' % (dr= ive, drive)) + self.hmp('qemu-io %s "remove_break bp_%s"' % (drive, drive)) =20 - def hmp_qemu_io(self, drive, cmd): + def hmp_qemu_io(self, drive, cmd, log=3DFalse): '''Write to a given drive using an HMP command''' - return self.qmp('human-monitor-command', - command_line=3D'qemu-io %s "%s"' % (drive, cmd)) + return self.hmp('qemu-io %s "%s"' % (drive, cmd), log=3Dlog) =20 def flatten_qmp_object(self, obj, output=3DNone, basestr=3D''): if output is None: --=20 2.21.1 From nobody Thu Nov 13 19:09:41 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.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=1582592549; cv=none; d=zohomail.com; s=zohoarc; b=OnYkw/fwl2qn5sC8otoWMi5NkGrkpP8CcHdRqkKMTBxO5vTUm9V3W4EJHh58Og09YPsnI+8dfQQKBmTmT61+2qfBfRciewxYwqopNuV//XVP89fBwNVpSLOCYgIOwTcQPt2+64dnMsyn1+GVdkN+kPiVhXxdQ1w/RGit6+6jmM4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582592549; 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=zFiI11K/zhMpvmP4sNkoFe4BM6V7xKs///v037C3nNo=; b=CDsIvOaYqUvEdiejd0OO2X1hgEhdjWkk87N4AJFqtFHkKUdlfDzGYxPauUrBDyBBZyLStV0lHyiGfAZCezaGvwnzLkzwli8/wUbMXzTDdfv84mZGBpr2DQ/MCNgz5mZ+VmTp5Bkeki15UMUjz87wDUTtistB+DFuMZhi43gLIYc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 15825925495697.583273519277213; Mon, 24 Feb 2020 17:02:29 -0800 (PST) Received: from localhost ([::1]:46932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6OcG-0000hV-H3 for importer@patchew.org; Mon, 24 Feb 2020 20:02:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55783) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6OWt-000267-2x for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:56:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6OWr-00081e-V9 for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:56:54 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:50279 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 1j6OWr-0007zj-Qh for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:56:53 -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-357-n06VbUNZNr2iTi9tKaysSA-1; Mon, 24 Feb 2020 19:56:49 -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 B100313E4; Tue, 25 Feb 2020 00:56:48 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-182.bos.redhat.com [10.18.17.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id C06DA1CB; Tue, 25 Feb 2020 00:56:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582592213; 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=zFiI11K/zhMpvmP4sNkoFe4BM6V7xKs///v037C3nNo=; b=aSjqsUkmf84cuyH6fUg9a8pSNdAULPbxSLujh2L3o28/pbwN0zpUFV/eEkqFF7qFEo51Tb mwGSVMKS5GajeFb2nNGrs7JCiDItHV5eeg4UCNN+CJRkzMkekO3QNbvOkLJ0l03GZdad6j QIlVGoI4dNsGk4gASpOz9N9f5GkZEB0= X-MC-Unique: n06VbUNZNr2iTi9tKaysSA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 5/6] qmp.py: change event_wait to use a dict Date: Mon, 24 Feb 2020 19:56:40 -0500 Message-Id: <20200225005641.5478-6-jsnow@redhat.com> In-Reply-To: <20200225005641.5478-1-jsnow@redhat.com> References: <20200225005641.5478-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 , vsementsov@virtuozzo.com, Eduardo Habkost , qemu-block@nongnu.org, Markus Armbruster , Max Reitz , pkrempa@redhat.com, Cleber Rosa , 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" It's easier to work with than a list of tuples, because we can check the keys for membership. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy --- python/qemu/machine.py | 10 +++++----- tests/qemu-iotests/040 | 12 ++++++------ tests/qemu-iotests/260 | 5 +++-- tests/qemu-iotests/iotests.py | 16 ++++++++-------- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 183d8f3d38..748de5f322 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -476,21 +476,21 @@ def event_wait(self, name, timeout=3D60.0, match=3DNo= ne): timeout: QEMUMonitorProtocol.pull_event timeout parameter. match: Optional match criteria. See event_match for details. """ - return self.events_wait([(name, match)], timeout) + return self.events_wait({name: match}, timeout) =20 def events_wait(self, events, timeout=3D60.0): """ events_wait waits for and returns a named event from QMP with a ti= meout. =20 - events: a sequence of (name, match_criteria) tuples. + events: a mapping containing {name: match_criteria}. The match criteria are optional and may be None. See event_match for details. timeout: QEMUMonitorProtocol.pull_event timeout parameter. """ def _match(event): - for name, match in events: - if event['event'] =3D=3D name and self.event_match(event, = match): - return True + name =3D event['event'] + if name in events: + return self.event_match(event, events[name]) return False =20 # Search cached events diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040 index 32c82b4ec6..90b59081ff 100755 --- a/tests/qemu-iotests/040 +++ b/tests/qemu-iotests/040 @@ -485,12 +485,12 @@ class TestErrorHandling(iotests.QMPTestCase): =20 def run_job(self, expected_events, error_pauses_job=3DFalse): match_device =3D {'data': {'device': 'job0'}} - events =3D [ - ('BLOCK_JOB_COMPLETED', match_device), - ('BLOCK_JOB_CANCELLED', match_device), - ('BLOCK_JOB_ERROR', match_device), - ('BLOCK_JOB_READY', match_device), - ] + events =3D { + 'BLOCK_JOB_COMPLETED': match_device, + 'BLOCK_JOB_CANCELLED': match_device, + 'BLOCK_JOB_ERROR': match_device, + 'BLOCK_JOB_READY': match_device, + } =20 completed =3D False log =3D [] diff --git a/tests/qemu-iotests/260 b/tests/qemu-iotests/260 index 30c0de380d..b2fb045ddd 100755 --- a/tests/qemu-iotests/260 +++ b/tests/qemu-iotests/260 @@ -65,8 +65,9 @@ def test(persistent, restart): =20 vm.qmp_log('block-commit', device=3D'drive0', top=3Dtop, filters=3D[iotests.filter_qmp_testfiles]) - ev =3D vm.events_wait((('BLOCK_JOB_READY', None), - ('BLOCK_JOB_COMPLETED', None))) + ev =3D vm.events_wait({ + 'BLOCK_JOB_READY': None, + 'BLOCK_JOB_COMPLETED': None }) log(filter_qmp_event(ev)) if (ev['event'] =3D=3D 'BLOCK_JOB_COMPLETED'): vm.shutdown() diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 5d2990a0e4..3390fab021 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -604,14 +604,14 @@ def run_job(self, job, auto_finalize=3DTrue, auto_dis= miss=3DFalse, """ match_device =3D {'data': {'device': job}} match_id =3D {'data': {'id': job}} - events =3D [ - ('BLOCK_JOB_COMPLETED', match_device), - ('BLOCK_JOB_CANCELLED', match_device), - ('BLOCK_JOB_ERROR', match_device), - ('BLOCK_JOB_READY', match_device), - ('BLOCK_JOB_PENDING', match_id), - ('JOB_STATUS_CHANGE', match_id) - ] + events =3D { + 'BLOCK_JOB_COMPLETED': match_device, + 'BLOCK_JOB_CANCELLED': match_device, + 'BLOCK_JOB_ERROR': match_device, + 'BLOCK_JOB_READY': match_device, + 'BLOCK_JOB_PENDING': match_id, + 'JOB_STATUS_CHANGE': match_id, + } error =3D None while True: ev =3D filter_qmp_event(self.events_wait(events, timeout=3Dwai= t)) --=20 2.21.1 From nobody Thu Nov 13 19:09:41 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.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=1582592435; cv=none; d=zohomail.com; s=zohoarc; b=UvfONuHdba7j4VFvL3l5NIfds1Zw8EnYQwBkPu/4VdExCGHTbARxX50jjy/zp2FJkBq2LxaEbbfoKeMz5igsCtF/aZBzuGTTByd4ZiM7pUC+NgN4+5d06/pW6Py2H9g0cN6i7XRiCew4YRyaVsqMhLLITyI7hSFDzXVu5cX95rk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582592435; 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=MF+W29R8kxyobCmE0u6fh0uYUjm26az6vcBOyE7oM8o=; b=SagfaBjXnzO6T34mlL1tV2PZtx+qonWoMazKLboncKd5AlVkfEOo2ipzPMLVxCcFMf8xP+aBRSiv4o8rRiBucweD/iSNu+fuepvk3K6W4sTgYq9S4SlsCeVqHID0FulbYkxs4p9OXwLlEXVI3+MAglLAIJ+Buo4lXh9vk6ipBLk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 1582592435924169.7733992680661; Mon, 24 Feb 2020 17:00:35 -0800 (PST) Received: from localhost ([::1]:46894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6OaQ-00078K-H6 for importer@patchew.org; Mon, 24 Feb 2020 20:00:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55847) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6OX5-0002bz-7C for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:57:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6OWu-00087p-4f for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:57:07 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:47231 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 1j6OWt-000872-Qt for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:56:56 -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-446-Yt-j7oZWNKqa-96bMCYmQg-1; Mon, 24 Feb 2020 19:56:51 -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 F127A13E2; Tue, 25 Feb 2020 00:56:49 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-182.bos.redhat.com [10.18.17.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id D100D1CB; Tue, 25 Feb 2020 00:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582592215; 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=MF+W29R8kxyobCmE0u6fh0uYUjm26az6vcBOyE7oM8o=; b=CmEhJwVeL4QoGEzhmwREpbLNTOglCAHTfcTcwbenIdjJVdrtwNRq0HJHtb+Y+s5MppxJYa YLQxmUfLrl0bXUg6RPeb4rg5H4RoZP76qTHI//XEr5lNGrxBRvDdMsn3lMRJ40YT25Q2hM Ey+iFi9PA7uPcN9yVPsna7iULHxZ96E= X-MC-Unique: Yt-j7oZWNKqa-96bMCYmQg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 6/6] iotests: add 287 for block-dirty-bitmap-populate Date: Mon, 24 Feb 2020 19:56:41 -0500 Message-Id: <20200225005641.5478-7-jsnow@redhat.com> In-Reply-To: <20200225005641.5478-1-jsnow@redhat.com> References: <20200225005641.5478-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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 , vsementsov@virtuozzo.com, Eduardo Habkost , qemu-block@nongnu.org, Markus Armbruster , Max Reitz , pkrempa@redhat.com, Cleber Rosa , 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" Give block-dirty-bitmap-populate a workout. Signed-off-by: John Snow --- tests/qemu-iotests/287 | 233 ++ tests/qemu-iotests/287.out | 4544 ++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 4778 insertions(+) create mode 100755 tests/qemu-iotests/287 create mode 100644 tests/qemu-iotests/287.out diff --git a/tests/qemu-iotests/287 b/tests/qemu-iotests/287 new file mode 100755 index 0000000000..0ab58dc011 --- /dev/null +++ b/tests/qemu-iotests/287 @@ -0,0 +1,233 @@ +#!/usr/bin/env python3 +# +# Test block-dirty-bitmap-populate +# +# Copyright (c) 2020 John Snow for Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# owner=3Djsnow@redhat.com + +from collections import namedtuple +import itertools +import math +import os + +import iotests +from iotests import log, qemu_img +from bitmaps import EmulatedBitmap, GROUPS + +SIZE =3D 64 * 1024 * 1024 +GRANULARITY =3D 64 * 1024 + + +class Drive: + def __init__(self, path, vm): + self.path =3D path + self.vm =3D vm + self.fmt =3D None + self.size =3D None + self.node =3D None + + def img_create(self, fmt, size): + self.fmt =3D fmt + self.size =3D size + iotests.qemu_img_create('-f', self.fmt, self.path, str(self.size)) + + +def block_dirty_bitmap_populate(vm, node, bitmap, job_id, pattern, **kwarg= s): + # Strip any arguments explicitly nulled by the caller: + kwargs =3D {key: val for key, val in kwargs.items() if val is not None} + result =3D vm.qmp_log('block-dirty-bitmap-populate', + node=3Dnode, + name=3Dbitmap, + job_id=3Djob_id, + pattern=3Dpattern, + **kwargs) + return result + + +def populate(drive, bitmap, job_id, pattern=3D'allocation-top', **kwargs): + kwargs.setdefault('pattern', pattern) + kwargs.setdefault('auto-finalize', False) + kwargs.setdefault('auto-dismiss', False) + ret =3D block_dirty_bitmap_populate(drive.vm, drive.node, + bitmap, job_id, **kwargs) + return { + 'id': job_id, + 'auto-finalize': kwargs['auto-finalize'], + 'auto-dismiss': kwargs['auto-dismiss'], + 'return': ret, + } + + +def perform_writes(drive, n, filter_node_name=3DNone): + log("-- Write #{:d}:".format(n)) + node_name =3D filter_node_name or drive.node + for pattern in GROUPS[n].patterns: + cmd =3D "write -P{:s} 0x{:07x} 0x{:x}".format( + pattern.byte, + pattern.offset, + pattern.size) + drive.vm.hmp_qemu_io(node_name, cmd, log=3DTrue) + log('') + + +TestConfig =3D namedtuple('TestConfig', [ + 'base_pattern', + 'disabled', + 'pre_writes', + 'mid_writes', + 'cancel', + 'post_writes', +]) + + +def test_bitmap_populate(config): + """ + Test bitmap populate. + + :param base_pattern: Write a base pattern? + :param disabled: Disable the target bitmap? + :param pre_writes: Write a pattern after bitmap creation, but before= job? + :param mid_writes: Write a pattern before job finalizes? + :param cancel: Cancel the job instead of finalizing it? + :param post_writes: Write a pattern after the job? + """ + with iotests.FilePaths(['img']) as (img_path,), iotests.VM() as vm: + log("\n=3D=3D=3D Bitmap Populate {:s} =3D=3D=3D\n".format(str(conf= ig))) + + log('-- Prepare image & VM:') + drive0 =3D Drive(img_path, vm=3Dvm) + drive0.img_create(iotests.imgfmt, SIZE) + vm.add_device("{},id=3Dscsi0".format(iotests.get_virtio_scsi_devic= e())) + vm.launch() + + file_config =3D { + 'driver': 'file', + 'filename': drive0.path + } + + drive0.node =3D 'drive0' + vm.qmp_log('blockdev-add', + filters=3D[iotests.filter_qmp_testfiles], + node_name=3Ddrive0.node, + driver=3Ddrive0.fmt, + file=3Dfile_config) + log('') + + + # Step 0: Prepare & Base Allocation Pattern + + if config.base_pattern: + perform_writes(drive0, 0) + + + # Step 1: Add test bitmap + + log('-- Add Bitmap:') + vm.qmp_log('block-dirty-bitmap-add', + node=3Ddrive0.node, + name=3D"target", + granularity=3DGRANULARITY, + disabled=3Dconfig.disabled) + ebitmap =3D EmulatedBitmap() + log('') + + # Step 2: Pre-Writes + + if config.pre_writes: + perform_writes(drive0, 1) + if not config.disabled: + ebitmap.dirty_group(1) + bitmap =3D vm.get_bitmap(drive0.node, 'target') + ebitmap.compare(bitmap) + + + # Step 3: Launch job & Mid-Writes + + log('-- Test block-dirty-bitmap-populate (bitpop0):') + def pre_finalize(): + # Writes issued prior to job finalization: + if config.mid_writes: + perform_writes(drive0, 2) + if not config.disabled: + ebitmap.dirty_group(2) + + job =3D populate(drive0, 'target', 'bitpop0') + assert job['return'] =3D=3D {'return': {}} + vm.run_job(job['id'], + auto_dismiss=3Djob['auto-dismiss'], + auto_finalize=3Djob['auto-finalize'], + pre_finalize=3Dpre_finalize, + cancel=3Dconfig.cancel) + log('') + + + # Step 4: Post-job verification + + if not config.cancel: + # Any writes made prior to the job finishing should now be vis= ible. + if config.base_pattern: + ebitmap.dirty_group(0) + if config.pre_writes: + ebitmap.dirty_group(1) + if config.mid_writes: + ebitmap.dirty_group(2) + + bitmap =3D vm.get_bitmap(drive0.node, 'target') + ebitmap.compare(bitmap) + + + # Step 5: Post-Writes + + if config.post_writes: + perform_writes(drive0, 3) + if not config.disabled: + ebitmap.dirty_group(3) + + + # Step 6: Final Verification + + log('-- Verification:') + bitmaps =3D vm.query_bitmaps() + log({'bitmaps': bitmaps}, indent=3D2) + log('') + bitmap =3D vm.get_bitmap(drive0.node, 'target', bitmaps=3Dbitmaps) + ebitmap.compare(bitmap) + + + log('-- Cleanup:') + vm.qmp_log("block-dirty-bitmap-remove", + node=3Ddrive0.node, name=3D"target") + + bitmaps =3D vm.query_bitmaps() + if bitmaps: + log("ERROR: bitmaps unaccounted for:") + log(bitmaps) + else: + log('OK: All bitmaps removed') + vm.shutdown() + log('') + + +def main(): + for args in itertools.product((True, False), repeat=3D6): + cfg =3D TestConfig(*args) + test_bitmap_populate(cfg) + + +if __name__ =3D=3D '__main__': + iotests.script_main(main, supported_fmts=3D['qcow2'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/287.out b/tests/qemu-iotests/287.out new file mode 100644 index 0000000000..7c0afc7192 --- /dev/null +++ b/tests/qemu-iotests/287.out @@ -0,0 +1,4544 @@ + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DTrue,= pre_writes=3DTrue, mid_writes=3DTrue, cancel=3DTrue, post_writes=3DTrue) = =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DTrue,= pre_writes=3DTrue, mid_writes=3DTrue, cancel=3DTrue, post_writes=3DFalse) = =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DTrue,= pre_writes=3DTrue, mid_writes=3DTrue, cancel=3DFalse, post_writes=3DTrue) = =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 655360, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DTrue,= pre_writes=3DTrue, mid_writes=3DTrue, cancel=3DFalse, post_writes=3DFalse)= =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 655360, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DTrue,= pre_writes=3DTrue, mid_writes=3DFalse, cancel=3DTrue, post_writes=3DTrue) = =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DTrue,= pre_writes=3DTrue, mid_writes=3DFalse, cancel=3DTrue, post_writes=3DFalse)= =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DTrue,= pre_writes=3DTrue, mid_writes=3DFalse, cancel=3DFalse, post_writes=3DTrue)= =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 458752, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DTrue,= pre_writes=3DTrue, mid_writes=3DFalse, cancel=3DFalse, post_writes=3DFalse= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 458752, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DTrue,= pre_writes=3DFalse, mid_writes=3DTrue, cancel=3DTrue, post_writes=3DTrue) = =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DTrue,= pre_writes=3DFalse, mid_writes=3DTrue, cancel=3DTrue, post_writes=3DFalse)= =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DTrue,= pre_writes=3DFalse, mid_writes=3DTrue, cancel=3DFalse, post_writes=3DTrue)= =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 655360, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DTrue,= pre_writes=3DFalse, mid_writes=3DTrue, cancel=3DFalse, post_writes=3DFalse= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 655360, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DTrue,= pre_writes=3DFalse, mid_writes=3DFalse, cancel=3DTrue, post_writes=3DTrue)= =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DTrue,= pre_writes=3DFalse, mid_writes=3DFalse, cancel=3DTrue, post_writes=3DFalse= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DTrue,= pre_writes=3DFalse, mid_writes=3DFalse, cancel=3DFalse, post_writes=3DTrue= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 4 dirty sectors; have 4. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 262144, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 4 dirty sectors; have 4. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DTrue,= pre_writes=3DFalse, mid_writes=3DFalse, cancel=3DFalse, post_writes=3DFals= e) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 4 dirty sectors; have 4. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 262144, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 4 dirty sectors; have 4. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DFalse= , pre_writes=3DTrue, mid_writes=3DTrue, cancel=3DTrue, post_writes=3DTrue) = =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 983040, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 15 dirty sectors; have 15. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DFalse= , pre_writes=3DTrue, mid_writes=3DTrue, cancel=3DTrue, post_writes=3DFalse)= =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 655360, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DFalse= , pre_writes=3DTrue, mid_writes=3DTrue, cancel=3DFalse, post_writes=3DTrue)= =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 983040, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 15 dirty sectors; have 15. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DFalse= , pre_writes=3DTrue, mid_writes=3DTrue, cancel=3DFalse, post_writes=3DFalse= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 655360, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DFalse= , pre_writes=3DTrue, mid_writes=3DFalse, cancel=3DTrue, post_writes=3DTrue)= =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 917504, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 14 dirty sectors; have 14. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DFalse= , pre_writes=3DTrue, mid_writes=3DFalse, cancel=3DTrue, post_writes=3DFalse= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DFalse= , pre_writes=3DTrue, mid_writes=3DFalse, cancel=3DFalse, post_writes=3DTrue= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 983040, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 15 dirty sectors; have 15. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DFalse= , pre_writes=3DTrue, mid_writes=3DFalse, cancel=3DFalse, post_writes=3DFals= e) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 458752, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DFalse= , pre_writes=3DFalse, mid_writes=3DTrue, cancel=3DTrue, post_writes=3DTrue)= =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 786432, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 12 dirty sectors; have 12. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DFalse= , pre_writes=3DFalse, mid_writes=3DTrue, cancel=3DTrue, post_writes=3DFalse= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 458752, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DFalse= , pre_writes=3DFalse, mid_writes=3DTrue, cancel=3DFalse, post_writes=3DTrue= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 983040, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 15 dirty sectors; have 15. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DFalse= , pre_writes=3DFalse, mid_writes=3DTrue, cancel=3DFalse, post_writes=3DFals= e) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 655360, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DFalse= , pre_writes=3DFalse, mid_writes=3DFalse, cancel=3DTrue, post_writes=3DTrue= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 524288, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 8 dirty sectors; have 8. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DFalse= , pre_writes=3DFalse, mid_writes=3DFalse, cancel=3DTrue, post_writes=3DFals= e) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DFalse= , pre_writes=3DFalse, mid_writes=3DFalse, cancel=3DFalse, post_writes=3DTru= e) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 4 dirty sectors; have 4. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 786432, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 12 dirty sectors; have 12. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DTrue, disabled=3DFalse= , pre_writes=3DFalse, mid_writes=3DFalse, cancel=3DFalse, post_writes=3DFal= se) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Write #0: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x49 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6c 0x0100000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6f 0x2000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x76 0x3ff0000 0x10000\""}} +{"return": ""} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 4 dirty sectors; have 4. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 262144, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 4 dirty sectors; have 4. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DTrue= , pre_writes=3DTrue, mid_writes=3DTrue, cancel=3DTrue, post_writes=3DTrue) = =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DTrue= , pre_writes=3DTrue, mid_writes=3DTrue, cancel=3DTrue, post_writes=3DFalse)= =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DTrue= , pre_writes=3DTrue, mid_writes=3DTrue, cancel=3DFalse, post_writes=3DTrue)= =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 655360, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DTrue= , pre_writes=3DTrue, mid_writes=3DTrue, cancel=3DFalse, post_writes=3DFalse= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 655360, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DTrue= , pre_writes=3DTrue, mid_writes=3DFalse, cancel=3DTrue, post_writes=3DTrue)= =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DTrue= , pre_writes=3DTrue, mid_writes=3DFalse, cancel=3DTrue, post_writes=3DFalse= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DTrue= , pre_writes=3DTrue, mid_writes=3DFalse, cancel=3DFalse, post_writes=3DTrue= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DTrue= , pre_writes=3DTrue, mid_writes=3DFalse, cancel=3DFalse, post_writes=3DFals= e) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DTrue= , pre_writes=3DFalse, mid_writes=3DTrue, cancel=3DTrue, post_writes=3DTrue)= =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DTrue= , pre_writes=3DFalse, mid_writes=3DTrue, cancel=3DTrue, post_writes=3DFalse= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DTrue= , pre_writes=3DFalse, mid_writes=3DTrue, cancel=3DFalse, post_writes=3DTrue= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 458752, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DTrue= , pre_writes=3DFalse, mid_writes=3DTrue, cancel=3DFalse, post_writes=3DFals= e) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 458752, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DTrue= , pre_writes=3DFalse, mid_writes=3DFalse, cancel=3DTrue, post_writes=3DTrue= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DTrue= , pre_writes=3DFalse, mid_writes=3DFalse, cancel=3DTrue, post_writes=3DFals= e) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DTrue= , pre_writes=3DFalse, mid_writes=3DFalse, cancel=3DFalse, post_writes=3DTru= e) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DTrue= , pre_writes=3DFalse, mid_writes=3DFalse, cancel=3DFalse, post_writes=3DFal= se) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "gra= nularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": false, + "status": "disabled" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DFals= e, pre_writes=3DTrue, mid_writes=3DTrue, cancel=3DTrue, post_writes=3DTrue)= =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 983040, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 15 dirty sectors; have 15. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DFals= e, pre_writes=3DTrue, mid_writes=3DTrue, cancel=3DTrue, post_writes=3DFalse= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 655360, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DFals= e, pre_writes=3DTrue, mid_writes=3DTrue, cancel=3DFalse, post_writes=3DTrue= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 983040, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 15 dirty sectors; have 15. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DFals= e, pre_writes=3DTrue, mid_writes=3DTrue, cancel=3DFalse, post_writes=3DFals= e) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 655360, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 10 dirty sectors; have 10. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DFals= e, pre_writes=3DTrue, mid_writes=3DFalse, cancel=3DTrue, post_writes=3DTrue= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 917504, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 14 dirty sectors; have 14. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DFals= e, pre_writes=3DTrue, mid_writes=3DFalse, cancel=3DTrue, post_writes=3DFals= e) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DFals= e, pre_writes=3DTrue, mid_writes=3DFalse, cancel=3DFalse, post_writes=3DTru= e) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 917504, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 14 dirty sectors; have 14. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DFals= e, pre_writes=3DTrue, mid_writes=3DFalse, cancel=3DFalse, post_writes=3DFal= se) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Write #1: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x65 0x0000000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x77 0x00f8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x72 0x2008000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x3fe0000 0x10000\""}} +{"return": ""} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 6 dirty sectors; have 6. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DFals= e, pre_writes=3DFalse, mid_writes=3DTrue, cancel=3DTrue, post_writes=3DTrue= ) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 786432, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 12 dirty sectors; have 12. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DFals= e, pre_writes=3DFalse, mid_writes=3DTrue, cancel=3DTrue, post_writes=3DFals= e) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 458752, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DFals= e, pre_writes=3DFalse, mid_writes=3DTrue, cancel=3DFalse, post_writes=3DTru= e) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 786432, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 12 dirty sectors; have 12. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DFals= e, pre_writes=3DFalse, mid_writes=3DTrue, cancel=3DFalse, post_writes=3DFal= se) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +-- Write #2: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x74 0x0010000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x69 0x00e8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x6e 0x2018000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0x67 0x3fe0000 0x20000\""}} +{"return": ""} + +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 458752, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 7 dirty sectors; have 7. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DFals= e, pre_writes=3DFalse, mid_writes=3DFalse, cancel=3DTrue, post_writes=3DTru= e) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 524288, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 8 dirty sectors; have 8. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DFals= e, pre_writes=3DFalse, mid_writes=3DFalse, cancel=3DTrue, post_writes=3DFal= se) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-cancel", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Job failed: Operation canceled +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_CANCELLED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DFals= e, pre_writes=3DFalse, mid_writes=3DFalse, cancel=3DFalse, post_writes=3DTr= ue) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Write #3: +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xaa 0x0010000 0x30000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xbb 0x00d8000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xcc 0x2028000 0x10000\""}} +{"return": ""} +{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-i= o drive0 \"write -P0xdd 0x3fc0000 0x10000\""}} +{"return": ""} + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 524288, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 8 dirty sectors; have 8. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + + +=3D=3D=3D Bitmap Populate TestConfig(base_pattern=3DFalse, disabled=3DFals= e, pre_writes=3DFalse, mid_writes=3DFalse, cancel=3DFalse, post_writes=3DFa= lse) =3D=3D=3D + +-- Prepare image & VM: +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +-- Add Bitmap: +{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "gr= anularity": 65536, "name": "target", "node": "drive0"}} +{"return": {}} + +-- Test block-dirty-bitmap-populate (bitpop0): +{"execute": "block-dirty-bitmap-populate", "arguments": {"auto-dismiss": f= alse, "auto-finalize": false, "job-id": "bitpop0", "name": "target", "node"= : "drive0", "pattern": "allocation-top"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "bitpop0"}} +{"return": {}} +{"data": {"id": "bitpop0", "type": "bitmap-populate"}, "event": "BLOCK_JOB= _PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "bitpop0", "len": 67108864, "offset": 67108864, "speed= ": 0, "type": "bitmap-populate"}, "event": "BLOCK_JOB_COMPLETED", "timestam= p": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "bitpop0"}} +{"return": {}} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Verification: +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "target", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap target =3D +expecting 0 dirty sectors; have 0. OK! + +-- Cleanup: +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "target", "= node": "drive0"}} +{"return": {}} +OK: All bitmaps removed + diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index 0317667695..5e80d7deab 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -293,3 +293,4 @@ 283 auto quick 284 rw 286 rw quick +287 rw --=20 2.21.1