go-qemu
go-qemu copied to clipboard
bufio.Scanner: token too long
When return is very long (more than 64KB), it will get an error: bufio.Scanner: token too long
This is because go-qemu/qmp/socket.go:160
uses a small default Buffer (bufio.scan.MaxScanTokenSize) while real world may much longer than that.
I also triggered this bug with the hmp command info mem
which returns a lot more than 64KB.
Why was Scanner
used in the first place? Can't the socket be just read until EOF?