Commit f15c61c4 authored by Hrvoje Ribicic's avatar Hrvoje Ribicic

Rename lxc_tty to num_ttys

As noted in the previous commit, the lxc_ prefix is bad and it's good
to be rid of it, and we can take advantage of this change to rename the
variable.
Its previous name was meant to reflect the lxc config option being set
(lxc.tty), but we should use a more descriptive name.
Signed-off-by: default avatarHrvoje Ribicic <riba@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 1ff098c0
......@@ -145,7 +145,7 @@ class LXCHypervisor(hv_base.BaseHypervisor):
constants.HV_LXC_DEVICES: hv_base.NO_CHECK,
constants.HV_LXC_DROP_CAPABILITIES: hv_base.NO_CHECK,
constants.HV_LXC_EXTRA_CONFIG: hv_base.NO_CHECK,
constants.HV_LXC_TTY: hv_base.REQ_NONNEGATIVE_INT_CHECK,
constants.HV_LXC_NUM_TTYS: hv_base.REQ_NONNEGATIVE_INT_CHECK,
constants.HV_LXC_STARTUP_TIMEOUT: hv_base.OPT_NONNEGATIVE_INT_CHECK,
}
......@@ -530,9 +530,9 @@ class LXCHypervisor(hv_base.BaseHypervisor):
# separate pseudo-TTY instances
out.append("lxc.pts = 255")
# standard TTYs
lxc_ttys = instance.hvparams[constants.HV_LXC_TTY]
if lxc_ttys: # if it is the number greater than 0
out.append("lxc.tty = %s" % lxc_ttys)
num_ttys = instance.hvparams[constants.HV_LXC_NUM_TTYS]
if num_ttys: # if it is the number greater than 0
out.append("lxc.tty = %s" % num_ttys)
# console log file
# After the following patch was applied, we lost the console log file output
......
......@@ -952,7 +952,7 @@ lxc\_extra\_config
This parameter is not set by default.
lxc\_tty
num_ttys
Valid for the LXC hypervisor.
This option specifies the number of ttys(actually ptys) that
......
......@@ -646,8 +646,8 @@ def TestInstanceModify(instance):
args.extend([
["-H", "%s=0" % constants.HV_CPU_MASK],
["-H", "%s=%s" % (constants.HV_CPU_MASK, constants.VALUE_DEFAULT)],
["-H", "%s=0" % constants.HV_LXC_TTY],
["-H", "%s=%s" % (constants.HV_LXC_TTY, constants.VALUE_DEFAULT)],
["-H", "%s=0" % constants.HV_LXC_NUM_TTYS],
["-H", "%s=%s" % (constants.HV_LXC_NUM_TTYS, constants.VALUE_DEFAULT)],
])
url = "http://example.com/busybox.img"
......
......@@ -1714,8 +1714,8 @@ hvLxcDropCapabilities = "lxc_drop_capabilities"
hvLxcExtraConfig :: String
hvLxcExtraConfig = "lxc_extra_config"
hvLxcTty :: String
hvLxcTty = "lxc_tty"
hvLxcNumTtys :: String
hvLxcNumTtys = "num_ttys"
hvMemPath :: String
hvMemPath = "mem_path"
......@@ -1883,7 +1883,7 @@ hvsParameterTypes = Map.fromList
, (hvLxcDevices, VTypeString)
, (hvLxcDropCapabilities, VTypeString)
, (hvLxcExtraConfig, VTypeString)
, (hvLxcTty, VTypeInt)
, (hvLxcNumTtys, VTypeInt)
, (hvLxcStartupTimeout, VTypeInt)
, (hvMemPath, VTypeString)
, (hvMigrationBandwidth, VTypeInt)
......@@ -3979,7 +3979,7 @@ hvcDefaults =
, (hvLxcDevices, PyValueEx lxcDevicesDefault)
, (hvLxcDropCapabilities, PyValueEx lxcDropCapabilitiesDefault)
, (hvLxcExtraConfig, PyValueEx "")
, (hvLxcTty, PyValueEx (6 :: Int))
, (hvLxcNumTtys, PyValueEx (6 :: Int))
, (hvLxcStartupTimeout, PyValueEx (30 :: Int))
])
]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment