Skip to content

Commit

Permalink
tests/nested/manual/install-volume-assignment: fix the pci addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
valentindavid committed Feb 1, 2025
1 parent 99fd190 commit 127d9fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/lib/nested.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,8 @@ nested_start_core_vm_unit() {
PARAM_TPM="$PARAM_TPM -device tpm-tis,tpmdev=tpm0"
fi
fi
PARAM_IMAGE="-drive file=$CURRENT_IMAGE,cache=none,format=raw,id=disk1,if=none -device virtio-blk-pci,drive=disk1,bootindex=1"
# addr=5 is to make tests/nested/manual/install-volume-assignment have stable address
PARAM_IMAGE="-drive file=$CURRENT_IMAGE,cache=none,format=raw,id=disk1,if=none -device virtio-blk-pci,drive=disk1,bootindex=1,addr=5"
else
PARAM_IMAGE="-drive file=$CURRENT_IMAGE,cache=none,format=raw,id=disk1,if=none -device ide-hd,drive=disk1"
fi
Expand Down
9 changes: 7 additions & 2 deletions tests/nested/manual/install-volume-assignment/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ prepare: |
device: /dev/disk/by-id/nvme0003
- assignment-name: test-device
assignment:
# FIXME: we should really not use those kind of paths, they are
# difficult to predict
pc:
device: /dev/disk/by-path/pci-0000:00:05.0
backup:
Expand Down Expand Up @@ -72,8 +74,11 @@ execute: |
BACKUP_VOLUME="$NESTED_IMAGES_DIR/$(nested_get_image_name_base core)-backup.img"
# setup extra disk options for tests.nested
NESTED_PARAM_EXTRA="-drive file=$BACKUP_VOLUME,if=none,snapshot=off,format=raw,id=disk2 \
-device virtio-blk-pci,drive=disk2,serial=target"
params=(
"-drive" "file=${BACKUP_VOLUME},if=none,snapshot=off,format=raw,id=disk2"
"-device" "virtio-blk-pci,drive=disk2,addr=6"
)
NESTED_PARAM_EXTRA="${params[*]}"
tests.nested create-vm core --extra-param "$NESTED_PARAM_EXTRA"
Expand Down

0 comments on commit 127d9fd

Please sign in to comment.