Revision 14fd6c81

b/lib/constants.py
748 748
# Constant representing that the user does not specify any IP version
749 749
IFACE_NO_IP_VERSION_SPECIFIED = 0
750 750

  
751
VALID_SERIAL_SPEEDS = compat.UniqueFrozenset([
752
  75,
753
  110,
754
  300,
755
  600,
756
  1200,
757
  1800,
758
  2400,
759
  4800,
760
  9600,
761
  14400,
762
  19200,
763
  28800,
764
  38400,
765
  57600,
766
  115200,
767
  230400,
768
  345600,
769
  460800,
770
  ])
771

  
751 772
# HV parameter names (global namespace)
752 773
HV_BOOT_ORDER = "boot_order"
753 774
HV_CDROM_IMAGE_PATH = "cdrom_image_path"
......
782 803
HV_INITRD_PATH = "initrd_path"
783 804
HV_ROOT_PATH = "root_path"
784 805
HV_SERIAL_CONSOLE = "serial_console"
806
HV_SERIAL_SPEED = "serial_speed"
785 807
HV_USB_MOUSE = "usb_mouse"
786 808
HV_KEYMAP = "keymap"
787 809
HV_DEVICE_MODEL = "device_model"
......
841 863
  HV_INITRD_PATH: VTYPE_STRING,
842 864
  HV_ROOT_PATH: VTYPE_MAYBE_STRING,
843 865
  HV_SERIAL_CONSOLE: VTYPE_BOOL,
866
  HV_SERIAL_SPEED: VTYPE_INT,
844 867
  HV_USB_MOUSE: VTYPE_STRING,
845 868
  HV_KEYMAP: VTYPE_STRING,
846 869
  HV_DEVICE_MODEL: VTYPE_STRING,
......
1887 1910
    HV_ROOT_PATH: "/dev/vda1",
1888 1911
    HV_ACPI: True,
1889 1912
    HV_SERIAL_CONSOLE: True,
1913
    HV_SERIAL_SPEED: 38400,
1890 1914
    HV_VNC_BIND_ADDRESS: "",
1891 1915
    HV_VNC_TLS: False,
1892 1916
    HV_VNC_X509: "",
b/lib/hypervisor/hv_kvm.py
466 466
    constants.HV_KERNEL_ARGS: hv_base.NO_CHECK,
467 467
    constants.HV_ACPI: hv_base.NO_CHECK,
468 468
    constants.HV_SERIAL_CONSOLE: hv_base.NO_CHECK,
469
    constants.HV_SERIAL_SPEED: hv_base.NO_CHECK,
469 470
    constants.HV_VNC_BIND_ADDRESS:
470 471
      (False, lambda x: (netutils.IP4Address.IsValid(x) or
471 472
                         utils.IsNormAbsPath(x)),
......
1135 1136
      root_append = ["root=%s" % hvp[constants.HV_ROOT_PATH],
1136 1137
                     hvp[constants.HV_KERNEL_ARGS]]
1137 1138
      if hvp[constants.HV_SERIAL_CONSOLE]:
1138
        root_append.append("console=ttyS0,38400")
1139
        serial_speed = hvp[constants.HV_SERIAL_SPEED]
1140
        root_append.append("console=ttyS0,%s" % serial_speed)
1139 1141
      kvm_cmd.extend(["-append", " ".join(root_append)])
1140 1142

  
1141 1143
    mem_path = hvp[constants.HV_MEM_PATH]
......
1949 1951
                                   (constants.HV_VNC_X509,
1950 1952
                                    constants.HV_VNC_X509_VERIFY))
1951 1953

  
1954
    if hvparams[constants.HV_SERIAL_CONSOLE]:
1955
      serial_speed = hvparams[constants.HV_SERIAL_SPEED]
1956
      valid_speeds = constants.VALID_SERIAL_SPEEDS
1957
      if not serial_speed or serial_speed not in valid_speeds:
1958
        raise errors.HypervisorError("Invalid serial console speed, must be"
1959
                                     " one of: %s" %
1960
                                     utils.CommaJoin(valid_speeds))
1961

  
1952 1962
    boot_order = hvparams[constants.HV_BOOT_ORDER]
1953 1963
    if (boot_order == constants.HT_BO_CDROM and
1954 1964
        not hvparams[constants.HV_CDROM_IMAGE_PATH]):
b/man/gnt-instance.rst
473 473
    This boolean option specifies whether to emulate a serial console
474 474
    for the instance.
475 475

  
476
serial\_speed
477
    Valid for the KVM hypervisor.
478

  
479
    This integer option specifies the speed of the serial console.
480
    Common values are 9600, 19200, 38400, 57600 and 115200: choose the
481
    one which works on your system. (The default is 38400 for historical
482
    reasons, but newer versions of kvm/qemu work with 115200)
483

  
476 484
disk\_cache
477 485
    Valid for the KVM hypervisor.
478 486

  

Also available in: Unified diff