Increase timeout for initial monitor poll, to prevent a guest from failing to start if it has to wait for a physical cdrom to spin up.

This commit is contained in:
Cole Robinson 2008-12-04 14:47:12 +00:00
parent 4fc29fa9f4
commit b9b9c8b020
2 changed files with 9 additions and 6 deletions

View File

@ -1,3 +1,7 @@
Thu Dec 4 09:42:00 EST 2008 Cole Robinson <crobinso@redhat.com>
* src/qemu_driver.c: Increase timeout for initial monitor poll
Thu Dec 4 15:36:42 CET 2008 Daniel Veillard <veillard@redhat.com>
* src/bridge.c: patch setting MTU on tap interface to be the same

View File

@ -360,9 +360,9 @@ qemudReadMonitorOutput(virConnectPtr conn,
char *buf,
int buflen,
qemudHandlerMonitorOutput func,
const char *what)
const char *what,
int timeout)
{
#define MONITOR_TIMEOUT 3000
int got = 0;
buf[0] = '\0';
@ -388,7 +388,7 @@ qemudReadMonitorOutput(virConnectPtr conn,
return -1;
}
ret = poll(&pfd, 1, MONITOR_TIMEOUT);
ret = poll(&pfd, 1, timeout);
if (ret == 0) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
_("Timed out while reading %s startup output"), what);
@ -422,7 +422,6 @@ qemudReadMonitorOutput(virConnectPtr conn,
_("Out of space while reading %s startup output"), what);
return -1;
#undef MONITOR_TIMEOUT
}
static int
@ -468,7 +467,7 @@ static int qemudOpenMonitor(virConnectPtr conn,
driver, vm, monfd,
buf, sizeof(buf),
qemudCheckMonitorPrompt,
"monitor");
"monitor", 10000);
/* Keep monitor open upon success */
if (ret == 0)
@ -579,7 +578,7 @@ static int qemudWaitForMonitor(virConnectPtr conn,
driver, vm, vm->stderr_fd,
buf, sizeof(buf),
qemudFindCharDevicePTYs,
"console");
"console", 3000);
buf[sizeof(buf)-1] = '\0';