mirror of
https://github.com/reactos/sysreg2.git
synced 2024-11-26 21:00:27 +00:00
[SYSREG2] Add support for newer libvirt XML output
This fixes querying console TTY with newer libvirt releases. We keep old path for compatibility
This commit is contained in:
parent
f41c67e5de
commit
6b68b7dfba
13
kvm.cpp
13
kvm.cpp
@ -50,6 +50,19 @@ bool KVM::GetConsole(char* console)
|
||||
if (obj)
|
||||
xmlXPathFreeObject(obj);
|
||||
|
||||
if (!RetVal)
|
||||
{
|
||||
obj = xmlXPathEval(BAD_CAST "string(/domain/devices/console/source/@path)", ctxt);
|
||||
if ((obj != NULL) && ((obj->type == XPATH_STRING) &&
|
||||
(obj->stringval != NULL) && (obj->stringval[0] != 0)))
|
||||
{
|
||||
strcpy(console, (char *)obj->stringval);
|
||||
RetVal = true;
|
||||
}
|
||||
if (obj)
|
||||
xmlXPathFreeObject(obj);
|
||||
}
|
||||
|
||||
xmlFreeDoc(xml);
|
||||
xmlXPathFreeContext(ctxt);
|
||||
return RetVal;
|
||||
|
Loading…
Reference in New Issue
Block a user