qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

duplicate acpi files


From: Michael S. Tsirkin
Subject: duplicate acpi files
Date: Thu, 2 Mar 2023 01:41:36 -0500

Hi guys,
I got annoyed that whenever I run ./tests/data/acpi/rebuild-expected-aml.sh
then my tree gets polluted with duplicate acpi files.
If I forget to blow them away then later they become stale
and bios table test fails.

So wrote a script to find these hoping to teach rebuild-expected-aml.sh
not to generate these:

find tests/data/acpi/ -type f -exec sha256sum '{}' ';'|sort -d|uniq -w 64 
--all-repeated=separate

Turns out we have lots of duplicates already!
These generally increase churn and make review and maintainance of aml
harder - I will remove the trivial ones but slightly harder issues:
- unifying pc and q35 - I guess we can teach bios table test to look
  for expected files one
  directory up and put pc and q35 in a shared directory.
- teaching rebuild-expected-aml.sh to remove duplicates.
- we really should first generate in some temp directory,
  then have a separate script to move files over, this way we can also
  do useful things like tell user what changed - or even pre-generate
  a good git commit message.

I have been using the following script but it expects files to
already be in git, not ideal:

SCM=`pwd`
temp=$(mktemp -d)
status=$?
[ -z "${file}" ] || exit $status
cd ${temp}
rm -fr old new
git clone ${SCM} old
git clone ${SCM} new
cd ${temp}/old
git checkout ${1}
./tests/data/acpi/disassemle-aml.sh -o ${temp}/old/asl
cd ${temp}/new
git checkout ${2}
./tests/data/acpi/disassemle-aml.sh -o ${temp}/new/asl
cd ${temp}
# skip irrelevant header fields
# prefix diff output so it's can be safely included in git log
diff -ru -N -IDisassembly -IChecksum -I'*     Length           ' old/asl 
new/asl | sed -e 's/^---\|+++\|@@\|diff/:&/'
rm -fr ${temp}


One of you want to try improving on these issues?

-- 
MST




reply via email to

[Prev in Thread] Current Thread [Next in Thread]