mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Revert "qemu: Adapt to new log format"
This reverts commit 28224c4d2a
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.
This commit is contained in:
parent
28224c4d2a
commit
fe915278c1
@ -1431,45 +1431,22 @@ cleanup:
|
|||||||
*
|
*
|
||||||
* char device redirected to /dev/pts/3
|
* 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
|
* Returns -1 for error, 0 success, 1 continue reading
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
qemuProcessExtractTTYPath(const char *haystack,
|
qemuProcessExtractTTYPath(const char *haystack,
|
||||||
size_t *offset,
|
size_t *offset,
|
||||||
const char *alias,
|
|
||||||
char **path)
|
char **path)
|
||||||
{
|
{
|
||||||
static const char *needle[] = {"char device", "redirected to"};
|
static const char needle[] = "char device redirected to";
|
||||||
const char *tmp, *dev;
|
char *tmp, *dev;
|
||||||
|
|
||||||
VIR_FREE(*path);
|
VIR_FREE(*path);
|
||||||
/* First look for our magic string */
|
/* First look for our magic string */
|
||||||
if (!(tmp = strstr(haystack + *offset, needle[0])))
|
if (!(tmp = strstr(haystack + *offset, needle))) {
|
||||||
return 1;
|
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);
|
|
||||||
}
|
}
|
||||||
|
tmp += sizeof(needle);
|
||||||
if (!STRPREFIX(tmp, needle[1]))
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
tmp += strlen(needle[1]);
|
|
||||||
dev = tmp;
|
dev = tmp;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1592,7 +1569,6 @@ qemuProcessFindCharDevicePTYs(virDomainObjPtr vm,
|
|||||||
virDomainChrDefPtr chr = vm->def->serials[i];
|
virDomainChrDefPtr chr = vm->def->serials[i];
|
||||||
if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY) {
|
if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY) {
|
||||||
if ((ret = qemuProcessExtractTTYPath(output, &offset,
|
if ((ret = qemuProcessExtractTTYPath(output, &offset,
|
||||||
chr->info.alias,
|
|
||||||
&chr->source.data.file.path)) != 0)
|
&chr->source.data.file.path)) != 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1603,7 +1579,6 @@ qemuProcessFindCharDevicePTYs(virDomainObjPtr vm,
|
|||||||
virDomainChrDefPtr chr = vm->def->parallels[i];
|
virDomainChrDefPtr chr = vm->def->parallels[i];
|
||||||
if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY) {
|
if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY) {
|
||||||
if ((ret = qemuProcessExtractTTYPath(output, &offset,
|
if ((ret = qemuProcessExtractTTYPath(output, &offset,
|
||||||
chr->info.alias,
|
|
||||||
&chr->source.data.file.path)) != 0)
|
&chr->source.data.file.path)) != 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1614,7 +1589,6 @@ qemuProcessFindCharDevicePTYs(virDomainObjPtr vm,
|
|||||||
virDomainChrDefPtr chr = vm->def->channels[i];
|
virDomainChrDefPtr chr = vm->def->channels[i];
|
||||||
if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY) {
|
if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY) {
|
||||||
if ((ret = qemuProcessExtractTTYPath(output, &offset,
|
if ((ret = qemuProcessExtractTTYPath(output, &offset,
|
||||||
chr->info.alias,
|
|
||||||
&chr->source.data.file.path)) != 0)
|
&chr->source.data.file.path)) != 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1634,7 +1608,6 @@ qemuProcessFindCharDevicePTYs(virDomainObjPtr vm,
|
|||||||
if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY &&
|
if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY &&
|
||||||
chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO) {
|
chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO) {
|
||||||
if ((ret = qemuProcessExtractTTYPath(output, &offset,
|
if ((ret = qemuProcessExtractTTYPath(output, &offset,
|
||||||
chr->info.alias,
|
|
||||||
&chr->source.data.file.path)) != 0)
|
&chr->source.data.file.path)) != 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user