[libvirt] [PATCH] fix build for srcdir != builddir

2008-11-24 Thread Guido Günther
Hi,
libvirt_sym.version is looked for at the wrong location. O.k. to apply?
Cheers,
 -- Guido
From df2b33ae4a865b0039899297c4fbda066c6be638 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Guido=20G=C3=BCnther?= [EMAIL PROTECTED]
Date: Mon, 24 Nov 2008 14:49:47 +0100
Subject: [PATCH] look for libvirt_sym.version in builddir

fixes build for srcdir != builddir
---
 src/Makefile.am |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index a8f440e..d0f881f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -392,14 +392,14 @@ EXTRA_DIST +=			\
 libvirt_la_SOURCES =
 libvirt_la_LIBADD += \
 		@CYGWIN_EXTRA_LIBADD@ ../gnulib/lib/libgnu.la
-libvirt_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libvirt_sym.version \
+libvirt_la_LDFLAGS = -Wl,--version-script=$(builddir)/libvirt_sym.version \
  -version-info @LIBVIRT_VERSION_INFO@ \
 $(COVERAGE_CFLAGS:-f%=-Wc,-f%) \
 $(LIBXML_LIBS) $(SELINUX_LIBS) \
 		$(XEN_LIBS) $(DRIVER_MODULE_LIBS) \
 		@CYGWIN_EXTRA_LDFLAGS@ @MINGW_EXTRA_LDFLAGS@
 libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT
-libvirt_la_DEPENDENCIES = $(libvirt_la_LIBADD) $(srcdir)/libvirt_sym.version
+libvirt_la_DEPENDENCIES = $(libvirt_la_LIBADD) $(builddir)/libvirt_sym.version
 
 # Create an automake convenience library version of libvirt_la,
 # just for testing, since the test harness requires access to internal
-- 
1.6.0.2

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] fix build for srcdir != builddir

2008-11-24 Thread Daniel P. Berrange
On Mon, Nov 24, 2008 at 02:52:50PM +0100, Guido G?nther wrote:
 Hi,
 libvirt_sym.version is looked for at the wrong location. O.k. to apply?

Ah yes, forgot to change this. Go ahead.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] libvirt.c: fix virStateActive return value; document ...

2008-11-24 Thread 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 [EMAIL PROTECTED]
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

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] * src/virterror.c (virReportErrorHelper): Sync doc to code.

2008-11-24 Thread 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 [EMAIL PROTECTED]
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

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] fix build for srcdir != builddir

2008-11-24 Thread Guido Günther
On Mon, Nov 24, 2008 at 01:56:29PM +, Daniel P. Berrange wrote:
 On Mon, Nov 24, 2008 at 02:52:50PM +0100, Guido G?nther wrote:
  Hi,
  libvirt_sym.version is looked for at the wrong location. O.k. to apply?
 
 Ah yes, forgot to change this. Go ahead.
Applied.
 -- Guido

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] fix --without-xen build

2008-11-24 Thread Daniel P. Berrange
On Fri, Nov 21, 2008 at 12:46:59PM -0500, David Lively wrote:
 Okay, *this* one seems to be a complete fix.

Not quite. The ENABLE_XEN_TESTS conditional is only set when not
running on a live Xen kernel, which is a different conditional
from disabling Xen driver entirely. It also shouldn't skip out
sub-directories because we need 'make dist' to include them even
when Xen build is disabled.

Try out this patch which should do what you were after. It also removes
some pointless conditionals from the source files - we don't need WITH_XEN
in the source, if we're disabling the build entirely in the Makefile.am


Index: tests/Makefile.am
===
RCS file: /data/cvs/libvirt/tests/Makefile.am,v
retrieving revision 1.59
diff -u -p -r1.59 Makefile.am
--- tests/Makefile.am   24 Nov 2008 07:13:30 -  1.59
+++ tests/Makefile.am   24 Nov 2008 15:47:46 -
@@ -43,10 +43,13 @@ EXTRA_DIST =\
nodeinfodata \
domainschematest
 
-noinst_PROGRAMS = xmlrpctest xml2sexprtest sexpr2xmltest virshtest conftest \
-   reconnect xmconfigtest xencapstest \
+noinst_PROGRAMS = xmlrpctest virshtest conftest \
 nodeinfotest statstest qparamtest
 
+if WITH_XEN
+noinst_PROGRAMS += xml2sexprtest sexpr2xmltest \
+   reconnect xmconfigtest xencapstest
+endif
 if WITH_QEMU
 noinst_PROGRAMS += qemuxml2argvtest qemuxml2xmltest
 endif
@@ -68,12 +71,22 @@ endif
 
 EXTRA_DIST += $(test_scripts)
 
-TESTS = xml2sexprtest sexpr2xmltest virshtest xmconfigtest \
-xencapstest nodeinfotest \
-   statstest qparamtest $(test_scripts)
+TESTS = virshtest \
+nodeinfotest \
+   statstest \
+   qparamtest \
+   $(test_scripts)
+
+if WITH_XEN
+TESTS += xml2sexprtest \
+   sexpr2xmltest \
+   xmconfigtest \
+   xencapstest
 if ENABLE_XEN_TESTS
-  TESTS += reconnect
+TESTS += reconnect
+endif
 endif
+
 if WITH_QEMU
 TESTS += qemuxml2argvtest qemuxml2xmltest
 endif
@@ -105,6 +118,7 @@ xmlrpctest_SOURCES = \
 
 xmlrpctest_LDADD = $(LDADDS)
 
+if WITH_XEN
 xml2sexprtest_SOURCES = \
xml2sexprtest.c testutilsxen.c testutilsxen.h \
testutils.c testutils.h
@@ -120,6 +134,20 @@ xmconfigtest_SOURCES = \
testutils.c testutils.h
 xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
 
+xencapstest_SOURCES = \
+   xencapstest.c testutils.h testutils.c
+xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
+
+reconnect_SOURCES = \
+   reconnect.c
+reconnect_LDADD = $(LDADDS)
+
+else
+EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
+   xencapstest.c reconnect.c \
+   testutilsxen.c testutilsxen.h
+endif
+
 if WITH_QEMU
 qemuxml2argvtest_SOURCES = \
qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
@@ -143,10 +171,6 @@ conftest_SOURCES = \
conftest.c
 conftest_LDADD = $(LDADDS)
 
-xencapstest_SOURCES = \
-   xencapstest.c testutils.h testutils.c
-xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
-
 nodeinfotest_SOURCES = \
nodeinfotest.c testutils.h testutils.c
 nodeinfotest_LDADD = $(LDADDS)
@@ -159,8 +183,4 @@ qparamtest_SOURCES = \
qparamtest.c testutils.h testutils.c
 qparamtest_LDADD = $(LDADDS)
 
-reconnect_SOURCES = \
-   reconnect.c
-reconnect_LDADD = $(LDADDS)
-
 CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
Index: tests/sexpr2xmltest.c
===
RCS file: /data/cvs/libvirt/tests/sexpr2xmltest.c,v
retrieving revision 1.32
diff -u -p -r1.32 sexpr2xmltest.c
--- tests/sexpr2xmltest.c   9 Sep 2008 13:53:58 -   1.32
+++ tests/sexpr2xmltest.c   24 Nov 2008 15:47:46 -
@@ -4,8 +4,6 @@
 #include string.h
 #include unistd.h
 
-#ifdef WITH_XEN
-
 #include internal.h
 #include xml.h
 #include xend_internal.h
@@ -146,11 +144,3 @@ mymain(int argc, char **argv)
 
 VIRT_TEST_MAIN(mymain)
 
-#else /* WITHOUT_XEN */
-int
-main(void)
-{
-fprintf(stderr, libvirt compiled without Xen support\n);
-return(0);
-}
-#endif /* WITH_XEN */
Index: tests/testutilsxen.c
===
RCS file: /data/cvs/libvirt/tests/testutilsxen.c,v
retrieving revision 1.2
diff -u -p -r1.2 testutilsxen.c
--- tests/testutilsxen.c12 Aug 2008 08:25:48 -  1.2
+++ tests/testutilsxen.c24 Nov 2008 15:47:46 -
@@ -1,6 +1,5 @@
 #include config.h
 
-#ifdef WITH_XEN
 #include sys/utsname.h
 #include stdlib.h
 
@@ -52,4 +51,3 @@ cleanup:
 virCapabilitiesFree(caps);
 return NULL;
 }
-#endif
Index: tests/xencapstest.c
===
RCS file: /data/cvs/libvirt/tests/xencapstest.c,v
retrieving revision 1.15
diff -u -p -r1.15 xencapstest.c
--- tests/xencapstest.c 5 Sep 2008 11:35:44 -   1.15
+++ tests/xencapstest.c 24 Nov 2008 15:47:46 -
@@ -5,8 +5,6 @@
 #include string.h
 #include unistd.h
 
-#ifdef 

[libvirt] PATCH: Autostart for Xen domains 3.0.4

2008-11-24 Thread Daniel P. Berrange
The old 'xm' driver does not currently implement the autostart feature
for domains managed via /etc/xen. This patche addresses that limitation
by making it create the symlinks in /etc/xen/auto as expected by the
existing 'xendomains' init script for autostart.


Daniel

diff -r dddbb717add4 src/xen_unified.c
--- a/src/xen_unified.c Mon Nov 24 10:45:05 2008 -0500
+++ b/src/xen_unified.c Mon Nov 24 11:00:24 2008 -0500
@@ -1159,13 +1159,16 @@ xenUnifiedDomainGetAutostart (virDomainP
 xenUnifiedDomainGetAutostart (virDomainPtr dom, int *autostart)
 {
 GET_PRIVATE(dom-conn);
-int i;
-
-for (i = 0; i  XEN_UNIFIED_NR_DRIVERS; ++i)
-if (priv-opened[i]  drivers[i]-domainGetAutostart 
-drivers[i]-domainGetAutostart (dom, autostart) == 0)
-return 0;
-
+
+if (priv-xendConfigVersion  3) {
+if (priv-opened[XEN_UNIFIED_XM_OFFSET])
+return xenXMDomainGetAutostart(dom, autostart);
+} else {
+if (priv-opened[XEN_UNIFIED_XEND_OFFSET])
+return xenDaemonDomainGetAutostart(dom, autostart);
+}
+
+xenUnifiedError (dom-conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
 return -1;
 }
 
@@ -1173,13 +1176,16 @@ xenUnifiedDomainSetAutostart (virDomainP
 xenUnifiedDomainSetAutostart (virDomainPtr dom, int autostart)
 {
 GET_PRIVATE(dom-conn);
-int i;
-
-for (i = 0; i  XEN_UNIFIED_NR_DRIVERS; ++i)
-if (priv-opened[i]  drivers[i]-domainSetAutostart 
-drivers[i]-domainSetAutostart (dom, autostart) == 0)
-return 0;
-
+
+if (priv-xendConfigVersion  3) {
+if (priv-opened[XEN_UNIFIED_XM_OFFSET])
+return xenXMDomainSetAutostart(dom, autostart);
+} else {
+if (priv-opened[XEN_UNIFIED_XEND_OFFSET])
+return xenDaemonDomainSetAutostart(dom, autostart);
+}
+
+xenUnifiedError (dom-conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
 return -1;
 }
 
diff -r dddbb717add4 src/xm_internal.c
--- a/src/xm_internal.c Mon Nov 24 10:45:05 2008 -0500
+++ b/src/xm_internal.c Mon Nov 24 11:02:16 2008 -0500
@@ -2669,3 +2669,84 @@ xenXMDomainBlockPeek (virDomainPtr dom,
 return -1;
 }
 
+
+static char *xenXMAutostartLinkName(virDomainPtr dom)
+{
+char *ret;
+if (asprintf(ret, /etc/xen/auto/%s, dom-name)  0)
+return NULL;
+return ret;
+}
+
+static char *xenXMDomainConfigName(virDomainPtr dom)
+{
+char *ret;
+if (asprintf(ret, /etc/xen/%s, dom-name)  0)
+return NULL;
+return ret;
+}
+
+int xenXMDomainGetAutostart(virDomainPtr dom, int *autostart)
+{
+char *linkname = xenXMAutostartLinkName(dom);
+char *config = xenXMDomainConfigName(dom);
+int ret = -1;
+
+if (!linkname || !config) {
+xenXMError(dom-conn, VIR_ERR_NO_MEMORY, NULL);
+goto cleanup;
+}
+
+*autostart = virFileLinkPointsTo(linkname, config);
+if (*autostart  0) {
+xenXMError(dom-conn, VIR_ERR_INTERNAL_ERROR,
+   _(failed to check autostart link %s: %s),
+   linkname, strerror(errno));
+goto cleanup;
+}
+
+ret = 0;
+
+cleanup:
+VIR_FREE(linkname);
+VIR_FREE(config);
+return ret;
+}
+
+
+int xenXMDomainSetAutostart(virDomainPtr dom, int autostart)
+{
+char *linkname = xenXMAutostartLinkName(dom);
+char *config = xenXMDomainConfigName(dom);
+int ret = -1;
+
+if (!linkname || !config) {
+xenXMError(dom-conn, VIR_ERR_NO_MEMORY, NULL);
+goto cleanup;
+}
+
+if (autostart) {
+if (symlink(config, linkname)  0 
+errno != EEXIST) {
+xenXMError(dom-conn, VIR_ERR_INTERNAL_ERROR,
+   failed to create link %s: %s,
+   linkname, strerror(errno));
+goto cleanup;
+}
+} else {
+if (unlink(linkname)   0 
+errno != ENOENT) {
+xenXMError(dom-conn, VIR_ERR_INTERNAL_ERROR,
+   failed to remove link %s: %s,
+   linkname, strerror(errno));
+goto cleanup;
+}
+}
+ret = 0;
+
+cleanup:
+VIR_FREE(linkname);
+VIR_FREE(config);
+
+return ret;
+}
diff -r dddbb717add4 src/xm_internal.h
--- a/src/xm_internal.h Mon Nov 24 10:45:05 2008 -0500
+++ b/src/xm_internal.h Mon Nov 24 10:59:24 2008 -0500
@@ -65,4 +65,7 @@ virDomainDefPtr xenXMDomainConfigParse(v
 
 int xenXMDomainBlockPeek (virDomainPtr dom, const char *path, unsigned long 
long offset, size_t size, void *buffer);
 
+int xenXMDomainGetAutostart(virDomainPtr dom, int *autostart);
+int xenXMDomainSetAutostart(virDomainPtr dom, int autostart);
+
 #endif

-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list

Re: [libvirt] [PATCH] libvirt.c: fix virStateActive return value; document ...

2008-11-24 Thread Daniel Veillard
On Mon, Nov 24, 2008 at 03:54:30PM +0100, Jim Meyering wrote:
 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 [EMAIL PROTECTED]
 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.

  Looks fine to me ! +1

Daniel

-- 
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
[EMAIL PROTECTED]  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] fix python events

2008-11-24 Thread Jim Meyering
David Lively [EMAIL PROTECTED] wrote:
 On Sat, 2008-11-22 at 08:21 +0100, Jim Meyering wrote:
 David Lively [EMAIL PROTECTED] wrote:
  On Fri, 2008-11-21 at 17:51 +0100, Jim Meyering wrote:
  I'm printing the (user-supplied) object names to help in debugging
  misbehaving python EventImpls (since there's no static type checking to
  catch these kinds of things).  So instead of printing NULL when we
  can't alloc the name, I'm printing something a little more helpful (the
  appropriate generic name).

 That's better, indeed.
 I prefer your NAME macro, too.
 ACK, modulo syntax:

 ...

 Reversed diff?  Better to split long lines,
 not to join.

 Ok.  Fixed in attached patch.

  +

 Trailing white space ^^.

 .. along with this one ... and the trailing whitespace on line 1982.

 *This* time I ran syntax-check :-)

;-)
Unqualified ACK, then, assuming those are the only changes.

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] libvirt.c: fix virStateActive return value; document ...

2008-11-24 Thread Daniel P. Berrange
On Mon, Nov 24, 2008 at 03:54:30PM +0100, Jim Meyering wrote:
 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 [EMAIL PROTECTED]
 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.

NACK.

 +/**
 + * 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;

This is *not* an error condition. This method is basically asking
whether the driver is 'active' - eg, does it have any domains
running. It returns 0 if it isn't active, or 1 if it is active.

There is no error scenario - it can never fail.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] * src/virterror.c (virReportErrorHelper): Sync doc to code.

2008-11-24 Thread Daniel P. Berrange
On Mon, Nov 24, 2008 at 03:56:38PM +0100, Jim Meyering wrote:
 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 [EMAIL PROTECTED]
 Date: Mon, 24 Nov 2008 15:55:24 +0100
 Subject: [PATCH] * src/virterror.c (virReportErrorHelper): Sync doc to code.

ACK

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] fix python events

2008-11-24 Thread Daniel P. Berrange
On Fri, Nov 21, 2008 at 02:14:57PM -0500, David Lively wrote:
 On Fri, 2008-11-21 at 17:51 +0100, Jim Meyering wrote:
  No big deal, but there are several debug printf uses here that look
  like they try to print NULL pointers upon memory allocation failure.
  It's ok with glibc's printf of course, but not for others.
 
 You're right.  Attached patch fixes those issues.  It also fixes some
 cases in which I got some printf string operands switched around ...
 
 I'm printing the (user-supplied) object names to help in debugging
 misbehaving python EventImpls (since there's no static type checking to
 catch these kinds of things).  So instead of printing NULL when we
 can't alloc the name, I'm printing something a little more helpful (the
 appropriate generic name).

ACK. This looks ok to me now.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] PATCH: Autostart for Xen domains 3.0.4

2008-11-24 Thread Daniel Veillard
On Mon, Nov 24, 2008 at 04:15:31PM +, Daniel P. Berrange wrote:
 The old 'xm' driver does not currently implement the autostart feature
 for domains managed via /etc/xen. This patche addresses that limitation
 by making it create the symlinks in /etc/xen/auto as expected by the
 existing 'xendomains' init script for autostart.

  Looks fine and clean. A good idea for 0.5.0 IMHO,

Daniel

-- 
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
[EMAIL PROTECTED]  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] fix python events

2008-11-24 Thread David Lively
On Mon, 2008-11-24 at 17:30 +0100, Jim Meyering wrote:
 David Lively [EMAIL PROTECTED] wrote:
  On Sat, 2008-11-22 at 08:21 +0100, Jim Meyering wrote:
  David Lively [EMAIL PROTECTED] wrote:
   On Fri, 2008-11-21 at 17:51 +0100, Jim Meyering wrote:
   I'm printing the (user-supplied) object names to help in debugging
   misbehaving python EventImpls (since there's no static type checking to
   catch these kinds of things).  So instead of printing NULL when we
   can't alloc the name, I'm printing something a little more helpful (the
   appropriate generic name).
 
  That's better, indeed.
  I prefer your NAME macro, too.
  ACK, modulo syntax:
 
  ...
 
  Reversed diff?  Better to split long lines,
  not to join.
 
  Ok.  Fixed in attached patch.
 
   +
 
  Trailing white space ^^.
 
  .. along with this one ... and the trailing whitespace on line 1982.
 
  *This* time I ran syntax-check :-)
 
 ;-)
 Unqualified ACK, then, assuming those are the only changes.

Those are the only changes.

Dave


--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] fix --without-xen build

2008-11-24 Thread Ben Guthro
This fixed it in our environment

ACK

Daniel P. Berrange wrote on 11/24/2008 10:50 AM:
 On Fri, Nov 21, 2008 at 12:46:59PM -0500, David Lively wrote:
 Okay, *this* one seems to be a complete fix.
 
 Not quite. The ENABLE_XEN_TESTS conditional is only set when not
 running on a live Xen kernel, which is a different conditional
 from disabling Xen driver entirely. It also shouldn't skip out
 sub-directories because we need 'make dist' to include them even
 when Xen build is disabled.
 
 Try out this patch which should do what you were after. It also removes
 some pointless conditionals from the source files - we don't need WITH_XEN
 in the source, if we're disabling the build entirely in the Makefile.am
 
 
 Index: tests/Makefile.am
 ===
 RCS file: /data/cvs/libvirt/tests/Makefile.am,v
 retrieving revision 1.59
 diff -u -p -r1.59 Makefile.am
 --- tests/Makefile.am 24 Nov 2008 07:13:30 -  1.59
 +++ tests/Makefile.am 24 Nov 2008 15:47:46 -
 @@ -43,10 +43,13 @@ EXTRA_DIST =  \
   nodeinfodata \
   domainschematest
  
 -noinst_PROGRAMS = xmlrpctest xml2sexprtest sexpr2xmltest virshtest conftest \
 - reconnect xmconfigtest xencapstest \
 +noinst_PROGRAMS = xmlrpctest virshtest conftest \
  nodeinfotest statstest qparamtest
  
 +if WITH_XEN
 +noinst_PROGRAMS += xml2sexprtest sexpr2xmltest \
 + reconnect xmconfigtest xencapstest
 +endif
  if WITH_QEMU
  noinst_PROGRAMS += qemuxml2argvtest qemuxml2xmltest
  endif
 @@ -68,12 +71,22 @@ endif
  
  EXTRA_DIST += $(test_scripts)
  
 -TESTS = xml2sexprtest sexpr2xmltest virshtest xmconfigtest \
 -xencapstest nodeinfotest \
 - statstest qparamtest $(test_scripts)
 +TESTS = virshtest \
 +nodeinfotest \
 + statstest \
 + qparamtest \
 + $(test_scripts)
 +
 +if WITH_XEN
 +TESTS += xml2sexprtest \
 + sexpr2xmltest \
 + xmconfigtest \
 + xencapstest
  if ENABLE_XEN_TESTS
 -  TESTS += reconnect
 +TESTS += reconnect
 +endif
  endif
 +
  if WITH_QEMU
  TESTS += qemuxml2argvtest qemuxml2xmltest
  endif
 @@ -105,6 +118,7 @@ xmlrpctest_SOURCES = \
  
  xmlrpctest_LDADD = $(LDADDS)
  
 +if WITH_XEN
  xml2sexprtest_SOURCES = \
   xml2sexprtest.c testutilsxen.c testutilsxen.h \
   testutils.c testutils.h
 @@ -120,6 +134,20 @@ xmconfigtest_SOURCES = \
   testutils.c testutils.h
  xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
  
 +xencapstest_SOURCES = \
 + xencapstest.c testutils.h testutils.c
 +xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
 +
 +reconnect_SOURCES = \
 + reconnect.c
 +reconnect_LDADD = $(LDADDS)
 +
 +else
 +EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
 + xencapstest.c reconnect.c \
 + testutilsxen.c testutilsxen.h
 +endif
 +
  if WITH_QEMU
  qemuxml2argvtest_SOURCES = \
   qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
 @@ -143,10 +171,6 @@ conftest_SOURCES = \
   conftest.c
  conftest_LDADD = $(LDADDS)
  
 -xencapstest_SOURCES = \
 - xencapstest.c testutils.h testutils.c
 -xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
 -
  nodeinfotest_SOURCES = \
   nodeinfotest.c testutils.h testutils.c
  nodeinfotest_LDADD = $(LDADDS)
 @@ -159,8 +183,4 @@ qparamtest_SOURCES = \
   qparamtest.c testutils.h testutils.c
  qparamtest_LDADD = $(LDADDS)
  
 -reconnect_SOURCES = \
 - reconnect.c
 -reconnect_LDADD = $(LDADDS)
 -
  CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
 Index: tests/sexpr2xmltest.c
 ===
 RCS file: /data/cvs/libvirt/tests/sexpr2xmltest.c,v
 retrieving revision 1.32
 diff -u -p -r1.32 sexpr2xmltest.c
 --- tests/sexpr2xmltest.c 9 Sep 2008 13:53:58 -   1.32
 +++ tests/sexpr2xmltest.c 24 Nov 2008 15:47:46 -
 @@ -4,8 +4,6 @@
  #include string.h
  #include unistd.h
  
 -#ifdef WITH_XEN
 -
  #include internal.h
  #include xml.h
  #include xend_internal.h
 @@ -146,11 +144,3 @@ mymain(int argc, char **argv)
  
  VIRT_TEST_MAIN(mymain)
  
 -#else /* WITHOUT_XEN */
 -int
 -main(void)
 -{
 -fprintf(stderr, libvirt compiled without Xen support\n);
 -return(0);
 -}
 -#endif /* WITH_XEN */
 Index: tests/testutilsxen.c
 ===
 RCS file: /data/cvs/libvirt/tests/testutilsxen.c,v
 retrieving revision 1.2
 diff -u -p -r1.2 testutilsxen.c
 --- tests/testutilsxen.c  12 Aug 2008 08:25:48 -  1.2
 +++ tests/testutilsxen.c  24 Nov 2008 15:47:46 -
 @@ -1,6 +1,5 @@
  #include config.h
  
 -#ifdef WITH_XEN
  #include sys/utsname.h
  #include stdlib.h
  
 @@ -52,4 +51,3 @@ cleanup:
  virCapabilitiesFree(caps);
  return NULL;
  }
 -#endif
 Index: tests/xencapstest.c
 ===
 RCS file: /data/cvs/libvirt/tests/xencapstest.c,v
 retrieving revision 1.15
 diff -u -p -r1.15 

[libvirt] PATCH: Fix node device build on mingw32

2008-11-24 Thread Daniel P. Berrange
The node device XML configuration handling routines contain a struct
member called 'interface'. This seems to clash with a some typedef or
function in the Win32 header files, causing horrific compile failure.
This patch simply renames 'interface' to 'ifname'.

Index: src/node_device_conf.c
===
RCS file: /data/cvs/libvirt/src/node_device_conf.c,v
retrieving revision 1.2
diff -r1.2 node_device_conf.c
272c272
   data-net.interface);
---
   data-net.ifname);
377c377
 VIR_FREE(data-net.interface);
---
 VIR_FREE(data-net.ifname);
Index: src/node_device_conf.h
===
RCS file: /data/cvs/libvirt/src/node_device_conf.h,v
retrieving revision 1.3
diff -r1.3 node_device_conf.h
105c105
 char *interface;
---
 char *ifname;
Index: src/node_device_devkit.c
===
RCS file: /data/cvs/libvirt/src/node_device_devkit.c,v
retrieving revision 1.2
diff -r1.2 node_device_devkit.c
121c121
 const char *interface;
---
 const char *ifname;
125,126c125,126
 interface = strrchr(sysfs_path, '/');
 if (!interface || !*interface || !*(++interface))
---
 ifname = strrchr(sysfs_path, '/');
 if (!ifname || !*ifname || !*(++ifname))
128c128
 if ((d-net.interface = strdup(interface)) == NULL)
---
 if ((d-net.ifname = strdup(ifname)) == NULL)
Index: src/node_device_hal.c
===
RCS file: /data/cvs/libvirt/src/node_device_hal.c,v
retrieving revision 1.2
diff -r1.2 node_device_hal.c
199c199
 (void)get_str_prop(ctx, udi, net.interface, d-net.interface);
---
 (void)get_str_prop(ctx, udi, net.interface, d-net.ifname);


-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] libvirt.c: fix virStateActive return value; document ...

2008-11-24 Thread Daniel Veillard
On Mon, Nov 24, 2008 at 04:31:28PM +, Daniel P. Berrange wrote:
 On Mon, Nov 24, 2008 at 03:54:30PM +0100, Jim Meyering wrote:
  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 [EMAIL PROTECTED]
  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.
 
 NACK.
 
  +/**
  + * 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;
 
 This is *not* an error condition. This method is basically asking
 whether the driver is 'active' - eg, does it have any domains
 running. It returns 0 if it isn't active, or 1 if it is active.
 
 There is no error scenario - it can never fail.

  Then that should be explained in the (missing) comment!
Still +1 for other parts of that patch including the comments I assume,

Daniel

-- 
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
[EMAIL PROTECTED]  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] libvirt.c: fix virStateActive return value; document ...

2008-11-24 Thread Jim Meyering
Daniel P. Berrange [EMAIL PROTECTED] wrote:
...
 + * 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;

 This is *not* an error condition. This method is basically asking
 whether the driver is 'active' - eg, does it have any domains
 running. It returns 0 if it isn't active, or 1 if it is active.

 There is no error scenario - it can never fail.

Ah.  I see what you mean.
This is better:

From a85968eed75cdbcf8848ea62b2739469fd6a9d60 Mon Sep 17 00:00:00 2001
From: Jim Meyering [EMAIL PROTECTED]
Date: Mon, 24 Nov 2008 15:52:55 +0100
Subject: [PATCH 1/3] libvirt.c: document the virState* functions

* src/libvirt.c (virStateActive, virStateCleanup, virStateReload):
(virStateActive): Add per-function comments.
---
 src/libvirt.c |   28 
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/src/libvirt.c b/src/libvirt.c
index f445333..6195a4e 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 all succeed, -1 upon any failure.
+ */
 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 all succeed, -1 upon any failure.
+ */
 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 all succeed, -1 upon any failure.
+ */
 int virStateReload(void) {
 int i, ret = 0;

@@ -672,6 +693,13 @@ int virStateReload(void) {
 return ret;
 }

+/**
+ * virStateActive:
+ *
+ * Run each virtualization driver's active method.
+ *
+ * Return 0 if none are active, 1 if at least one is.
+ */
 int virStateActive(void) {
 int i, ret = 0;

--
1.6.0.4.1044.g77718

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] fix python events

2008-11-24 Thread David Lively
On Sat, 2008-11-22 at 08:21 +0100, Jim Meyering wrote:
 David Lively [EMAIL PROTECTED] wrote:
  On Fri, 2008-11-21 at 17:51 +0100, Jim Meyering wrote:
  I'm printing the (user-supplied) object names to help in debugging
  misbehaving python EventImpls (since there's no static type checking to
  catch these kinds of things).  So instead of printing NULL when we
  can't alloc the name, I'm printing something a little more helpful (the
  appropriate generic name).
 
 That's better, indeed.
 I prefer your NAME macro, too.
 ACK, modulo syntax:
 
...

 Reversed diff?  Better to split long lines,
 not to join.

Ok.  Fixed in attached patch.

  +
 
 Trailing white space ^^.

.. along with this one ... and the trailing whitespace on line 1982.

*This* time I ran syntax-check :-)

Dave


 examples/domain-events/events-python/event-test.py |   26 +-
 python/libvir.c|  203 +
 python/libvir.py   |4 
 python/libvirt_wrap.h  |8 
 python/types.c |1 
 python/virConnect.py   |4 
 6 files changed, 196 insertions(+), 50 deletions(-)


diff --git a/examples/domain-events/events-python/event-test.py b/examples/domain-events/events-python/event-test.py
index 45aaa93..7bea606 100644
--- a/examples/domain-events/events-python/event-test.py
+++ b/examples/domain-events/events-python/event-test.py
@@ -72,22 +72,22 @@ def myAddHandle(fd, events, cb, opaque):
 h_events = events
 h_cb = cb
 h_opaque = opaque
-
 mypoll.register(fd, myEventHandleTypeToPollEvent(events))
+return 0
 
 def myUpdateHandle(watch, event):
 global h_fd, h_events
-#print Updating Handle %s %s % (str(fd), str(events))
-h_fd = fd
+#print Updating Handle %s %s % (str(h_fd), str(event))
 h_events = event
-mypoll.unregister(watch)
-mypoll.register(watch, myEventHandleTypeToPollEvent(event))
+mypoll.unregister(h_fd)
+mypoll.register(h_fd, myEventHandleTypeToPollEvent(event))
 
 def myRemoveHandle(watch):
 global h_fd
-#print Removing Handle %s % str(fd)
+#print Removing Handle %s % str(h_fd)
+mypoll.unregister(h_fd)
 h_fd = 0
-mypoll.unregister(watch)
+return h_opaque
 
 def myAddTimeout(timeout, cb, opaque):
 global t_active, t_timeout, t_cb, t_opaque
@@ -96,16 +96,18 @@ def myAddTimeout(timeout, cb, opaque):
 t_timeout = timeout;
 t_cb = cb;
 t_opaque = opaque;
+return 0
 
 def myUpdateTimeout(timer, timeout):
 global t_timeout
-#print Updating Timeout %s % (str(timer), str(timeout))
+#print Updating Timeout %s %s % (str(timer), str(timeout))
 t_timeout = timeout;
 
 def myRemoveTimeout(timer):
 global t_active
 #print Removing Timeout %s % str(timer)
 t_active = 0;
+return t_opaque
 
 ##
 # Main
@@ -143,6 +145,14 @@ def main():
myRemoveTimeout );
 vc = libvirt.open(uri)
 
+# Close connection on exit (to test cleanup paths)
+old_exitfunc = getattr(sys, 'exitfunc', None)
+def exit():
+print Closing  + str(vc)
+vc.close()
+if (old_exitfunc): old_exitfunc()
+sys.exitfunc = exit
+
 #Add 2 callbacks to prove this works with more than just one
 vc.domainEventRegister(myDomainEventCallback1,None)
 vc.domainEventRegister(myDomainEventCallback2,None)
diff --git a/python/libvir.c b/python/libvir.c
index 7d58442..ca1e890 100644
--- a/python/libvir.c
+++ b/python/libvir.c
@@ -35,6 +35,18 @@ extern void initcygvirtmod(void);
 #define VIR_PY_INT_FAIL (libvirt_intWrap(-1))
 #define VIR_PY_INT_SUCCESS (libvirt_intWrap(0))
 
+static char *py_str(PyObject *obj)
+{
+PyObject *str = PyObject_Str(obj);
+if (!str) {
+PyErr_Print();
+PyErr_Clear();
+return NULL;
+};
+return PyString_AsString(str);
+}
+
+
 /
  *	*
  *		Statistics		*
@@ -484,7 +496,8 @@ libvirt_virErrorFuncHandler(ATTRIBUTE_UNUSED void *ctx, virErrorPtr err)
 PyObject *result;
 
 #ifdef DEBUG_ERROR
-printf(libvirt_virErrorFuncHandler(%p, %s, ...) called\n, ctx, msg);
+printf(libvirt_virErrorFuncHandler(%p, %s, ...) called\n, ctx,
+   err-message);
 #endif
 
 if ((err == NULL) || (err-code == VIR_ERR_OK))
@@ -1780,12 +1793,19 @@ libvirt_virConnectDomainEventDeregister(ATTRIBUTE_UNUSED PyObject * self,
  * Event Impl
  ***/
 static PyObject *addHandleObj = NULL;
+static char *addHandleName= NULL;
 static PyObject *updateHandleObj  = NULL;
+static char *updateHandleName = NULL;
 static PyObject *removeHandleObj  = NULL;
+static char *removeHandleName = NULL;
 static PyObject *addTimeoutObj= NULL;
+static char *addTimeoutName   = NULL;
 static PyObject 

Re: [libvirt] [PATCH] fix --without-xen build

2008-11-24 Thread Daniel P. Berrange
On Mon, Nov 24, 2008 at 11:46:56AM -0500, Ben Guthro wrote:
 This fixed it in our environment

Great, committed this fix now.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] libvirt.c: fix virStateActive return value; document ...

2008-11-24 Thread Daniel P. Berrange
On Mon, Nov 24, 2008 at 06:05:37PM +0100, Jim Meyering wrote:
 Daniel P. Berrange [EMAIL PROTECTED] wrote:
 ...
  + * 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;
 
  This is *not* an error condition. This method is basically asking
  whether the driver is 'active' - eg, does it have any domains
  running. It returns 0 if it isn't active, or 1 if it is active.
 
  There is no error scenario - it can never fail.
 
 Ah.  I see what you mean.
 This is better:
 
 From a85968eed75cdbcf8848ea62b2739469fd6a9d60 Mon Sep 17 00:00:00 2001
 From: Jim Meyering [EMAIL PROTECTED]
 Date: Mon, 24 Nov 2008 15:52:55 +0100
 Subject: [PATCH 1/3] libvirt.c: document the virState* functions

ACK.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] fix python events

2008-11-24 Thread Daniel P. Berrange
On Mon, Nov 24, 2008 at 11:44:15AM -0500, David Lively wrote:
 On Mon, 2008-11-24 at 17:30 +0100, Jim Meyering wrote:
  David Lively [EMAIL PROTECTED] wrote:
   On Sat, 2008-11-22 at 08:21 +0100, Jim Meyering wrote:
   David Lively [EMAIL PROTECTED] wrote:
On Fri, 2008-11-21 at 17:51 +0100, Jim Meyering wrote:
I'm printing the (user-supplied) object names to help in debugging
misbehaving python EventImpls (since there's no static type checking to
catch these kinds of things).  So instead of printing NULL when we
can't alloc the name, I'm printing something a little more helpful (the
appropriate generic name).
  
   That's better, indeed.
   I prefer your NAME macro, too.
   ACK, modulo syntax:
  
   ...
  
   Reversed diff?  Better to split long lines,
   not to join.
  
   Ok.  Fixed in attached patch.
  
+
  
   Trailing white space ^^.
  
   .. along with this one ... and the trailing whitespace on line 1982.
  
   *This* time I ran syntax-check :-)
  
  ;-)
  Unqualified ACK, then, assuming those are the only changes.
 
 Those are the only changes.

Ok, I committed this patch now.


Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list