summaryrefslogtreecommitdiff
path: root/scripts/check-remote-protocol.py
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2020-10-30 14:43:00 +0000
committerDaniel P. Berrangé <berrange@redhat.com>2020-11-11 11:13:25 +0000
commit41528686207163af0fe15c195d0c7097e70619ef (patch)
treea8bded78a3f6c3258bdbcdca73175d0b6fdc64cc /scripts/check-remote-protocol.py
parentd63764f8bc9540cc54092f575f1ea8bfc24b4189 (diff)
downloadlibvirt-41528686207163af0fe15c195d0c7097e70619ef.tar.gz
scripts: trim "__attribute__((packed))" in RPC struct diff
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>
Diffstat (limited to 'scripts/check-remote-protocol.py')
-rw-r--r--scripts/check-remote-protocol.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/check-remote-protocol.py b/scripts/check-remote-protocol.py
index 0a6135376e..cd96e894a7 100644
--- a/scripts/check-remote-protocol.py
+++ b/scripts/check-remote-protocol.py
@@ -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)