提交 1d86fca4 编写于 作者: D Daniel P. Berrange

Fix parsing of QEMU stdout looking for serial device PTY with Xenner

上级 915b86d2
Fri Jul 11 10:46:59 BST 2008 Daniel P. Berrange <berrange@redhat.com>
* 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 <veillard@redhat.com> Fri Jul 11 10:53:59 CEST 2008 Daniel Veillard <veillard@redhat.com>
* src/openvz_conf.c: cleanup OpenVZ config file accesses, patch * src/openvz_conf.c: cleanup OpenVZ config file accesses, patch
......
...@@ -528,6 +528,9 @@ static int qemudExtractMonitorPath(const char *haystack, ...@@ -528,6 +528,9 @@ static int qemudExtractMonitorPath(const char *haystack,
strncpy(path, tmp+sizeof(needle), pathmax-1); strncpy(path, tmp+sizeof(needle), pathmax-1);
path[pathmax-1] = '\0'; 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 * And look for first whitespace character and nul terminate
* to mark end of the pty path * to mark end of the pty path
...@@ -536,6 +539,7 @@ static int qemudExtractMonitorPath(const char *haystack, ...@@ -536,6 +539,7 @@ static int qemudExtractMonitorPath(const char *haystack,
while (*tmp) { while (*tmp) {
if (c_isspace(*tmp)) { if (c_isspace(*tmp)) {
*tmp = '\0'; *tmp = '\0';
/* ... now further update offset till we get EOL */
*offset += (sizeof(needle)-1) + strlen(path); *offset += (sizeof(needle)-1) + strlen(path);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册