]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
scripts: trim "__attribute__((packed))" in RPC struct diff
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 30 Oct 2020 14:43:00 +0000 (14:43 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 11 Nov 2020 11:13:25 +0000 (11:13 +0000)
i686 builds on x86_64 host on Debian 10 result in the RPC structs
getting "__attribute__((packed))" annotations added to them. This is
harmless since we know the XDR protocol aligns and pads struct fields
suitably on the wire. Thus we can safely cull the attribute before doing
the diff comparison.

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
scripts/check-remote-protocol.py

index 0a6135376e6f900e485500a6ac3434d5e983bc99..cd96e894a70cb28556af62f7344ebb23075e3f83 100644 (file)
@@ -123,6 +123,12 @@ if n < 1:
 
 diff = subprocess.Popen(["diff", "-u", expected, "-"], stdin=subprocess.PIPE)
 actualstr = "\n".join(actual) + "\n"
+# i686 builds on x86_64 host add __attribute__(packed)) to
+# the structs. This doesn't matter functionally because we
+# know our RPC structs are suitably aligned to not need
+# packing, so we can just trim the attribute.
+actualstr = re.sub(r'''} __attribute__\(\(__packed__\)\);''', "};", actualstr)
+
 diff.communicate(input=actualstr.encode("utf-8"))
 
 sys.exit(diff.returncode)