[libvirt] [PATCH] Remove all generated RPC files from GIT

commit 7a2fd256cb85dd9a9d6640d9faed0b66ca617411 Author: Daniel P. Berrange <berrange@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 :|

On 05/06/2011 07:11 AM, Daniel P. Berrange wrote:
commit 7a2fd256cb85dd9a9d6640d9faed0b66ca617411 Author: Daniel P. Berrange <berrange@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
Thanks for doing that. However, it means that 'git am' didn't like this patch, so I hope I tested it correctly. At any rate, after applying your patch, removing the generated files, then running 'make dist', and comparing that to a 'make dist' pre-patch, the minor differences were all expected (in the Makefiles, not in the generated files).
-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)
More than strictly necessary, but I suppose it doesn't hurt, since all the generated files will have similar timestamps anyways. Certainly more compact :)
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)
Yep, that's the right approach for something that gets generated into $(srcdir) for use in the distribution, but which does not need to be rebuilt by normal users.
@@ -528,68 +535,17 @@ libvirt_driver_remote_la_LDFLAGS += -module -avoid-version endif libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
-if HAVE_RPCGEN
-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 \ + $< $@
Let's make bootstrap.conf mention that rpcgen is now a bootstrap prerequisite.
+++ 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";
I guess I'll see what happens when I try this on Cygwin, but if there are any followups needed, it should be separate patches. As is, cygwin already can't use -Werror because of repetitive declarations in the tirpc headers that trigger one of our default set of gcc warnings.
+ +chmod 0444, $target + or die "cannot set $target readonly: $!";
Nice touch, to help us remember that it is generated. ACK with this squashed in: diff --git i/bootstrap.conf w/bootstrap.conf index 09e8218..2d27846 100644 --- i/bootstrap.conf +++ w/bootstrap.conf @@ -169,6 +169,7 @@ gzip - libtool - perl 5.5 pkg-config - +rpcgen - tar - " diff --git i/src/remote/rpcgen_fix.pl w/src/remote/rpcgen_fix.pl index d11bbd4..4edba98 100644 --- i/src/remote/rpcgen_fix.pl +++ w/src/remote/rpcgen_fix.pl @@ -1,4 +1,4 @@ -# +# # Generate code for an XDR protocol, optionally applying # fixups to the glibc rpcgen code so that it compiles # with warnings turned on. @@ -8,7 +8,7 @@ # actually fixes for 64 bit, so this file is necessary. Arguably # so is the type-punning fix. # -# Copyright (C) 2007 Red Hat, Inc. +# Copyright (C) 2007, 2011 Red Hat, Inc. # # See COPYING for the license of this software. # diff --git i/.gitignore w/.gitignore index 803f2a3..86afa8d 100644 --- i/.gitignore +++ w/.gitignore @@ -34,6 +34,7 @@ /config.sub /configure /configure.lineno +/daemon/*_dispatch_*.h /gnulib/ /libtool /libvirt-*.tar.gz @@ -49,6 +50,7 @@ /po/* /proxy/ /src/libvirt_iohelper +/src/remote/*_protocol.[ch] /tests/*.log /tests/cputest /tests/hashtest -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 05/06/2011 10:11 AM, Eric Blake wrote:
On 05/06/2011 07:11 AM, Daniel P. Berrange wrote: Thanks for doing that. However, it means that 'git am' didn't like this patch, so I hope I tested it correctly. At any rate, after applying your patch, removing the generated files, then running 'make dist', and comparing that to a 'make dist' pre-patch, the minor differences were all expected (in the Makefiles, not in the generated files).
And now that Matthias' patches are in, this no longer applies. I'm working on rebasing/refactoring the series to account for the newly generated files in Matthias' series, and will post shortly. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

And now that Matthias' patches are in, this no longer applies. I'm working on rebasing/refactoring the series to account for the newly generated files in Matthias' series, and will post shortly.
I split Daniel's v1 into two pieces, and only had to manually trim patch 3/3. I also discovered a flaw in 'make syntax-check' that has to be fixed upstream in gnulib first; expect a 4/3 that fixes that shortly. Daniel P. Berrange (2): build: refactor generated RPC files build: Remove all generated RPC files from GIT Eric Blake (1): build: rename generated files to .h, for automake's sake .gitignore | 3 + bootstrap.conf | 1 + cfg.mk | 10 +- daemon/Makefile.am | 43 +- daemon/qemu_dispatch_args.h | 5 - daemon/qemu_dispatch_bodies.c | 5 - daemon/qemu_dispatch_prototypes.h | 12 - daemon/qemu_dispatch_ret.h | 5 - daemon/qemu_dispatch_table.h | 14 - daemon/remote.c | 4 +- daemon/remote_dispatch_args.h | 180 -- daemon/remote_dispatch_bodies.c | 5932 ----------------------------------- daemon/remote_dispatch_prototypes.h | 1620 ---------- daemon/remote_dispatch_ret.h | 142 - daemon/remote_dispatch_table.h | 1054 ------- daemon/remote_generator.pl | 4 +- po/POTFILES.in | 2 - src/Makefile.am | 101 +- src/remote/qemu_client_bodies.c | 3 - src/remote/qemu_protocol.c | 41 - src/remote/qemu_protocol.h | 57 - src/remote/remote_client_bodies.c | 4663 --------------------------- src/remote/remote_driver.c | 4 +- src/remote/remote_protocol.c | 3996 ----------------------- src/remote/remote_protocol.h | 3167 ------------------- src/remote/rpcgen_fix.pl | 47 +- 26 files changed, 102 insertions(+), 21013 deletions(-) delete mode 100644 daemon/qemu_dispatch_args.h delete mode 100644 daemon/qemu_dispatch_bodies.c delete mode 100644 daemon/qemu_dispatch_prototypes.h delete mode 100644 daemon/qemu_dispatch_ret.h delete mode 100644 daemon/qemu_dispatch_table.h delete mode 100644 daemon/remote_dispatch_args.h delete mode 100644 daemon/remote_dispatch_bodies.c delete mode 100644 daemon/remote_dispatch_prototypes.h delete mode 100644 daemon/remote_dispatch_ret.h delete mode 100644 daemon/remote_dispatch_table.h delete mode 100644 src/remote/qemu_client_bodies.c delete mode 100644 src/remote/qemu_protocol.c delete mode 100644 src/remote/qemu_protocol.h delete mode 100644 src/remote/remote_client_bodies.c delete mode 100644 src/remote/remote_protocol.c delete mode 100644 src/remote/remote_protocol.h -- 1.7.4.4

In preparation for removing generated files, it is necessary to tell automake that the generated files must be distributed but not directly compiled (since they are included into the body of a larger .c file that is compiled). Hence, even though these files are code and not headers in the strict sense of the word, it is easier to rename them to .h for automake's sake. * daemon/remote_client_bodies.c: Rename to .h. * daemon/qemu_client_bodies.c: Likewise. * src/remote/remote_client_bodies.c: Likewise. * src/remote/qemu_client_bodies.c: Likewise. * daemon/Makefile.am (remote_dispatch_bodies.c) (qemu_dispatch_bodies.c): Rename to .h. (remote.c, EXTRA_DIST): Reflect rename. * daemon/remote.c: Likewise. * daemon/remote_generator.pl: Likewise. * src/Makefile.am (remote/remote_driver.c): Likewise. * src/remote/remote_driver.c: Likewise. * po/POTFILES.in: Likewise. * cfg.mk (exclude_file_name_regexp--sc_require_config_h) (exclude_file_name_regexp--sc_require_config_h_first) (exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF): Likewise. --- cfg.mk | 8 +++----- daemon/Makefile.am | 12 ++++++------ ...mu_dispatch_bodies.c => qemu_dispatch_bodies.h} | 0 daemon/remote.c | 4 ++-- ..._dispatch_bodies.c => remote_dispatch_bodies.h} | 0 daemon/remote_generator.pl | 4 ++-- po/POTFILES.in | 4 ++-- src/Makefile.am | 8 ++++---- .../{qemu_client_bodies.c => qemu_client_bodies.h} | 0 ...mote_client_bodies.c => remote_client_bodies.h} | 0 src/remote/remote_driver.c | 4 ++-- 11 files changed, 21 insertions(+), 23 deletions(-) rename daemon/{qemu_dispatch_bodies.c => qemu_dispatch_bodies.h} (100%) rename daemon/{remote_dispatch_bodies.c => remote_dispatch_bodies.h} (100%) rename src/remote/{qemu_client_bodies.c => qemu_client_bodies.h} (100%) rename src/remote/{remote_client_bodies.c => remote_client_bodies.h} (100%) diff --git a/cfg.mk b/cfg.mk index d80f3d5..27ed929 100644 --- a/cfg.mk +++ b/cfg.mk @@ -614,7 +614,7 @@ exclude_file_name_regexp--sc_prohibit_close = \ exclude_file_name_regexp--sc_prohibit_doubled_word = ^po/ exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = \ - (^docs/api_extension/|^tests/qemuhelpdata/|\.(gif|ico|png)$$|^daemon/.*_dispatch_bodies\.c$$|^src/remote/.*_client_bodies\.c$$) + (^docs/api_extension/|^tests/qemuhelpdata/|\.(gif|ico|png)$$|^daemon/.*_dispatch_bodies\.h$$|^src/remote/.*_client_bodies\.h$$) _src2=src/(util/util|libvirt|lxc/lxc_controller) exclude_file_name_regexp--sc_prohibit_fork_wrappers = \ @@ -639,11 +639,9 @@ exclude_file_name_regexp--sc_prohibit_strncpy = \ exclude_file_name_regexp--sc_prohibit_xmlGetProp = ^src/util/xml\.c$$ -exclude_file_name_regexp--sc_require_config_h = \ - ^(examples/|daemon/.*_dispatch_bodies\.c$$|src/remote/.*_client_bodies\.c$$) +exclude_file_name_regexp--sc_require_config_h = ^examples/ -exclude_file_name_regexp--sc_require_config_h_first = \ - ^(examples/|daemon/.*_dispatch_bodies\.c$$|src/remote/.*_client_bodies\.c$$) +exclude_file_name_regexp--sc_require_config_h_first = ^examples/ exclude_file_name_regexp--sc_trailing_blank = (^docs/|\.(fig|gif|ico|png)$$) diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 3dec183..c6f4d29 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -24,8 +24,8 @@ AVAHI_SOURCES = \ DISTCLEANFILES = EXTRA_DIST = \ remote_generator.pl \ - remote_dispatch_bodies.c \ - qemu_dispatch_bodies.c \ + remote_dispatch_bodies.h \ + qemu_dispatch_bodies.h \ libvirtd.conf \ libvirtd.init.in \ libvirtd.upstart \ @@ -206,10 +206,10 @@ endif remote.c: \ remote_dispatch_prototypes.h \ remote_dispatch_table.h \ - remote_dispatch_bodies.c \ + remote_dispatch_bodies.h \ qemu_dispatch_prototypes.h \ qemu_dispatch_table.h \ - qemu_dispatch_bodies.c + qemu_dispatch_bodies.h remote.h: \ remote_dispatch_args.h \ @@ -232,7 +232,7 @@ remote_dispatch_args.h: $(srcdir)/remote_generator.pl $(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.c: $(srcdir)/remote_generator.pl $(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) @@ -247,7 +247,7 @@ qemu_dispatch_args.h: $(srcdir)/remote_generator.pl $(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.c: $(srcdir)/remote_generator.pl $(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) > $@ LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \ diff --git a/daemon/qemu_dispatch_bodies.c b/daemon/qemu_dispatch_bodies.h similarity index 100% rename from daemon/qemu_dispatch_bodies.c rename to daemon/qemu_dispatch_bodies.h diff --git a/daemon/remote.c b/daemon/remote.c index 883f181..2220655 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -2985,8 +2985,8 @@ cleanup: return rv; } -#include "remote_dispatch_bodies.c" -#include "qemu_dispatch_bodies.c" +#include "remote_dispatch_bodies.h" +#include "qemu_dispatch_bodies.h" /*----- Helpers. -----*/ diff --git a/daemon/remote_dispatch_bodies.c b/daemon/remote_dispatch_bodies.h similarity index 100% rename from daemon/remote_dispatch_bodies.c rename to daemon/remote_dispatch_bodies.h diff --git a/daemon/remote_generator.pl b/daemon/remote_generator.pl index bb1978f..062ccc1 100755 --- a/daemon/remote_generator.pl +++ b/daemon/remote_generator.pl @@ -236,7 +236,7 @@ elsif ($opt_t) { } } -# Bodies for dispatch functions ("remote_dispatch_bodies.c"). +# Bodies for dispatch functions ("remote_dispatch_bodies.h"). elsif ($opt_b) { # list of functions that currently are not generatable my @ungeneratable; @@ -726,7 +726,7 @@ elsif ($opt_b) { } } -# Bodies for client functions ("remote_client_bodies.c"). +# Bodies for client functions ("remote_client_bodies.h"). elsif ($opt_k) { # list of functions that currently are not generatable my @ungeneratable; diff --git a/po/POTFILES.in b/po/POTFILES.in index 8ecb6a0..7f5156c 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -2,7 +2,7 @@ daemon/dispatch.c daemon/libvirtd.c daemon/remote.c daemon/stream.c -daemon/remote_dispatch_bodies.c +daemon/remote_dispatch_bodies.h src/conf/cpu_conf.c src/conf/domain_conf.c src/conf/domain_event.c @@ -64,7 +64,7 @@ src/qemu/qemu_monitor.c src/qemu/qemu_monitor_json.c src/qemu/qemu_monitor_text.c src/qemu/qemu_process.c -src/remote/remote_client_bodies.c +src/remote/remote_client_bodies.h src/remote/remote_driver.c src/secret/secret_driver.c src/security/security_apparmor.c diff --git a/src/Makefile.am b/src/Makefile.am index 8ba176d..962c6f9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -162,19 +162,19 @@ REMOTE_DRIVER_SOURCES = \ remote/qemu_protocol.c \ remote/qemu_protocol.h -remote/remote_driver.c: remote/remote_client_bodies.c remote/qemu_client_bodies.c +remote/remote_driver.c: remote/remote_client_bodies.h remote/qemu_client_bodies.h REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x -remote/remote_client_bodies.c: $(top_srcdir)/daemon/remote_generator.pl $(REMOTE_PROTOCOL) +remote/remote_client_bodies.h: $(top_srcdir)/daemon/remote_generator.pl $(REMOTE_PROTOCOL) $(AM_V_GEN)perl -w $(top_srcdir)/daemon/remote_generator.pl -c -k remote $(REMOTE_PROTOCOL) > $@ -remote/qemu_client_bodies.c: $(top_srcdir)/daemon/remote_generator.pl $(QEMU_PROTOCOL) +remote/qemu_client_bodies.h: $(top_srcdir)/daemon/remote_generator.pl $(QEMU_PROTOCOL) $(AM_V_GEN)perl -w $(top_srcdir)/daemon/remote_generator.pl -k remote $(QEMU_PROTOCOL) > $@ EXTRA_DIST += remote/remote_protocol.x remote/qemu_protocol.x \ - remote/rpcgen_fix.pl remote/remote_client_bodies.c remote/qemu_client_bodies.c + remote/rpcgen_fix.pl remote/remote_client_bodies.h remote/qemu_client_bodies.h # Ensure that we don't change the struct or member names or member ordering # in remote_protocol.x The embedded perl below needs a few comments, and diff --git a/src/remote/qemu_client_bodies.c b/src/remote/qemu_client_bodies.h similarity index 100% rename from src/remote/qemu_client_bodies.c rename to src/remote/qemu_client_bodies.h diff --git a/src/remote/remote_client_bodies.c b/src/remote/remote_client_bodies.h similarity index 100% rename from src/remote/remote_client_bodies.c rename to src/remote/remote_client_bodies.h diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 4dfeab6..d076a90 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -4962,8 +4962,8 @@ done: return rv; } -#include "remote_client_bodies.c" -#include "qemu_client_bodies.c" +#include "remote_client_bodies.h" +#include "qemu_client_bodies.h" /*----------------------------------------------------------------------*/ -- 1.7.4.4

2011/5/6 Eric Blake <eblake@redhat.com>:
In preparation for removing generated files, it is necessary to tell automake that the generated files must be distributed but not directly compiled (since they are included into the body of a larger .c file that is compiled). Hence, even though these files are code and not headers in the strict sense of the word, it is easier to rename them to .h for automake's sake.
* daemon/remote_client_bodies.c: Rename to .h. * daemon/qemu_client_bodies.c: Likewise. * src/remote/remote_client_bodies.c: Likewise. * src/remote/qemu_client_bodies.c: Likewise. * daemon/Makefile.am (remote_dispatch_bodies.c) (qemu_dispatch_bodies.c): Rename to .h. (remote.c, EXTRA_DIST): Reflect rename. * daemon/remote.c: Likewise. * daemon/remote_generator.pl: Likewise. * src/Makefile.am (remote/remote_driver.c): Likewise. * src/remote/remote_driver.c: Likewise. * po/POTFILES.in: Likewise. * cfg.mk (exclude_file_name_regexp--sc_require_config_h) (exclude_file_name_regexp--sc_require_config_h_first) (exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF): Likewise. --- cfg.mk | 8 +++----- daemon/Makefile.am | 12 ++++++------ ...mu_dispatch_bodies.c => qemu_dispatch_bodies.h} | 0 daemon/remote.c | 4 ++-- ..._dispatch_bodies.c => remote_dispatch_bodies.h} | 0 daemon/remote_generator.pl | 4 ++-- po/POTFILES.in | 4 ++-- src/Makefile.am | 8 ++++---- .../{qemu_client_bodies.c => qemu_client_bodies.h} | 0 ...mote_client_bodies.c => remote_client_bodies.h} | 0 src/remote/remote_driver.c | 4 ++-- 11 files changed, 21 insertions(+), 23 deletions(-) rename daemon/{qemu_dispatch_bodies.c => qemu_dispatch_bodies.h} (100%) rename daemon/{remote_dispatch_bodies.c => remote_dispatch_bodies.h} (100%) rename src/remote/{qemu_client_bodies.c => qemu_client_bodies.h} (100%) rename src/remote/{remote_client_bodies.c => remote_client_bodies.h} (100%)
ACK. Matthias

Make sure that xgettext scans generated files for translatable strings, rather than just files stored in libvirt.git. * .gnulib: Update, for bootstrap and syntax-check fixes. * bootstrap: Resynchronize with gnulib. * cfg.mk (generated_files): Define. * po/POTFILES.in: Add more files with _(). --- As promised, here's the fix for the dropped translations in 3/3. * .gnulib 3864a29...a6676cc (53):
maintainer-makefile: make sc_po_check easier to tune fclose: guarantee behavior on seekable stdin fflush, fpurge: Relicense under LGPLv2+. rm exit module maint.mk: use info-gnu@ as the default only for a stable release assert-h: new module, which supports C1X-style static_assert fclose, fflush: Respect rules for use of AC_LIBOBJ. fflush, fseeko: Respect rules for use of AC_LIBOBJ. tzset: Relicense under LGPL. strtoimax, strtoumax: Relicense under LGPL. getgroups: Relicense under LGPL. nanosleep: Relicense under LGPL. futimens: Relicense under LGPL. fflush: Relicense under LGPL. tmpfile: Relicense under LGPL. isfinite: Relicense under LGPL. acosl..tanl: Relicense under LGPL. signal: Define sighandler_t. maint: remove useless REPLACE_*_H macros do-release-commit-and-tag: add option to specify branch Avoid unnecessary compilation units, through conditional dependencies. Support for conditional dependencies. test-getaddrinfo: report error information bootstrap: avoid build failure when $GZIP is set readme-release: new module with release instructions fflush: also replace fclose when fixing fflush fclose: add some tests fclose: reduce dependencies exit: drop remaining clients freading: relax license from LGPLv3+ to LGPLv2+ fchdir: Remove unused dependencies. gnulib-tool: Refactor. exit: Remove module. Update DEPENDENCIES. gnulib-tool: Reduce code duplication. Revert "netdb: Fix invalid C syntax." commit from 2011-04-30. fclose: don't fail on non-seekable input stream dup3: cleanup netdb: Make it work in C++ mode. New modules 'vfscanf', 'vscanf'. passfd: Add comments. sys_uio: Make <sys/uio.h> self-contained. sys_socket: Ensure 'struct iovec' definition. sys_uio: Protect definition of 'struct iovec'. manywarnings: fix indentation netdb: Fix invalid C syntax. manywarnings: add -Wno-missing-field-initializers if needed maint: indent ChangeLog with TAB consistently announce-gen: cosmetic improvement vc-list-files: indent with spaces, not TABs announce-gen: indent with spaces, not TABs quotearg: avoid uninitialized variable use maint.mk: remove unused VC-tag variable
.gnulib | 2 +- bootstrap | 7 +++++-- cfg.mk | 8 ++++++++ po/POTFILES.in | 3 +++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.gnulib b/.gnulib index 3864a29..a6676cc 160000 --- a/.gnulib +++ b/.gnulib @@ -1 +1 @@ -Subproject commit 3864a29763baff1d01895a57f73729fd53cc5fbf +Subproject commit a6676cca6498ce67c5a3c8d7221b8d6c30b61dc4 diff --git a/bootstrap b/bootstrap index 7cbb5dc..d91611b 100755 --- a/bootstrap +++ b/bootstrap @@ -1,6 +1,6 @@ #! /bin/sh # Print a version string. -scriptversion=2011-04-05.18; # UTC +scriptversion=2011-05-03.08; # UTC # Bootstrap this package from checked-out sources. @@ -421,7 +421,10 @@ check_versions() { # Honor $APP variables ($TAR, $AUTOCONF, etc.) appvar=`echo $app | tr '[a-z]-' '[A-Z]_'` test "$appvar" = TAR && appvar=AMTAR - eval "app=\${$appvar-$app}" + case $appvar in + GZIP) ;; # Do not use $GZIP: it contains gzip options. + *) eval "app=\${$appvar-$app}" ;; + esac inst_ver=$(get_version $app) if [ ! "$inst_ver" ]; then echo "$me: Error: '$app' not found" >&2 diff --git a/cfg.mk b/cfg.mk index 1deb6ba..9ae3f42 100644 --- a/cfg.mk +++ b/cfg.mk @@ -28,6 +28,14 @@ url_dir_list = \ # We use .gnulib, not gnulib. gnulib_dir = $(srcdir)/.gnulib +# List of additional files that we want to pick up in our POTFILES.in +# This is all gnulib files, as well as generated files for RPC code. +generated_files = \ + $(srcdir)/daemon/*_dispatch_*.h \ + $(srcdir)/src/remote/*_client_bodies.h \ + $(srcdir)/src/remote/*_protocol.[ch] \ + $(srcdir)/gnulib/lib/*.[ch] + # Tests not to run as part of "make distcheck". local-checks-to-skip = \ changelog-check \ diff --git a/po/POTFILES.in b/po/POTFILES.in index 766f8f6..96180d5 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,7 +1,9 @@ daemon/dispatch.c daemon/libvirtd.c daemon/remote.c +daemon/remote_dispatch_bodies.h daemon/stream.c +gnulib/lib/gai_strerror.c src/conf/cpu_conf.c src/conf/domain_conf.c src/conf/domain_event.c @@ -63,6 +65,7 @@ src/qemu/qemu_monitor.c src/qemu/qemu_monitor_json.c src/qemu/qemu_monitor_text.c src/qemu/qemu_process.c +src/remote/remote_client_bodies.h src/remote/remote_driver.c src/secret/secret_driver.c src/security/security_apparmor.c -- 1.7.4.4

2011/5/7 Eric Blake <eblake@redhat.com>:
Make sure that xgettext scans generated files for translatable strings, rather than just files stored in libvirt.git.
* .gnulib: Update, for bootstrap and syntax-check fixes. * bootstrap: Resynchronize with gnulib. * cfg.mk (generated_files): Define. * po/POTFILES.in: Add more files with _(). ---
As promised, here's the fix for the dropped translations in 3/3.
ACK. Matthias

On 05/07/2011 06:07 AM, Matthias Bolte wrote:
2011/5/7 Eric Blake <eblake@redhat.com>:
Make sure that xgettext scans generated files for translatable strings, rather than just files stored in libvirt.git.
* .gnulib: Update, for bootstrap and syntax-check fixes. * bootstrap: Resynchronize with gnulib. * cfg.mk (generated_files): Define. * po/POTFILES.in: Add more files with _(). ---
As promised, here's the fix for the dropped translations in 3/3.
ACK.
Thanks; I've pushed this. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 05/06/2011 04:07 PM, Eric Blake wrote:
Make sure that xgettext scans generated files for translatable strings, rather than just files stored in libvirt.git.
* .gnulib: Update, for bootstrap and syntax-check fixes. * bootstrap: Resynchronize with gnulib. * cfg.mk (generated_files): Define. * po/POTFILES.in: Add more files with _().
---
As promised, here's the fix for the dropped translations in 3/3.
* .gnulib 3864a29...a6676cc (53):
maintainer-makefile: make sc_po_check easier to tune fclose: guarantee behavior on seekable stdin
Eek. This patch introduces a double-close() bug in the gnulib fclose() replacement. And glibc's fclose() is buggy on seekable stdin (http://sourceware.org/bugzilla/show_bug.cgi?id=12724) which means libvirt is now vulnerable until I fix the gnulib fclose() replacement. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

* src/Makefile.am (REMOTE_DRIVER_GENERATED): Generated files should live in $(srcdir). Update rules to reflect this. --- This still doesn't fix the fact that 'make dist' under WITH_REMOTE false is broken, but one thing at a time. src/Makefile.am | 37 +++++++++++++++++++------------------ 1 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index b7ea8d8..cea3d39 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -155,24 +155,24 @@ CONF_SOURCES = \ # The remote RPC driver, covering domains, storage, networks, etc REMOTE_DRIVER_GENERATED = \ - remote/remote_protocol.c \ - remote/remote_protocol.h \ - remote/remote_client_bodies.h \ - remote/qemu_protocol.c \ - remote/qemu_protocol.h \ - remote/qemu_client_bodies.h - -REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x -QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x + $(srcdir)/remote/remote_protocol.c \ + $(srcdir)/remote/remote_protocol.h \ + $(srcdir)/remote/remote_client_bodies.h \ + $(srcdir)/remote/qemu_protocol.c \ + $(srcdir)/remote/qemu_protocol.h \ + $(srcdir)/remote/qemu_client_bodies.h + +REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x +QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL) -remote/remote_client_bodies.h: $(top_srcdir)/daemon/remote_generator.pl \ - $(REMOTE_PROTOCOL) +$(srcdir)/remote/remote_client_bodies.h: $(REMOTE_PROTOCOL) \ + $(top_srcdir)/daemon/remote_generator.pl $(AM_V_GEN)perl -w $(top_srcdir)/daemon/remote_generator.pl \ -c -k remote $(REMOTE_PROTOCOL) > $@ -remote/qemu_client_bodies.h: $(top_srcdir)/daemon/remote_generator.pl \ - $(QEMU_PROTOCOL) +$(srcdir)/remote/qemu_client_bodies.h: $(QEMU_PROTOCOL) \ + $(top_srcdir)/daemon/remote_generator.pl $(AM_V_GEN)perl -w $(top_srcdir)/daemon/remote_generator.pl \ -k qemu $(QEMU_PROTOCOL) > $@ @@ -549,15 +549,16 @@ endif libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES) -remote/remote_driver.c: $(REMOTE_DRIVER_GENERATED) +$(srcdir)/remote/remote_driver.c: $(REMOTE_DRIVER_GENERATED) -remote/%_protocol.c: remote/%_protocol.x remote/%_protocol.h +$(srcdir)/remote/%_protocol.c: $(srcdir)/remote/%_protocol.x \ + $(srcdir)/remote/%_protocol.h $(AM_V_GEN)perl -w $(srcdir)/remote/rpcgen_fix.pl $(RPCGEN) -c \ - $< $@ + $< $@ -remote/%_protocol.h: remote/%_protocol.x +$(srcdir)/remote/%_protocol.h: $(srcdir)/remote/%_protocol.x $(AM_V_GEN)perl -w $(srcdir)/remote/rpcgen_fix.pl $(RPCGEN) -h \ - $< $@ + $< $@ endif -- 1.7.4.4

2011/5/7 Eric Blake <eblake@redhat.com>:
* src/Makefile.am (REMOTE_DRIVER_GENERATED): Generated files should live in $(srcdir). Update rules to reflect this. ---
This still doesn't fix the fact that 'make dist' under WITH_REMOTE false is broken, but one thing at a time.
src/Makefile.am | 37 +++++++++++++++++++------------------ 1 files changed, 19 insertions(+), 18 deletions(-)
ACK. Matthias

On Sat, May 07, 2011 at 14:18:35 +0200, Matthias Bolte wrote:
2011/5/7 Eric Blake <eblake@redhat.com>:
* src/Makefile.am (REMOTE_DRIVER_GENERATED): Generated files should live in $(srcdir). Update rules to reflect this. ---
This still doesn't fix the fact that 'make dist' under WITH_REMOTE false is broken, but one thing at a time.
src/Makefile.am | 37 +++++++++++++++++++------------------ 1 files changed, 19 insertions(+), 18 deletions(-)
ACK.
I went ahead and pushed this patch. Jirka

Noticed this while trying to run rpcgen on cygwin. * src/Makefile.am ($(srcdir)/remote/%_protocol.h) ($(srcdir)/remote/%_protocol.c): Add a dependency. --- Cygwin still needs rpcgen_fix.pl to do stuff, since right now it has LOADS of warnings, then dies with: remote/remote_protocol.c: In function 'xdr_remote_node_get_cells_free_memory_arg s': remote/remote_protocol.c:656: warning: unused variable 'buf' [-Wunused-variable] remote/remote_protocol.c: In function 'xdr_remote_node_get_cells_free_memory_ret ': remote/remote_protocol.c:671: error: 'xdr_quad_t' undeclared (first use in this function) Unfortunately, I've run out of time to complete the fix today, but at a first pass, I fixed the Makefile dependencies. src/Makefile.am | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index cea3d39..75ece49 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -552,11 +552,12 @@ libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES) $(srcdir)/remote/remote_driver.c: $(REMOTE_DRIVER_GENERATED) $(srcdir)/remote/%_protocol.c: $(srcdir)/remote/%_protocol.x \ - $(srcdir)/remote/%_protocol.h + $(srcdir)/remote/%_protocol.h $(srcdir)/remote/rpcgen_fix.pl $(AM_V_GEN)perl -w $(srcdir)/remote/rpcgen_fix.pl $(RPCGEN) -c \ $< $@ -$(srcdir)/remote/%_protocol.h: $(srcdir)/remote/%_protocol.x +$(srcdir)/remote/%_protocol.h: $(srcdir)/remote/%_protocol.x \ + $(srcdir)/remote/rpcgen_fix.pl $(AM_V_GEN)perl -w $(srcdir)/remote/rpcgen_fix.pl $(RPCGEN) -h \ $< $@ -- 1.7.4.4

2011/5/7 Eric Blake <eblake@redhat.com>:
Noticed this while trying to run rpcgen on cygwin.
* src/Makefile.am ($(srcdir)/remote/%_protocol.h) ($(srcdir)/remote/%_protocol.c): Add a dependency. ---
ACK. Matthias

On Sat, May 07, 2011 at 14:20:22 +0200, Matthias Bolte wrote:
2011/5/7 Eric Blake <eblake@redhat.com>:
Noticed this while trying to run rpcgen on cygwin.
* src/Makefile.am ($(srcdir)/remote/%_protocol.h) ($(srcdir)/remote/%_protocol.c): Add a dependency. ---
ACK.
And while at it, I pushed this patch as well. Jirka

From: Daniel P. Berrange <berrange@redhat.com> Always generate the rpc files, and require rpcgen during bootstrap. * 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 --- bootstrap.conf | 1 + daemon/Makefile.am | 35 ++++++--------- src/Makefile.am | 101 ++++++++++++----------------------------- src/remote/remote_protocol.c | 2 +- src/remote/rpcgen_fix.pl | 47 +++++++++++++++++--- 5 files changed, 87 insertions(+), 99 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 09e8218..2d27846 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -169,6 +169,7 @@ gzip - libtool - perl 5.5 pkg-config - +rpcgen - tar - " diff --git a/daemon/Makefile.am b/daemon/Makefile.am index c6f4d29..114adf3 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -2,21 +2,26 @@ 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 \ 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 + +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 @@ -202,20 +207,8 @@ install-data-polkit:: uninstall-data-polkit:: endif - -remote.c: \ - remote_dispatch_prototypes.h \ - remote_dispatch_table.h \ - remote_dispatch_bodies.h \ - qemu_dispatch_prototypes.h \ - qemu_dispatch_table.h \ - qemu_dispatch_bodies.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 @@ -360,4 +353,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/src/Makefile.am b/src/Makefile.am index 962c6f9..b7ea8d8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -154,27 +154,36 @@ 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/remote_client_bodies.h \ remote/qemu_protocol.c \ - remote/qemu_protocol.h - -remote/remote_driver.c: remote/remote_client_bodies.h remote/qemu_client_bodies.h + remote/qemu_protocol.h \ + remote/qemu_client_bodies.h REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x +REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL) -remote/remote_client_bodies.h: $(top_srcdir)/daemon/remote_generator.pl $(REMOTE_PROTOCOL) - $(AM_V_GEN)perl -w $(top_srcdir)/daemon/remote_generator.pl -c -k remote $(REMOTE_PROTOCOL) > $@ +remote/remote_client_bodies.h: $(top_srcdir)/daemon/remote_generator.pl \ + $(REMOTE_PROTOCOL) + $(AM_V_GEN)perl -w $(top_srcdir)/daemon/remote_generator.pl \ + -c -k remote $(REMOTE_PROTOCOL) > $@ -remote/qemu_client_bodies.h: $(top_srcdir)/daemon/remote_generator.pl $(QEMU_PROTOCOL) - $(AM_V_GEN)perl -w $(top_srcdir)/daemon/remote_generator.pl -k remote $(QEMU_PROTOCOL) > $@ +remote/qemu_client_bodies.h: $(top_srcdir)/daemon/remote_generator.pl \ + $(QEMU_PROTOCOL) + $(AM_V_GEN)perl -w $(top_srcdir)/daemon/remote_generator.pl \ + -k qemu $(QEMU_PROTOCOL) > $@ + +REMOTE_DRIVER_SOURCES = \ + gnutls_1_0_compat.h \ + remote/remote_driver.c remote/remote_driver.h \ + $(REMOTE_DRIVER_GENERATED) -EXTRA_DIST += remote/remote_protocol.x remote/qemu_protocol.x \ - remote/rpcgen_fix.pl remote/remote_client_bodies.h remote/qemu_client_bodies.h +EXTRA_DIST += $(REMOTE_DRIVER_PROTOCOL) \ + $(REMOTE_DRIVER_GENERATED) \ + remote/rpcgen_fix.pl # Ensure that we don't change the struct or member names or member ordering # in remote_protocol.x The embedded perl below needs a few comments, and @@ -539,68 +548,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 @@ -1350,3 +1308,4 @@ endif CLEANFILES = *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s DISTCLEANFILES = $(BUILT_SOURCES) +MAINTAINERCLEANFILES = $(REMOTE_DRIVER_GENERATED) diff --git a/src/remote/remote_protocol.c b/src/remote/remote_protocol.c index 301ffbf..84bc617 100644 --- a/src/remote/remote_protocol.c +++ b/src/remote/remote_protocol.c @@ -4,7 +4,7 @@ * It was generated using rpcgen. */ -#include "remote_protocol.h" +#include "remote/remote_protocol.h" #include "internal.h" #include <arpa/inet.h> #ifdef HAVE_XDR_U_INT64_T diff --git a/src/remote/rpcgen_fix.pl b/src/remote/rpcgen_fix.pl index 3cf5479..4edba98 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 @@ -6,7 +8,7 @@ # actually fixes for 64 bit, so this file is necessary. Arguably # so is the type-punning fix. # -# Copyright (C) 2007 Red Hat, Inc. +# Copyright (C) 2007, 2011 Red Hat, Inc. # # See COPYING for the license of this software. # @@ -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: $!"; -- 1.7.4.4

From: Daniel P. Berrange <berrange@redhat.com> 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 Unfortunately, this means that the strings marked for translation in generated files are not picked up by gnulib's syntax-check, I'm working on fixing that in gnulib. * .gitignore, cfg.mk, po/POTFILES.in: Reflect deletion. --- Manually edited to elide deletions. .gitignore | 3 + cfg.mk | 4 +- daemon/qemu_dispatch_args.h | 5 - daemon/qemu_dispatch_bodies.h | 5 - daemon/qemu_dispatch_prototypes.h | 12 - daemon/qemu_dispatch_ret.h | 5 - daemon/qemu_dispatch_table.h | 14 - daemon/remote_dispatch_args.h | 180 -- daemon/remote_dispatch_bodies.h | 5932 ----------------------------------- daemon/remote_dispatch_prototypes.h | 1620 ---------- daemon/remote_dispatch_ret.h | 142 - daemon/remote_dispatch_table.h | 1054 ------- po/POTFILES.in | 2 - src/remote/qemu_client_bodies.h | 3 - src/remote/qemu_protocol.c | 41 - src/remote/qemu_protocol.h | 57 - src/remote/remote_client_bodies.h | 4663 --------------------------- src/remote/remote_protocol.c | 3996 ----------------------- src/remote/remote_protocol.h | 3167 ------------------- 19 files changed, 4 insertions(+), 20901 deletions(-) delete mode 100644 daemon/qemu_dispatch_args.h delete mode 100644 daemon/qemu_dispatch_bodies.h delete mode 100644 daemon/qemu_dispatch_prototypes.h delete mode 100644 daemon/qemu_dispatch_ret.h delete mode 100644 daemon/qemu_dispatch_table.h delete mode 100644 daemon/remote_dispatch_args.h delete mode 100644 daemon/remote_dispatch_bodies.h delete mode 100644 daemon/remote_dispatch_prototypes.h delete mode 100644 daemon/remote_dispatch_ret.h delete mode 100644 daemon/remote_dispatch_table.h delete mode 100644 src/remote/qemu_client_bodies.h delete mode 100644 src/remote/qemu_protocol.c delete mode 100644 src/remote/qemu_protocol.h delete mode 100644 src/remote/remote_client_bodies.h delete mode 100644 src/remote/remote_protocol.c delete mode 100644 src/remote/remote_protocol.h diff --git a/.gitignore b/.gitignore index 803f2a3..87a105f 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ /config.sub /configure /configure.lineno +/daemon/*_dispatch_*.h /gnulib/ /libtool /libvirt-*.tar.gz @@ -49,6 +50,8 @@ /po/* /proxy/ /src/libvirt_iohelper +/src/remote/*_client_bodies.h +/src/remote/*_protocol.[ch] /tests/*.log /tests/cputest /tests/hashtest diff --git a/cfg.mk b/cfg.mk index 27ed929..1deb6ba 100644 --- a/cfg.mk +++ b/cfg.mk @@ -495,8 +495,6 @@ sc_prohibit_newline_at_end_of_diagnostic: && { echo '$(ME): newline at end of message(s)' 1>&2; \ exit 1; } || : -# Regex for grep -E that exempts generated files from style rules. -preprocessor_exempt = ((qemu|remote)_(driver|protocol)\.h)$$ # Enforce recommended preprocessor indentation style. sc_preprocessor_indentation: @if cppi --version >/dev/null 2>&1; then \ @@ -614,7 +612,7 @@ exclude_file_name_regexp--sc_prohibit_close = \ exclude_file_name_regexp--sc_prohibit_doubled_word = ^po/ exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = \ - (^docs/api_extension/|^tests/qemuhelpdata/|\.(gif|ico|png)$$|^daemon/.*_dispatch_bodies\.h$$|^src/remote/.*_client_bodies\.h$$) + (^docs/api_extension/|^tests/qemuhelpdata/|\.(gif|ico|png)$$) _src2=src/(util/util|libvirt|lxc/lxc_controller) exclude_file_name_regexp--sc_prohibit_fork_wrappers = \ diff --git a/daemon/qemu_dispatch_args.h b/daemon/qemu_dispatch_args.h deleted file mode 100644 index 81623bc..0000000 --- a/daemon/qemu_dispatch_args.h +++ /dev/null diff --git a/daemon/qemu_dispatch_bodies.h b/daemon/qemu_dispatch_bodies.h deleted file mode 100644 index 8f5bed6..0000000 --- a/daemon/qemu_dispatch_bodies.h +++ /dev/null diff --git a/daemon/qemu_dispatch_prototypes.h b/daemon/qemu_dispatch_prototypes.h deleted file mode 100644 index 031ae38..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 4dcab6c..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 d8eebd0..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 31c02c7..0000000 --- a/daemon/remote_dispatch_args.h +++ /dev/null diff --git a/daemon/remote_dispatch_bodies.h b/daemon/remote_dispatch_bodies.h deleted file mode 100644 index 702a8bd..0000000 --- a/daemon/remote_dispatch_bodies.h +++ /dev/null diff --git a/daemon/remote_dispatch_prototypes.h b/daemon/remote_dispatch_prototypes.h deleted file mode 100644 index b6819c0..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 cf63657..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 c140341..0000000 --- a/daemon/remote_dispatch_table.h +++ /dev/null diff --git a/po/POTFILES.in b/po/POTFILES.in index 7f5156c..766f8f6 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -2,7 +2,6 @@ daemon/dispatch.c daemon/libvirtd.c daemon/remote.c daemon/stream.c -daemon/remote_dispatch_bodies.h src/conf/cpu_conf.c src/conf/domain_conf.c src/conf/domain_event.c @@ -64,7 +63,6 @@ src/qemu/qemu_monitor.c src/qemu/qemu_monitor_json.c src/qemu/qemu_monitor_text.c src/qemu/qemu_process.c -src/remote/remote_client_bodies.h src/remote/remote_driver.c src/secret/secret_driver.c src/security/security_apparmor.c diff --git a/src/remote/qemu_client_bodies.h b/src/remote/qemu_client_bodies.h deleted file mode 100644 index 3ca2a91..0000000 --- a/src/remote/qemu_client_bodies.h +++ /dev/null diff --git a/src/remote/qemu_protocol.c b/src/remote/qemu_protocol.c deleted file mode 100644 index 3480c54..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 c2501c7..0000000 --- a/src/remote/qemu_protocol.h +++ /dev/null diff --git a/src/remote/remote_client_bodies.h b/src/remote/remote_client_bodies.h deleted file mode 100644 index 6b6f98d..0000000 --- a/src/remote/remote_client_bodies.h +++ /dev/null diff --git a/src/remote/remote_protocol.c b/src/remote/remote_protocol.c deleted file mode 100644 index 84bc617..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 8942646..0000000 --- a/src/remote/remote_protocol.h +++ /dev/null -- 1.7.4.4

2011/5/6 Eric Blake <eblake@redhat.com>:
From: Daniel P. Berrange <berrange@redhat.com>
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
Unfortunately, this means that the strings marked for translation in generated files are not picked up by gnulib's syntax-check, I'm working on fixing that in gnulib.
* .gitignore, cfg.mk, po/POTFILES.in: Reflect deletion. ---
Manually edited to elide deletions.
.gitignore | 3 + cfg.mk | 4 +- daemon/qemu_dispatch_args.h | 5 - daemon/qemu_dispatch_bodies.h | 5 - daemon/qemu_dispatch_prototypes.h | 12 - daemon/qemu_dispatch_ret.h | 5 - daemon/qemu_dispatch_table.h | 14 - daemon/remote_dispatch_args.h | 180 -- daemon/remote_dispatch_bodies.h | 5932 ----------------------------------- daemon/remote_dispatch_prototypes.h | 1620 ---------- daemon/remote_dispatch_ret.h | 142 - daemon/remote_dispatch_table.h | 1054 ------- po/POTFILES.in | 2 - src/remote/qemu_client_bodies.h | 3 - src/remote/qemu_protocol.c | 41 - src/remote/qemu_protocol.h | 57 - src/remote/remote_client_bodies.h | 4663 --------------------------- src/remote/remote_protocol.c | 3996 ----------------------- src/remote/remote_protocol.h | 3167 ------------------- 19 files changed, 4 insertions(+), 20901 deletions(-) delete mode 100644 daemon/qemu_dispatch_args.h delete mode 100644 daemon/qemu_dispatch_bodies.h delete mode 100644 daemon/qemu_dispatch_prototypes.h delete mode 100644 daemon/qemu_dispatch_ret.h delete mode 100644 daemon/qemu_dispatch_table.h delete mode 100644 daemon/remote_dispatch_args.h delete mode 100644 daemon/remote_dispatch_bodies.h delete mode 100644 daemon/remote_dispatch_prototypes.h delete mode 100644 daemon/remote_dispatch_ret.h delete mode 100644 daemon/remote_dispatch_table.h delete mode 100644 src/remote/qemu_client_bodies.h delete mode 100644 src/remote/qemu_protocol.c delete mode 100644 src/remote/qemu_protocol.h delete mode 100644 src/remote/remote_client_bodies.h delete mode 100644 src/remote/remote_protocol.c delete mode 100644 src/remote/remote_protocol.h
ACK. Matthias

On 05/06/2011 03:44 PM, Matthias Bolte wrote:
2011/5/6 Eric Blake <eblake@redhat.com>:
From: Daniel P. Berrange <berrange@redhat.com>
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
Unfortunately, this means that the strings marked for translation in generated files are not picked up by gnulib's syntax-check, I'm working on fixing that in gnulib.
* .gitignore, cfg.mk, po/POTFILES.in: Reflect deletion. ---
Manually edited to elide deletions.
ACK.
Thanks; I've pushed 1-3, and am awaiting an ack on 4/3. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

2011/5/6 Eric Blake <eblake@redhat.com>:
From: Daniel P. Berrange <berrange@redhat.com>
Always generate the rpc files, and require rpcgen during bootstrap.
* 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 --- bootstrap.conf | 1 + daemon/Makefile.am | 35 ++++++--------- src/Makefile.am | 101 ++++++++++++----------------------------- src/remote/remote_protocol.c | 2 +- src/remote/rpcgen_fix.pl | 47 +++++++++++++++++--- 5 files changed, 87 insertions(+), 99 deletions(-)
ACK. Matthias

On 05/06/2011 03:21 PM, Eric Blake wrote:
From: Daniel P. Berrange <berrange@redhat.com>
Always generate the rpc files, and require rpcgen during bootstrap.
* 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
Aargh. This fails VPATH builds. I'm working on a fix. It also fails with WITH_REMOTE is false - once we generate files, they must live in $(srcdir), and the rules to generate them must be unconditionally available for make dist to work. Good thing we're at the beginning of a release cycle, to have time to clear this all up. It may be Monday before I get to it. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On Fri, May 06, 2011 at 10:11:48AM -0600, Eric Blake wrote:
On 05/06/2011 07:11 AM, Daniel P. Berrange wrote:
commit 7a2fd256cb85dd9a9d6640d9faed0b66ca617411 Author: Daniel P. Berrange <berrange@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
Thanks for doing that. However, it means that 'git am' didn't like this patch, so I hope I tested it correctly. At any rate, after applying your patch, removing the generated files, then running 'make dist', and comparing that to a 'make dist' pre-patch, the minor differences were all expected (in the Makefiles, not in the generated files).
+++ 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";
I guess I'll see what happens when I try this on Cygwin, but if there are any followups needed, it should be separate patches. As is, cygwin already can't use -Werror because of repetitive declarations in the tirpc headers that trigger one of our default set of gcc warnings.
This shouldn't make Cygwin any worse should it ? We don't support running bootstrap on Win32 at all, only building from a dist. So they'd not be running rpcgen Daniel -- |: 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 :|

On 05/09/2011 03:21 AM, Daniel P. Berrange wrote:
+my $fixup = $^O eq "linux";
I guess I'll see what happens when I try this on Cygwin, but if there are any followups needed, it should be separate patches. As is, cygwin already can't use -Werror because of repetitive declarations in the tirpc headers that trigger one of our default set of gcc warnings.
This shouldn't make Cygwin any worse should it ? We don't support running bootstrap on Win32 at all, only building from a dist. So they'd not be running rpcgen
Why not? Prior to this patch, there was nothing that prevented me from building libvirt.git on cygwin, and if it's not too hard to keep it that way, I don't see why we would want to insist that cygwin is a tarball-only build platform. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On Mon, May 09, 2011 at 12:51:24PM -0600, Eric Blake wrote:
On 05/09/2011 03:21 AM, Daniel P. Berrange wrote:
+my $fixup = $^O eq "linux";
I guess I'll see what happens when I try this on Cygwin, but if there are any followups needed, it should be separate patches. As is, cygwin already can't use -Werror because of repetitive declarations in the tirpc headers that trigger one of our default set of gcc warnings.
This shouldn't make Cygwin any worse should it ? We don't support running bootstrap on Win32 at all, only building from a dist. So they'd not be running rpcgen
Why not? Prior to this patch, there was nothing that prevented me from building libvirt.git on cygwin, and if it's not too hard to keep it that way, I don't see why we would want to insist that cygwin is a tarball-only build platform.
I didn't know that was possible. I thought we already only supported it as a tarball build, not git Daniel -- |: 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 :|
participants (4)
-
Daniel P. Berrange
-
Eric Blake
-
Jiri Denemark
-
Matthias Bolte