Virt: ACPI: fix qemu assert due to re-assigned table data address
commit4d027afeb3a9781bf15ad30d43d07a02c2b08c73
authorZhaoshenglong <zhaoshenglong@huawei.com>
Thu, 11 Jan 2018 13:25:34 +0000 (11 13:25 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 11 Jan 2018 13:25:34 +0000 (11 13:25 +0000)
treeeda6463cd50a71a995ed840838a2134aa0ce2c5c
parent0785557f8811133bd69be02aeccf018d47a26373
Virt: ACPI: fix qemu assert due to re-assigned table data address

acpi_data_push uses g_array_set_size to resize the memory size. If there
is no enough contiguous memory, the address will be changed. If we use
the old value, it will assert.
qemu-kvm: hw/acpi/bios-linker-loader.c:214: bios_linker_loader_add_checksum:
Assertion `start_offset < file->blob->len' failed.`

This issue only happens in building SRAT table now but here we unify the
pattern for other tables as well to avoid possible issues in the future.

Signed-off-by: Zhaoshenglong <zhaoshenglong@huawei.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/virt-acpi-build.c