Skip to content

Conversation

@RuoqingHe
Copy link
Member

Summary of the PR

Backport 01cac5e to v0.12.1 to resolve #355.

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

  • All commits in this PR have Signed-Off-By trailers (with
    git commit -s), and the commit message has max 60 characters for the
    summary and max 75 characters for each description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • All added/changed public-facing functionality has entries in the "Upcoming
    Release" section of CHANGELOG.md (if no such section exists, please create one).
  • Any newly added unsafe code is properly documented.

@RuoqingHe RuoqingHe force-pushed the fix-create-device branch 3 times, most recently from 0634729 to 96dbf66 Compare October 27, 2025 18:03
@stefano-garzarella
Copy link
Member

@RuoqingHe LGTM, but I suggest doing backport with git cherry-pick -x or report in other way the sha1 of the upstream commit. Also, why not backporting ae039f2 instead of doing a new commit?

@RuoqingHe
Copy link
Member Author

@RuoqingHe LGTM, but I suggest doing backport with git cherry-pick -x or report in other way the sha1 of the upstream commit. Also, why not backporting ae039f2 instead of doing a new commit?

Noted, for ae039f2, CI was too old to accept the URL (because it exceeded the line length limit in commit body), I will change to use that

@stefano-garzarella
Copy link
Member

@RuoqingHe LGTM, but I suggest doing backport with git cherry-pick -x or report in other way the sha1 of the upstream commit. Also, why not backporting ae039f2 instead of doing a new commit?

Noted, for ae039f2, CI was too old to accept the URL (because it exceeded the line length limit in commit body), I will change to use that

don't worry too much about CI, I think we can just merge this. So if you want to revert also the CI commit, it's fine by me.

Use `ioctl_with_mut_ref` instead of `ioctl_with_ref` in the
`create_device` method as it needs to write to the `kvm_create_device`
struct passed to it. This incorrect usage of `ioctl_with_ref` causes
newer versions of Rust compiler (1.82 and above) to treat the
`kvm_create_device` struct as read-only and bypass following reads from
it. This optimization lead to incorrect value being passed to the
`File::from_raw_fd` call.

(cherry picked from commit ade910b)

Signed-off-by: Egor Lazarchuk <[email protected]>
Signed-off-by: Ruoqing He <[email protected]>
@RuoqingHe
Copy link
Member Author

@RuoqingHe LGTM, but I suggest doing backport with git cherry-pick -x or report in other way the sha1 of the upstream commit. Also, why not backporting ae039f2 instead of doing a new commit?

Noted, for ae039f2, CI was too old to accept the URL (because it exceeded the line length limit in commit body), I will change to use that

don't worry too much about CI, I think we can just merge this. So if you want to revert also the CI commit, it's fine by me.

I've updated the commit message and re-cherry-picked ae039f2 now, would you mind taking another look

@RuoqingHe
Copy link
Member Author

Could @ShadowCurse take a look on this when convenient 🙂

As this patch [1] documents, and pointed out by @roypat, create an
in-kernel `irqchip` before invoking any ioctls relate to PIT.

[1] https://lore.kernel.org/kvm/CA+i-1C1LOn19FcddyC5kV8idGQq5KDdAjWBo80ANpRGn8DCx3g@mail.gmail.com/T/

(cherry picked from commit ae039f2)

Signed-off-by: Ruoqing He <[email protected]>
Update rust-vmm-ci to g042b206, and set toolchain to 1.63.0 to
workaround cargo audit problem.

Signed-off-by: Ruoqing He <[email protected]>
@stefano-garzarella stefano-garzarella merged commit 9ac8507 into rust-vmm:kvm-ioctls-v0.12.1 Oct 29, 2025
18 of 23 checks passed
@stefano-garzarella
Copy link
Member

Released: https://crates.io/crates/kvm-ioctls/0.12.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants