build: also check qemu_protocol for on-the-wire stability

Since we are going to add some libvirt-qemu.so entry points in
0.9.4, we might as well start checking for RPC stability, just
as for libvirt.so.

* src/Makefile.am (PROTOCOL_STRUCTS): New variable.
(remote_protocol-structs): Rename...
(%_protocol-structs): ...and make more generic.
* src/qemu_protocol-structs: New file.
This commit is contained in:
Eric Blake 2011-07-08 10:54:02 -06:00
parent df94811f71
commit 62dee6fa48
2 changed files with 25 additions and 9 deletions

View File

@ -211,16 +211,18 @@ EXTRA_DIST += $(REMOTE_DRIVER_PROTOCOL) \
r1 = (?:/\* \d+ \*/\n)?
r2 = /\* <[[:xdigit:]]+> \S+:\d+ \*/
.PHONY: remote_protocol-structs
PROTOCOL_STRUCTS = \
$(srcdir)/remote_protocol-structs \
$(srcdir)/qemu_protocol-structs
if WITH_REMOTE
# The .o file that pdwtags parses is created as a side effect of running
# libtool; but from make's perspective we depend on the .lo file.
remote_protocol-structs: libvirt_driver_remote_la-remote_protocol.lo
%_protocol-structs: libvirt_driver_remote_la-%_protocol.lo
$(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then \
pdwtags --verbose libvirt_driver_remote_la-remote_protocol.$(OBJEXT) \
pdwtags --verbose $(<:.lo=.$(OBJEXT)) \
| perl -0777 -n \
-e 'foreach my $$p (split m!\n\n$(r1)$(r2)\n!) {' \
-e ' if ($$p =~ /^struct remote_/) {' \
-e ' if ($$p =~ /^struct (remote|qemu)_/) {' \
-e ' $$p =~ s!\t*/\*.*?\*/!!sg;' \
-e ' $$p =~ s!\s+\n!\n!sg;' \
-e ' $$p =~ s!\s+$$!!;' \
@ -233,7 +235,7 @@ remote_protocol-structs: libvirt_driver_remote_la-remote_protocol.lo
-e ' print "/* -*- c -*- */\n";' \
-e '}' \
-e 'END {' \
-e ' if ($$n < 300) {' \
-e ' if ($$n < 3) {' \
-e ' warn "WARNING: your pdwtags program is too old\n";' \
-e ' warn "WARNING: skipping the $@ test\n";' \
-e ' warn "WARNING: install dwarves-1.3 or newer\n";' \
@ -248,12 +250,12 @@ remote_protocol-structs: libvirt_driver_remote_la-remote_protocol.lo
echo 'WARNING: install the dwarves package to get pdwtags' >&2; \
fi
else !WITH_REMOTE
# This generated file must live in git, because it cannot be re-generated
# These generated files must live in git, because they cannot be re-generated
# when configured --without-remote.
remote_protocol-structs:
$(srcdir)/%_protocol-structs:
endif
EXTRA_DIST += remote_protocol-structs
check-local: remote_protocol-structs
EXTRA_DIST += $(PROTOCOL_STRUCTS)
check-local: $(PROTOCOL_STRUCTS)
# Mock driver, covering domains, storage, networks, etc
TEST_DRIVER_SOURCES = \

14
src/qemu_protocol-structs Normal file
View File

@ -0,0 +1,14 @@
/* -*- c -*- */
struct remote_nonnull_domain {
remote_nonnull_string name;
remote_uuid uuid;
int id;
};
struct qemu_monitor_command_args {
remote_nonnull_domain dom;
remote_nonnull_string cmd;
int flags;
};
struct qemu_monitor_command_ret {
remote_nonnull_string result;
};