Merge pull request #44282 from orozery/qa-qemu-nbd-ide-interface

qa/tasks/qemu: switch nbd devices from virtio to ide

Reviewed-by: Mykola Golub <mgolub@suse.com>
Reviewed-by: Deepika Upadhyay <dupadhya@redhat.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
Ilya Dryomov 2022-01-25 15:06:14 +01:00 committed by GitHub
commit 82219b3bea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 8 deletions

View File

@ -19,13 +19,22 @@ if [[ -s "${SCRIPT}" ]]; then
chmod +x "${SCRIPT}"
fi
TEST_DEV="/dev/vdb"
if [[ ! -b "${TEST_DEV}" ]]; then
TEST_DEV="/dev/sdb"
fi
SCRATCH_DEV="/dev/vdc"
if [[ ! -b "${SCRATCH_DEV}" ]]; then
SCRATCH_DEV="/dev/sdc"
fi
# tests excluded fail in the current testing vm regardless of whether
# rbd is used
./"${SCRIPT}" -c 1 -f xfs -t /dev/vdb -s /dev/vdc \
./"${SCRIPT}" -c 1 -f xfs -t "${TEST_DEV}" -s "${SCRATCH_DEV}" \
1-7 9-17 19-26 28-49 51-61 63 66-67 69-79 83 85-105 108-110 112-135 \
137-170 174-191 193-204 206-217 220-227 230-231 233 235-241 243-249 \
251-262 264-278 281-286 288-289
252-259 261-262 264-278 281-286 289
STATUS=$?
rm -f "${SCRIPT}"

View File

@ -203,14 +203,18 @@ def generate_iso(ctx, config):
'device_letter' not in disk or \
'image_url' in disk:
continue
dev_letter = disk['device_letter']
if disk['encryption_format'] == 'none':
dev_name = 'vd' + disk['device_letter']
else:
# encrypted disks use if=ide interface, instead of if=virtio
dev_name = 'sd' + disk['device_letter']
user_data += """
- |
#!/bin/bash
mkdir /mnt/test_{dev_letter}
mkfs -t xfs /dev/vd{dev_letter}
mount -t xfs /dev/vd{dev_letter} /mnt/test_{dev_letter}
""".format(dev_letter=dev_letter)
mkdir /mnt/test_{dev_name}
mkfs -t xfs /dev/{dev_name}
mount -t xfs /dev/{dev_name} /mnt/test_{dev_name}
""".format(dev_name=dev_name)
user_data += """
- |
@ -496,17 +500,23 @@ def run_qemu(ctx, config):
continue
if disk['encryption_format'] == 'none':
interface = 'virtio'
disk_spec = 'rbd:rbd/{img}:id={id}'.format(
img=disk['image_name'],
id=client[len('client.'):]
)
else:
# encrypted disks use ide as a temporary workaround for
# a bug in qemu when using virtio over nbd
# TODO: use librbd encryption directly via qemu (not via nbd)
interface = 'ide'
disk_spec = disk['device_path']
args.extend([
'-drive',
'file={disk_spec},format=raw,if=virtio,cache={cachemode}'.format(
'file={disk_spec},format=raw,if={interface},cache={cachemode}'.format(
disk_spec=disk_spec,
interface=interface,
cachemode=cachemode,
),
])