[libvirt] [PATCH] build: fix VPATH build with distributed generated files
by Eric Blake
* daemon/Makefile.am (DAEMON_GENERATED, remote_dispatch_*.h)
(qemu_dispatch_*.h): Update to live in srcdir, since they are
distributed.
Detected by Daniel P. Berrange's autobuilder.
---
Pushing under the build-breaker rule.
daemon/Makefile.am | 102 +++++++++++++++++++++++++++++++---------------------
1 files changed, 61 insertions(+), 41 deletions(-)
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 114adf3..f734c89 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -3,16 +3,16 @@
CLEANFILES =
DAEMON_GENERATED = \
- remote_dispatch_prototypes.h \
- remote_dispatch_table.h \
- remote_dispatch_args.h \
- remote_dispatch_ret.h \
- remote_dispatch_bodies.h \
- qemu_dispatch_prototypes.h \
- qemu_dispatch_table.h \
- qemu_dispatch_args.h \
- qemu_dispatch_ret.h \
- qemu_dispatch_bodies.h
+ $(srcdir)/remote_dispatch_prototypes.h \
+ $(srcdir)/remote_dispatch_table.h \
+ $(srcdir)/remote_dispatch_args.h \
+ $(srcdir)/remote_dispatch_ret.h \
+ $(srcdir)/remote_dispatch_bodies.h \
+ $(srcdir)/qemu_dispatch_prototypes.h \
+ $(srcdir)/qemu_dispatch_table.h \
+ $(srcdir)/qemu_dispatch_args.h \
+ $(srcdir)/qemu_dispatch_ret.h \
+ $(srcdir)/qemu_dispatch_bodies.h
DAEMON_SOURCES = \
libvirtd.c libvirtd.h \
@@ -186,7 +186,7 @@ CLEANFILES += probes.h probes.o
endif
install-data-local: install-init install-data-sasl install-data-polkit \
- install-logrotate
+ install-logrotate
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt
mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt
mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt
@@ -213,38 +213,58 @@ remote.h: $(DAEMON_GENERATED)
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x
QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x
-remote_dispatch_prototypes.h: $(srcdir)/remote_generator.pl $(REMOTE_PROTOCOL)
- $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -c -p remote $(REMOTE_PROTOCOL) > $@
-
-remote_dispatch_table.h: $(srcdir)/remote_generator.pl $(REMOTE_PROTOCOL)
- $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -c -t remote $(REMOTE_PROTOCOL) > $@
-
-remote_dispatch_args.h: $(srcdir)/remote_generator.pl $(REMOTE_PROTOCOL)
- $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -c -a remote $(REMOTE_PROTOCOL) > $@
-
-remote_dispatch_ret.h: $(srcdir)/remote_generator.pl $(REMOTE_PROTOCOL)
- $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -c -r remote $(REMOTE_PROTOCOL) > $@
-
-remote_dispatch_bodies.h: $(srcdir)/remote_generator.pl $(REMOTE_PROTOCOL)
- $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -c -b remote $(REMOTE_PROTOCOL) > $@
-
-qemu_dispatch_prototypes.h: $(srcdir)/remote_generator.pl $(QEMU_PROTOCOL)
- $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -p qemu $(QEMU_PROTOCOL) > $@
-
-qemu_dispatch_table.h: $(srcdir)/remote_generator.pl $(QEMU_PROTOCOL)
- $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -t qemu $(QEMU_PROTOCOL) > $@
-
-qemu_dispatch_args.h: $(srcdir)/remote_generator.pl $(QEMU_PROTOCOL)
- $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -a qemu $(QEMU_PROTOCOL) > $@
-
-qemu_dispatch_ret.h: $(srcdir)/remote_generator.pl $(QEMU_PROTOCOL)
- $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -r qemu $(QEMU_PROTOCOL) > $@
-
-qemu_dispatch_bodies.h: $(srcdir)/remote_generator.pl $(QEMU_PROTOCOL)
- $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -b qemu $(QEMU_PROTOCOL) > $@
+$(srcdir)/remote_dispatch_prototypes.h: $(srcdir)/remote_generator.pl \
+ $(REMOTE_PROTOCOL)
+ $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -c -p remote \
+ $(REMOTE_PROTOCOL) > $@
+
+$(srcdir)/remote_dispatch_table.h: $(srcdir)/remote_generator.pl \
+ $(REMOTE_PROTOCOL)
+ $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -c -t remote \
+ $(REMOTE_PROTOCOL) > $@
+
+$(srcdir)/remote_dispatch_args.h: $(srcdir)/remote_generator.pl \
+ $(REMOTE_PROTOCOL)
+ $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -c -a remote \
+ $(REMOTE_PROTOCOL) > $@
+
+$(srcdir)/remote_dispatch_ret.h: $(srcdir)/remote_generator.pl \
+ $(REMOTE_PROTOCOL)
+ $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -c -r remote \
+ $(REMOTE_PROTOCOL) > $@
+
+$(srcdir)/remote_dispatch_bodies.h: $(srcdir)/remote_generator.pl \
+ $(REMOTE_PROTOCOL)
+ $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -c -b remote \
+ $(REMOTE_PROTOCOL) > $@
+
+$(srcdir)/qemu_dispatch_prototypes.h: $(srcdir)/remote_generator.pl \
+ $(QEMU_PROTOCOL)
+ $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -p qemu \
+ $(QEMU_PROTOCOL) > $@
+
+$(srcdir)/qemu_dispatch_table.h: $(srcdir)/remote_generator.pl \
+ $(QEMU_PROTOCOL)
+ $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -t qemu \
+ $(QEMU_PROTOCOL) > $@
+
+$(srcdir)/qemu_dispatch_args.h: $(srcdir)/remote_generator.pl \
+ $(QEMU_PROTOCOL)
+ $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -a qemu \
+ $(QEMU_PROTOCOL) > $@
+
+$(srcdir)/qemu_dispatch_ret.h: $(srcdir)/remote_generator.pl \
+ $(QEMU_PROTOCOL)
+ $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -r qemu \
+ $(QEMU_PROTOCOL) > $@
+
+$(srcdir)/qemu_dispatch_bodies.h: $(srcdir)/remote_generator.pl \
+ $(QEMU_PROTOCOL)
+ $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -b qemu \
+ $(QEMU_PROTOCOL) > $@
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
- libvirtd.uml.logrotate libvirtd.logrotate
+ libvirtd.uml.logrotate libvirtd.logrotate
BUILT_SOURCES += $(LOGROTATE_CONFS)
--
1.7.4.4
13 years, 7 months
[libvirt] [PATCH] docs: avoid double 'the'
by Eric Blake
* docs/testsuites.html.in: Keep 'make syntax-check' happy.
---
Pushing under the build-breaker rule.
docs/testsuites.html.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/docs/testsuites.html.in b/docs/testsuites.html.in
index 86fd5ef..4441d94 100644
--- a/docs/testsuites.html.in
+++ b/docs/testsuites.html.in
@@ -29,7 +29,7 @@
<a href="python.html">Python bindings</a>
of libvirt. It is available separately as a
<a href="ftp://libvirt.org/libvirt/libvirt-test-API/">download</a>,
- or directly get the
+ or directly get
the <a href="http://libvirt.org/git/?p=libvirt-test-API.git">version
from GIT</a>.
</ul>
--
1.7.4.4
13 years, 7 months
[libvirt] Crash state and QEMU
by Anthony Liguori
Hi,
As far as I can tell, if QEMU exits abruptly or with a non-zero status
code, libvirt treats this as a domain destruction given no real
indication to the user that something bad happened.
But libvirt does have a crashed state for domains, it's just not used
for QEMU guests.
I was wondering how intention of a design decision this was. Right now
there's no good way for a management tool to detect a crashed
guest/QEMU. Is there something I'm overlooking?
Regards,
Anthony Liguori
13 years, 7 months
[libvirt] [PATCH] Documentation on tests suites and new API test suite
by Daniel Veillard
This is really a dual mail. The main point is announcing the
availability of the livirt-test-API, a GPL'ed Python based test
suite for libvirt functional testing. It was developped independantly
of the TCK by our QA group here in Beijing China and is now made
open-source. The software requirements are relatively light and
it has been tested on RHEL various versions (5.x and 6.x) as well as
Fedora 14. It should be relatively easy to use on Centos, SL,
but use on other distributions may need a bit of porting.
It has been in use for quite some time,, it is still in development
and the public repository is in libvirt.org git at:
http://libvirt.org/git/?p=libvirt-test-API.git
and can be cloned with
git clone git://libvirt.org/libvirt-test-API.git
there is some pblican based documentation under the docs/ subtree and
we have a PDF ready ans well as snapshots in the download tree
http://libvirt.org/sources/libvirt-test-API/
ftp://libvirt.org/libvirt/libvirt-test-API/
There is a lot of improvements possible, it should be relatively
easy to glue to autotest (c.f. chapter 5 of the PDF), and there is
definitely cleanups to be done :-) , I think the best way to proceed
is to just send git patches here on the libvir-list and have them
reviewed and ACK'ed. People with commit access should be able to
push as usual, note that I added Guannan Ren <gren(a)redhat.com>
as a commiter for this purpose since he has much expertise with that
code (along with Osier).
Now for the patch itself, it add a top level section in the
navigation bar, provide a main description page for the 3 test suites
(internal, TCK and libvirt-test-API) and then add a separate full
page for the 2 independant test suite.
I hesitated between creating a new doc section and trying to reuse
one existing, but it didn't fit well in any of the existing section,
though that could have been added under "Download" or "Related links"
but it was feeling a bit weird in both case so I opted for a new top
level.
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
13 years, 7 months
[libvirt] [PATCH 0/2] xen/libxl: support enabling or disabling the HPET
by Paolo Bonzini
This patch series add support for enabling or disabling the HPET
in Xen domains. It's split in two because I didn't have means to test
the libxl part.
Paolo Bonzini (2):
xen: parse and generate hpet item in sxpr
libxl: support enabling the HPET
src/libxl/libxl_conf.c | 8 ++++
src/xenxs/xen_sxpr.c | 26 +++++++++++
src/xenxs/xen_xm.c | 26 +++++++++++
tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.sexpr | 9 ++++
tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml | 44 +++++++++++++++++++
.../sexpr2xmldata/sexpr2xml-fv-force-nohpet.sexpr | 9 ++++
tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml | 44 +++++++++++++++++++
tests/sexpr2xmltest.c | 2 +
tests/xmconfigdata/test-fullvirt-force-hpet.cfg | 26 +++++++++++
tests/xmconfigdata/test-fullvirt-force-hpet.xml | 45 ++++++++++++++++++++
tests/xmconfigdata/test-fullvirt-force-nohpet.cfg | 26 +++++++++++
tests/xmconfigdata/test-fullvirt-force-nohpet.xml | 45 ++++++++++++++++++++
tests/xmconfigtest.c | 3 +
tests/xml2sexprdata/xml2sexpr-fv-force-hpet.sexpr | 9 ++++
tests/xml2sexprdata/xml2sexpr-fv-force-hpet.xml | 39 +++++++++++++++++
.../xml2sexprdata/xml2sexpr-fv-force-nohpet.sexpr | 9 ++++
tests/xml2sexprdata/xml2sexpr-fv-force-nohpet.xml | 39 +++++++++++++++++
tests/xml2sexprtest.c | 2 +
18 files changed, 411 insertions(+), 0 deletions(-)
create mode 100644 tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.sexpr
create mode 100644 tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml
create mode 100644 tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.sexpr
create mode 100644 tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml
create mode 100644 tests/xmconfigdata/test-fullvirt-force-hpet.cfg
create mode 100644 tests/xmconfigdata/test-fullvirt-force-hpet.xml
create mode 100644 tests/xmconfigdata/test-fullvirt-force-nohpet.cfg
create mode 100644 tests/xmconfigdata/test-fullvirt-force-nohpet.xml
create mode 100644 tests/xml2sexprdata/xml2sexpr-fv-force-hpet.sexpr
create mode 100644 tests/xml2sexprdata/xml2sexpr-fv-force-hpet.xml
create mode 100644 tests/xml2sexprdata/xml2sexpr-fv-force-nohpet.sexpr
create mode 100644 tests/xml2sexprdata/xml2sexpr-fv-force-nohpet.xml
--
1.7.4.4
13 years, 7 months
[libvirt] how to assign an ip when assign a NIC or VF to the Virtual Machine?
by guan qin
Hi,
I use the *Intel Virtualization Technology for Directed I/O*(VT-d) or
*Single-Root
I/O Virtualization*(SR-IOV) to assign a network card or Virtual Function(VF)
to a Virtual Machine(VM) to access the network by the hostdev element in
libvirt Domain XML.
But the ethX in the VM hasn't an ip,I must to enter the VM to assign an ip
to the VM manually.
So how can I assign an ip to the VM when assign the NIC or VF to the VM
?thanks.
best regards,
qinguan
13 years, 7 months
[libvirt] [PATCH 2/2] docs: updates to CA cert and client cert/key info
by Doug Goldstein
Update the documentation to mention that the CA certificate and the
client cert/key pair can come from the user's location or the global
location independent of each other.
Signed-off-by: Doug Goldstein <cardoe(a)gentoo.org>
---
docs/remote.html.in | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/docs/remote.html.in b/docs/remote.html.in
index 33dbba2..42eb14c 100644
--- a/docs/remote.html.in
+++ b/docs/remote.html.in
@@ -395,10 +395,13 @@ next section.
</p>
<ul>
<li> For a non-root user, libvirt tries to find the certificates
- in $HOME/.pki/libvirt. If any of the required certificates can
- not be found, then the global default locations
- (/etc/pki/CA/cacert.pem, /etc/pki/libvirt/private/clientkey,
- /etc/pki/libvirt/clientcert.pem) will be used.
+ in $HOME/.pki/libvirt. If the required CA certificate can
+ not be found, then the global default location
+ (/etc/pki/CA/cacert.pem) will be used.
+ Likewise, if either the client certificate
+ or the client key can not be found, then the global default
+ locations (/etc/pki/libvirt/clientcert.pem,
+ /etc/pki/libvirt/private/clientkey.pem) will be used.
</li>
<li> For the root user, the global default locations will be used.</li>
</ul>
--
1.7.5.rc3
13 years, 7 months
[libvirt] [PATCH 1/2] virsh: flexibility in CA cert and user cert/key
by Doug Goldstein
Allow the CA certificate to come from the user's home directory or from
the global location independently of the client certificate/key pair.
Mostly for the case when each user on a system has their own cert/key
pair but the system as a whole shares the same CA.
Signed-off-by: Doug Goldstein <cardoe(a)gentoo.org>
---
src/remote/remote_driver.c | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 4c3bdf3..9965d38 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -1222,21 +1222,26 @@ initialize_gnutls(char *pkipath, int flags)
"clientcert.pem")) < 0)
goto out_of_memory;
- /* Use default location as long as one of CA certificate,
+ /* Use the default location of the CA certificate if it
+ * cannot be found in $HOME/.pki/libvirt
+ */
+ if (!virFileExists(libvirt_cacert)) {
+ VIR_FREE(libvirt_cacert);
+
+ libvirt_cacert = strdup(LIBVIRT_CACERT);
+ if (!libvirt_cacert) goto out_of_memory;
+ }
+
+ /* Use default location as long as one of
* client key, and client certificate cannot be found in
* $HOME/.pki/libvirt, we don't want to make user confused
* with one file is here, the other is there.
*/
- if (!virFileExists(libvirt_cacert) ||
- !virFileExists(libvirt_clientkey) ||
+ if (!virFileExists(libvirt_clientkey) ||
!virFileExists(libvirt_clientcert)) {
- VIR_FREE(libvirt_cacert);
VIR_FREE(libvirt_clientkey);
VIR_FREE(libvirt_clientcert);
- libvirt_cacert = strdup(LIBVIRT_CACERT);
- if (!libvirt_cacert) goto out_of_memory;
-
libvirt_clientkey = strdup(LIBVIRT_CLIENTKEY);
if (!libvirt_clientkey) goto out_of_memory;
--
1.7.5.rc3
13 years, 7 months
[libvirt] [PATCH] Remove all generated RPC files from GIT
by Daniel P. Berrange
commit 7a2fd256cb85dd9a9d6640d9faed0b66ca617411
Author: Daniel P. Berrange <berrange(a)redhat.com>
Date: Fri May 6 13:36:21 2011 +0100
Remove all generated files for remote protocol
Stop storing the generated files for the remote protocol client
and server in source control. The generated files will still be
included in the result of 'make dist' to avoid end-users needing
to generate the files
* daemon/Makefile.am: Removed generated files with
maintainer-clean target
* src/Makefile.am: Removed generated files with
maintainer-clean target. Always run 'rpcgen' if
generated files are missing
NB: hand edited diff to remove the huge deleted files
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index af71188..49e94d2 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -2,11 +2,7 @@
CLEANFILES =
-DAEMON_SOURCES = \
- libvirtd.c libvirtd.h \
- remote.c remote.h \
- dispatch.c dispatch.h \
- stream.c stream.h \
+DAEMON_GENERATED = \
remote_dispatch_prototypes.h \
remote_dispatch_table.h \
remote_dispatch_args.h \
@@ -14,9 +10,16 @@ DAEMON_SOURCES = \
qemu_dispatch_prototypes.h \
qemu_dispatch_table.h \
qemu_dispatch_args.h \
- qemu_dispatch_ret.h \
+ qemu_dispatch_ret.h
+
+DAEMON_SOURCES = \
+ libvirtd.c libvirtd.h \
+ remote.c remote.h \
+ dispatch.c dispatch.h \
+ stream.c stream.h \
../src/remote/remote_protocol.c \
- ../src/remote/qemu_protocol.c
+ ../src/remote/qemu_protocol.c \
+ $(DAEMON_GENERATED)
AVAHI_SOURCES = \
mdns.c mdns.h
@@ -201,17 +204,8 @@ uninstall-data-polkit::
endif
-remote.c: \
- remote_dispatch_prototypes.h \
- remote_dispatch_table.h \
- qemu_dispatch_prototypes.h \
- qemu_dispatch_table.h
-
-remote.h: \
- remote_dispatch_args.h \
- remote_dispatch_ret.h \
- qemu_dispatch_args.h \
- qemu_dispatch_ret.h
+remote.c: $(DAEMON_GENERATED)
+remote.h: $(DAEMON_GENERATED)
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x
QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x
@@ -350,4 +344,4 @@ endif
CLEANFILES += $(BUILT_SOURCES) $(man8_MANS)
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
-MAINTAINERCLEANFILES = $(srcdir)/libvirtd.8.in
+MAINTAINERCLEANFILES = $(srcdir)/libvirtd.8.in $(DAEMON_GENERATED)
diff --git a/daemon/qemu_dispatch_args.h b/daemon/qemu_dispatch_args.h
deleted file mode 100644
index e278fa4..0000000
--- a/daemon/qemu_dispatch_args.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Automatically generated by remote_generate_stubs.pl.
- * Do not edit this file. Any changes you make will be lost.
- */
-
- qemu_monitor_command_args val_qemu_monitor_command_args;
diff --git a/daemon/qemu_dispatch_prototypes.h b/daemon/qemu_dispatch_prototypes.h
deleted file mode 100644
index 4ec1ab4..0000000
--- a/daemon/qemu_dispatch_prototypes.h
+++ /dev/null
diff --git a/daemon/qemu_dispatch_ret.h b/daemon/qemu_dispatch_ret.h
deleted file mode 100644
index 492dcf9..0000000
--- a/daemon/qemu_dispatch_ret.h
+++ /dev/null
diff --git a/daemon/qemu_dispatch_table.h b/daemon/qemu_dispatch_table.h
deleted file mode 100644
index c196a3c..0000000
--- a/daemon/qemu_dispatch_table.h
+++ /dev/null
diff --git a/daemon/remote_dispatch_args.h b/daemon/remote_dispatch_args.h
deleted file mode 100644
index f9537d7..0000000
--- a/daemon/remote_dispatch_args.h
+++ /dev/null
diff --git a/daemon/remote_dispatch_prototypes.h b/daemon/remote_dispatch_prototypes.h
deleted file mode 100644
index cf2f38c..0000000
--- a/daemon/remote_dispatch_prototypes.h
+++ /dev/null
diff --git a/daemon/remote_dispatch_ret.h b/daemon/remote_dispatch_ret.h
deleted file mode 100644
index 114e832..0000000
--- a/daemon/remote_dispatch_ret.h
+++ /dev/null
diff --git a/daemon/remote_dispatch_table.h b/daemon/remote_dispatch_table.h
deleted file mode 100644
index b39f7c2..0000000
--- a/daemon/remote_dispatch_table.h
+++ /dev/null
diff --git a/src/Makefile.am b/src/Makefile.am
index 1eaa7d1..00c5e04 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -154,15 +154,22 @@ CONF_SOURCES = \
$(CPU_CONF_SOURCES)
# The remote RPC driver, covering domains, storage, networks, etc
-REMOTE_DRIVER_SOURCES = \
- gnutls_1_0_compat.h \
- remote/remote_driver.c remote/remote_driver.h \
+REMOTE_DRIVER_GENERATED = \
remote/remote_protocol.c \
remote/remote_protocol.h \
remote/qemu_protocol.c \
remote/qemu_protocol.h
-EXTRA_DIST += remote/remote_protocol.x remote/qemu_protocol.x \
+REMOTE_DRIVER_PROTOCOL = \
+ remote/remote_protocol.x \
+ remote/qemu_protocol.x
+
+REMOTE_DRIVER_SOURCES = \
+ gnutls_1_0_compat.h \
+ remote/remote_driver.c remote/remote_driver.h \
+ $(REMOTE_DRIVER_GENERATED)
+
+EXTRA_DIST += $(REMOTE_DRIVER_PROTOCOL) \
remote/rpcgen_fix.pl
# Ensure that we don't change the struct or member names or member ordering
@@ -528,68 +535,17 @@ libvirt_driver_remote_la_LDFLAGS += -module -avoid-version
endif
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
-if HAVE_RPCGEN
-#
-# Maintainer-only target for re-generating the derived .c/.h source
-# files, which are actually derived from the .x file.
-#
-# For committing protocol changes to GIT, the GLIBC rpcgen *must*
-# be used.
-#
-# Support for non-GLIB rpcgen is here as a convenience for
-# non-Linux people needing to test changes during dev.
-#
-rpcgen-normal:
- rm -f rp.c-t rp.h-t rp.c-t1 rp.c-t2 rp.h-t1
- $(RPCGEN) -h -o rp.h-t $(srcdir)/remote/remote_protocol.x
- $(RPCGEN) -c -o rp.c-t $(srcdir)/remote/remote_protocol.x
-if HAVE_GLIBC_RPCGEN
- perl -w $(srcdir)/remote/rpcgen_fix.pl rp.h-t > rp.h-t1
- perl -w $(srcdir)/remote/rpcgen_fix.pl rp.c-t > rp.c-t1
- (echo '#include <config.h>'; cat rp.c-t1) > rp.c-t2
- chmod 0444 rp.c-t2 rp.h-t1
- mv -f rp.h-t1 $(srcdir)/remote/remote_protocol.h
- mv -f rp.c-t2 $(srcdir)/remote/remote_protocol.c
- rm -f rp.c-t rp.h-t rp.c-t1
-else
- chmod 0444 rp.c-t rp.h-t
- mv -f rp.h-t $(srcdir)/remote/remote_protocol.h
- mv -f rp.c-t $(srcdir)/remote/remote_protocol.c
-endif
-
-rpcgen-qemu:
- rm -f rp_qemu.c-t rp_qemu.h-t rp_qemu.c-t1 rp_qemu.c-t2 rp_qemu.h-t1
- $(RPCGEN) -h -o rp_qemu.h-t $(srcdir)/remote/qemu_protocol.x
- $(RPCGEN) -c -o rp_qemu.c-t $(srcdir)/remote/qemu_protocol.x
-if HAVE_GLIBC_RPCGEN
- perl -w $(srcdir)/remote/rpcgen_fix.pl rp_qemu.h-t > rp_qemu.h-t1
- perl -w $(srcdir)/remote/rpcgen_fix.pl rp_qemu.c-t > rp_qemu.c-t1
- (echo '#include <config.h>'; cat rp_qemu.c-t1) > rp_qemu.c-t2
- chmod 0444 rp_qemu.c-t2 rp_qemu.h-t1
- mv -f rp_qemu.h-t1 $(srcdir)/remote/qemu_protocol.h
- mv -f rp_qemu.c-t2 $(srcdir)/remote/qemu_protocol.c
- rm -f rp_qemu.c-t rp_qemu.h-t rp_qemu.c-t1
-else
- chmod 0444 rp_qemu.c-t rp_qemu.h-t
- mv -f rp_qemu.h-t $(srcdir)/remote/qemu_protocol.h
- mv -f rp_qemu.c-t $(srcdir)/remote/qemu_protocol.c
-endif
-#
-# Maintainer-only target for re-generating the derived .c/.h source
-# files, which are actually derived from the .x file.
-#
-# For committing protocol changes to GIT, the GLIBC rpcgen *must*
-# be used.
-#
-# Support for non-GLIB rpcgen is here as a convenience for
-# non-Linux people needing to test changes during dev.
-#
-rpcgen: rpcgen-normal rpcgen-qemu
+remote/remote_driver.c: $(REMOTE_DRIVER_GENERATED)
-endif
+remote/%_protocol.c: remote/%_protocol.x remote/%_protocol.h
+ $(AM_V_GEN)perl -w $(srcdir)/remote/rpcgen_fix.pl $(RPCGEN) -c \
+ $< $@
+
+remote/%_protocol.h: remote/%_protocol.x
+ $(AM_V_GEN)perl -w $(srcdir)/remote/rpcgen_fix.pl $(RPCGEN) -h \
+ $< $@
-remote/remote_protocol.c: remote/remote_protocol.h
endif
if WITH_XEN
@@ -1339,3 +1295,4 @@ endif
CLEANFILES = *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES = $(BUILT_SOURCES)
+MAINTAINERCLEANFILES = $(REMOTE_DRIVER_GENERATED)
diff --git a/src/remote/qemu_protocol.c b/src/remote/qemu_protocol.c
deleted file mode 100644
index 81916ed..0000000
--- a/src/remote/qemu_protocol.c
+++ /dev/null
diff --git a/src/remote/qemu_protocol.h b/src/remote/qemu_protocol.h
deleted file mode 100644
index b822187..0000000
--- a/src/remote/qemu_protocol.h
+++ /dev/null
diff --git a/src/remote/remote_protocol.c b/src/remote/remote_protocol.c
deleted file mode 100644
index 5604371..0000000
--- a/src/remote/remote_protocol.c
+++ /dev/null
diff --git a/src/remote/remote_protocol.h b/src/remote/remote_protocol.h
deleted file mode 100644
index d9bf151..0000000
--- a/src/remote/remote_protocol.h
+++ /dev/null
diff --git a/src/remote/rpcgen_fix.pl b/src/remote/rpcgen_fix.pl
index 3cf5479..d11bbd4 100644
--- a/src/remote/rpcgen_fix.pl
+++ b/src/remote/rpcgen_fix.pl
@@ -1,4 +1,6 @@
-# Fix XDR code (generated by rpcgen) so that it compiles
+#
+# Generate code for an XDR protocol, optionally applying
+# fixups to the glibc rpcgen code so that it compiles
# with warnings turned on.
#
# This code is evil. Arguably better would be just to compile
@@ -17,10 +19,35 @@ use strict;
my $in_function = 0;
my @function = ();
-while (<>) {
+my $rpcgen = shift;
+my $mode = shift;
+my $xdrdef = shift;
+my $target = shift;
+
+unlink $target;
+
+open RPCGEN, "-|", $rpcgen, $mode, $xdrdef
+ or die "cannot run $rpcgen $mode $xdrdef: $!";
+open TARGET, ">$target"
+ or die "cannot create $target: $!";
+
+my $fixup = $^O eq "linux";
+
+if ($mode eq "-c") {
+ print TARGET "#include <config.h>\n";
+}
+
+while (<RPCGEN>) {
+ # We only want to fixup the GLibc rpcgen output
+ # So just print data unchanged, if non-Linux
+ unless ($fixup) {
+ print TARGET;
+ next;
+ }
+
if (m/^{/) {
$in_function = 1;
- print;
+ print TARGET;
next;
}
@@ -79,13 +106,21 @@ while (<>) {
map { s/\bXDR_INLINE\b/(int32_t*)XDR_INLINE/; $_ }
@function;
- print (join ("", @function));
+ print TARGET (join ("", @function));
@function = ();
}
unless ($in_function) {
- print;
+ print TARGET;
} else {
push @function, $_;
}
}
+
+close TARGET
+ or die "cannot save $target: $!";
+close RPCGEN
+ or die "cannot shutdown $rpcgen: $!";
+
+chmod 0444, $target
+ or die "cannot set $target readonly: $!";
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
13 years, 7 months