Compare commits
106 Commits
libvirt-0_
...
libvirt-0_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b7b86e327 | ||
|
|
f4bfe638b6 | ||
|
|
0e9d242f05 | ||
|
|
e24467a8c2 | ||
|
|
b39c370a76 | ||
|
|
62e4e7cde2 | ||
|
|
f822179f97 | ||
|
|
47e7e1e548 | ||
|
|
e73b75314b | ||
|
|
8193a55b4a | ||
|
|
6036708fa2 | ||
|
|
4717aa0b6d | ||
|
|
97ae25ea7d | ||
|
|
6470ed033b | ||
|
|
b550f9c1d5 | ||
|
|
ee0273ffc3 | ||
|
|
50fce74b00 | ||
|
|
e29f71d1c9 | ||
|
|
427ed20801 | ||
|
|
d23e6c285b | ||
|
|
2c139b45d8 | ||
|
|
762435e3b7 | ||
|
|
6383d6b056 | ||
|
|
3712441ea6 | ||
|
|
9d0bc882fa | ||
|
|
90dddf3d3d | ||
|
|
86abd54d02 | ||
|
|
4ab5ad5425 | ||
|
|
f9c1b758c3 | ||
|
|
38cf1bd5ba | ||
|
|
aeda455930 | ||
|
|
288291b795 | ||
|
|
7c2073faca | ||
|
|
5b528ba717 | ||
|
|
4f731a7250 | ||
|
|
f1ac0031f5 | ||
|
|
e45b9c9030 | ||
|
|
3cf75c269d | ||
|
|
585033f372 | ||
|
|
897506e66a | ||
|
|
e4bf8ffa42 | ||
|
|
20367a58a6 | ||
|
|
aa037364ed | ||
|
|
c034c1a3b2 | ||
|
|
da05e02884 | ||
|
|
e1b7b518ac | ||
|
|
581b5f5022 | ||
|
|
c476c8b683 | ||
|
|
b93eafc59f | ||
|
|
2105d62ca8 | ||
|
|
743adffffe | ||
|
|
11e3b51c0d | ||
|
|
66df925739 | ||
|
|
b20a5c6d3b | ||
|
|
7f58f3aa54 | ||
|
|
6577b14441 | ||
|
|
2e7812764f | ||
|
|
854b878580 | ||
|
|
89c28e4013 | ||
|
|
db269c2d21 | ||
|
|
98e4f7ee9f | ||
|
|
0c4afc5ee9 | ||
|
|
593255292e | ||
|
|
ccafc8ecb4 | ||
|
|
a38fb9cbc1 | ||
|
|
6359121866 | ||
|
|
b20d669e88 | ||
|
|
a3e1cc37ed | ||
|
|
a6eca3382d | ||
|
|
c6c5072e90 | ||
|
|
705fd20a0e | ||
|
|
e0e9927d93 | ||
|
|
bae7a0fb84 | ||
|
|
36aee593bc | ||
|
|
dc0cb0e91a | ||
|
|
84d66312fe | ||
|
|
4f644ce267 | ||
|
|
cdd5b3d62d | ||
|
|
53f63aa62d | ||
|
|
748df35c5f | ||
|
|
a6e23d00fa | ||
|
|
c6d11b43c9 | ||
|
|
83091ff0dd | ||
|
|
4465a63872 | ||
|
|
3f397d9786 | ||
|
|
750aec5507 | ||
|
|
d7c1d3bbc0 | ||
|
|
fa0f21c263 | ||
|
|
afdaf5d354 | ||
|
|
26bba5aea9 | ||
|
|
1a4185bdcc | ||
|
|
6a73119e65 | ||
|
|
1e2f9fce0a | ||
|
|
f5edf79c95 | ||
|
|
b59e64bf44 | ||
|
|
a09fc2658a | ||
|
|
a008fcf27e | ||
|
|
511f6cd625 | ||
|
|
48b90fefc1 | ||
|
|
bc4bbabdf6 | ||
|
|
905627c8fd | ||
|
|
a16d752c10 | ||
|
|
29b1292019 | ||
|
|
f3546be64b | ||
|
|
fb9044931e | ||
|
|
03c5fec4d2 |
13
.cvsignore
13
.cvsignore
@@ -4,3 +4,16 @@ i686
|
||||
x86_64
|
||||
libvirt-*.tar.gz
|
||||
libvirt-0.6.0.tar.gz
|
||||
libvirt-0.6.1.tar.gz
|
||||
libvirt-0.6.2.tar.gz
|
||||
libvirt-0.6.3.tar.gz
|
||||
libvirt-0.6.4.tar.gz
|
||||
libvirt-0.6.5.tar.gz
|
||||
libvirt-0.7.0.tar.gz
|
||||
libvirt-0.7.1.tar.gz
|
||||
libvirt-0.7.2.tar.gz
|
||||
libvirt-0.7.3.tar.gz
|
||||
libvirt-0.7.4.tar.gz
|
||||
libvirt-0.7.5.tar.gz
|
||||
libvirt-0.7.6.tar.gz
|
||||
libvirt-0.7.7.tar.gz
|
||||
|
||||
2
Makefile
2
Makefile
@@ -4,7 +4,7 @@ NAME := libvirt
|
||||
SPECFILE = $(firstword $(wildcard *.spec))
|
||||
|
||||
define find-makefile-common
|
||||
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
|
||||
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(find-makefile-common))
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
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-02-18 10:56:34.000000000 +0000
|
||||
+++ libvirt-0.6.0.new/src/remote_internal.c 2009-02-18 13:35:26.000000000 +0000
|
||||
@@ -654,12 +654,13 @@ doRemoteOpen (virConnectPtr conn,
|
||||
*/
|
||||
if (errno == ECONNREFUSED &&
|
||||
flags & VIR_DRV_OPEN_REMOTE_AUTOSTART &&
|
||||
- trials < 5) {
|
||||
+ trials < 20) {
|
||||
close(priv->sock);
|
||||
priv->sock = -1;
|
||||
- if (remoteForkDaemon(conn) == 0) {
|
||||
+ if (trials > 0 ||
|
||||
+ remoteForkDaemon(conn) == 0) {
|
||||
trials++;
|
||||
- usleep(5000 * trials * trials);
|
||||
+ usleep(1000 * 100 * trials);
|
||||
goto autostart_retry;
|
||||
}
|
||||
}
|
||||
Only in libvirt-0.6.0.new/src: remote_internal.c~
|
||||
@@ -1,44 +0,0 @@
|
||||
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-02-18 10:56:34.000000000 +0000
|
||||
+++ libvirt-0.6.0.new/qemud/qemud.c 2009-02-18 12:52:18.000000000 +0000
|
||||
@@ -860,6 +860,10 @@ static struct qemud_server *qemudNetwork
|
||||
if (auth_unix_rw == REMOTE_AUTH_POLKIT ||
|
||||
auth_unix_ro == REMOTE_AUTH_POLKIT) {
|
||||
DBusError derr;
|
||||
+
|
||||
+ dbus_connection_set_change_sigpipe(FALSE);
|
||||
+ dbus_threads_init_default();
|
||||
+
|
||||
dbus_error_init(&derr);
|
||||
server->sysbus = dbus_bus_get(DBUS_BUS_SYSTEM, &derr);
|
||||
if (!(server->sysbus)) {
|
||||
@@ -868,6 +872,7 @@ static struct qemud_server *qemudNetwork
|
||||
dbus_error_free(&derr);
|
||||
goto cleanup;
|
||||
}
|
||||
+ dbus_connection_set_exit_on_disconnect(server->sysbus, FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
diff -rup libvirt-0.6.0.orig/src/node_device_hal.c libvirt-0.6.0.new/src/node_device_hal.c
|
||||
--- libvirt-0.6.0.orig/src/node_device_hal.c 2009-01-16 12:44:22.000000000 +0000
|
||||
+++ libvirt-0.6.0.new/src/node_device_hal.c 2009-02-18 12:52:48.000000000 +0000
|
||||
@@ -685,6 +685,9 @@ static int halDeviceMonitorStartup(void)
|
||||
nodeDeviceLock(driverState);
|
||||
|
||||
/* Allocate and initialize a new HAL context */
|
||||
+ dbus_connection_set_change_sigpipe(FALSE);
|
||||
+ dbus_threads_init_default();
|
||||
+
|
||||
dbus_error_init(&err);
|
||||
hal_ctx = libhal_ctx_new();
|
||||
if (hal_ctx == NULL) {
|
||||
@@ -696,6 +699,8 @@ static int halDeviceMonitorStartup(void)
|
||||
fprintf(stderr, "%s: dbus_bus_get failed\n", __FUNCTION__);
|
||||
goto failure;
|
||||
}
|
||||
+ dbus_connection_set_exit_on_disconnect(dbus_conn, FALSE);
|
||||
+
|
||||
if (!libhal_ctx_set_dbus_connection(hal_ctx, dbus_conn)) {
|
||||
fprintf(stderr, "%s: libhal_ctx_set_dbus_connection failed\n",
|
||||
__FUNCTION__);
|
||||
@@ -1,109 +0,0 @@
|
||||
diff -rup libvirt-0.6.0.orig/src/qemu_driver.c libvirt-0.6.0.new/src/qemu_driver.c
|
||||
--- libvirt-0.6.0.orig/src/qemu_driver.c 2009-01-31 09:04:18.000000000 +0000
|
||||
+++ libvirt-0.6.0.new/src/qemu_driver.c 2009-02-18 11:15:37.000000000 +0000
|
||||
@@ -633,6 +633,7 @@ qemudReadMonitorOutput(virConnectPtr con
|
||||
{
|
||||
int got = 0;
|
||||
buf[0] = '\0';
|
||||
+ timeout *= 1000; /* poll wants milli seconds */
|
||||
|
||||
/* Consume & discard the initial greeting */
|
||||
while (got < (buflen-1)) {
|
||||
@@ -694,6 +695,56 @@ qemudReadMonitorOutput(virConnectPtr con
|
||||
|
||||
}
|
||||
|
||||
+
|
||||
+/*
|
||||
+ * Returns -1 for error, 0 on success
|
||||
+ */
|
||||
+static int
|
||||
+qemudReadLogOutput(virConnectPtr conn,
|
||||
+ virDomainObjPtr vm,
|
||||
+ int fd,
|
||||
+ char *buf,
|
||||
+ int buflen,
|
||||
+ qemudHandlerMonitorOutput func,
|
||||
+ const char *what,
|
||||
+ int timeout)
|
||||
+{
|
||||
+ int got = 0;
|
||||
+ int ret;
|
||||
+ int retries = timeout*10;
|
||||
+ buf[0] = '\0';
|
||||
+
|
||||
+ while (retries) {
|
||||
+ while((ret = read(fd, buf+got, buflen-got-1)) > 0) {
|
||||
+ got += ret;
|
||||
+ buf[got] = '\0';
|
||||
+ if ((buflen-got-1) == 0) {
|
||||
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
||||
+ _("Out of space while reading %s log output"), what);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (ret < 0 && errno != EINTR) {
|
||||
+ virReportSystemError(conn, errno,
|
||||
+ _("Failure while reading %s log output"),
|
||||
+ what);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ ret = func(conn, vm, buf, fd);
|
||||
+ if (ret <= 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ usleep(100*1000);
|
||||
+ retries--;
|
||||
+ }
|
||||
+ if (retries == 0)
|
||||
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
||||
+ _("Timed out while reading %s log output"), what);
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
static int
|
||||
qemudCheckMonitorPrompt(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
virDomainObjPtr vm,
|
||||
@@ -738,7 +789,7 @@ static int qemudOpenMonitor(virConnectPt
|
||||
vm, monfd,
|
||||
buf, sizeof(buf),
|
||||
qemudCheckMonitorPrompt,
|
||||
- "monitor", 10000) <= 0)
|
||||
+ "monitor", 10) <= 0)
|
||||
ret = -1;
|
||||
else
|
||||
ret = 0;
|
||||
@@ -770,6 +821,7 @@ static int qemudOpenMonitor(virConnectPt
|
||||
return ret;
|
||||
}
|
||||
|
||||
+/* Returns -1 for error, 0 success, 1 continue reading */
|
||||
static int qemudExtractMonitorPath(virConnectPtr conn,
|
||||
const char *haystack,
|
||||
size_t *offset,
|
||||
@@ -873,19 +925,16 @@ static int qemudWaitForMonitor(virConnec
|
||||
< 0)
|
||||
return -1;
|
||||
|
||||
- ret = qemudReadMonitorOutput(conn, vm, logfd, buf, sizeof(buf),
|
||||
- qemudFindCharDevicePTYs,
|
||||
- "console", 3000);
|
||||
+ ret = qemudReadLogOutput(conn, vm, logfd, buf, sizeof(buf),
|
||||
+ qemudFindCharDevicePTYs,
|
||||
+ "console", 3);
|
||||
if (close(logfd) < 0)
|
||||
qemudLog(QEMUD_WARN, _("Unable to close logfile: %s\n"),
|
||||
strerror(errno));
|
||||
|
||||
- if (ret == 1) /* Success */
|
||||
+ if (ret == 0) /* success */
|
||||
return 0;
|
||||
|
||||
- if (ret == -1)
|
||||
- return -1;
|
||||
-
|
||||
/* Unexpected end of file - inform user of QEMU log data */
|
||||
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
||||
_("unable to start guest: %s"), buf);
|
||||
@@ -1,70 +0,0 @@
|
||||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1,124 +0,0 @@
|
||||
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;
|
||||
233
libvirt-0.7.7-fix-usb-product.patch
Normal file
233
libvirt-0.7.7-fix-usb-product.patch
Normal file
@@ -0,0 +1,233 @@
|
||||
From 3a441522017aa9c1b8b54d2ce4569d0f0d96fa72 Mon Sep 17 00:00:00 2001
|
||||
From: Cole Robinson <crobinso@redhat.com>
|
||||
Date: Fri, 12 Mar 2010 12:36:56 -0500
|
||||
Subject: [PATCH] qemu: Add some debugging at domain startup
|
||||
|
||||
---
|
||||
src/qemu/qemu_driver.c | 24 +++++++++++++++++++++++-
|
||||
1 files changed, 23 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
||||
index f8ab545..040d645 100644
|
||||
--- a/src/qemu/qemu_driver.c
|
||||
+++ b/src/qemu/qemu_driver.c
|
||||
@@ -2695,6 +2695,8 @@ static int qemudStartVMDaemon(virConnectPtr conn,
|
||||
|
||||
FD_ZERO(&keepfd);
|
||||
|
||||
+ DEBUG0("Beginning VM startup process");
|
||||
+
|
||||
if (virDomainObjIsActive(vm)) {
|
||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("VM is already active"));
|
||||
@@ -2703,22 +2705,27 @@ static int qemudStartVMDaemon(virConnectPtr conn,
|
||||
|
||||
/* If you are using a SecurityDriver with dynamic labelling,
|
||||
then generate a security label for isolation */
|
||||
+ DEBUG0("Generating domain security label (if required)");
|
||||
if (driver->securityDriver &&
|
||||
driver->securityDriver->domainGenSecurityLabel &&
|
||||
driver->securityDriver->domainGenSecurityLabel(vm) < 0)
|
||||
return -1;
|
||||
|
||||
+ DEBUG0("Generating setting domain security labels (if required)");
|
||||
if (driver->securityDriver &&
|
||||
driver->securityDriver->domainSetSecurityAllLabel &&
|
||||
driver->securityDriver->domainSetSecurityAllLabel(vm) < 0)
|
||||
goto cleanup;
|
||||
|
||||
- /* Ensure no historical cgroup for this VM is lieing around bogus settings */
|
||||
+ /* Ensure no historical cgroup for this VM is lying around bogus
|
||||
+ * settings */
|
||||
+ DEBUG0("Ensuring no historical cgroup is lying around");
|
||||
qemuRemoveCgroup(driver, vm, 1);
|
||||
|
||||
if ((vm->def->ngraphics == 1) &&
|
||||
vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
|
||||
vm->def->graphics[0]->data.vnc.autoport) {
|
||||
+ DEBUG0("Determining VNC port");
|
||||
int port = qemudNextFreeVNCPort(driver);
|
||||
if (port < 0) {
|
||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
@@ -2735,6 +2742,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
+ DEBUG0("Creating domain log file");
|
||||
if ((logfile = qemudLogFD(driver, vm->def->name)) < 0)
|
||||
goto cleanup;
|
||||
|
||||
@@ -2751,14 +2759,17 @@ static int qemudStartVMDaemon(virConnectPtr conn,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
+ DEBUG0("Determing emulator version");
|
||||
if (qemudExtractVersionInfo(emulator,
|
||||
NULL,
|
||||
&qemuCmdFlags) < 0)
|
||||
goto cleanup;
|
||||
|
||||
+ DEBUG0("Setting up domain cgroup (if required)");
|
||||
if (qemuSetupCgroup(driver, vm) < 0)
|
||||
goto cleanup;
|
||||
|
||||
+ DEBUG0("Preparing host devices");
|
||||
if (qemuPrepareHostDevices(driver, vm->def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
@@ -2767,6 +2778,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
+ DEBUG0("Preparing monitor state");
|
||||
if (qemuPrepareMonitorChr(driver, priv->monConfig, vm->def->name) < 0)
|
||||
goto cleanup;
|
||||
|
||||
@@ -2798,6 +2810,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
|
||||
* use in hotplug
|
||||
*/
|
||||
if (qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE) {
|
||||
+ DEBUG0("Assigning domain PCI addresses");
|
||||
/* Populate cache with current addresses */
|
||||
if (priv->pciaddrs) {
|
||||
qemuDomainPCIAddressSetFree(priv->pciaddrs);
|
||||
@@ -2816,6 +2829,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
|
||||
priv->persistentAddrs = 0;
|
||||
}
|
||||
|
||||
+ DEBUG0("Building emulator command line");
|
||||
vm->def->id = driver->nextvmid++;
|
||||
if (qemudBuildCommandLine(conn, driver, vm->def, priv->monConfig,
|
||||
priv->monJSON, qemuCmdFlags, &argv, &progenv,
|
||||
@@ -2899,25 +2913,31 @@ static int qemudStartVMDaemon(virConnectPtr conn,
|
||||
if (ret == -1) /* The VM failed to start */
|
||||
goto cleanup;
|
||||
|
||||
+ DEBUG0("Waiting for monitor to show up");
|
||||
if (qemudWaitForMonitor(driver, vm, pos) < 0)
|
||||
goto abort;
|
||||
|
||||
+ DEBUG0("Detecting VCPU PIDs");
|
||||
if (qemuDetectVcpuPIDs(driver, vm) < 0)
|
||||
goto abort;
|
||||
|
||||
+ DEBUG0("Setting CPU affinity");
|
||||
if (qemudInitCpuAffinity(vm) < 0)
|
||||
goto abort;
|
||||
|
||||
+ DEBUG0("Setting any required VM passwords");
|
||||
if (qemuInitPasswords(conn, driver, vm, qemuCmdFlags) < 0)
|
||||
goto abort;
|
||||
|
||||
/* If we have -device, then addresses are assigned explicitly.
|
||||
* If not, then we have to detect dynamic ones here */
|
||||
if (!(qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE)) {
|
||||
+ DEBUG0("Determining domain device PCI addresses");
|
||||
if (qemuInitPCIAddresses(driver, vm) < 0)
|
||||
goto abort;
|
||||
}
|
||||
|
||||
+ DEBUG0("Setting initial memory amount");
|
||||
qemuDomainObjEnterMonitorWithDriver(driver, vm);
|
||||
if (qemuMonitorSetBalloon(priv->mon, vm->def->memory) < 0) {
|
||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||
@@ -2925,6 +2945,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
|
||||
}
|
||||
|
||||
if (migrateFrom == NULL) {
|
||||
+ DEBUG0("Starting domain CPUs");
|
||||
/* Allow the CPUS to start executing */
|
||||
if (qemuMonitorStartCPUs(priv->mon, conn) < 0) {
|
||||
if (virGetLastError() == NULL)
|
||||
@@ -2937,6 +2958,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
|
||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||
|
||||
|
||||
+ DEBUG0("Writing domain status to disk");
|
||||
if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0)
|
||||
goto abort;
|
||||
|
||||
--
|
||||
1.6.6.1
|
||||
|
||||
From 6d5c8a8f51db8ce97ab35ab6022dd5c94ab016b4 Mon Sep 17 00:00:00 2001
|
||||
From: Cole Robinson <crobinso@redhat.com>
|
||||
Date: Fri, 12 Mar 2010 12:37:52 -0500
|
||||
Subject: [PATCH] qemu: Fix USB by product with security enabled
|
||||
|
||||
We need to call PrepareHostdevs to determine the USB device path before
|
||||
any security calls. PrepareHostUSBDevices was also incorrectly skipping
|
||||
all USB devices.
|
||||
---
|
||||
src/qemu/qemu_driver.c | 11 ++++++-----
|
||||
1 files changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
||||
index 040d645..b17d26d 100644
|
||||
--- a/src/qemu/qemu_driver.c
|
||||
+++ b/src/qemu/qemu_driver.c
|
||||
@@ -2360,7 +2360,7 @@ qemuPrepareHostUSBDevices(struct qemud_driver *driver ATTRIBUTE_UNUSED,
|
||||
|
||||
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
|
||||
continue;
|
||||
- if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
|
||||
+ if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB)
|
||||
continue;
|
||||
|
||||
/* Resolve a vendor/product to bus/device */
|
||||
@@ -2703,6 +2703,11 @@ static int qemudStartVMDaemon(virConnectPtr conn,
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ /* Must be run before security labelling */
|
||||
+ DEBUG0("Preparing host devices");
|
||||
+ if (qemuPrepareHostDevices(driver, vm->def) < 0)
|
||||
+ goto cleanup;
|
||||
+
|
||||
/* If you are using a SecurityDriver with dynamic labelling,
|
||||
then generate a security label for isolation */
|
||||
DEBUG0("Generating domain security label (if required)");
|
||||
@@ -2769,10 +2774,6 @@ static int qemudStartVMDaemon(virConnectPtr conn,
|
||||
if (qemuSetupCgroup(driver, vm) < 0)
|
||||
goto cleanup;
|
||||
|
||||
- DEBUG0("Preparing host devices");
|
||||
- if (qemuPrepareHostDevices(driver, vm->def) < 0)
|
||||
- goto cleanup;
|
||||
-
|
||||
if (VIR_ALLOC(priv->monConfig) < 0) {
|
||||
virReportOOMError();
|
||||
goto cleanup;
|
||||
--
|
||||
1.6.6.1
|
||||
|
||||
From 65e97240e6e4606820dd1c42ac172319e0af4d8d Mon Sep 17 00:00:00 2001
|
||||
From: Cole Robinson <crobinso@redhat.com>
|
||||
Date: Mon, 22 Mar 2010 10:45:36 -0400
|
||||
Subject: [PATCH] security: selinux: Fix crash when releasing non-existent label
|
||||
|
||||
This can be triggered by the qemuStartVMDaemon cleanup path if a
|
||||
VM references a non-existent USB device (by product) in the XML.
|
||||
|
||||
Signed-off-by: Cole Robinson <crobinso@redhat.com>
|
||||
---
|
||||
src/security/security_selinux.c | 3 ++-
|
||||
1 files changed, 2 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
|
||||
index 975b315..6680e2d 100644
|
||||
--- a/src/security/security_selinux.c
|
||||
+++ b/src/security/security_selinux.c
|
||||
@@ -632,7 +632,8 @@ SELinuxReleaseSecurityLabel(virDomainObjPtr vm)
|
||||
{
|
||||
const virSecurityLabelDefPtr secdef = &vm->def->seclabel;
|
||||
|
||||
- if (secdef->type == VIR_DOMAIN_SECLABEL_STATIC)
|
||||
+ if (secdef->type == VIR_DOMAIN_SECLABEL_STATIC ||
|
||||
+ secdef->label == NULL)
|
||||
return 0;
|
||||
|
||||
context_t con = context_new(secdef->label);
|
||||
--
|
||||
1.6.6.1
|
||||
|
||||
87
libvirt-0.7.7-set-kernel-perms.patch
Normal file
87
libvirt-0.7.7-set-kernel-perms.patch
Normal file
@@ -0,0 +1,87 @@
|
||||
From 3f1aa08af6580c215d973bc6bf57f505dbf8b926 Mon Sep 17 00:00:00 2001
|
||||
From: Cole Robinson <crobinso@redhat.com>
|
||||
Date: Fri, 12 Mar 2010 13:38:39 -0500
|
||||
Subject: [PATCH] security: Set permissions for kernel/initrd
|
||||
|
||||
Fixes URL installs when running virt-install as root on Fedora.
|
||||
---
|
||||
src/qemu/qemu_security_dac.c | 21 +++++++++++++++++++++
|
||||
src/security/security_selinux.c | 16 ++++++++++++++++
|
||||
2 files changed, 37 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_security_dac.c b/src/qemu/qemu_security_dac.c
|
||||
index 6911f48..1883fbe 100644
|
||||
--- a/src/qemu/qemu_security_dac.c
|
||||
+++ b/src/qemu/qemu_security_dac.c
|
||||
@@ -332,6 +332,15 @@ qemuSecurityDACRestoreSecurityAllLabel(virDomainObjPtr vm)
|
||||
vm->def->disks[i]) < 0)
|
||||
rc = -1;
|
||||
}
|
||||
+
|
||||
+ if (vm->def->os.kernel &&
|
||||
+ qemuSecurityDACRestoreSecurityFileLabel(vm->def->os.kernel) < 0)
|
||||
+ rc = -1;
|
||||
+
|
||||
+ if (vm->def->os.initrd &&
|
||||
+ qemuSecurityDACRestoreSecurityFileLabel(vm->def->os.initrd) < 0)
|
||||
+ rc = -1;
|
||||
+
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -356,6 +365,18 @@ qemuSecurityDACSetSecurityAllLabel(virDomainObjPtr vm)
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ if (vm->def->os.kernel &&
|
||||
+ qemuSecurityDACSetOwnership(vm->def->os.kernel,
|
||||
+ driver->user,
|
||||
+ driver->group) < 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ if (vm->def->os.initrd &&
|
||||
+ qemuSecurityDACSetOwnership(vm->def->os.initrd,
|
||||
+ driver->user,
|
||||
+ driver->group) < 0)
|
||||
+ return -1;
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
|
||||
index b2c8581..975b315 100644
|
||||
--- a/src/security/security_selinux.c
|
||||
+++ b/src/security/security_selinux.c
|
||||
@@ -616,6 +616,14 @@ SELinuxRestoreSecurityAllLabel(virDomainObjPtr vm)
|
||||
rc = -1;
|
||||
}
|
||||
|
||||
+ if (vm->def->os.kernel &&
|
||||
+ SELinuxRestoreSecurityFileLabel(vm->def->os.kernel) < 0)
|
||||
+ rc = -1;
|
||||
+
|
||||
+ if (vm->def->os.initrd &&
|
||||
+ SELinuxRestoreSecurityFileLabel(vm->def->os.initrd) < 0)
|
||||
+ rc = -1;
|
||||
+
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -736,6 +744,14 @@ SELinuxSetSecurityAllLabel(virDomainObjPtr vm)
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ if (vm->def->os.kernel &&
|
||||
+ SELinuxSetFilecon(vm->def->os.kernel, default_content_context) < 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ if (vm->def->os.initrd &&
|
||||
+ SELinuxSetFilecon(vm->def->os.initrd, default_content_context) < 0)
|
||||
+ return -1;
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
1.6.6.1
|
||||
|
||||
890
libvirt.spec
890
libvirt.spec
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user