- PARAMETERS = [
- constants.HV_KERNEL_PATH,
- constants.HV_INITRD_PATH,
- constants.HV_ROOT_PATH,
- constants.HV_KERNEL_ARGS,
- constants.HV_ACPI,
- constants.HV_SERIAL_CONSOLE,
- constants.HV_VNC_BIND_ADDRESS,
- constants.HV_VNC_TLS,
- constants.HV_VNC_X509,
- constants.HV_VNC_X509_VERIFY,
- constants.HV_CDROM_IMAGE_PATH,
- constants.HV_BOOT_ORDER,
- constants.HV_NIC_TYPE,
- constants.HV_DISK_TYPE,
- constants.HV_USB_MOUSE,
- ]
+ PARAMETERS = {
+ constants.HV_KERNEL_PATH: hv_base.OPT_FILE_CHECK,
+ constants.HV_INITRD_PATH: hv_base.OPT_FILE_CHECK,
+ constants.HV_ROOT_PATH: hv_base.NO_CHECK,
+ constants.HV_KERNEL_ARGS: hv_base.NO_CHECK,
+ constants.HV_ACPI: hv_base.NO_CHECK,
+ constants.HV_SERIAL_CONSOLE: hv_base.NO_CHECK,
+ constants.HV_VNC_BIND_ADDRESS:
+ (False, lambda x: (utils.IsValidIP(x) or utils.IsNormAbsPath(x)),
+ "the VNC bind address must be either a valid IP address or an absolute"
+ " pathname", None, None),
+ constants.HV_VNC_TLS: hv_base.NO_CHECK,
+ constants.HV_VNC_X509: hv_base.OPT_DIR_CHECK,
+ constants.HV_VNC_X509_VERIFY: hv_base.NO_CHECK,
+ constants.HV_CDROM_IMAGE_PATH: hv_base.OPT_FILE_CHECK,
+ constants.HV_BOOT_ORDER:
+ hv_base.ParamInSet(True, constants.HT_KVM_VALID_BO_TYPES),
+ constants.HV_NIC_TYPE:
+ hv_base.ParamInSet(True, constants.HT_KVM_VALID_NIC_TYPES),
+ constants.HV_DISK_TYPE:
+ hv_base.ParamInSet(True, constants.HT_KVM_VALID_DISK_TYPES),
+ constants.HV_USB_MOUSE:
+ hv_base.ParamInSet(False, constants.HT_KVM_VALID_MOUSE_TYPES),
+ }