qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

scripts: ensure signrom treats data as bytes

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <20180116134217.8725-10-berrange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

authored by

Daniel P. Berrange and committed by
Eduardo Habkost
31d8f92e d4e5ec87

+2 -2
+2 -2
scripts/signrom.py
··· 18 18 fout = open(sys.argv[2], 'wb') 19 19 20 20 magic = fin.read(2) 21 - if magic != '\x55\xaa': 21 + if magic != b'\x55\xaa': 22 22 sys.exit("%s: option ROM does not begin with magic 55 aa" % sys.argv[1]) 23 23 24 24 size_byte = ord(fin.read(1)) ··· 33 33 # Add padding if necessary, rounding the whole input to a multiple of 34 34 # 512 bytes according to the third byte of the input. 35 35 # size-1 because a final byte is added below to store the checksum. 36 - data = data.ljust(size-1, '\0') 36 + data = data.ljust(size-1, b'\0') 37 37 else: 38 38 if ord(data[-1:]) != 0: 39 39 sys.stderr.write('WARNING: ROM includes nonzero checksum\n')