Fix the unbearably slow serial port output of VirtualBox 5.2.10 by calling "VBoxManage setextradata VM_NAME VBoxInternal/Devices/serial/0/Config/YieldOnLSRRead 1".

This has to happen after the VM has been defined, so call PrepareSerialPort() after virDomainDefineXML().
This commit is contained in:
Colin Finck 2018-08-27 08:56:15 +00:00
parent ad5d3ed861
commit a4eb4a4551
2 changed files with 11 additions and 5 deletions

View File

@ -123,15 +123,15 @@ bool LibVirt::LaunchMachine(const char* XmlFileName, const char* BootDevice)
xmlFreeDoc(xml);
xmlXPathFreeContext(ctxt);
if (!PrepareSerialPort())
{
return false;
}
vDom = virDomainDefineXML(vConn, buffer);
xmlFree((xmlChar*)buffer);
if (vDom)
{
if (!PrepareSerialPort())
{
return false;
}
if (virDomainCreate(vDom) != 0)
{
virDomainUndefine(vDom);

View File

@ -32,6 +32,12 @@ void VirtualBox::InitializeDisk()
bool VirtualBox::PrepareSerialPort()
{
char vboxmanage_cmdline[300];
/* VirtualBox 5.x serial port output is unbearably slow by default, fix that! */
sprintf(vboxmanage_cmdline, "VBoxManage setextradata %s VBoxInternal/Devices/serial/0/Config/YieldOnLSRRead 1", AppSettings.Name);
Execute(vboxmanage_cmdline);
return CreateLocalSocket();
}