From: John Snow <jsnow@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-block@nongnu.org
Cc: fam@euphon.net, kwolf@redhat.com, den@openvz.org,
qemu-devel@nongnu.org, mreitz@redhat.com
Subject: Re: [PATCH v5 3/9] iotests: add test-case to 165 to test reopening qcow2 bitmaps to RW
Date: Fri, 27 Sep 2019 16:43:03 -0400 [thread overview]
Message-ID: <06acd6be-0b8f-a5e3-5f81-e47c550dc6ea@redhat.com> (raw)
In-Reply-To: <20190927122355.7344-4-vsementsov@virtuozzo.com>
On 9/27/19 8:23 AM, Vladimir Sementsov-Ogievskiy wrote:
> Reopening bitmaps to RW was broken prior to previous commit. Check that
> it works now.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> tests/qemu-iotests/165 | 57 ++++++++++++++++++++++++++++++++++++--
> tests/qemu-iotests/165.out | 4 +--
> 2 files changed, 57 insertions(+), 4 deletions(-)
>
> diff --git a/tests/qemu-iotests/165 b/tests/qemu-iotests/165
> index 5650dc7c87..951ea011a2 100755
> --- a/tests/qemu-iotests/165
> +++ b/tests/qemu-iotests/165
> @@ -43,10 +43,10 @@ class TestPersistentDirtyBitmap(iotests.QMPTestCase):
> os.remove(disk)
>
> def mkVm(self):
> - return iotests.VM().add_drive(disk)
> + return iotests.VM().add_drive(disk, opts='node-name=node0')
>
> def mkVmRo(self):
> - return iotests.VM().add_drive(disk, opts='readonly=on')
> + return iotests.VM().add_drive(disk, opts='readonly=on,node-name=node0')
>
> def getSha256(self):
> result = self.vm.qmp('x-debug-block-dirty-bitmap-sha256',
> @@ -102,6 +102,59 @@ class TestPersistentDirtyBitmap(iotests.QMPTestCase):
>
> self.vm.shutdown()
>
> + def test_reopen_rw(self):
> + self.vm = self.mkVm()
> + self.vm.launch()
> + self.qmpAddBitmap()
> +
> + # Calculate hashes
> +
> + self.writeRegions(regions1)
> + sha256_1 = self.getSha256()
> +
> + self.writeRegions(regions2)
> + sha256_2 = self.getSha256()
> + assert sha256_1 != sha256_2 # Otherwise, it's not very interesting.
> +
> + result = self.vm.qmp('block-dirty-bitmap-clear', node='drive0',
> + name='bitmap0')
> + self.assert_qmp(result, 'return', {})
> +
> + # Start with regions1
> +
> + self.writeRegions(regions1)
> + assert sha256_1 == self.getSha256()
> +
> + self.vm.shutdown()
> +
> + self.vm = self.mkVmRo()
> + self.vm.launch()
> +
> + assert sha256_1 == self.getSha256()
> +
> + # Check that we are in RO mode and can't modify bitmap.
> + self.writeRegions(regions2)
> + assert sha256_1 == self.getSha256()
> +
> + # Reopen to RW
> + result = self.vm.qmp('x-blockdev-reopen', **{
> + 'node-name': 'node0',
> + 'driver': iotests.imgfmt,
> + 'file': {
> + 'driver': 'file',
> + 'filename': disk
> + },
> + 'read-only': False
> + })
> + self.assert_qmp(result, 'return', {})
> +
> + # Check that bitmap is reopened to RW and we can write to it.
> + self.writeRegions(regions2)
> + assert sha256_2 == self.getSha256()
> +
> + self.vm.shutdown()
> +
> +
> if __name__ == '__main__':
> iotests.main(supported_fmts=['qcow2'],
> supported_protocols=['file'])
> diff --git a/tests/qemu-iotests/165.out b/tests/qemu-iotests/165.out
> index ae1213e6f8..fbc63e62f8 100644
> --- a/tests/qemu-iotests/165.out
> +++ b/tests/qemu-iotests/165.out
> @@ -1,5 +1,5 @@
> -.
> +..
> ----------------------------------------------------------------------
> -Ran 1 tests
> +Ran 2 tests
>
> OK
>
Reviewed-by: John Snow <jsnow@redhat.com>
next prev parent reply other threads:[~2019-09-27 20:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-27 12:23 [PATCH v5 0/9] qcow2-bitmaps: rewrite reopening logic Vladimir Sementsov-Ogievskiy
2019-09-27 12:23 ` [PATCH v5 1/9] block: switch reopen queue from QSIMPLEQ to QTAILQ Vladimir Sementsov-Ogievskiy
2019-09-27 12:23 ` [PATCH v5 2/9] block: reverse order for reopen commits Vladimir Sementsov-Ogievskiy
2019-09-27 12:23 ` [PATCH v5 3/9] iotests: add test-case to 165 to test reopening qcow2 bitmaps to RW Vladimir Sementsov-Ogievskiy
2019-09-27 20:43 ` John Snow [this message]
2019-09-27 12:23 ` [PATCH v5 4/9] block/qcow2-bitmap: get rid of bdrv_has_changed_persistent_bitmaps Vladimir Sementsov-Ogievskiy
2019-09-27 12:23 ` [PATCH v5 5/9] block/qcow2-bitmap: drop qcow2_reopen_bitmaps_rw_hint() Vladimir Sementsov-Ogievskiy
2019-09-27 12:23 ` [PATCH v5 6/9] block/qcow2-bitmap: do not remove bitmaps on reopen-ro Vladimir Sementsov-Ogievskiy
2019-09-27 12:23 ` [PATCH v5 7/9] iotests: add test 260 to check bitmap life after snapshot + commit Vladimir Sementsov-Ogievskiy
2019-09-27 12:23 ` [PATCH v5 8/9] block/qcow2-bitmap: fix and improve qcow2_reopen_bitmaps_rw Vladimir Sementsov-Ogievskiy
2019-09-27 12:23 ` [PATCH v5 9/9] qcow2-bitmap: move bitmap reopen-rw code to qcow2_reopen_commit Vladimir Sementsov-Ogievskiy
2019-09-27 22:41 ` [PATCH v5 0/9] qcow2-bitmaps: rewrite reopening logic John Snow
2019-09-27 23:36 ` John Snow
2019-09-30 10:32 ` Vladimir Sementsov-Ogievskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=06acd6be-0b8f-a5e3-5f81-e47c550dc6ea@redhat.com \
--to=jsnow@redhat.com \
--cc=den@openvz.org \
--cc=fam@euphon.net \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).