提交 e561951d 编写于 作者: E Eric Blake

tests: check remaining .x files

We have been adding new .x files without keeping the list of
*-structs files up-to-date.  This adds the support for the
recent additions.

In the process of testing this, I also noticed that Fedora 19's
use of dwarves-1.10 (providing pdwtags version 1.9) was producing
a single line on stderr but still giving enough useful info on
stdout that we could check structs; the real goal of checking
stderr separately from stdout was to avoid the bug in dwarves-1.9
where stdout was empty (see bug http://bugzilla.redhat.com/772358).

* src/Makefile.am (struct_prefix, PROTOCOL_STRUCTS): Add missing
struct tests.
(PDWTAGS): Work with Fedora 19 pdwtags.
(lxc_monitor_protocol-struct, lock_protocol-struct): New rules.
* src/lxc_monitor_protocol-structs: New file.
* src/lock_protocol-structs): Likewise.
* cfg.mk (generated_files): Enlarge list.
Signed-off-by: NEric Blake <eblake@redhat.com>
上级 012c25e8
...@@ -33,8 +33,9 @@ gnulib_dir = $(srcdir)/.gnulib ...@@ -33,8 +33,9 @@ gnulib_dir = $(srcdir)/.gnulib
# This is all gnulib files, as well as generated files for RPC code. # This is all gnulib files, as well as generated files for RPC code.
generated_files = \ generated_files = \
$(srcdir)/daemon/*_dispatch.h \ $(srcdir)/daemon/*_dispatch.h \
$(srcdir)/src/*/*_dispatch.h \
$(srcdir)/src/remote/*_client_bodies.h \ $(srcdir)/src/remote/*_client_bodies.h \
$(srcdir)/src/remote/*_protocol.[ch] \ $(srcdir)/src/*/*_protocol.[ch] \
$(srcdir)/gnulib/lib/*.[ch] $(srcdir)/gnulib/lib/*.[ch]
# We haven't converted all scripts to using gnulib's init.sh yet. # We haven't converted all scripts to using gnulib's init.sh yet.
......
...@@ -364,10 +364,10 @@ EXTRA_DIST += $(REMOTE_DRIVER_PROTOCOL) \ ...@@ -364,10 +364,10 @@ EXTRA_DIST += $(REMOTE_DRIVER_PROTOCOL) \
# The alternation of the following regexps matches both cases. # The alternation of the following regexps matches both cases.
r1 = /\* \d+ \*/ r1 = /\* \d+ \*/
r2 = /\* <[[:xdigit:]]+> \S+:\d+ \*/ r2 = /\* <[[:xdigit:]]+> \S+:\d+ \*/
struct_prefix = (remote_|qemu_|lxc_|virNet|keepalive_) struct_prefix = (remote_|qemu_|lxc_|keepalive|vir(Net|LockSpace|LXCMonitor))
# Depending on configure options, libtool creates one or both of # Depending on configure options, libtool creates one or both of
# {,.libs/}libvirt_remote_driver_la-remote_protocol.o. We want the # {,.libs/}libvirt_driver_remote_la-remote_protocol.o. We want the
# newest of the two, in case configure options changed and a stale # newest of the two, in case configure options changed and a stale
# file is left around from an earlier build. # file is left around from an earlier build.
PDWTAGS = \ PDWTAGS = \
...@@ -376,7 +376,7 @@ PDWTAGS = \ ...@@ -376,7 +376,7 @@ PDWTAGS = \
2>/dev/null | sed -n 1p`; \ 2>/dev/null | sed -n 1p`; \
test -f "$$o" || { echo ".o for $< not found" >&2; exit 1; }; \ test -f "$$o" || { echo ".o for $< not found" >&2; exit 1; }; \
pdwtags --verbose $$o > $(@F)-t1 2> $(@F)-t2; \ pdwtags --verbose $$o > $(@F)-t1 2> $(@F)-t2; \
if test -s $(@F)-t2; then \ if test ! -s $(@F)-t1 && test -s $(@F)-t2; then \
rm -rf $(@F)-t?; \ rm -rf $(@F)-t?; \
echo 'WARNING: pdwtags appears broken; skipping the $@ test' >&2;\ echo 'WARNING: pdwtags appears broken; skipping the $@ test' >&2;\
else \ else \
...@@ -426,12 +426,17 @@ check-symsorting: ...@@ -426,12 +426,17 @@ check-symsorting:
$(srcdir) $(SYM_FILES) $(srcdir) $(SYM_FILES)
EXTRA_DIST += check-symfile.pl check-symsorting.pl EXTRA_DIST += check-symfile.pl check-symsorting.pl
# Keep this list synced with RPC_PROBE_FILES
PROTOCOL_STRUCTS = \ PROTOCOL_STRUCTS = \
$(srcdir)/remote_protocol-structs \ $(srcdir)/remote_protocol-structs \
$(srcdir)/lxc_protocol-structs \ $(srcdir)/lxc_protocol-structs \
$(srcdir)/qemu_protocol-structs \ $(srcdir)/qemu_protocol-structs \
$(srcdir)/virnetprotocol-structs \ $(srcdir)/virnetprotocol-structs \
$(srcdir)/virkeepaliveprotocol-structs $(srcdir)/virkeepaliveprotocol-structs \
$(srcdir)/lxc_monitor_protocol-structs \
$(srcdir)/lock_protocol-structs \
$(NULL)
if WITH_REMOTE if WITH_REMOTE
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct) check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)
...@@ -445,6 +450,13 @@ $(srcdir)/remote_protocol-struct \ ...@@ -445,6 +450,13 @@ $(srcdir)/remote_protocol-struct \
$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \ $(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
$(srcdir)/%-struct: libvirt_net_rpc_la-%.lo $(srcdir)/%-struct: libvirt_net_rpc_la-%.lo
$(PDWTAGS) $(PDWTAGS)
$(srcdir)/lxc_monitor_protocol-struct: \
$(srcdir)/%-struct: libvirt_driver_lxc_impl_la-%.lo
$(PDWTAGS)
$(srcdir)/lock_protocol-struct: \
$(srcdir)/%-struct: lockd_la-%.lo
$(PDWTAGS)
else !WITH_REMOTE else !WITH_REMOTE
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be # The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
# re-generated when configured --without-remote. # re-generated when configured --without-remote.
...@@ -1886,6 +1898,7 @@ tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp ...@@ -1886,6 +1898,7 @@ tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp
"non_pic_object='$<'" \ "non_pic_object='$<'" \
> $@ > $@
# Keep this list synced with PROTOCOL_STRUCTS
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \ RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
$(srcdir)/rpc/virkeepaliveprotocol.x \ $(srcdir)/rpc/virkeepaliveprotocol.x \
$(srcdir)/remote/remote_protocol.x \ $(srcdir)/remote/remote_protocol.x \
......
/* -*- c -*- */
struct virLockSpaceProtocolOwner {
virLockSpaceProtocolUUID uuid;
virLockSpaceProtocolNonNullString name;
u_int id;
u_int pid;
};
struct virLockSpaceProtocolRegisterArgs {
virLockSpaceProtocolOwner owner;
u_int flags;
};
struct virLockSpaceProtocolRestrictArgs {
u_int flags;
};
struct virLockSpaceProtocolNewArgs {
virLockSpaceProtocolNonNullString path;
u_int flags;
};
struct virLockSpaceProtocolCreateResourceArgs {
virLockSpaceProtocolNonNullString path;
virLockSpaceProtocolNonNullString name;
u_int flags;
};
struct virLockSpaceProtocolDeleteResourceArgs {
virLockSpaceProtocolNonNullString path;
virLockSpaceProtocolNonNullString name;
u_int flags;
};
enum virLockSpaceProtocolAcquireResourceFlags {
VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_SHARED = 1,
VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_AUTOCREATE = 2,
};
struct virLockSpaceProtocolAcquireResourceArgs {
virLockSpaceProtocolNonNullString path;
virLockSpaceProtocolNonNullString name;
u_int flags;
};
struct virLockSpaceProtocolReleaseResourceArgs {
virLockSpaceProtocolNonNullString path;
virLockSpaceProtocolNonNullString name;
u_int flags;
};
struct virLockSpaceProtocolCreateLockSpaceArgs {
virLockSpaceProtocolNonNullString path;
};
enum virLockSpaceProtocolProcedure {
VIR_LOCK_SPACE_PROTOCOL_PROC_REGISTER = 1,
VIR_LOCK_SPACE_PROTOCOL_PROC_RESTRICT = 2,
VIR_LOCK_SPACE_PROTOCOL_PROC_NEW = 3,
VIR_LOCK_SPACE_PROTOCOL_PROC_CREATE_RESOURCE = 4,
VIR_LOCK_SPACE_PROTOCOL_PROC_DELETE_RESOURCE = 5,
VIR_LOCK_SPACE_PROTOCOL_PROC_ACQUIRE_RESOURCE = 6,
VIR_LOCK_SPACE_PROTOCOL_PROC_RELEASE_RESOURCE = 7,
VIR_LOCK_SPACE_PROTOCOL_PROC_CREATE_LOCKSPACE = 8,
};
/* -*- c -*- */
enum virLXCMonitorExitStatus {
VIR_LXC_MONITOR_EXIT_STATUS_ERROR = 0,
VIR_LXC_MONITOR_EXIT_STATUS_SHUTDOWN = 1,
VIR_LXC_MONITOR_EXIT_STATUS_REBOOT = 2,
};
struct virLXCMonitorExitEventMsg {
enum virLXCMonitorExitStatus status;
};
struct virLXCMonitorInitEventMsg {
uint64_t initpid;
};
enum virLXCMonitorProcedure {
VIR_LXC_MONITOR_PROC_EXIT_EVENT = 1,
VIR_LXC_MONITOR_PROC_INIT_EVENT = 2,
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册