Re: [Libvir] [PATCH]Change MAC address to case insensitive

2008-02-27 Thread Richard W.M. Jones
On Wed, Feb 27, 2008 at 02:27:30PM +0900, S.Sakamoto wrote:
  
  OK, try this patch.
  
 
 I tried this patch.
 It works fine to me.

Yes, the patch works for me too.  I'll commit this end of today
unless anyone objects.

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v

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


[Libvir] [PATCH] fix typo

2008-02-27 Thread Atsushi SAKAI
fix typo

 event.h|   10 +-
 iptables.c |6 +++---
 sexpr.c|6 +++---
 socketcompat.h |2 +-
 storage_backend.c  |2 +-
 storage_backend_disk.c |4 ++--
 storage_conf.c |2 +-
 virterror.c|   12 ++--
 xen_internal.c |   18 +-
 xen_unified.c  |4 ++--
 10 files changed, 33 insertions(+), 33 deletions(-)


Signed-off-by: Atsushi SAKAI [EMAIL PROTECTED]

Thanks
Atsushi SAKAI



fix_typo.patch
Description: Binary data
--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[Libvir] [PATCH] Fix a make syntax-check failure.

2008-02-27 Thread Jim Meyering
make syntax-check reported this:

src/capabilities.c
Makefile.maint: the above files do not include config.h
make: *** [sc_require_config_h] Error 1

The fix is so trivial it's barely worth posting, but just in case...
And besides, it's good policy.

Fix a make syntax-check failure.
* src/capabilities.c: Include config.h from the .c file,
* src/capabilities.h: ... not from the .h file.

---
 src/capabilities.c |4 +++-
 src/capabilities.h |3 ---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/capabilities.c b/src/capabilities.c
index 94f7d17..263935c 100644
--- a/src/capabilities.c
+++ b/src/capabilities.c
@@ -21,6 +21,8 @@
  * Author: Daniel P. Berrange [EMAIL PROTECTED]
  */

+#include config.h
+
 #include capabilities.h
 #include buf.h

@@ -30,7 +32,7 @@
  * @arch: host machine architecture
  * @offlineMigrate: non-zero if offline migration is available
  * @liveMigrate: non-zero if live migration is available
- * 
+ *
  * Allocate a new capabilities object
  */
 virCapsPtr
diff --git a/src/capabilities.h b/src/capabilities.h
index 97bd06f..b379e51 100644
--- a/src/capabilities.h
+++ b/src/capabilities.h
@@ -24,9 +24,6 @@
 #ifndef __VIR_CAPABILITIES_H
 #define __VIR_CAPABILITIES_H

-#include config.h
-
-
 typedef struct _virCapsGuestFeature virCapsGuestFeature;
 typedef virCapsGuestFeature *virCapsGuestFeaturePtr;
 struct _virCapsGuestFeature {
--
1.5.4.3.231.gc0a6

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


[Libvir] [PATCH] Avoid make distcheck failure.

2008-02-27 Thread Jim Meyering
Here's another trivial one:
util-lib.h wasn't included in the tarball
created by make dist, so make distcheck would fail.

Avoid make distcheck failure.
* src/Makefile.am (virsh_SOURCES): Add util-lib.h.

Signed-off-by: Jim Meyering [EMAIL PROTECTED]
---
 src/Makefile.am |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 02be9db..9c4810a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -101,7 +101,7 @@ libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT

 bin_PROGRAMS = virsh

-virsh_SOURCES = virsh.c console.c console.h util-lib.c
+virsh_SOURCES = virsh.c console.c console.h util-lib.c util-lib.h
 virsh_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDFLAGS)
 virsh_DEPENDENCIES = $(DEPS)
 virsh_LDADD = $(LDADDS) $(VIRSH_LIBS)
--
1.5.4.3.231.gc0a6

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


Re: [Libvir] [PATCH] Avoid make distcheck failure.

2008-02-27 Thread Daniel Veillard
On Wed, Feb 27, 2008 at 04:11:19PM +0100, Jim Meyering wrote:
 Here's another trivial one:
 util-lib.h wasn't included in the tarball
 created by make dist, so make distcheck would fail.
 
   Avoid make distcheck failure.
 * src/Makefile.am (virsh_SOURCES): Add util-lib.h.

  sure, +1, 

Daniel

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

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


Re: [Libvir] [PATCH] (for discussion) DHCP host mappings using 3 arrays API

2008-02-27 Thread Hugh O. Brock
On Mon, Feb 25, 2008 at 05:28:05PM +, Richard W.M. Jones wrote:
 On Mon, Feb 25, 2008 at 04:49:00PM +, Richard W.M. Jones wrote:
 [...]
 
 Thanks to Jim for pointing me in the right direction here.  If you try
 this patch you'll need to insert memset() calls at the two places
 indicated below.  That fixes all the problems I can see and it appears
 to all work fine now.
 
 Rich.

+1

If no one has any objections, can we go ahead and commit this? I'd
like to use it for oVirt...

--Hugh

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


[Libvir] [PATCH] Avoid link errors with configure --disable-shared.

2008-02-27 Thread Jim Meyering
I got link errors when building with --disable-shared, and finally
fixed it.  Here's most of the solution.  The patch after this one
adjusts the gcov (test-coverage)-related things so that works with
the new setup, too.

This also fixes what look like accidental omissions
in src/libvirt_sym.version.

Avoid link errors with configure --disable-shared.
* src/Makefile.am: Create a convenience library, libvirt_test.la,
and don't restrict access to *its* symbols.
* tests/Makefile.am (LDADDS): Add ../src/libvirt_test.la, so that
configure --disable-shared no longer provokes link errors.
(LIBVIRT): Remove definition.
(LDADDS): Remove use.
($(LIBVIRT)): Remove rule.
(LDADDS): Use the new convenience library instead.
(CLEANFILES): Define.
* docs/examples/index.py (dump_Makefile): Append $(COVERAGE_LDFLAGS),
to the LDADDS definition, to avoid link error with the combination of
--enable-test-coverage and --disable-shared.
* docs/examples/Makefile.am: Regenerate.
* docs/examples/index.html: Likewise.
* qemud/Makefile.am (libvirtd_LDFLAGS): Append $(COVERAGE_LDFLAGS).

Signed-off-by: Jim Meyering [EMAIL PROTECTED]
---
 docs/examples/Makefile.am |2 +-
 docs/examples/index.html  |2 +-
 docs/examples/index.py|3 ++-
 qemud/Makefile.am |   26 --
 src/Makefile.am   |   19 +++
 src/libvirt_sym.version   |   11 +++
 tests/Makefile.am |   13 ++---
 7 files changed, 48 insertions(+), 28 deletions(-)

diff --git a/docs/examples/Makefile.am b/docs/examples/Makefile.am
index 9da4e21..d8e4868 100644
--- a/docs/examples/Makefile.am
+++ b/docs/examples/Makefile.am
@@ -3,7 +3,7 @@
 SUBDIRS=python
 INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include [EMAIL 
PROTECTED]@/include
 DEPS = $(top_builddir)/src/libvirt.la
-LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la
+LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la   
$(COVERAGE_LDFLAGS)

 rebuild: examples.xml index.html

diff --git a/docs/examples/index.html b/docs/examples/index.html

[...omitting generated diff containing a couple of 4000+-byte lines...]

diff --git a/docs/examples/index.py b/docs/examples/index.py
index 8f386ed..6be80c5 100755
--- a/docs/examples/index.py
+++ b/docs/examples/index.py
@@ -225,7 +225,8 @@ def dump_Makefile():
 SUBDIRS=python
 INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include [EMAIL 
PROTECTED]@/include
 DEPS = $(top_builddir)/src/libvirt.la
-LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la
+LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la \
+   $(COVERAGE_LDFLAGS)

 rebuild: examples.xml index.html

diff --git a/qemud/Makefile.am b/qemud/Makefile.am
index 1e1f861..b39bc2f 100644
--- a/qemud/Makefile.am
+++ b/qemud/Makefile.am
@@ -47,18 +47,22 @@ libvirtd_SOURCES = \

 #-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
 libvirtd_CFLAGS = \
--I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
--I$(top_srcdir)/include -I$(top_builddir)/include \
-$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
-$(POLKIT_CFLAGS) \
-$(WARN_CFLAGS) -DLOCAL_STATE_DIR=\$(localstatedir)\ \
--DSYSCONF_DIR=\$(sysconfdir)\ \
+   -I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
+   -I$(top_srcdir)/include -I$(top_builddir)/include \
+   $(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
+   $(POLKIT_CFLAGS) \
+   $(WARN_CFLAGS) -DLOCAL_STATE_DIR=\$(localstatedir)\ \
+   $(COVERAGE_CFLAGS) \
+   -DSYSCONF_DIR=\$(sysconfdir)\ \
-DQEMUD_PID_FILE=\$(QEMUD_PID_FILE)\ \
-DREMOTE_PID_FILE=\$(REMOTE_PID_FILE)\ \
--DGETTEXT_PACKAGE=\$(PACKAGE)\
+   -DGETTEXT_PACKAGE=\$(PACKAGE)\
+
+libvirtd_LDFLAGS = \
+   $(WARN_CFLAGS) $(LIBXML_LIBS) $(GNUTLS_LIBS) $(SASL_LIBS) \
+   $(COVERAGE_LDFLAGS)
+   $(POLKIT_LIBS)

-libvirtd_LDFLAGS = $(WARN_CFLAGS) $(LIBXML_LIBS) $(GNUTLS_LIBS) $(SASL_LIBS) \
-   $(POLKIT_LIBS)
 libvirtd_DEPENDENCIES = ../src/libvirt.la
 libvirtd_LDADD = ../src/libvirt.la ../gnulib/lib/libgnu.la

@@ -144,7 +148,6 @@ libvirtd.init: libvirtd.init.in
chmod a+x [EMAIL PROTECTED]
mv [EMAIL PROTECTED] $@

-CLEANFILES = libvirtd.init
 else

 install-init:
@@ -153,3 +156,6 @@ uninstall-init:
 endif # DBUS_INIT_SCRIPTS_RED_HAT

 endif # WITH_LIBVIRTD
+
+CLEANFILES = libvirtd.init
+CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
diff --git a/src/Makefile.am b/src/Makefile.am
index 02be9db..c15de77 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -99,6 +99,25 @@ libvirt_la_LDFLAGS = 
-Wl,--version-script=$(srcdir)/libvirt_sym.version \
@CYGWIN_EXTRA_LDFLAGS@ @MINGW_EXTRA_LDFLAGS@
 libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT

+# Create an 

[Libvir] [PATCH] Rewrite test-coverage rules to accommodate multiple .o files per .c.

2008-02-27 Thread Jim Meyering
This makes the make -C src cov rule work with the addition of the
libvirt_test.la convenience library.  The trouble is that since there
are now two .o files per .c (one for the real libvirt library, and
another for the convenience library, libvirt_test.la, with no access
restrictions, for testing), when you generate test-coverage stats,
you have stats for each .c file in two different places, one for each
.o file.  This solves the problem by running gcov on each pair of .o files.

A minor twist: when profiling with --disable-shared, the .o files are in
., rather than in .libs/, so configure.in now records the dirname
in a new AC_SUBST'd variable, LV_LIBTOOL_OBJDIR, and src/Makefile.am
uses that.  Thus, profiling works with shared as well as static
libraries.


Rewrite test-coverage rules to accommodate multiple .o files per .c.
* src/Makefile.am (cov): Rewrite rule to merge gcov results 
corresponding
to two .o files: the libvirt_la- one, and the libvirt_test_la- one.
(tst): Remove unused rule.
* configure.in (LV_LIBTOOL_OBJDIR): Define and AC_SUBST.

Signed-off-by: Jim Meyering [EMAIL PROTECTED]
---
 configure.in|7 +++
 src/Makefile.am |   24 
 2 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/configure.in b/configure.in
index c2030c7..6367990 100644
--- a/configure.in
+++ b/configure.in
@@ -913,6 +913,13 @@ AC_SUBST(MINGW_EXTRA_LDFLAGS)

 AC_SYS_LARGEFILE

+# Set LV_LIBTOOL_OBJDIR to . or $lt_cv_objdir, depending on whether
+# we're building shared libraries.  This is the name of the directory
+# in which .o files will be created.
+test $enable_shared = no  lt_cv_objdir=.
+LV_LIBTOOL_OBJDIR=${lt_cv_objdir-.}
+AC_SUBST(LV_LIBTOOL_OBJDIR)
+
 # very annoying
 rm -f COPYING
 cp COPYING.LIB COPYING
diff --git a/src/Makefile.am b/src/Makefile.am
index c15de77..f8f2c4b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -137,20 +137,20 @@ else
 EXTRA_DIST += parthelper.c
 endif

-#
-# target to ease building test programs
-#
-tst: tst.c
-   $(CC) $(CFLAGS) $(INCLUDES) -I../include -o tst tst.c .libs/libvirt.a 
$(LIBXML_LIBS) $(VIRSH_LIBS) $(GNUTLS_LIBS) $(LIBS)
-
-COVERAGE_FILES = $(CLIENT_SOURCES:%.c=libvirt_la-%.cov)
-
-cov: clean-cov $(COVERAGE_FILES)
+cov: clean-cov
+   for i in $(CLIENT_SOURCES); do  \
+ case $$i in *.c) ;; *) continue;; esac;   \
+ b=$$(basename $$i .c);\
+ o_files=; \
+ for i in '' _test; do \
+   o=$(LV_LIBTOOL_OBJDIR)/libvirt$${i}_la-$$b.o; \
+   test -f $$o   \
+  o_files=$$o_files $$o;   \
+ done; \
+ gcov -b -f $$o_files  $$b.cov;   \
+   done

 clean-cov:
rm -f *.cov *.gcov

-%.cov: .libs/%.o
-   gcov -b -f -o .libs $  $@
-
 CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
--
1.5.4.3.231.gc0a6

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


Re: [Libvir] [PATCH] (for discussion) DHCP host mappings using 3 arrays API

2008-02-27 Thread Richard W.M. Jones
Here's the final version of the 3 arrays version of the patch, with
the memory corruptor fixed.

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v
Index: include/libvirt/libvirt.h.in
===
RCS file: /data/cvs/libvirt/include/libvirt/libvirt.h.in,v
retrieving revision 1.42
diff -u -r1.42 libvirt.h.in
--- include/libvirt/libvirt.h.in20 Feb 2008 14:57:39 -  1.42
+++ include/libvirt/libvirt.h.in27 Feb 2008 16:08:26 -
@@ -760,6 +760,27 @@
 intvirNetworkSetAutostart  (virNetworkPtr network,
 int autostart);
 
+/*
+ * DHCP host mappings
+ */
+int virNetworkNumOfDHCPHostMappings
+(virNetworkPtr network);
+int virNetworkListDHCPHostMappings
+(virNetworkPtr network,
+char **const hwaddrs,
+char **const ipaddrs,
+char **const hostnames,
+int maxmappings);
+
+int virNetworkAddDHCPHostMapping
+(virNetworkPtr network,
+const char *hwaddr,
+const char *ipaddr,
+const char *hostname,
+unsigned int flags);
+int virNetworkDeleteDHCPHostMapping
+(virNetworkPtr network,
+const char *hwaddr);
 
 /**
  * virStoragePool:
Index: qemud/remote.c
===
RCS file: /data/cvs/libvirt/qemud/remote.c,v
retrieving revision 1.24
diff -u -r1.24 remote.c
--- qemud/remote.c  22 Feb 2008 16:26:13 -  1.24
+++ qemud/remote.c  27 Feb 2008 16:08:28 -
@@ -2058,6 +2058,173 @@
 
 
 static int
+remoteDispatchNetworkNumOfDhcpHostMappings (struct qemud_server *server 
ATTRIBUTE_UNUSED,
+struct qemud_client *client,
+remote_message_header *req,
+
remote_network_num_of_dhcp_host_mappings_args *args,
+
remote_network_num_of_dhcp_host_mappings_ret *ret)
+{
+virNetworkPtr net;
+CHECK_CONN(client);
+
+net = get_nonnull_network (client-conn, args-net);
+if (net == NULL) {
+remoteDispatchError (client, req, network not found);
+return -2;
+}
+
+ret-num = virNetworkNumOfDHCPHostMappings (net);
+if (ret-num == -1) {
+virNetworkFree (net);
+return -1;
+}
+
+virNetworkFree (net);
+return 0;
+}
+
+
+static int
+remoteDispatchNetworkListDhcpHostMappings (struct qemud_server *server 
ATTRIBUTE_UNUSED,
+   struct qemud_client *client,
+   remote_message_header *req,
+   
remote_network_list_dhcp_host_mappings_args *args,
+   
remote_network_list_dhcp_host_mappings_ret *ret)
+{
+virNetworkPtr net;
+char **hwaddrs, **ipaddrs, **hostnames;
+int nr_mappings, i;
+CHECK_CONN(client);
+
+net = get_nonnull_network (client-conn, args-net);
+if (net == NULL) {
+remoteDispatchError (client, req, network not found);
+return -2;
+}
+
+if (args-maxmappings  REMOTE_NETWORK_DHCP_HOST_MAPPINGS_LIST_MAX) {
+remoteDispatchError (client, req,
+ maxmappings  
REMOTE_NETWORK_DHCP_HOST_MAPPINGS_LIST_MAX);
+return -2;
+}
+
+hwaddrs = malloc (args-maxmappings * sizeof (char *));
+if (!hwaddrs) {
+remoteDispatchSendError (client, req, VIR_ERR_NO_MEMORY, hwaddrs);
+return -2;
+}
+ipaddrs = malloc (args-maxmappings * sizeof (char *));
+if (!ipaddrs) {
+remoteDispatchSendError (client, req, VIR_ERR_NO_MEMORY, ipaddrs);
+free (hwaddrs);
+return -2;
+}
+hostnames = malloc (args-maxmappings * sizeof (char *));
+if (!hostnames) {
+remoteDispatchSendError (client, req, VIR_ERR_NO_MEMORY, hostnames);
+free (hwaddrs);
+free (ipaddrs);
+return -2;
+}
+
+nr_mappings = virNetworkListDHCPHostMappings (net,
+  hwaddrs, 

Re: [Libvir] [PATCH] Avoid link errors with configure --disable-shared.

2008-02-27 Thread Jim Meyering
Daniel P. Berrange [EMAIL PROTECTED] wrote:

 On Wed, Feb 27, 2008 at 04:52:21PM +0100, Jim Meyering wrote:
 I got link errors when building with --disable-shared, and finally
 fixed it.  Here's most of the solution.  The patch after this one
 adjusts the gcov (test-coverage)-related things so that works with
 the new setup, too.
 diff --git a/src/libvirt_sym.version b/src/libvirt_sym.version
 index 38b631e..581f380 100644
 --- a/src/libvirt_sym.version
 +++ b/src/libvirt_sym.version
 @@ -32,6 +32,7 @@
  virDomainLookupByName;
  virDomainLookupByUUID;
  virDomainLookupByUUIDString;
 +virDomainParseXMLDesc;

 This is not part of the public API.

Good catch.
I needed that with an earlier incarnation of this work,
but no longer.

 @@ -184,6 +185,8 @@
  __virBufferVSprintf;
  __virBufferAdd;
  __virBufferAddChar;
 +__virErrorMsg;
 +__virRaiseError;

 What uses these two symbols ? AFAIK they shoudl only ever be
 called by internal drivers and not exported

Same here.

With those adjustments, the only changes to libvirt_sym.version
are to remove some SPACE-before-TAB.

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


Re: [Libvir] [PATCH]Change MAC address to case insensitive

2008-02-27 Thread Richard W.M. Jones

This patch has been committed now.  Thanks for your contribution
to libvirt.

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v

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


Re: [Libvir] [PATCH] Avoid link errors with configure --disable-shared.

2008-02-27 Thread Daniel P. Berrange
On Wed, Feb 27, 2008 at 04:52:21PM +0100, Jim Meyering wrote:
 I got link errors when building with --disable-shared, and finally
 fixed it.  Here's most of the solution.  The patch after this one
 adjusts the gcov (test-coverage)-related things so that works with
 the new setup, too.
 diff --git a/src/libvirt_sym.version b/src/libvirt_sym.version
 index 38b631e..581f380 100644
 --- a/src/libvirt_sym.version
 +++ b/src/libvirt_sym.version
 @@ -32,6 +32,7 @@
   virDomainLookupByName;
   virDomainLookupByUUID;
   virDomainLookupByUUIDString;
 + virDomainParseXMLDesc;

This is not part of the public API.


 @@ -184,6 +185,8 @@
  __virBufferVSprintf;
  __virBufferAdd;
  __virBufferAddChar;
 +__virErrorMsg;
 +__virRaiseError;

What uses these two symbols ? AFAIK they shoudl only ever be
called by internal drivers and not exported

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-   Perl modules: http://search.cpan.org/~danberr/  -=|
|=-   Projects: http://freshmeat.net/~danielpb/   -=|
|=-  GnuPG: 7D3B9505   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: [Libvir] [PATCH] (for discussion) DHCP host mappings using 3 arrays API

2008-02-27 Thread Jim Meyering
Richard W.M. Jones [EMAIL PROTECTED] wrote:
 Here's the final version of the 3 arrays version of the patch, with
 the memory corruptor fixed.
...
 Index: src/qemu_driver.c
 ===
 RCS file: /data/cvs/libvirt/src/qemu_driver.c,v
 retrieving revision 1.57
 diff -u -r1.57 qemu_driver.c
 --- src/qemu_driver.c 27 Feb 2008 04:37:07 -  1.57
 +++ src/qemu_driver.c 27 Feb 2008 16:08:34 -
 @@ -925,6 +930,7 @@
  dhcpStartDhcpDaemon(virConnectPtr conn,
  struct qemud_network *network)
  {
 +char buf[PATH_MAX];
  char **argv;
  int ret, i;

 @@ -934,6 +940,15 @@
  return -1;
  }

 +/* Touch the DHCP hosts file so it exists before dnsmasq starts up. */
 +snprintf (buf, sizeof buf, DHCP_HOSTS_FORMAT, network-def-name);
 +ret = open (buf, O_CREAT|O_WRONLY, 0644);
 +if (ret == -1) {
 +qemudReportError (conn, NULL, NULL, VIR_ERR_SYSTEM_ERROR,
 +  %s: %s, buf, strerror (errno));
 +return -1;
 +}
 +
  argv = NULL;
  if (qemudBuildDnsmasqArgv(conn, network, argv)  0)
  return -1;

Whoops.  You'll want to close that file descriptor.
E.g., put this right before argv = NULL;:

if (close (ret))
return -1;

It'd be nice to declare a new variable, say fd, for that bit.

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


Re: [Libvir] [PATCH] (for discussion) DHCP host mappings using 3 arrays API

2008-02-27 Thread Richard W.M. Jones
On Wed, Feb 27, 2008 at 05:27:33PM +0100, Jim Meyering wrote:
 Whoops.  You'll want to close that file descriptor.
 E.g., put this right before argv = NULL;:
 
 if (close (ret))
 return -1;
 
 It'd be nice to declare a new variable, say fd, for that bit.

Oh yes, that would be a good idea :-)

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top

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


[Libvir] [PATCH] make qemud/'s rpcgen rules work

2008-02-27 Thread Jim Meyering
I applied Rich's patch and found that qemud/remote_protocol.c
was not automatically rebuilt.  Since the Makefile rule
is an implicit one using a non-default suffix (.x),
you have to tell make about the new suffix.
In straight make, you'd have to add .SUFFIXES: .x
but with automake, it is recommended to use the SUFFIXES variable:

Make qemud/'s rpcgen rules work.
* qemud/Makefile.am (SUFFIXES): Define to .x before implicit rule.

Signed-off-by: Jim Meyering [EMAIL PROTECTED]
---
 qemud/Makefile.am |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/qemud/Makefile.am b/qemud/Makefile.am
index 1e1f861..3094b18 100644
--- a/qemud/Makefile.am
+++ b/qemud/Makefile.am
@@ -14,6 +14,7 @@ EXTRA_DIST = libvirtd.init.in libvirtd.sysconf 
default-network.xml \
 libvirtd.conf

 if RPCGEN
+SUFFIXES = .x
 .x.c:
rm -f $@
rpcgen -c -o $@ $
--
1.5.4.3.231.gc0a6

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


Re: [Libvir] [PATCH] make qemud/'s rpcgen rules work

2008-02-27 Thread Richard W.M. Jones
On Wed, Feb 27, 2008 at 07:26:15PM +0100, Jim Meyering wrote:
 I applied Rich's patch and found that qemud/remote_protocol.c
 was not automatically rebuilt.  Since the Makefile rule
 is an implicit one using a non-default suffix (.x),
 you have to tell make about the new suffix.
 In straight make, you'd have to add .SUFFIXES: .x
 but with automake, it is recommended to use the SUFFIXES variable:
 
 Make qemud/'s rpcgen rules work.
   * qemud/Makefile.am (SUFFIXES): Define to .x before implicit rule.
 
 Signed-off-by: Jim Meyering [EMAIL PROTECTED]
 ---
  qemud/Makefile.am |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
 
 diff --git a/qemud/Makefile.am b/qemud/Makefile.am
 index 1e1f861..3094b18 100644
 --- a/qemud/Makefile.am
 +++ b/qemud/Makefile.am
 @@ -14,6 +14,7 @@ EXTRA_DIST = libvirtd.init.in libvirtd.sysconf 
 default-network.xml \
  libvirtd.conf
 
  if RPCGEN
 +SUFFIXES = .x
  .x.c:
   rm -f $@
   rpcgen -c -o $@ $

+1.

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v

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


Re: [Libvir] [PATCH] make qemud/'s rpcgen rules work

2008-02-27 Thread Jim Meyering
Richard W.M. Jones [EMAIL PROTECTED] wrote:
 On Wed, Feb 27, 2008 at 07:26:15PM +0100, Jim Meyering wrote:
 I applied Rich's patch and found that qemud/remote_protocol.c
 was not automatically rebuilt.  Since the Makefile rule
 is an implicit one using a non-default suffix (.x),
 you have to tell make about the new suffix.
 In straight make, you'd have to add .SUFFIXES: .x
 but with automake, it is recommended to use the SUFFIXES variable:

 Make qemud/'s rpcgen rules work.
  * qemud/Makefile.am (SUFFIXES): Define to .x before implicit rule.
...
 +1.

Thanks.  Committed.

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


Re: [Libvir] [PATCH] Use virErrorMsg in qemudReportError

2008-02-27 Thread Cole Robinson
Daniel P. Berrange wrote:
 On Wed, Feb 20, 2008 at 12:28:23PM -0500, Cole Robinson wrote:
 Currently the qemu driver doesn't use virErrorMsg when raising error
 messages. This causes some errors to appear as libvir: QEMU error: 
 if a custom string wasn't raised, which isn't all that useful. The
 patch below fixes this.
 
 Ah, cnice catch - surprised no one has noticed this before.
 
 Dan.

Hmm, I haven't seen this committed yet, I assume it was just forgotten.
Could this be applied if the patch is okay?

Thanks,
Cole

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


[Libvir] PATCH: Set mac address on TUN device to fix Xenner

2008-02-27 Thread Daniel P. Berrange

The QEMU driver pre-allocates a TAP device and connects it to a bridge
when using virtual networking. The FD associated with the tap device is
then passed to QEMU.

When running Xen guests, Xenner needs to turn this FD back into a TUN
device name. It does this by querying the hardware address of each NIC
and looking for the one which matches that it expects - ie its TUN device.
This obviously requires that the TUN device be configured with a MAC
address though. libvirt does not currently do this. This patch fixes this
and thus makes Xenner work from the QEMU driver when using virtual 
networking

With this patch applied, and the latest 'virt-install' from upstream
and the latest 'xenner' RPM from Fedora 9, it is now possible to
create Xen paravirt guests under KVM using virt-install. That said
there's a few more pending patch to cleanup various hacks.

 bridge.c|   14 ++
 bridge.h|1 +
 qemu_conf.c |1 +
 3 files changed, 16 insertions(+)

Dan.

Index: bridge.c
===
RCS file: /data/cvs/libvirt/src/bridge.c,v
retrieving revision 1.8
diff -u -p -r1.8 bridge.c
--- bridge.c5 Feb 2008 19:27:37 -   1.8
+++ bridge.c27 Feb 2008 21:32:44 -
@@ -42,6 +42,7 @@
 #include linux/sockios.h   /* SIOCBRADDBR etc.   */
 #include linux/if_bridge.h /* SYSFS_BRIDGE_ATTR  */
 #include linux/if_tun.h/* IFF_TUN, IFF_NO_PI */
+#include net/if_arp.h/* ARPHRD_ETHER */
 
 #include internal.h
 
@@ -312,6 +313,7 @@ brDeleteInterface(brControl *ctl ATTRIBU
 int
 brAddTap(brControl *ctl,
  const char *bridge,
+ unsigned char *macaddr,
  char *ifname,
  int maxlen,
  int *tapfd)
@@ -355,6 +357,18 @@ brAddTap(brControl *ctl,
 }
 
 if (ioctl(fd, TUNSETIFF, try) == 0) {
+struct ifreq addr;
+memset(addr, 0, sizeof(addr));
+memcpy(addr.ifr_hwaddr.sa_data, macaddr, 6);
+addr.ifr_hwaddr.sa_family = ARPHRD_ETHER;
+
+/* Device actually starts in 'UP' state, but it
+ * needs to be down to set the MAC addr
+ */
+if ((errno = brSetInterfaceUp(ctl, try.ifr_name, 0)))
+goto error;
+if (ioctl(fd, SIOCSIFHWADDR, addr) != 0)
+goto error;
 if ((errno = brAddInterface(ctl, bridge, try.ifr_name)))
 goto error;
 if ((errno = brSetInterfaceUp(ctl, try.ifr_name, 1)))
Index: bridge.h
===
RCS file: /data/cvs/libvirt/src/bridge.h,v
retrieving revision 1.4
diff -u -p -r1.4 bridge.h
--- bridge.h29 Jan 2008 18:15:54 -  1.4
+++ bridge.h27 Feb 2008 21:32:44 -
@@ -62,6 +62,7 @@ int brDeleteInterface   (brContr
 
 int brAddTap(brControl *ctl,
  const char *bridge,
+ unsigned char *mac,
  char *ifname,
  int maxlen,
  int *tapfd);
Index: qemu_conf.c
===
RCS file: /data/cvs/libvirt/src/qemu_conf.c,v
retrieving revision 1.38
diff -u -p -r1.38 qemu_conf.c
--- qemu_conf.c 27 Feb 2008 04:35:08 -  1.38
+++ qemu_conf.c 27 Feb 2008 21:32:44 -
@@ -1530,6 +1530,7 @@ qemudNetworkIfaceConnect(virConnectPtr c
 }
 
 if ((err = brAddTap(driver-brctl, brname,
+net-mac,
 ifname, BR_IFNAME_MAXLEN, tapfd))) {
 qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
  Failed to add tap interface '%s' to bridge '%s' : 
%s,


-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-   Perl modules: http://search.cpan.org/~danberr/  -=|
|=-   Projects: http://freshmeat.net/~danielpb/   -=|
|=-  GnuPG: 7D3B9505   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: [Libvir] PATCH: Set mac address on TUN device to fix Xenner

2008-02-27 Thread Daniel Veillard
On Wed, Feb 27, 2008 at 09:36:56PM +, Daniel P. Berrange wrote:
 
 The QEMU driver pre-allocates a TAP device and connects it to a bridge
 when using virtual networking. The FD associated with the tap device is
 then passed to QEMU.
 
 When running Xen guests, Xenner needs to turn this FD back into a TUN
 device name. It does this by querying the hardware address of each NIC
 and looking for the one which matches that it expects - ie its TUN device.
 This obviously requires that the TUN device be configured with a MAC
 address though. libvirt does not currently do this. This patch fixes this
 and thus makes Xenner work from the QEMU driver when using virtual 
 networking

  needed and looks clean to me, +1

Daniel

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

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


[Libvir] [Q] gnulib comment

2008-02-27 Thread Atsushi SAKAI
Hi, Jim

I have two questions on gnulib in libvirt.

1)tupe is typo?(I attach a patch.)
  (I do not guess the correct words, it is jargon?)
2)many NUL appeared on comment.
  Is the normal comment on gnulib?
  I think it should be NULL.

c.f.
I do spell check for my diversion.

Thanks
Atsushi SAKAI



gnulib_typo.patch
Description: Binary data
--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list