Skip to contentSkip to conversation

virt: Config file unification

PATCH New Lucas Meneghel Rodrigues 1 participant 6 messages Dec 30, 2011 KVM

lore
Share & tools
lore
#0 lore raw

cover virt: Config file unification

Make kvm and libvirt test configs mostly shared, so it's easy to maintain those config files.

Chris Evich (5):
virt: Adding common config among libvirt and kvm tests
virt: Remove sample config from kvm and libvirt folders
virt: Move vm_type into separate tests.cfg.sample
virt: libvirt_vm: Avoid re-copying kernel and initrd on install
virt: Fixup extra_params usage and config

 client/tests/kvm/base.cfg.sample           |  169 ---
 client/tests/kvm/cdkeys.cfg.sample         |   18 -
 client/tests/kvm/guest-hw.cfg.sample       |  105 --
 client/tests/kvm/guest-os.cfg.sample       | 1729 ----------------------------
 client/tests/kvm/subtests.cfg.sample       | 1385 ----------------------
 client/tests/kvm/tests.cfg.sample          |    5 +
 client/tests/kvm/virtio-win.cfg.sample     |  235 ----
 client/tests/libvirt/base.cfg.sample       |  134 ---
 client/tests/libvirt/cdkeys.cfg.sample     |   18 -
 client/tests/libvirt/guest-hw.cfg.sample   |  107 --
 client/tests/libvirt/guest-os.cfg.sample   | 1664 --------------------------
 client/tests/libvirt/subtests.cfg.sample   | 1045 -----------------
 client/tests/libvirt/tests.cfg.sample      |    5 +
 client/tests/libvirt/virtio-win.cfg.sample |  235 ----
 client/virt/base.cfg.sample                |  180 +++
 client/virt/cdkeys.cfg.sample              |   18 +
 client/virt/guest-hw.cfg.sample            |  110 ++
 client/virt/guest-os.cfg.sample            | 1720 +++++++++++++++++++++++++++
 client/virt/kvm_vm.py                      |    4 +
 client/virt/libvirt_vm.py                  |   19 +-
 client/virt/subtests.cfg.sample            | 1392 ++++++++++++++++++++++
 client/virt/virt_utils.py                  |    6 +-
 client/virt/virtio-win.cfg.sample          |  235 ++++
 23 files changed, 3687 insertions(+), 6851 deletions(-)
 delete mode 100644 client/tests/kvm/base.cfg.sample
 delete mode 100644 client/tests/kvm/cdkeys.cfg.sample
 delete mode 100644 client/tests/kvm/guest-hw.cfg.sample
 delete mode 100644 client/tests/kvm/guest-os.cfg.sample
 delete mode 100644 client/tests/kvm/subtests.cfg.sample
 delete mode 100644 client/tests/kvm/virtio-win.cfg.sample
 delete mode 100644 client/tests/libvirt/base.cfg.sample
 delete mode 100644 client/tests/libvirt/cdkeys.cfg.sample
 delete mode 100644 client/tests/libvirt/guest-hw.cfg.sample
 delete mode 100644 client/tests/libvirt/guest-os.cfg.sample
 delete mode 100644 client/tests/libvirt/subtests.cfg.sample
 delete mode 100644 client/tests/libvirt/virtio-win.cfg.sample
 create mode 100644 client/virt/base.cfg.sample
 create mode 100644 client/virt/cdkeys.cfg.sample
 create mode 100644 client/virt/guest-hw.cfg.sample
 create mode 100644 client/virt/guest-os.cfg.sample
 create mode 100644 client/virt/subtests.cfg.sample
 create mode 100644 client/virt/virtio-win.cfg.sample
Signature · 1 line
1.7.7.4
#1 lore raw

PATCH 1/5 virt: Adding common config among libvirt and kvm tests

With this we have a single set of config files among libvirt and kvm tests, avoiding having to maintain 2 sets of different files.

---
 client/virt/base.cfg.sample       |  184 ++++
 client/virt/cdkeys.cfg.sample     |   18 +
 client/virt/guest-hw.cfg.sample   |  110 +++
 client/virt/guest-os.cfg.sample   | 1723 +++++++++++++++++++++++++++++++++++++
 client/virt/subtests.cfg.sample   | 1392 ++++++++++++++++++++++++++++++
 client/virt/virtio-win.cfg.sample |  235 +++++
 6 files changed, 3662 insertions(+), 0 deletions(-)
 create mode 100644 client/virt/base.cfg.sample
 create mode 100644 client/virt/cdkeys.cfg.sample
 create mode 100644 client/virt/guest-hw.cfg.sample
 create mode 100644 client/virt/guest-os.cfg.sample
 create mode 100644 client/virt/subtests.cfg.sample
 create mode 100644 client/virt/virtio-win.cfg.sample
client/virt/base.cfg.sample new file +184 -0
new file mode 100644
index 0000000..eda511c
@@ -0,0 +1,184 @@
+# Copy this file to base.cfg and edit it
+
+# Absolute paths and/or names of binaries (default path is /usr/bin)
+qemu_binary = qemu
+qemu_img_binary = qemu-img
+qemu_io_binary = qemu-io
+
+# List of virtual machine object names (whitespace seperated)
+vms = vm1
+# Default virtual machine to use, when not specified by test.
+main_vm = vm1
+# Virtualization type (kvm or libvirt)
+# TODO: Update code to use vm_library + vm_type + vm_subtype
+#           i.e.        (libvirt/none) + (qemu/kvm/xen) + (hvm/paravirt)
+vm_type = kvm
+
+# List of network device object names (whitespace seperated)
+nics = nic1
+# List of end-point bridges to connect NIC devices to on host
+bridge = virbr0
+# For libvirt, use following as argument to --network
+virsh_network = network=default
+
+# List of block device object names (whitespace seperated)
+images = image1
+# List of optical device object names
+cdroms = cd1
+
+# USB controller object names (whitespace seperated)
+usbs = usb1
+# USB controller type, can be ehci/uhci
+usb_type = uhci
+# Max ports on a controller.
+usb_max_port = 6
+
+
+
+##### Low-level parameters for platform, networking, block, and usb devices.
+
+# libvirt driver
+driver_type = default
+
+# Default number of processors for each VM
+smp = 1
+# Memory for each VM
+mem = 1024
+
+# Networking type (nic, user, tap, socket, vde, dump, none)
+nic_mode = tap
+
+# Size of file-based qcow2 image, if image_raw-device not used.
+image_size = 10G
+
+# Use raw block device node or file-based qcow2 format
+image_raw_device = no
+# Name of image, or path to device node if using image_raw_device
+image_name = image
+
+# Host-side caching to use (none, writeback, writethrough)
+#    writeback - use host cache, report complete after storage write
+#    writethrough - use host cache, report complete before storage write
+drive_cache = none
+
+# List of hypervisor-monitor object names (one per guest),
+#    used to communicate with hypervisor to control guests.
+#    Order cooresponds to 'vms' list above.
+monitors = humanmonitor1
+# Default monitor type (protocol), if multiple types to be used
+monitor_type = human
+
+# Guest Display type (vnc, sdl, spice, or nographic)
+display = vnc
+# If using a spice display, specific spice options
+qxl = on
+qxl_dev_nr = 1
+spice = disable-ticketing
+# Capture contents of display during each test
+take_regular_screendumps = yes
+keep_screendumps_on_error = yes
+screendump_delay = 5
+# Encode video from vm screenshots
+encode_video_files = yes
+
+
+
+##### Less-common and default parameters expected by some tests,
+##### do not modify unless you know what you're doing.
+
+# Whether to run the qemu binary with malloc perturb set.
+#    Off by default, set to 'yes' to enable
+malloc_perturb = no
+
+# Monitor network traffic during testing
+run_tcpdump = yes
+
+# Block devices
+drive_index_image1 = 0
+drive_index_cd1 = 1
+# You can specify a blkdebug file here, relative to kvm/blkdebug dir
+#    we have a premade default.conf in there. Important to note that you
+#    can set this for any image defined in the config at a given time
+#    drive_blkdebug_image1 = blkdebug/default.conf
+#    drive_blkdebug_image1 =
+# What to do whether a read error is detected, such as 'stop'
+drive_rerror_image1 =
+# What to do whether a write error is detected, such as 'stop'
+drive_werror_image1 =
+# KVM qcow2 image verification and backup settings
+# Enable backup_image = yes only in some specific tests, such as
+#    unattended_install. In all other tests, it should be no, so keep the global
+#    as is.
+backup_image = no
+# Enable backup_image_on_check_error = yes globally to allow isolate bad images
+#    for investigation purposes
+backup_image_on_check_error = no
+# Enable restore_image_on_check_error = yes globally to allow restore a image
+#    that had a check image with a pristine image. Works only if
+#    backup_image_on_check_error = yes, of course. For tests such as
+#    unattended_install, you'll have to set it to no, since if it fails, we won't
+#    have an image at all, so you save time.
+restore_image_on_check_error = no
+
+## UHCI's multifunction configure.
+# usb_type_usb1 = uhci
+# multifunction_usb1 = on
+# masterbus_usb1 = usb1
+# firstport_usb1 = 0
+## EHCI's multifunction configure.
+# usb_type_usb2 = ehci
+# multifunction_usb2 = on
+
+# Some preprocessor/postprocessor params
+start_vm = yes
+kill_vm = no
+kill_vm_gracefully = yes
+kill_unresponsive_vms = yes
+
+# Screendump thread params
+convert_ppm_files_to_png_on_error = yes
+keep_ppm_files = no
+keep_ppm_files_on_error = no
+screendump_quality = 30
+screendump_temp_dir = /dev/shm
+screendump_verbose = no
+keep_video_files = yes
+keep_video_files_on_error = yes
+
+# Default remote shell port (SSH under linux)
+shell_port = 22
+# If you need more ports to be available for comm between host and guest,
+# please add them here
+priv_bridge_ports = 53 67
+
+# Default scheduler params
+used_cpus = 1
+used_mem = 512
+
+# Port redirections
+redirs = remote_shell
+guest_port_remote_shell = 22
+
+# Profilers
+profilers = kvm_stat
+
+# Timeouts
+login_timeout = 360
+
+# libvirt (virt-install optional arguments)
+# TODO: Rename these with 'libvirt_' prefix
+use_autostart = no
+use_check_cpu = yes
+use_debug = yes
+use_no_reboot = no
+use_os_variant = no
+use_os_type = yes
+# if using 'url = auto' to install, url_auto_ip must match IP on
+# selected virsh network or bridge
+url_auto_ip = 192.168.122.1
+# wait in minutes for virt-install to finish (bz still open)
+use_virt_install_wait = no
+virt_install_wait_time = 300
+
+# NFS directory of guest images
+images_good = fileserver.foo.com:/autotest/images_good
client/virt/cdkeys.cfg.sample new file +18 -0
new file mode 100644
index 0000000..2d1d05d
@@ -0,0 +1,18 @@
+# Copy this file to cdkeys.cfg and edit it.
+#
+# Replace the 'CDKEY' strings with real cdkeys where necessary.
+# Feel free to add additional guests as required.
+
+RHEL.5.3.i386: cdkey = CDKEY
+RHEL.5.3.x86_64: cdkey = CDKEY
+Win2000: cdkey = CDKEY
+WinXP.32: cdkey = CDKEY
+WinXP.64: cdkey = CDKEY
+Win2003.32: cdkey = CDKEY
+Win2003.64: cdkey = CDKEY
+WinVista.32: cdkey = CDKEY
+WinVista.64: cdkey = CDKEY
+Win2008.32: cdkey = CDKEY
+Win2008.64: cdkey = CDKEY
+Win7.32: cdkey = CDKEY
+Win7.64: cdkey = CDKEY
client/virt/guest-hw.cfg.sample new file +110 -0

110 lines not on this page · raw message

client/virt/guest-os.cfg.sample new file +1723 -0

1,723 lines not on this page · raw message

client/virt/subtests.cfg.sample new file +1392 -0

965 lines not on this page · raw message

client/virt/virtio-win.cfg.sample new file +235 -0

235 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 6 lines
1.7.7.4

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Part of the diff is not shown here. View the raw message.

#2 lore raw

PATCH 2/5 virt: Remove sample config from kvm and libvirt folders

In reply to Lucas Meneghel Rodrigues

Also, make virt_test_assistant to use sample files inside the common virt directory.

---
 client/tests/kvm/base.cfg.sample           |  169 ---
 client/tests/kvm/cdkeys.cfg.sample         |   18 -
 client/tests/kvm/guest-hw.cfg.sample       |  105 --
 client/tests/kvm/guest-os.cfg.sample       | 1729 ----------------------------
 client/tests/kvm/subtests.cfg.sample       | 1385 ----------------------
 client/tests/kvm/virtio-win.cfg.sample     |  235 ----
 client/tests/libvirt/base.cfg.sample       |  134 ---
 client/tests/libvirt/cdkeys.cfg.sample     |   18 -
 client/tests/libvirt/guest-hw.cfg.sample   |  107 --
 client/tests/libvirt/guest-os.cfg.sample   | 1664 --------------------------
 client/tests/libvirt/subtests.cfg.sample   | 1045 -----------------
 client/tests/libvirt/virtio-win.cfg.sample |  235 ----
 client/virt/virt_utils.py                  |    6 +-
 13 files changed, 4 insertions(+), 6846 deletions(-)
 delete mode 100644 client/tests/kvm/base.cfg.sample
 delete mode 100644 client/tests/kvm/cdkeys.cfg.sample
 delete mode 100644 client/tests/kvm/guest-hw.cfg.sample
 delete mode 100644 client/tests/kvm/guest-os.cfg.sample
 delete mode 100644 client/tests/kvm/subtests.cfg.sample
 delete mode 100644 client/tests/kvm/virtio-win.cfg.sample
 delete mode 100644 client/tests/libvirt/base.cfg.sample
 delete mode 100644 client/tests/libvirt/cdkeys.cfg.sample
 delete mode 100644 client/tests/libvirt/guest-hw.cfg.sample
 delete mode 100644 client/tests/libvirt/guest-os.cfg.sample
 delete mode 100644 client/tests/libvirt/subtests.cfg.sample
 delete mode 100644 client/tests/libvirt/virtio-win.cfg.sample
client/tests/kvm/base.cfg.sample deleted +0 -169
deleted file mode 100644
index ad4bfdc..0000000
@@ -1,169 +0,0 @@
-# Copy this file to base.cfg and edit it.
-
-# Absolute paths and/or names of binaries (default path is /usr/bin)
-qemu_binary = qemu
-qemu_img_binary = qemu-img
-qemu_io_binary = qemu-io
-
-# List of virtual machine object names (whitespace seperated)
-vms = vm1
-# Default virtual machine to use, when not specified by test.
-main_vm = vm1
-# Virtualization type (kvm/xen/libvirt/etc.)
-vm_type = kvm
-
-# List of network device object names (whitespace seperated)
-nics = nic1
-# Connect NIC devices to host bridge device
-bridge = virbr0
-
-# Tell framework of nic1's static ip address
-# ip_nic1 = 192.168.100.110
-
-# List of block device object names (whitespace seperated)
-images = image1
-# List of optical device object names
-cdroms = cd1
-
-# USB controller object names (whitespace seperated)
-usbs = usb1
-# USB controller type, can be ehci/uhci
-usb_type = uhci
-# Max ports on a controller.
-usb_max_port = 6
-
-
-
-##### Low-level parameters for platform, networking, block, and usb devices.
-
-# Default number of processors for each VM
-smp = 1
-# Memory for each VM
-mem = 1024
-
-# Networking type (nic, user, tap, socket, vde, dump, none)
-nic_mode = tap
-
-# Size of file-based qcow2 image, if image_raw-device not used.
-image_size = 10G
-
-# Use raw block device node or file-based qcow2 format
-image_raw_device = no
-# Name of image, or path to device node if using image_raw_device
-image_name = image
-
-# Host-side caching to use (none, writeback, writethrough)
-#    writeback - use host cache, report complete after storage write
-#    writethrough - use host cache, report complete before storage write
-drive_cache = none
-
-# List of hypervisor-monitor object names (one per guest),
-#    used to communicate with hypervisor to control guests.
-monitors = humanmonitor1
-# Default monitor object to use, when not specified by test.
-main_monitor = humanmonitor1
-# Default monitor type (protocol), if multiple types to be used
-monitor_type = human
-
-# Guest Display type (vnc, sdl, spice, or nographic)
-display = vnc
-# If using a spice display, specific spice options
-qxl = on
-qxl_dev_nr = 1
-spice = disable-ticketing
-# Capture contents of display during each test
-take_regular_screendumps = yes
-keep_screendumps_on_error = yes
-screendump_delay = 5
-# Encode video from vm screenshots
-encode_video_files = yes
-
-
-
-##### Less-common and default parameters expected by some tests,
-##### do not modify unless you know what you're doing.
-
-# Whether to run the qemu binary with malloc perturb set.
-#    Off by default, set to 'yes' to enable
-malloc_perturb = no
-
-# Monitor network traffic during testing
-run_tcpdump = yes
-
-# Block devices
-drive_index_image1 = 0
-drive_index_cd1 = 1
-# You can specify a blkdebug file here, relative to kvm/blkdebug dir
-#    we have a premade default.conf in there. Important to note that you
-#    can set this for any image defined in the config at a given time
-#    drive_blkdebug_image1 = blkdebug/default.conf
-#    drive_blkdebug_image1 =
-# What to do whether a read error is detected, such as 'stop'
-drive_rerror_image1 =
-# What to do whether a write error is detected, such as 'stop'
-drive_werror_image1 =
-# Disk backup settings
-# Enable backup_image = yes only in some specific tests, such as
-#    unattended_install. In all other tests, it should be no, so keep the global
-#    as is.
-backup_image = no
-# Enable backup_image_on_check_error = yes globally to allow isolate bad images
-#    for investigation purposes
-backup_image_on_check_error = no
-# Enable restore_image_on_check_error = yes globally to allow restore a image
-#    that had a check image with a pristine image. Works only if
-#    backup_image_on_check_error = yes, of course. For tests such as
-#    unattended_install, you'll have to set it to no, since if it fails, we won't
-#    have an image at all, so you save time.
-restore_image_on_check_error = no
-
-## UHCI's multifunction configure.
-# usb_type_usb1 = uhci
-# multifunction_usb1 = on
-# masterbus_usb1 = usb1
-# firstport_usb1 = 0
-## EHCI's multifunction configure.
-# usb_type_usb2 = ehci
-# multifunction_usb2 = on
-
-# Some preprocessor/postprocessor params
-start_vm = yes
-kill_vm = no
-kill_vm_gracefully = yes
-kill_unresponsive_vms = yes
-
-# Screendump thread params
-convert_ppm_files_to_png_on_error = yes
-keep_ppm_files = no
-keep_ppm_files_on_error = no
-screendump_quality = 30
-screendump_temp_dir = /dev/shm
-screendump_verbose = no
-
-keep_video_files = yes
-keep_video_files_on_error = yes
-
-# Default remote shell port (SSH under linux)
-shell_port = 22
-
-# Default scheduler params
-used_cpus = 1
-used_mem = 512
-
-# Numa pinning params
-# pin guest memory to 1st numa node
-# pin processes to host cpu of 1st node
-# numa_node = 1
-
-# Port redirections
-redirs = remote_shell
-guest_port_remote_shell = 22
-
-# Profilers
-profilers = kvm_stat
-
-# Timeouts
-login_timeout = 360
-
-# NFS directory of guest images
-images_good = fileserver.foo.com:/autotest/images_good
client/tests/kvm/cdkeys.cfg.sample deleted +0 -18
deleted file mode 100644
index 2d1d05d..0000000
@@ -1,18 +0,0 @@
-# Copy this file to cdkeys.cfg and edit it.
-#
-# Replace the 'CDKEY' strings with real cdkeys where necessary.
-# Feel free to add additional guests as required.
-
-RHEL.5.3.i386: cdkey = CDKEY
-RHEL.5.3.x86_64: cdkey = CDKEY
-Win2000: cdkey = CDKEY
-WinXP.32: cdkey = CDKEY
-WinXP.64: cdkey = CDKEY
-Win2003.32: cdkey = CDKEY
-Win2003.64: cdkey = CDKEY
-WinVista.32: cdkey = CDKEY
-WinVista.64: cdkey = CDKEY
-Win2008.32: cdkey = CDKEY
-Win2008.64: cdkey = CDKEY
-Win7.32: cdkey = CDKEY
-Win7.64: cdkey = CDKEY
client/tests/kvm/guest-hw.cfg.sample deleted +0 -105

105 lines not on this page · raw message

client/tests/kvm/guest-os.cfg.sample deleted +0 -1729

1,729 lines not on this page · raw message

client/tests/kvm/subtests.cfg.sample deleted +0 -1385

979 lines not on this page · raw message

client/tests/kvm/virtio-win.cfg.sample deleted +0 -235

235 lines not on this page · raw message

client/tests/libvirt/base.cfg.sample deleted +0 -134

134 lines not on this page · raw message

client/tests/libvirt/cdkeys.cfg.sample deleted +0 -18
deleted file mode 100644
index 2d1d05d..0000000

Lines of this file are not shown. View the raw message.

client/tests/libvirt/guest-hw.cfg.sample deleted +0 -107

107 lines not on this page · raw message

client/tests/libvirt/guest-os.cfg.sample deleted +0 -1664

1,664 lines not on this page · raw message

client/tests/libvirt/subtests.cfg.sample deleted +0 -1045

1,045 lines not on this page · raw message

client/tests/libvirt/virtio-win.cfg.sample deleted +0 -235

235 lines not on this page · raw message

client/virt/virt_utils.py +4 -2
index 1b90d0f..8927f33 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 6 lines
1.7.7.4

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Part of the diff is not shown here. View the raw message.

#3 lore raw

PATCH 3/5 virt: Move vm_type into separate tests.cfg.sample

In reply to Lucas Meneghel Rodrigues

Moved vm_type setting into seperate tests.cfg.sample so that base.cfg.sample can be shared between virt test types.

---
 client/tests/kvm/tests.cfg.sample     |    5 +++++
 client/tests/libvirt/tests.cfg.sample |    5 +++++
 client/virt/base.cfg.sample           |    4 ----
 3 files changed, 10 insertions(+), 4 deletions(-)
client/tests/kvm/tests.cfg.sample +5 -0
index bd0d05e..9048884 100644
@@ -10,6 +10,11 @@ include guest-hw.cfg
 include cdkeys.cfg
 include virtio-win.cfg
 
+# Virtualization type (kvm or libvirt)
+# TODO: Update code to use vm_library + vm_type + vm_subtype
+#           i.e.        (libvirt/none) + (qemu/kvm/xen) + (hvm/paravirt)
+vm_type = kvm
+
 # Here you can override the image name for our custom linux and windows guests
 #
 CustomGuestLinux:
client/tests/libvirt/tests.cfg.sample +5 -0
index 831ff4e..158c7b1 100644
@@ -8,6 +8,11 @@ include guest-hw.cfg
 include cdkeys.cfg
 include virtio-win.cfg
 
+# Virtualization type (kvm or libvirt)
+# TODO: Update code to use vm_library + vm_type + vm_subtype
+#           i.e.        (libvirt/none) + (qemu/kvm/xen) + (hvm/paravirt)
+vm_type = libvirt
+
 variants:
     # Runs virt-install, f16 64 bit guest OS, install, boot, shutdown
     - @libvirt_f16_quick:
client/virt/base.cfg.sample +0 -4
index eda511c..7bd998a 100644
@@ -9,10 +9,6 @@ qemu_io_binary = qemu-io
 vms = vm1
 # Default virtual machine to use, when not specified by test.
 main_vm = vm1
-# Virtualization type (kvm or libvirt)
-# TODO: Update code to use vm_library + vm_type + vm_subtype
-#           i.e.        (libvirt/none) + (qemu/kvm/xen) + (hvm/paravirt)
-vm_type = kvm
 
 # List of network device object names (whitespace seperated)
 nics = nic1
Signature · 1 line
1.7.7.4
#4 lore raw

PATCH 4/5 virt: libvirt_vm: Avoid re-copying kernel and initrd on install

In reply to Lucas Meneghel Rodrigues

Added simple workaround for virt-install's insistence on re-copying kernel and initrd files from a specific directory layout. Added a note that this code should be cleaned up if/when corresponding part of unattended_install test is cleaned.

---
 client/virt/libvirt_vm.py |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
client/virt/libvirt_vm.py +11 -2
index 65db338..97b9f8b 100644
@@ -601,7 +601,7 @@ class VM(virt_vm.BaseVM):
         if smp:
             virt_install_cmd += add_smp(help, smp)
 
-        # TODO: directory location for vmlinuz/kernel for cdrom install ?
+        # libvirt expects --location <path>/images/pxeboot/<vmlinuz|initrd>
         location = None
         if params.get("medium") == 'url':
             if params.get("url") == 'auto':
@@ -620,7 +620,16 @@ class VM(virt_vm.BaseVM):
             if params.get("use_libvirt_cdrom_switch") == 'yes':
                 virt_install_cmd += add_cdrom(help, params.get("cdrom_cd1"))
             else:
-                location = params.get("image_dir")
+                # Fake images/pxeboot using relative symlinks
+                # Assumes kernel and initrd were copied to same dir
+                # TODO: This and cooresponding add_cdrom() in unattended_install test
+                #       should be much cleaner.
+                location = os.path.dirname(params.get("kernel"))
+                try:
+                    os.symlink( ".", os.path.join(location, "images")  )
+                    os.symlink( ".", os.path.join(location, "pxeboot")  )
+                except OSError:
+                    pass # ignore if already exists
 
         if location:
             virt_install_cmd += add_location(help, location)
Signature · 1 line
1.7.7.4
#5 lore raw

PATCH 5/5 virt: Fixup extra_params usage and config

In reply to Lucas Meneghel Rodrigues

Created a special category, 'kernel_params', for options passed to the kernel which we are booting, such as the installer kernels. With this patch we don't mess up with the other uses of extra_params still keeping consistency between libvirt and kvm tests.

---
 client/virt/guest-os.cfg.sample |   21 +++++++++------------
 client/virt/kvm_vm.py           |    4 ++++
 client/virt/libvirt_vm.py       |    6 +++---
 3 files changed, 16 insertions(+), 15 deletions(-)
client/virt/guest-os.cfg.sample +9 -12
index 538dd87..7eb2b1d 100644
@@ -104,11 +104,10 @@ variants:
                 shell_prompt = "^\[.*\][\#\$]\s*$"
                 unattended_install:
                     boot_path = "images/pxeboot"
-                    # TODO: does kvm need to prefix this with '--append'?
-                    extra_params += " 'ks=cdrom nicdelay=60 console=ttyS0,115200 console=tty0'"
+                    kernel_params = "ks=cdrom nicdelay=60 console=ttyS0,115200 console=tty0"
                     # You have to use ks=floppy if you want to use floppies to
                     # hold your kickstart file
-                    #extra_params += " ks=floppy nicdelay=60 console=ttyS0,115200 console=tty0"
+                    #kernel_params = "ks=floppy nicdelay=60 console=ttyS0,115200 console=tty0"
                 variants:
                     - 8.32:
                         no setup
@@ -403,8 +402,7 @@ variants:
                     boot_path = images/pxeboot
                     # You have to use ks=floppy if you want to use floppies to
                     # hold your kickstart file
-                    # TODO: does kvm need to prefix this with '--append'?
-                    extra_params += " ks=cdrom nicdelay=60 console=ttyS0,115200 console=tty0"
+                    kernel_params = "ks=cdrom nicdelay=60 console=ttyS0,115200 console=tty0"
                 variants:
                     - 3.9.i386:
                         no setup autotest linux_s3 guest_s4 shutdown multi_disk
@@ -768,8 +766,8 @@ variants:
                 unattended_install:
                     # You have to use autoyast=floppy if you want to use floppies to
                     # hold your autoyast file
-                    #extra_params += " --append 'autoyast=floppy console=ttyS0,115200 console=tty0'"
-                    extra_params += " --append 'autoyast=device://scd0/autoinst.xml console=ttyS0,115200 console=tty0'"
+                    #kernel_params = "autoyast=floppy console=ttyS0,115200 console=tty0"
+                    kernel_params = "autoyast=device://scd0/autoinst.xml console=ttyS0,115200 console=tty0"
                     wait_no_ack = yes
 
                 variants:
@@ -932,10 +930,10 @@ variants:
                 unattended_install:
                     # You have to use autoyast=floppy if you want to use floppies to
                     # hold your autoyast file
-                    #extra_params += " --append 'autoyast=floppy console=ttyS0,115200 console=tty0'"
-                    extra_params += " --append 'autoyast=device://scd0/autoinst.xml console=ttyS0,115200 console=tty0'"
+                    #kernel_params = "autoyast=floppy console=ttyS0,115200 console=tty0"
+                    kernel_params = "autoyast=device://scd0/autoinst.xml console=ttyS0,115200 console=tty0"
                     # --- uncomment the below line for other SLES 10 distros only ---
-                    #extra_params += " --append 'autoyast=device://hdb/autoinst.xml console=ttyS0,115200 console=tty0'"
+                    #kernel_params = "autoyast=device://hdb/autoinst.xml console=ttyS0,115200 console=tty0"
                     kernel = linux
                     initrd = initrd
                     wait_no_ack = yes
@@ -1036,7 +1034,7 @@ variants:
                     kernel = linux
                     initrd = initrd
                     wait_no_ack = yes
-                    extra_params += " --append 'console=ttyS0,115200 console=tty0'"
+                    kernel_params = "console=ttyS0,115200 console=tty0"
 
                 variants:
                     - 6.10-32:
@@ -1720,4 +1718,3 @@ variants:
                 steps = steps/memtest86+.steps
                 cdrom_cd1 = isos/misc/memtest86+-2.01.iso
                 md5sum_cd1 = 9fae22f2666369968a76ef59e9a81ced
-
client/virt/kvm_vm.py +4 -0
index 1fb177f..b55d57d 100644
@@ -680,6 +680,10 @@ class VM(virt_vm.BaseVM):
             for pci_id in vm.pa_pci_ids:
                 qemu_cmd += add_pcidevice(help, pci_id)
 
+        kernel_params = params.get("kernel_params")
+        if kernel_params:
+            qemu_cmd += " --append '%s'" % kernel_params
+
         extra_params = params.get("extra_params")
         if extra_params:
             qemu_cmd += " %s" % extra_params
client/virt/libvirt_vm.py +3 -3
index 97b9f8b..437fbe6 100644
@@ -761,9 +761,9 @@ class VM(virt_vm.BaseVM):
             virt_install_cmd += (" --wait %s" %
                                  params.get("virt_install_wait_time"))
 
-        extra_params = params.get("extra_params")
-        if extra_params:
-            virt_install_cmd += " --extra-args '%s'" % extra_params
+        kernel_params = params.get("kernel_params")
+        if kernel_params:
+            virt_install_cmd += " --extra-args '%s'" % kernel_params
 
         virt_install_cmd += " --noautoconsole"
 
Signature · 1 line
1.7.7.4