Skip to content

Commit a29798c

Browse files
committed
storage: use dynamic device names instead of hardcoded device names
Remove hardcoded 'xvdb' device name and use the device name returned by vm.connect_vdi() to support flexible device naming. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
1 parent ed08671 commit a29798c

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

tests/storage/storage.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,9 @@ def vdi_export_import(vm: VM, sr: SR, image_format: ImageFormat, temp_large_dir:
309309
defer(lambda: vdi_dest.destroy())
310310

311311
vm.host.xe('vdi-import', {'uuid': vdi_dest.uuid, 'filename': image_path, 'format': image_format})
312-
vm.connect_vdi(vdi_dest, 'xvdb')
312+
vbd = vm.connect_vdi(vdi_dest)
313313
defer(lambda: vm.disconnect_vdi(vdi_dest))
314+
dev = f'/dev/{vbd.param_get("device")}'
314315

315316
randstream(vm, f'validate --size {stream_size} --expected-checksum {checksum1} {dev}')
316317
randstream(vm, f'validate --position {stream_position} --size {stream_size} --expected-checksum {checksum2} {dev}')

tests/storage/zfsvol/test_zfsvol_sr.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,9 @@ def test_vdi_export_import(self, storage_test_vm: VM, zfsvol_sr: SR, image_forma
128128
defer(lambda: vdi_dest.destroy())
129129

130130
vm.host.xe('vdi-import', {'uuid': vdi_dest.uuid, 'filename': image_path, 'format': image_format})
131-
vm.connect_vdi(vdi_dest, 'xvdb')
131+
vbd = vm.connect_vdi(vdi_dest)
132132
defer(lambda: vm.disconnect_vdi(vdi_dest))
133+
dev = f'/dev/{vbd.param_get("device")}'
133134

134135
randstream(vm, f'validate --size {stream_size} --expected-checksum {checksum1} {dev}')
135136
randstream(

0 commit comments

Comments
 (0)