+Tue Feb 10 11:14:07 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
+
+ Fix I/O errors in libvirtd daemon, and hang/crash in remote
+ client upon I/O error.
+ * qemud/event.c: Treat POLLNVAL as VIR_EVENT_HANDLE_ERROR
+ * src/domain_conf.c: Initialize monitor FD to -1
+ * src/remote_internal.c: Remove call object from waitDispatch
+ queue upon I/O failure, since call is about to free it.
+
Mon Feb 16 17:59:04 EST 2009 Cole Robinson <crobinso@redhat.com>
* src/virsh.c, src/Makefile.am: Don't pass flags to DumpXML
ret |= VIR_EVENT_HANDLE_WRITABLE;
if(events & POLLERR)
ret |= VIR_EVENT_HANDLE_ERROR;
+ if(events & POLLNVAL) /* Treat NVAL as error, since libvirt doesn't distinguish */
+ ret |= VIR_EVENT_HANDLE_ERROR;
if(events & POLLHUP)
ret |= VIR_EVENT_HANDLE_HANGUP;
return ret;
continue;
virReportSystemError(in_open ? NULL : conn, errno,
"%s", _("poll on socket failed"));
- return -1;
+ goto error;
}
if (fds[0].revents & POLLOUT) {
if (processCallSend(conn, priv, in_open) < 0)
- return -1;
+ goto error;
}
if (fds[0].revents & POLLIN) {
if (processCallRecv(conn, priv, in_open) < 0)
- return -1;
+ goto error;
}
/* Iterate through waiting threads and if
if (fds[0].revents & (POLLHUP | POLLERR)) {
errorf(in_open ? NULL : conn, VIR_ERR_INTERNAL_ERROR,
"%s", _("received hangup / error event on socket"));
- return -1;
+ goto error;
}
}
+
+
+error:
+ priv->waitDispatch = thiscall->next;
+ DEBUG("Giving up the buck due to I/O error %d %p %p", thiscall->proc_nr, thiscall, priv->waitDispatch);
+ /* See if someone else is still waiting
+ * and if so, then pass the buck ! */
+ if (priv->waitDispatch) {
+ DEBUG("Passing the buck to %d %p", priv->waitDispatch->proc_nr, priv->waitDispatch);
+ virCondSignal(&priv->waitDispatch->cond);
+ }
+ return -1;
}
/*