From 1d86fca433eb95958b424414a6f611c30a920612 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 11 Jul 2008 09:48:51 +0000 Subject: [PATCH] Fix parsing of QEMU stdout looking for serial device PTY with Xenner --- ChangeLog | 5 +++++ src/qemu_driver.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index eede5f37d4..dd79b76ff5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Jul 11 10:46:59 BST 2008 Daniel P. Berrange + + * src/qemu_driver.c: Fix parsing of QEMU stdout looking for + serial device PTY with Xenner + Fri Jul 11 10:53:59 CEST 2008 Daniel Veillard * src/openvz_conf.c: cleanup OpenVZ config file accesses, patch diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 61576c7873..8d8fcd64b3 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -528,6 +528,9 @@ static int qemudExtractMonitorPath(const char *haystack, strncpy(path, tmp+sizeof(needle), pathmax-1); path[pathmax-1] = '\0'; + /* Update offset to point to where we found the needle..*/ + *offset = tmp - haystack; + /* * And look for first whitespace character and nul terminate * to mark end of the pty path @@ -536,6 +539,7 @@ static int qemudExtractMonitorPath(const char *haystack, while (*tmp) { if (c_isspace(*tmp)) { *tmp = '\0'; + /* ... now further update offset till we get EOL */ *offset += (sizeof(needle)-1) + strlen(path); return 0; }