@@ -414,18 +414,13 @@ class VM:
if smp:
qemu_cmd += add_smp(help, smp)
- iso = params.get("cdrom")
- if iso:
- iso = kvm_utils.get_path(root_dir, iso)
- qemu_cmd += add_cdrom(help, iso, 2)
-
- # Even though this is not a really scalable approach,
- # it doesn't seem like we are going to need more than
- # 2 CDs active on the same VM.
- iso_extra = params.get("cdrom_extra")
- if iso_extra:
- iso_extra = kvm_utils.get_path(root_dir, iso_extra)
- qemu_cmd += add_cdrom(help, iso_extra, 3)
+ cdroms = kvm_utils.get_sub_dict_names(params, "cdroms")
+ for cdrom in cdroms:
+ cdrom_params = kvm_utils.get_sub_dict(params, cdrom)
+ iso = cdrom_params.get("cdrom")
+ if iso:
+ qemu_cmd += add_cdrom(help, kvm_utils.get_path(root_dir, iso),
+ cdrom_params.get("drive_index"))
# We may want to add {floppy_otps} parameter for -fda
# {fat:floppy:}/path/. However vvfat is not usually recommended.
@@ -13,8 +13,8 @@ include cdkeys.cfg
# * All image files are expected under /tmp/kvm_autotest_root/images/
# * All iso files are expected under /tmp/kvm_autotest_root/isos/
qemu_img_binary = /usr/bin/qemu-img
-image_name.* ?<= /tmp/kvm_autotest_root/images/
-cdrom.* ?<= /tmp/kvm_autotest_root/isos/
+image_name(_.*)? ?<= /tmp/kvm_autotest_root/images/
+cdrom(_.*)? ?<= /tmp/kvm_autotest_root/isos/
# Here are the test sets variants. The variant 'qemu_kvm_windows_quick' is
# fully commented, the following ones have comments only on noteworthy points
@@ -3,9 +3,10 @@
# Define the objects we'll be using
vms = vm1
images = image1
+cdroms = cd1
nics = nic1
monitors = humanmonitor1
-login_timeout = 360
+
# Choose the main VM and monitor
main_vm = vm1
main_monitor = humanmonitor1
@@ -33,8 +34,10 @@ qemu_img_binary = qemu-img
smp = 1
mem = 512
image_size = 10G
+drive_index_image1 = 0
shell_port = 22
display = vnc
+drive_index_cd1 = 2
# Monitor params
monitor_type = human
@@ -56,6 +59,7 @@ run_tcpdump = yes
# Misc
profilers = kvm_stat
+login_timeout = 360
# Tests
@@ -1044,7 +1048,9 @@ variants:
unattended_install.cdrom:
timeout = 7200
finish_program = deps/finish.exe
- cdrom_extra = windows/winutils.iso
+ cdroms += " extracd"
+ cdrom_extracd = windows/winutils.iso
+ drive_index_extracd = 3
migrate:
migration_test_command = ver && vol
migration_bg_command = start ping -t localhost