提交 fe915278 编写于 作者: M Michal Privoznik

Revert "qemu: Adapt to new log format"

This reverts commit 28224c4d
which shouldn't be needed at all because with current qemu
we obtain all paths from 'query-chardev' output. We ought
not parse log output at all anymore.
上级 28224c4d
......@@ -1431,45 +1431,22 @@ cleanup:
*
* char device redirected to /dev/pts/3
*
* However, since 1.4 the line we are looking for has changed to:
*
* char device <alias> redirected to /some/path
*
* Returns -1 for error, 0 success, 1 continue reading
*/
static int
qemuProcessExtractTTYPath(const char *haystack,
size_t *offset,
const char *alias,
char **path)
{
static const char *needle[] = {"char device", "redirected to"};
const char *tmp, *dev;
static const char needle[] = "char device redirected to";
char *tmp, *dev;
VIR_FREE(*path);
/* First look for our magic string */
if (!(tmp = strstr(haystack + *offset, needle[0])))
if (!(tmp = strstr(haystack + *offset, needle))) {
return 1;
tmp += strlen(needle[0]);
virSkipSpaces(&tmp);
/* We prepend character devices IDs with 'char' prefix,
* hence full device ID is 'charalias0' */
if (STRPREFIX(tmp, "char")) {
/* we are dealing with new style */
tmp += strlen("char");
if (!STRPREFIX(tmp, alias))
return 1;
tmp += strlen(alias);
virSkipSpaces(&tmp);
}
if (!STRPREFIX(tmp, needle[1]))
return 1;
tmp += strlen(needle[1]);
tmp += sizeof(needle);
dev = tmp;
/*
......@@ -1592,7 +1569,6 @@ qemuProcessFindCharDevicePTYs(virDomainObjPtr vm,
virDomainChrDefPtr chr = vm->def->serials[i];
if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY) {
if ((ret = qemuProcessExtractTTYPath(output, &offset,
chr->info.alias,
&chr->source.data.file.path)) != 0)
return ret;
}
......@@ -1603,7 +1579,6 @@ qemuProcessFindCharDevicePTYs(virDomainObjPtr vm,
virDomainChrDefPtr chr = vm->def->parallels[i];
if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY) {
if ((ret = qemuProcessExtractTTYPath(output, &offset,
chr->info.alias,
&chr->source.data.file.path)) != 0)
return ret;
}
......@@ -1614,7 +1589,6 @@ qemuProcessFindCharDevicePTYs(virDomainObjPtr vm,
virDomainChrDefPtr chr = vm->def->channels[i];
if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY) {
if ((ret = qemuProcessExtractTTYPath(output, &offset,
chr->info.alias,
&chr->source.data.file.path)) != 0)
return ret;
}
......@@ -1634,7 +1608,6 @@ qemuProcessFindCharDevicePTYs(virDomainObjPtr vm,
if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY &&
chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO) {
if ((ret = qemuProcessExtractTTYPath(output, &offset,
chr->info.alias,
&chr->source.data.file.path)) != 0)
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册