[libvirt] [PATCH] Xen Events Updated
by Ben Guthro
This version of the Xen-Events patch goes a step further than the last version, and now emits the following domain events:
STARTED
STOPPED
ADDED
REMOVED
This is accomplished by monitoring /etc/xen, and taking advantage of what seemed to be dormant code in the XM driver. By re-enabling the "config cache", we can properly track domains when files come, and go into this directory.
configure.in | 13 +
include/libvirt/virterror.h | 1
po/POTFILES.in | 1
src/Makefile.am | 3
src/virterror.c | 3
src/xen_inotify.c | 270 +++++++++++++++++++++++++++
src/xen_inotify.h | 32 +++
src/xen_unified.c | 190 +++++++++++++++++++
src/xen_unified.h | 61 ++++++
src/xm_internal.c | 24 +-
src/xs_internal.c | 430 +++++++++++++++++++++++++++++++++++++++++++-
src/xs_internal.h | 51 +++++
12 files changed, 1069 insertions(+), 10 deletions(-)
16 years, 4 months
[libvirt] PATCH: allow to set nvcpus = 0
by Evgeniy Sokolov
OpenVZ uses all CPUs available in system
- by default (number of CPUs did not set)
- number of CPUs = 0
Currenty, libvirt don't allow to set nvcpus = 0.
Attached patch removes limitation in libvirt set nvcpu = 0, but add it
to each driver which allow to set number of virtual CPU. For OpenVZ set
default number of CPUs = 0.
16 years, 4 months
[libvirt] [PATCH] fix python events
by David Lively
This patch gets python events working again after upstream changes, and
make the test implementation properly clean up after itself and
implement the new EventImpl API properly.
Note that the Python RemoveHandle and RemoveTimeout implementations
should return the opaque object registered by the corresponding
AddHandle/Timeout calls, in lieu of calling the (C) freefunc. (The
binding code will then call freefunc if it's not NULL.) Ignoring this
means you'll leak memory in the same way that C RemoveHandle/Timeout
leak if they don't (now) call the freefunc.
I also moved around some of the error checking code to unclutter (and
speed up) the common code paths. For instance, we now check that the
virRegisterEventImpl arguments are callable just once (and return
failure if they're not), rather than checking them before every call and
blithely ignoring them if they're not callable.
Dave
examples/domain-events/events-python/event-test.py | 29 +--
python/libvir.c | 200+++++++++++++++----
python/libvir.py | 4
python/libvirt_wrap.h | 8
python/types.c | 1
python/virConnect.py | 4
6 files changed, 194 insertions(+), 52 deletions(-)
16 years, 4 months
[libvirt] [PATCH] libvirt.c: fix virStateActive return value; document ...
by Jim Meyering
The s/1/-1/ fix induces no semantic change, since the sole use
of virStateActive tests solely for nonzero.
>From 4bc9713207a2ed6b101e2067f7bba82d1df45987 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Mon, 24 Nov 2008 15:52:55 +0100
Subject: [PATCH] libvirt.c: fix virStateActive return value; document some new functions
* src/libvirt.c (virStateActive): Return -1 upon error, not 1,
to be consistent with the other virState* functions.
(virStateActive, virStateCleanup, virStateReload, virStateActive):
Add per-function comments.
---
src/libvirt.c | 30 +++++++++++++++++++++++++++++-
1 files changed, 29 insertions(+), 1 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index f445333..10835b9 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -636,6 +636,13 @@ virRegisterStateDriver(virStateDriverPtr driver)
return virStateDriverTabCount++;
}
+/**
+ * virStateInitialize:
+ *
+ * Initialize all virtualization drivers.
+ *
+ * Return 0 if successful, -1 upon error.
+ */
int virStateInitialize(void) {
int i, ret = 0;
@@ -650,6 +657,13 @@ int virStateInitialize(void) {
return ret;
}
+/**
+ * virStateCleanup:
+ *
+ * Run each virtualization driver's cleanup method.
+ *
+ * Return 0 if successful, -1 upon error.
+ */
int virStateCleanup(void) {
int i, ret = 0;
@@ -661,6 +675,13 @@ int virStateCleanup(void) {
return ret;
}
+/**
+ * virStateReload
+ *
+ * Run each virtualization driver's reload method.
+ *
+ * Return 0 if successful, -1 upon error.
+ */
int virStateReload(void) {
int i, ret = 0;
@@ -672,13 +693,20 @@ int virStateReload(void) {
return ret;
}
+/**
+ * virStateActive
+ *
+ * Run each virtualization driver's "active" method.
+ *
+ * Return 0 if successful, -1 upon error.
+ */
int virStateActive(void) {
int i, ret = 0;
for (i = 0 ; i < virStateDriverTabCount ; i++) {
if (virStateDriverTab[i]->active &&
virStateDriverTab[i]->active())
- ret = 1;
+ ret = -1;
}
return ret;
}
--
1.6.0.4.1021.g4320
16 years, 4 months
[libvirt] [PATCH] fix --without-xen build
by David Lively
The last change to tests/Makefile.am broke the build when --without-xen
is specified. This patch fixes it ...
Dave
tests/Makefile.am | 9 +++++++++
1 file changed, 9 insertions(+)
16 years, 4 months
[libvirt] [PATCH] * src/virterror.c (virReportErrorHelper): Sync doc to code.
by Jim Meyering
The dom and net parameters are long gone.
Reflect s/msg/fmt/ renaming:
>From 8b87344dbe31fe478ac4a679005835e03a329ace Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Mon, 24 Nov 2008 15:55:24 +0100
Subject: [PATCH] * src/virterror.c (virReportErrorHelper): Sync doc to code.
---
src/virterror.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/virterror.c b/src/virterror.c
index 0723db8..112a19e 100644
--- a/src/virterror.c
+++ b/src/virterror.c
@@ -747,17 +747,15 @@ virErrorMsg(virErrorNumber error, const char *info)
}
/**
- * virReportErrorHelper
+ * virReportErrorHelper:
*
* @conn: the connection to the hypervisor if available
- * @dom: the domain if available
- * @net: the network if available
* @domcode: the virErrorDomain indicating where it's coming from
* @errcode: the virErrorNumber code for the error
* @filename: Source file error is dispatched from
* @funcname: Function error is dispatched from
* @linenr: Line number error is dispatched from
- * @msg: the message to display/transmit
+ * @fmt: the format string
* @...: extra parameters for the message display
*
* Helper function to do most of the grunt work for individual driver
--
1.6.0.4.1021.g4320
16 years, 4 months
[libvirt] [PATCH] tests: virsh-all: new script
by Jim Meyering
Actually, this was the first step.
This tiny script merely invokes all commands blindly,
solely to get test coverage, even if they (as most do) fail.
Additional tests will be smarter about providing sensible arguments.
>From 058681eab07936f4ecbb1ff514528eb921d27074 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Fri, 21 Nov 2008 10:18:43 +0100
Subject: [PATCH] tests: virsh-all: new script
* tests/virsh-all: New script.
* tests/Makefile.am (test_scripts): Add virsh-all.
---
tests/Makefile.am | 1 +
tests/virsh-all | 39 +++++++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+), 0 deletions(-)
create mode 100755 tests/virsh-all
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bdbf927..0b4eebd 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -57,6 +57,7 @@ test_scripts += \
read-non-seekable \
undefine \
vcpupin
+ virsh-all
endif
EXTRA_DIST += $(test_scripts)
diff --git a/tests/virsh-all b/tests/virsh-all
new file mode 100755
index 0000000..af7e09d
--- /dev/null
+++ b/tests/virsh-all
@@ -0,0 +1,39 @@
+#!/bin/sh
+# blindly run each and every command listed by "virsh help"
+
+# Copyright (C) 2008 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+if test "$VERBOSE" = yes; then
+ set -x
+ virsh --version
+fi
+
+. $srcdir/test-lib.sh
+
+fail=0
+
+test_url=test:///default
+
+virsh -c $test_url help > cmds || framework_failure
+cmds=$(sed -n 's/^ \([^ ][^ ]*\) .*/\1/p' cmds) || framework_failure
+test -n "$cmds" || framework_failure
+
+for i in $cmds; do
+ echo testing $i... 1>&2
+ virsh -c $test_url $i < /dev/null
+done
+
+(exit $fail); exit $fail
--
1.6.0.4.1021.g4320
16 years, 4 months
[libvirt] [PATCH] * gnulib/tests/test-EOVERFLOW: Remove.
by Jim Meyering
Back on October 28, I mistakenly added a binary.
This adds the requisite .cvsignore entry and
updates the corresponding .gitignore file as well
as two stale ones.
>From 30a853d37fc2102a7e4009b93867209e318014a1 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Fri, 21 Nov 2008 14:15:15 +0100
Subject: [PATCH] * gnulib/tests/test-EOVERFLOW: Remove.
* gnulib/tests/.cvsignore: Add test-EOVERFLOW, then...
Run "make sync-vcs-ignore-files" to Update .gitignore files.
---
examples/domain-events/events-c/.gitignore | 2 ++
gnulib/tests/.cvsignore | 1 +
gnulib/tests/.gitignore | 1 +
gnulib/tests/test-EOVERFLOW | Bin 6680 -> 0 bytes
src/.gitignore | 1 +
5 files changed, 5 insertions(+), 0 deletions(-)
delete mode 100755 gnulib/tests/test-EOVERFLOW
diff --git a/examples/domain-events/events-c/.gitignore b/examples/domain-events/events-c/.gitignore
index 7b8079b..ed9ac4d 100644
--- a/examples/domain-events/events-c/.gitignore
+++ b/examples/domain-events/events-c/.gitignore
@@ -1,3 +1,5 @@
+Makefile
+Makefile.in
*.exe
.deps
.libs
diff --git a/gnulib/tests/.cvsignore b/gnulib/tests/.cvsignore
index 6ac20bc..04eb4a0 100644
--- a/gnulib/tests/.cvsignore
+++ b/gnulib/tests/.cvsignore
@@ -3,6 +3,7 @@
Makefile
Makefile.in
sys
+test-EOVERFLOW
test-alloca-opt
test-arpa_inet
test-c-ctype
diff --git a/gnulib/tests/.gitignore b/gnulib/tests/.gitignore
index 6ac20bc..04eb4a0 100644
--- a/gnulib/tests/.gitignore
+++ b/gnulib/tests/.gitignore
@@ -3,6 +3,7 @@
Makefile
Makefile.in
sys
+test-EOVERFLOW
test-alloca-opt
test-arpa_inet
test-c-ctype
diff --git a/gnulib/tests/test-EOVERFLOW b/gnulib/tests/test-EOVERFLOW
deleted file mode 100755
index ea3a8a27290fea9dd71beab276a9180b71a4847b..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 6680
zcmcIoU2Ggz6+Zjp*eP!8n3%YUQAX-Ua*#aT7{_sdz}SxM*|3d`<3ON=*^PH>Z?)dF
zcE(`?MYV7XTDfkGctPT!72*K|4|zdU0*OQ>MBym~ghCNeg+!SCpj3cr9@^!cJLlLl
...
zau)bXmrZ?BcK<8j@D;CN`0sM9)EIV@%NMN$$IfAtfv$5-$(qd;a|K&wUuHtx8&go~
Q6T0rYn6Ht&D`jQ!Z=>`m&;S4c
diff --git a/src/.gitignore b/src/.gitignore
index 4aff461..cef59e0 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -15,3 +15,4 @@ libvirt_parthelper
libvirt_lxc
virsh-net-edit.c
virsh-pool-edit.c
+libvirt_sym.version
--
1.6.0.4.1021.g4320
16 years, 4 months
[libvirt] --with-xen=foo
by Ben Guthro
So, when I merged my changes up yesterday to some of the developments going on, it would seem that one of the changesets I pulled in had a bit of a reduction in configure flexibility.
I'm not yet sure what changeset caused it...but I used to be able to specify an external xen tree with the following line in a Makefile...
./autogen.sh --prefix=/usr --with-xen=$(XEN_SRC)/dist/install/usr
This now seems to fail to find that xen tree, as I error out with:
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../gnulib/lib -I../gnulib/lib -I../include -I../include -I../qemud -I/usr/include/libxml2 -DBINDIR=\"/usr/libexec\" -DSBINDIR=\"/usr/sbin\" -DSYSCONF_DIR=\"/etc\" -DLOCALEBASEDIR=\"/usr/share/locale\" -DLOCAL_STATE_DIR=\"/var\" -DGETTEXT_PACKAGE=\"libvirt\" -Wall -Wformat -Wformat-security -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wextra -Wshadow -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Winline -Wredundant-decls -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fasynchronous-unwind-tables -g -O2 -MT stats_linux.lo -MD -MP -MF .deps/stats_linux.Tpo -c stats_linux.c -fPIC -DPIC -o .libs/stats_linux.o
stats_linux.c:24:16: error: xs.h: No such file or directory
stats_linux.c: In function 'check_bd_connected':
stats_linux.c:154: warning: implicit declaration of function 'xs_read'
stats_linux.c:154: warning: nested extern declaration of 'xs_read'
stats_linux.c:154: warning: assignment makes pointer from integer without a cast
I assume this has something to do with Daniel B's changes to configure scripts recently.
Could you give me a pointer as to where I should be looking?
Ben
16 years, 4 months