[PATCH v2] tests/ioctl_kvm_run.c: handle cpuid at the end of vcpu dentry

Dmitry V. Levin ldv at altlinux.org
Thu May 3 17:15:58 UTC 2018


On Wed, May 02, 2018 at 05:11:07PM +0900, Masatake YAMATO wrote:
> Since Linux 4.16, kernel appends the cpuid as suffix to the entry
> for a kvm vcpu in /proc/$pid/fd like:
> 
>     anon_inode:kvm-vcpu:0
> 
> That was
> 
>     anon_inode:kvm-vcpu
> 
> This change causes the test case fails on the newer kernel.
> With this change, the test case can deal with the new name well.
> 
> * tests/ioctl_kvm_run.c: Include unistd.h for using readlink(2).
> (vcpu_dev_should_have_cpuid): New function for detecting whether
> a proc entry for given fd has the cpuid suffix or not.
> (main): Trim vcpu_dev to remove the cpuid suffix if needed.
> (vcpu_dev): Remove const modifier.
> 
> A change in v2:
> 
> * Use memcmp instead of strcmp to compare the value got from readlink
>   with an expected value. Suggested by ldv.

Applied, thanks.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20180503/d16b8fcf/attachment.bin>


More information about the Strace-devel mailing list