@@ -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])
@@ -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": {}}