ioctls: Fix device fd ioctl numbers to match kernel UAPI#324
Conversation
|
@weltling The test failure seems due to Kernel version in test host. it is still 6.6. Right? |
d46ba6f to
33d3263
Compare
The kernel 6.18 removed MSHV_GET_DEVICE_ATTR and renumbered MSHV_HAS_DEVICE_ATTR from 0x02 to 0x01. The crate still used the 6.6 layout (SET=0x00, GET=0x01, HAS=0x02), causing has_device_attr() to return -ENOTTY on 6.18. Update ioctl numbers to match the 6.18 UAPI: - Remove MSHV_GET_DEVICE_ATTR (0x01) - Renumber MSHV_HAS_DEVICE_ATTR from 0x02 to 0x01 - Remove get_device_attr() from DeviceFd Note: this breaks compatibility with the 6.6 kernel. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
33d3263 to
8b13f97
Compare
Correct. 6.18 will have the mentioned IOCTLs changes which is incompatible. We can perhaps consider bumping the minor version of the crate after this change, as it's going to breach backward compatibility. Thanks |
|
Now confirmed through a manual run Thanks |
|
Thinking more we need a strategy for this, because this kind of breach requires a swap on the CI side. The MSHV runner needs to use 6.18 based imag. Which would probably mean an impact on testability of the older versions of this crate. @gamora12 @anirudhrb WDYT? Thanks |
The kernel 6.18 reorganized the mshv device fd UAPI. In 6.6:
In 6.18, MSHV_GET_DEVICE_ATTR was removed and MSHV_HAS_DEVICE_ATTR was renumbered to 0x01:
The crate still uses the 6.6 layout, causing has_device_attr() to send ioctl command 0x02 which the 6.18 kernel does not recognize, returning -ENOTTY. This makes test_create_device panic on:
Update the crate to match the 6.18 UAPI:
Note: this breaks compatibility with the 6.6 kernel.