[fedora-virt-maint] rpms/libvirt/F-10 libvirt-0.6.0-rpccall2.patch, NONE, 1.1 libvirt-0.6.0-timeout.patch, NONE, 1.1 libvirt.spec, 1.107, 1.108 sources, 1.37, 1.38
Daniel P. Berrange
berrange at fedoraproject.org
Fri Feb 6 20:23:01 UTC 2009
- Previous message (by thread): [fedora-virt-maint] rpms/libvirt/F-9 libvirt-0.6.0-rpccall.patch, NONE, 1.1 libvirt-0.6.0-timeout.patch, NONE, 1.1 libvirt.spec, 1.98, 1.99 sources, 1.36, 1.37
- Next message (by thread): [fedora-virt-maint] rpms/libvirt/devel .cvsignore,1.36,1.37
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: berrange
Update of /cvs/pkgs/rpms/libvirt/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv22995
Modified Files:
libvirt.spec sources
Added Files:
libvirt-0.6.0-rpccall2.patch libvirt-0.6.0-timeout.patch
Log Message:
Fix libvirtd --timeout usage
Fix RPC call problems and QEMU startup handling (rhbz #484414)
Fix unowned directories (rhbz #483442)
libvirt-0.6.0-rpccall2.patch:
--- NEW FILE libvirt-0.6.0-rpccall2.patch ---
diff -rup libvirt-0.6.0.orig/qemud/event.c libvirt-0.6.0.new/qemud/event.c
--- libvirt-0.6.0.orig/qemud/event.c 2009-02-06 19:30:58.000000000 +0000
+++ libvirt-0.6.0.new/qemud/event.c 2009-02-06 19:30:00.000000000 +0000
@@ -657,6 +657,8 @@ virPollEventToEventHandleType(int events
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;
diff -rup libvirt-0.6.0.orig/src/domain_conf.c libvirt-0.6.0.new/src/domain_conf.c
--- libvirt-0.6.0.orig/src/domain_conf.c 2009-01-31 09:04:17.000000000 +0000
+++ libvirt-0.6.0.new/src/domain_conf.c 2009-02-06 19:30:00.000000000 +0000
@@ -504,6 +504,7 @@ virDomainObjPtr virDomainAssignDef(virCo
domain->state = VIR_DOMAIN_SHUTOFF;
domain->def = def;
domain->monitor_watch = -1;
+ domain->monitor = -1;
if (VIR_REALLOC_N(doms->objs, doms->count + 1) < 0) {
virReportOOMError(conn);
diff -rup libvirt-0.6.0.orig/src/remote_internal.c libvirt-0.6.0.new/src/remote_internal.c
--- libvirt-0.6.0.orig/src/remote_internal.c 2009-01-31 09:04:18.000000000 +0000
+++ libvirt-0.6.0.new/src/remote_internal.c 2009-02-06 19:30:00.000000000 +0000
@@ -6198,17 +6198,17 @@ processCalls(virConnectPtr conn,
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
@@ -6259,9 +6259,21 @@ processCalls(virConnectPtr conn,
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;
}
/*
libvirt-0.6.0-timeout.patch:
--- NEW FILE libvirt-0.6.0-timeout.patch ---
diff -rup libvirt-0.6.0.orig/qemud/event.c libvirt-0.6.0.new/qemud/event.c
--- libvirt-0.6.0.orig/qemud/event.c 2008-12-22 13:02:54.000000000 +0000
+++ libvirt-0.6.0.new/qemud/event.c 2009-02-06 19:29:28.000000000 +0000
@@ -68,6 +68,7 @@ struct virEventTimeout {
/* State for the main event loop */
struct virEventLoop {
pthread_mutex_t lock;
+ int running;
pthread_t leader;
int wakeupfd[2];
int handlesCount;
@@ -521,6 +522,7 @@ int virEventRunOnce(void) {
int ret, timeout, nfds;
virEventLock();
+ eventLoop.running = 1;
eventLoop.leader = pthread_self();
if ((nfds = virEventMakePollFDs(&fds)) < 0) {
virEventUnlock();
@@ -572,7 +574,7 @@ int virEventRunOnce(void) {
return -1;
}
- eventLoop.leader = 0;
+ eventLoop.running = 0;
virEventUnlock();
return 0;
}
@@ -611,7 +613,9 @@ int virEventInit(void)
static int virEventInterruptLocked(void)
{
char c = '\0';
- if (pthread_self() == eventLoop.leader)
+
+ if (!eventLoop.running ||
+ pthread_self() == eventLoop.leader)
return 0;
if (safewrite(eventLoop.wakeupfd[1], &c, sizeof(c)) != sizeof(c))
diff -rup libvirt-0.6.0.orig/qemud/qemud.c libvirt-0.6.0.new/qemud/qemud.c
--- libvirt-0.6.0.orig/qemud/qemud.c 2009-01-31 09:04:17.000000000 +0000
+++ libvirt-0.6.0.new/qemud/qemud.c 2009-02-06 19:29:28.000000000 +0000
@@ -2013,11 +2013,15 @@ static int qemudOneLoop(void) {
return 0;
}
-static void qemudInactiveTimer(int timer ATTRIBUTE_UNUSED, void *data) {
+static void qemudInactiveTimer(int timerid, void *data) {
struct qemud_server *server = (struct qemud_server *)data;
- DEBUG0("Got inactive timer expiry");
- if (!virStateActive()) {
- DEBUG0("No state active, shutting down");
+
+ if (virStateActive() ||
+ server->clients) {
+ DEBUG0("Timer expired but still active, not shutting down");
+ virEventUpdateTimeoutImpl(timerid, -1);
+ } else {
+ DEBUG0("Timer expired and inactive, shutting down");
server->shutdown = 1;
}
}
@@ -2048,9 +2052,18 @@ static void qemudFreeClient(struct qemud
static int qemudRunLoop(struct qemud_server *server) {
int timerid = -1;
int ret = -1, i;
+ int timerActive = 0;
virMutexLock(&server->lock);
+ if (timeout > 0 &&
+ (timerid = virEventAddTimeoutImpl(-1,
+ qemudInactiveTimer,
+ server, NULL)) < 0) {
+ VIR_ERROR0(_("Failed to register shutdown timeout"));
+ return -1;
+ }
+
if (min_workers > max_workers)
max_workers = min_workers;
@@ -2071,11 +2084,21 @@ static int qemudRunLoop(struct qemud_ser
* if any drivers have active state, if not
* shutdown after timeout seconds
*/
- if (timeout > 0 && !virStateActive() && !server->clients) {
- timerid = virEventAddTimeoutImpl(timeout*1000,
- qemudInactiveTimer,
- server, NULL);
- DEBUG("Scheduling shutdown timer %d", timerid);
+ if (timeout > 0) {
+ if (timerActive) {
+ if (server->clients) {
+ DEBUG("Deactivating shutdown timer %d", timerid);
+ virEventUpdateTimeoutImpl(timerid, -1);
+ timerActive = 0;
+ }
+ } else {
+ if (!virStateActive() &&
+ !server->clients) {
+ DEBUG("Activating shutdown timer %d", timerid);
+ virEventUpdateTimeoutImpl(timerid, timeout * 1000);
+ timerActive = 1;
+ }
+ }
}
virMutexUnlock(&server->lock);
@@ -2129,15 +2152,6 @@ static int qemudRunLoop(struct qemud_ser
}
}
- /* Unregister any timeout that's active, since we
- * just had an event processed
- */
- if (timerid != -1) {
- DEBUG("Removing shutdown timer %d", timerid);
- virEventRemoveTimeoutImpl(timerid);
- timerid = -1;
- }
-
if (server->shutdown) {
ret = 0;
break;
Index: libvirt.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libvirt/F-10/libvirt.spec,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -r1.107 -r1.108
--- libvirt.spec 31 Jan 2009 10:08:45 -0000 1.107
+++ libvirt.spec 6 Feb 2009 20:22:30 -0000 1.108
@@ -47,10 +47,12 @@
Summary: Library providing a simple API virtualization
Name: libvirt
Version: 0.6.0
-Release: 1%{?dist}%{?extra_release}
+Release: 2%{?dist}%{?extra_release}
License: LGPLv2+
Group: Development/Libraries
Source: libvirt-%{version}.tar.gz
+Patch1: %{name}-%{version}-timeout.patch
+Patch2: %{name}-%{version}-rpccall2.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
URL: http://libvirt.org/
BuildRequires: python python-devel
@@ -177,6 +179,8 @@
%prep
%setup -q
+%patch1 -p1
+%patch2 -p1
%build
%if ! %{with_xen}
@@ -390,6 +394,7 @@
%if %{with_network}
%dir %{_localstatedir}/run/libvirt/network/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/
+%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/iptables/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/iptables/filter/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/iptables/nat/
%endif
@@ -408,6 +413,7 @@
%{_datadir}/PolicyKit/policy/org.libvirt.unix.policy
%endif
+%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/
%if %{with_qemu}
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
%endif
@@ -457,6 +463,11 @@
%endif
%changelog
+* Fri Feb 6 2009 Daniel P. Berrange <berrange at redhat.com> - 0.6.0-2.fc10
+- Fix libvirtd --timeout usage
+- Fix RPC call problems and QEMU startup handling (rhbz #484414)
+- Fix unowned directories (rhbz #483442)
+
* Sat Jan 31 2009 Daniel Veillard <veillard at redhat.com> - 0.6.0-1.fc10
- upstream release 0.6.0
- thread safety of API
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/libvirt/F-10/sources,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- sources 31 Jan 2009 10:08:45 -0000 1.37
+++ sources 6 Feb 2009 20:22:30 -0000 1.38
@@ -1,2 +1 @@
-abc697978e9c66cbc8d8db4fa3f1c1b6 libvirt-0.5.1.tar.gz
8e0120d5452b37179f682031bf0895ea libvirt-0.6.0.tar.gz
- Previous message (by thread): [fedora-virt-maint] rpms/libvirt/F-9 libvirt-0.6.0-rpccall.patch, NONE, 1.1 libvirt-0.6.0-timeout.patch, NONE, 1.1 libvirt.spec, 1.98, 1.99 sources, 1.36, 1.37
- Next message (by thread): [fedora-virt-maint] rpms/libvirt/devel .cvsignore,1.36,1.37
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Fedora-virt-maint
mailing list