[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 32/35] iotests/image-fleecing: proper source device
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v3 32/35] iotests/image-fleecing: proper source device |
Date: |
Tue, 1 Jun 2021 19:50:23 +0300 |
Define scsi device to operate with it by qom-set in further patch.
Give a new node-name to source block node, to not look like device
name.
Job now don't want to work without giving explicit id, so, let's call
it "fleecing".
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
---
tests/qemu-iotests/tests/image-fleecing | 12 ++++++++----
tests/qemu-iotests/tests/image-fleecing.out | 2 +-
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/tests/qemu-iotests/tests/image-fleecing
b/tests/qemu-iotests/tests/image-fleecing
index 799369e290..961941bb27 100755
--- a/tests/qemu-iotests/tests/image-fleecing
+++ b/tests/qemu-iotests/tests/image-fleecing
@@ -70,7 +70,11 @@ with iotests.FilePath('base.img') as base_img_path, \
log('--- Launching VM ---')
log('')
- vm.add_drive(base_img_path)
+ src_node = 'source'
+ vm.add_blockdev(f'driver={iotests.imgfmt},file.driver=file,'
+ f'file.filename={base_img_path},node-name={src_node}')
+ vm.add_device('virtio-scsi')
+ vm.add_device(f'scsi-hd,id=sda,drive={src_node}')
vm.launch()
log('Done')
@@ -78,7 +82,6 @@ with iotests.FilePath('base.img') as base_img_path, \
log('--- Setting up Fleecing Graph ---')
log('')
- src_node = 'drive0'
tgt_node = 'fleeceNode'
# create tgt_node backed by src_node
@@ -94,6 +97,7 @@ with iotests.FilePath('base.img') as base_img_path, \
# Establish COW from source to fleecing node
log(vm.qmp('blockdev-backup',
+ job_id='fleecing',
device=src_node,
target=tgt_node,
sync='none'))
@@ -125,7 +129,7 @@ with iotests.FilePath('base.img') as base_img_path, \
for p in overwrite:
cmd = 'write -P%s %s %s' % p
log(cmd)
- log(vm.hmp_qemu_io(src_node, cmd))
+ log(vm.hmp_qemu_io('/machine/peripheral/sda', cmd, qdev=True))
log('')
log('--- Verifying Data ---')
@@ -140,7 +144,7 @@ with iotests.FilePath('base.img') as base_img_path, \
log('--- Cleanup ---')
log('')
- log(vm.qmp('block-job-cancel', device=src_node))
+ log(vm.qmp('block-job-cancel', device='fleecing'))
e = vm.event_wait('BLOCK_JOB_CANCELLED')
assert e is not None
log(e, filters=[iotests.filter_qmp_event])
diff --git a/tests/qemu-iotests/tests/image-fleecing.out
b/tests/qemu-iotests/tests/image-fleecing.out
index 16643dde30..314a1b54e9 100644
--- a/tests/qemu-iotests/tests/image-fleecing.out
+++ b/tests/qemu-iotests/tests/image-fleecing.out
@@ -50,7 +50,7 @@ read -P0 0x3fe0000 64k
--- Cleanup ---
{"return": {}}
-{"data": {"device": "drive0", "len": 67108864, "offset": 393216, "speed": 0,
"type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp":
{"microseconds": "USECS", "seconds": "SECS"}}
+{"data": {"device": "fleecing", "len": 67108864, "offset": 393216, "speed": 0,
"type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp":
{"microseconds": "USECS", "seconds": "SECS"}}
{"return": {}}
{"return": {}}
--
2.29.2
- [PATCH v3 24/35] qapi: publish copy-before-write filter, (continued)
- [PATCH v3 24/35] qapi: publish copy-before-write filter, Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 29/35] iotests/222: constantly use single quotes for strings, Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 25/35] python/qemu/machine.py: refactor _qemu_args(), Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 33/35] iotests/image-fleecing: rename tgt_node, Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 26/35] python/qemu/machine: QEMUMachine: improve qmp() method, Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 30/35] iotests: move 222 to tests/image-fleecing, Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 27/35] iotests.py: VM: add own __enter__ method, Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 31/35] iotests.py: hmp_qemu_io: support qdev, Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 34/35] iotests/image-fleecing: prepare for adding new test-case, Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 35/35] iotests/image-fleecing: add test-case for copy-before-write filter, Vladimir Sementsov-Ogievskiy, 2021/06/01
- [PATCH v3 32/35] iotests/image-fleecing: proper source device,
Vladimir Sementsov-Ogievskiy <=
- DROP Re: [PATCH v3 00/35] block: publish backup-top filter, Vladimir Sementsov-Ogievskiy, 2021/06/02