render / rpms / libvirt

Forked from rpms/libvirt 11 months ago
Clone
Daniel P. Berrange 25ea2f
diff -rup libvirt-0.6.0.orig/qemud/event.c libvirt-0.6.0.new/qemud/event.c
Daniel P. Berrange 25ea2f
--- libvirt-0.6.0.orig/qemud/event.c	2009-02-06 19:30:58.000000000 +0000
Daniel P. Berrange 25ea2f
+++ libvirt-0.6.0.new/qemud/event.c	2009-02-06 19:30:00.000000000 +0000
Daniel P. Berrange 25ea2f
@@ -657,6 +657,8 @@ virPollEventToEventHandleType(int events
Daniel P. Berrange c80b7f
         ret |= VIR_EVENT_HANDLE_WRITABLE;
Daniel P. Berrange c80b7f
     if(events & POLLERR)
Daniel P. Berrange c80b7f
         ret |= VIR_EVENT_HANDLE_ERROR;
Daniel P. Berrange c80b7f
+    if(events & POLLNVAL) /* Treat NVAL as error, since libvirt doesn't distinguish */
Daniel P. Berrange c80b7f
+        ret |= VIR_EVENT_HANDLE_ERROR;
Daniel P. Berrange c80b7f
     if(events & POLLHUP)
Daniel P. Berrange c80b7f
         ret |= VIR_EVENT_HANDLE_HANGUP;
Daniel P. Berrange c80b7f
     return ret;
Daniel P. Berrange 25ea2f
diff -rup libvirt-0.6.0.orig/src/domain_conf.c libvirt-0.6.0.new/src/domain_conf.c
Daniel P. Berrange 25ea2f
--- libvirt-0.6.0.orig/src/domain_conf.c	2009-01-31 09:04:17.000000000 +0000
Daniel P. Berrange 25ea2f
+++ libvirt-0.6.0.new/src/domain_conf.c	2009-02-06 19:30:00.000000000 +0000
Daniel P. Berrange c80b7f
@@ -504,6 +504,7 @@ virDomainObjPtr virDomainAssignDef(virCo
Daniel P. Berrange c80b7f
     domain->state = VIR_DOMAIN_SHUTOFF;
Daniel P. Berrange c80b7f
     domain->def = def;
Daniel P. Berrange c80b7f
     domain->monitor_watch = -1;
Daniel P. Berrange c80b7f
+    domain->monitor = -1;
Daniel P. Berrange c80b7f
 
Daniel P. Berrange c80b7f
     if (VIR_REALLOC_N(doms->objs, doms->count + 1) < 0) {
Daniel P. Berrange c80b7f
         virReportOOMError(conn);
Daniel P. Berrange 25ea2f
diff -rup libvirt-0.6.0.orig/src/remote_internal.c libvirt-0.6.0.new/src/remote_internal.c
Daniel P. Berrange 25ea2f
--- libvirt-0.6.0.orig/src/remote_internal.c	2009-01-31 09:04:18.000000000 +0000
Daniel P. Berrange 25ea2f
+++ libvirt-0.6.0.new/src/remote_internal.c	2009-02-06 19:30:00.000000000 +0000
Daniel P. Berrange 25ea2f
@@ -6198,17 +6198,17 @@ processCalls(virConnectPtr conn,
Daniel P. Berrange c80b7f
                 continue;
Daniel P. Berrange c80b7f
             virReportSystemError(in_open ? NULL : conn, errno,
Daniel P. Berrange c80b7f
                                  "%s", _("poll on socket failed"));
Daniel P. Berrange c80b7f
-            return -1;
Daniel P. Berrange c80b7f
+            goto error;
Daniel P. Berrange c80b7f
         }
Daniel P. Berrange c80b7f
 
Daniel P. Berrange c80b7f
         if (fds[0].revents & POLLOUT) {
Daniel P. Berrange c80b7f
             if (processCallSend(conn, priv, in_open) < 0)
Daniel P. Berrange c80b7f
-                return -1;
Daniel P. Berrange c80b7f
+                goto error;
Daniel P. Berrange c80b7f
         }
Daniel P. Berrange c80b7f
 
Daniel P. Berrange c80b7f
         if (fds[0].revents & POLLIN) {
Daniel P. Berrange c80b7f
             if (processCallRecv(conn, priv, in_open) < 0)
Daniel P. Berrange c80b7f
-                return -1;
Daniel P. Berrange c80b7f
+                goto error;
Daniel P. Berrange c80b7f
         }
Daniel P. Berrange c80b7f
 
Daniel P. Berrange c80b7f
         /* Iterate through waiting threads and if
Daniel P. Berrange 25ea2f
@@ -6259,9 +6259,21 @@ processCalls(virConnectPtr conn,
Daniel P. Berrange c80b7f
         if (fds[0].revents & (POLLHUP | POLLERR)) {
Daniel P. Berrange c80b7f
             errorf(in_open ? NULL : conn, VIR_ERR_INTERNAL_ERROR,
Daniel P. Berrange c80b7f
                    "%s", _("received hangup / error event on socket"));
Daniel P. Berrange c80b7f
-            return -1;
Daniel P. Berrange c80b7f
+            goto error;
Daniel P. Berrange c80b7f
         }
Daniel P. Berrange c80b7f
     }
Daniel P. Berrange c80b7f
+
Daniel P. Berrange c80b7f
+
Daniel P. Berrange c80b7f
+error:
Daniel P. Berrange c80b7f
+    priv->waitDispatch = thiscall->next;
Daniel P. Berrange c80b7f
+    DEBUG("Giving up the buck due to I/O error %d %p %p", thiscall->proc_nr, thiscall, priv->waitDispatch);
Daniel P. Berrange c80b7f
+    /* See if someone else is still waiting
Daniel P. Berrange c80b7f
+     * and if so, then pass the buck ! */
Daniel P. Berrange c80b7f
+    if (priv->waitDispatch) {
Daniel P. Berrange c80b7f
+        DEBUG("Passing the buck to %d %p", priv->waitDispatch->proc_nr, priv->waitDispatch);
Daniel P. Berrange c80b7f
+        virCondSignal(&priv->waitDispatch->cond);
Daniel P. Berrange c80b7f
+    }
Daniel P. Berrange c80b7f
+    return -1;
Daniel P. Berrange c80b7f
 }
Daniel P. Berrange c80b7f
 
Daniel P. Berrange c80b7f
 /*