]> git.proxmox.com Git - mirror_qemu.git/commitdiff
image-fuzzer: Use bytes constant for field values
authorEduardo Habkost <ehabkost@redhat.com>
Wed, 16 Oct 2019 19:24:27 +0000 (16:24 -0300)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 5 Nov 2019 15:35:06 +0000 (16:35 +0100)
Field values are supposed to be bytes objects, not unicode
strings.  Change two constants that were declared as strings.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20191016192430.25098-8-ehabkost@redhat.com
Message-Id: <20191016192430.25098-8-ehabkost@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
tests/image-fuzzer/qcow2/layout.py

index 0adcbd448d1dc32ec8f6b02a46eb751c5dce0cf8..a0fd53c7ad3fbac61e17b3c523f3d2912f66f980 100644 (file)
@@ -122,7 +122,7 @@ class Image(object):
     def create_header(self, cluster_bits, backing_file_name=None):
         """Generate a random valid header."""
         meta_header = [
-            ['>4s', 0, "QFI\xfb", 'magic'],
+            ['>4s', 0, b"QFI\xfb", 'magic'],
             ['>I', 4, random.randint(2, 3), 'version'],
             ['>Q', 8, 0, 'backing_file_offset'],
             ['>I', 16, 0, 'backing_file_size'],
@@ -231,7 +231,7 @@ class Image(object):
             feature_tables = []
             feature_ids = []
             inner_offset = self.ext_offset + ext_header_len
-            feat_name = 'some cool feature'
+            feat_name = b'some cool feature'
             while len(feature_tables) < num_fnt_entries * 3:
                 feat_type, feat_bit = gen_feat_ids()
                 # Remove duplicates