From 1bf43a821445e4a686a5cd8d2b8b8ca12d9885b3 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Tue, 4 Feb 2020 17:26:32 +0100 Subject: [PATCH] virtcontainers: clh: Set the serial to NULL instead of OFF The guest Linux kernel might try to access the serial port, and in case the serial is "off", this might cause some slowness because the port is not emulated at all. Problem is, when the port is not emulated, the default value when reading the I/O port will be 0, which has a special meaning in case of the serial port. It means there is some data ready to be read, which the kernel might try to read for some time, causing global system slowness. That's why it's safer to use "null" by default as this means the serial port will be emulated but anything written to it will be redirected to /dev/null. Fixes #2437 Signed-off-by: Sebastien Boeuf --- virtcontainers/clh.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/virtcontainers/clh.go b/virtcontainers/clh.go index 56e796b54b..f292f511c4 100644 --- a/virtcontainers/clh.go +++ b/virtcontainers/clh.go @@ -265,7 +265,7 @@ func (clh *cloudHypervisor) createSandbox(ctx context.Context, id string, networ } else { clh.vmconfig.Serial = chclient.ConsoleConfig{ - Mode: cctOFF, + Mode: cctNULL, } } @@ -761,6 +761,7 @@ func MaxClhVCPUs() uint32 { const ( cctOFF string = "Off" cctFILE string = "File" + cctNULL string = "Null" ) const (