Skip to content

Commit 30a7148

Browse files
committed
Make sure /usr/local/share/qemu symlink is captured
For qemu 6.0.0 this was included in the opensnoop log, but with qemu 6.1.0 all the data files seem to be referenced purely relative to the executable. Signed-off-by: Jan Dubois <[email protected]>
1 parent a2045a1 commit 30a7148

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

hack/lima-and-qemu.pl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,20 @@
2929
#
3030
# It shows the following binaries from /usr/local are called:
3131

32+
my %deps;
3233
my $install_dir = "/usr/local";
3334
record("$install_dir/bin/limactl");
3435
record("$install_dir/bin/qemu-img");
3536
record("$install_dir/bin/qemu-system-x86_64");
3637

38+
# qemu 6.1.0 doesn't use the symlink to access data files anymore
39+
# but we need to include it because we replace the symlinks in
40+
# /usr/local/bin with the actual files, so data file references need
41+
# to resolve relative to that location too.
42+
my $name = "$install_dir/share/qemu";
43+
# Don't call record($name) because we only want the link, not the whole target directory
44+
$deps{$name} = "" . readlink($name);
45+
3746
# Capture any library and datafiles access with opensnoop
3847
my $opensnoop = "/tmp/opensnoop.log";
3948
END { system("sudo pkill dtrace") }
@@ -64,7 +73,6 @@
6473
record($_);
6574
}
6675

67-
my %deps;
6876
print "$_ $deps{$_}\n" for sort keys %deps;
6977
print "\n";
7078

0 commit comments

Comments
 (0)