]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
build: check for virnetprotocol on-the-wire stability
authorEric Blake <eblake@redhat.com>
Wed, 13 Jul 2011 15:35:03 +0000 (09:35 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 14 Jul 2011 15:25:41 +0000 (09:25 -0600)
Similar to the recent qemu_protocol-structs addition.

* src/virnetprotocol-structs: New file.
* src/Makefile.am (%_protocol-structs): Factor body...
(PDWTAGS): ...into new helper macro.
(virnetprotocol-structs): New rule.
(PROTOCOL_STRUCTS): Add virnetprotocol-structs.

src/Makefile.am
src/virnetprotocol-structs [new file with mode: 0644]

index 39f0cf80c6c46cf5795e529831704bce4b75b52d..d19d1ca1bdfce9db6c9970eaf1e8915b3f57fd4f 100644 (file)
@@ -212,18 +212,12 @@ EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
 r1 = (?:/\* \d+ \*/\n)?
 r2 = /\* <[[:xdigit:]]+> \S+:\d+ \*/
 
-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.
-%_protocol-structs: libvirt_driver_remote_la-%_protocol.lo
+PDWTAGS = \
        $(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then           \
          pdwtags --verbose $(<:.lo=.$(OBJEXT))                         \
            | perl -0777 -n                                             \
                -e 'foreach my $$p (split m!\n\n$(r1)$(r2)\n!) {'       \
-               -e '  if ($$p =~ /^struct (remote|qemu)_/) {'           \
+               -e '  if ($$p =~ /^struct (remote_|qemu_|virNet)/) {'   \
                -e '    $$p =~ s!\t*/\*.*?\*/!!sg;'                     \
                -e '    $$p =~ s!\s+\n!\n!sg;'                          \
                -e '    $$p =~ s!\s+$$!!;'                              \
@@ -250,10 +244,22 @@ if WITH_REMOTE
          echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2;   \
          echo 'WARNING: install the dwarves package to get pdwtags' >&2; \
        fi
+
+PROTOCOL_STRUCTS = \
+       $(srcdir)/remote_protocol-structs \
+       $(srcdir)/qemu_protocol-structs \
+       $(srcdir)/virnetprotocol-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.
+$(srcdir)/%_protocol-structs: libvirt_driver_remote_la-%_protocol.lo
+       $(PDWTAGS)
+$(srcdir)/virnetprotocol-structs: libvirt_net_rpc_la-virnetprotocol.lo
+       $(PDWTAGS)
 else !WITH_REMOTE
 # These generated files must live in git, because they cannot be re-generated
 # when configured --without-remote.
-$(srcdir)/%_protocol-structs:
+$(PROTOCOL_STRUCTS):
 endif
 EXTRA_DIST += $(PROTOCOL_STRUCTS)
 check-local: $(PROTOCOL_STRUCTS)
diff --git a/src/virnetprotocol-structs b/src/virnetprotocol-structs
new file mode 100644 (file)
index 0000000..1ee2c6d
--- /dev/null
@@ -0,0 +1,31 @@
+/* -*- c -*- */
+struct virNetMessageHeader {
+        u_int                      prog;
+        u_int                      vers;
+        int                        proc;
+        virNetMessageType          type;
+        u_int                      serial;
+        virNetMessageStatus        status;
+};
+struct virNetMessageNonnullDomain {
+        virNetMessageNonnullString name;
+        virNetMessageUUID          uuid;
+        int                        id;
+};
+struct virNetMessageNonnullNetwork {
+        virNetMessageNonnullString name;
+        virNetMessageUUID          uuid;
+};
+struct virNetMessageError {
+        int                        code;
+        int                        domain;
+        virNetMessageString        message;
+        int                        level;
+        virNetMessageDomain        dom;
+        virNetMessageString        str1;
+        virNetMessageString        str2;
+        virNetMessageString        str3;
+        int                        int1;
+        int                        int2;
+        virNetMessageNetwork       net;
+};