Skip to content

Commit 3f76611

Browse files
authored
Merge pull request #398 from Microsoft/uart_enable_vmdebug
Moving uart kernel config to ComPort creation
2 parents 2da02d8 + cec2b0d commit 3f76611

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/uvm/create.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,12 +389,14 @@ func Create(opts *UVMOptions) (_ *UtilityVM, err error) {
389389

390390
if opts.ConsolePipe != "" {
391391
vmDebugging = true
392-
kernelArgs += " console=ttyS0,115200"
392+
kernelArgs += " 8250_core.nr_uarts=1 8250_core.skip_txen_test=1 console=ttyS0,115200"
393393
vm.Devices.ComPorts = map[string]hcsschema.ComPort{
394394
"0": { // Which is actually COM1
395395
NamedPipe: opts.ConsolePipe,
396396
},
397397
}
398+
} else {
399+
kernelArgs += " 8250_core.nr_uarts=0"
398400
}
399401

400402
if opts.EnableGraphicsConsole {
@@ -405,11 +407,9 @@ func Create(opts *UVMOptions) (_ *UtilityVM, err error) {
405407
vm.Devices.VideoMonitor = &hcsschema.VideoMonitor{}
406408
}
407409

408-
if vmDebugging {
409-
kernelArgs += " 8250_core.nr_uarts=1 8250_core.skip_txen_test=1"
410-
} else {
410+
if !vmDebugging {
411411
// Terminate the VM if there is a kernel panic.
412-
kernelArgs += " panic=-1 8250_core.nr_uarts=0 quiet"
412+
kernelArgs += " panic=-1 quiet"
413413
}
414414

415415
if opts.KernelBootOptions != "" {

0 commit comments

Comments
 (0)