mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-03 15:43:51 +00:00
test: qemu: Fix qemu monitor test utils to allow testing HMP
qemu HMP commands sent by libvirt are terminated just by a '\r'. The fake monitor used in tests wasn't prepared to handle this and the communication would hang on an attempt to do a HMP conversation. Add a special case for handling commands separated by \r in case HMP is used.
This commit is contained in:
parent
4f6b6788c4
commit
fc4713454d
@ -251,7 +251,8 @@ qemuMonitorTestIO(virNetSocketPtr sock,
|
||||
* if so, handle that command
|
||||
*/
|
||||
t1 = test->incoming;
|
||||
while ((t2 = strstr(t1, "\n"))) {
|
||||
while ((t2 = strstr(t1, "\n")) ||
|
||||
(!test->json && (t2 = strstr(t1, "\r")))) {
|
||||
*t2 = '\0';
|
||||
|
||||
if (qemuMonitorTestProcessCommand(test, t1) < 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user