f973c8f5 | 07-Oct-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
scripts: forbid use of arbitrary SPDX tags besides license identifiers
While SPDX-License-Identifier is a well known SPDX tag, there are a great many more besides that[1]. This are around making mac
scripts: forbid use of arbitrary SPDX tags besides license identifiers
While SPDX-License-Identifier is a well known SPDX tag, there are a great many more besides that[1]. This are around making machine readable metadata available to the 'reuse' tool and similar for things like author names, copyright owners, and much more. It is even possible to define source file line groups and apply different SPDX tags to just that region of code.
At this time we're only interested in adopting SPDX for recording the licensing info, so detect & reject any other SPDX metadata. If we want to explicitly collect extra data in SPDX format, we can evaluate each case on its merits.
[1] https://spdx.github.io/spdx-spec/v2.2.2/file-tags/ https://spdx.github.io/spdx-spec/v2.2.2/file-information/
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
show more ...
|
82565fb6 | 09-Jan-2025 |
Fabiano Rosas <farosas@suse.de> |
migration: Fix arrays of pointers in JSON writer
Currently, if an array of pointers contains a NULL pointer, that pointer will be encoded as '0' in the stream. Since the JSON writer doesn't define a
migration: Fix arrays of pointers in JSON writer
Currently, if an array of pointers contains a NULL pointer, that pointer will be encoded as '0' in the stream. Since the JSON writer doesn't define a "pointer" type, that '0' will now be an uint8, which is different from the original type being pointed to, e.g. struct.
(we're further calling uint8 "nullptr", but that's irrelevant to the issue)
That mixed-type array shouldn't be compressed, otherwise data is lost as the code currently makes the whole array have the type of the first element:
css = {NULL, NULL, ..., 0x5555568a7940, NULL};
{"name": "s390_css", "instance_id": 0, "vmsd_name": "s390_css", "version": 1, "fields": [ ..., {"name": "css", "array_len": 256, "type": "nullptr", "size": 1}, ..., ]}
In the above, the valid pointer at position 254 got lost among the compressed array of nullptr.
While we could disable the array compression when a NULL pointer is found, the JSON part of the stream still makes part of downtime, so we should avoid writing unecessary bytes to it.
Keep the array compression in place, but if NULL and non-NULL pointers are mixed break the array into several type-contiguous pieces :
css = {NULL, NULL, ..., 0x5555568a7940, NULL};
{"name": "s390_css", "instance_id": 0, "vmsd_name": "s390_css", "version": 1, "fields": [ ..., {"name": "css", "array_len": 254, "type": "nullptr", "size": 1}, {"name": "css", "type": "struct", "struct": {"vmsd_name": "s390_css_img", ... }, "size": 768}, {"name": "css", "type": "nullptr", "size": 1}, ..., ]}
Now each type-discontiguous region will become a new JSON entry. The reader should interpret this as a concatenation of values, all part of the same field.
Parsing the JSON with analyze-script.py now shows the proper data being pointed to at the places where the pointer is valid and "nullptr" where there's NULL:
"s390_css (14)": { ... "css": [ "nullptr", "nullptr", ... "nullptr", { "chpids": [ { "in_use": "0x00", "type": "0x00", "is_virtual": "0x00" }, ... ] }, "nullptr", }
Reviewed-by: Peter Xu <peterx@redhat.com> Message-Id: <20250109185249.23952-7-farosas@suse.de> Signed-off-by: Fabiano Rosas <farosas@suse.de> (cherry picked from commit 35049eb0d2fc72bb8c563196ec75b4d6c13fce02) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
show more ...
|
e3839b0c | 09-Jan-2025 |
Fabiano Rosas <farosas@suse.de> |
migration: Fix parsing of s390 stream
The parsing for the S390StorageAttributes section is currently leaving an unconsumed token that is later interpreted by the generic code as QEMU_VM_EOF, cutting
migration: Fix parsing of s390 stream
The parsing for the S390StorageAttributes section is currently leaving an unconsumed token that is later interpreted by the generic code as QEMU_VM_EOF, cutting the parsing short.
The migration will issue a STATTR_FLAG_DONE between iterations, which the script consumes correctly, but there's a final STATTR_FLAG_EOS at .save_complete that the script is ignoring. Since the EOS flag is a u64 0x1ULL and the stream is big endian, on little endian hosts a byte read from it will be 0x0, the same as QEMU_VM_EOF.
Fixes: 81c2c9dd5d ("tests/qtest/migration-test: Fix analyze-migration.py for s390x") Reviewed-by: Peter Xu <peterx@redhat.com> Message-Id: <20250109185249.23952-4-farosas@suse.de> Signed-off-by: Fabiano Rosas <farosas@suse.de> (cherry picked from commit 69d1f784569fdb950f2923c3b6d00d7c1b71acc1) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
show more ...
|