Commit Graph

17088 Commits

Author SHA1 Message Date
Fabiano Fidêncio
a164693e1a release: Bump version to 3.22.0
Bump VERSION and helm-chart versions

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
3.22.0
2025-10-28 16:28:18 +01:00
Steve Horsman
1b46cf43c4 Merge pull request #11989 from Amulyam24/actionpz-ppc64le
revert: Enable new ibm runners for ppc64le
2025-10-28 12:09:03 +00:00
Amulyam24
c603094584 revert: Enable new ibm runners for ppc64le
Temporarily disables the new runners for building artifacts jobs. Will be re-enabled once they are stable.

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2025-10-28 17:09:26 +05:30
Hyounggyu Choi
7d2fe5e187 revert: Enable new ibm runners for s390x
This partially reverts 8dcd91c for the s390x because the
CI jobs are currently blocking the release. The new runners
will be re-introduced once they are stable and no longer
impact critical paths.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2025-10-28 11:11:51 +01:00
Fabiano Fidêncio
754e832cfa kata-deploy: Allow passing shims / defaultShim per arch
This allows us to do a full multi-arch deployment, as the user can
easily select which shim can be deployed per arch, as some of the VMMs
are not supported on all architectures, which would lead to a broken
installation.

Now, passing shims per arch we can easily have an heterogenous
deployment where, for instance, we can set qemu-se-runtime-rs for s390x,
qemu-cca for aarch64, and qemu-snp / qemu-tdx for x86_64 and call all of
those a default kata-confidential ... and have everything working with
the same deployment.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-27 22:42:37 +01:00
Greg Kurz
ffdc80733a Merge pull request #11966 from zvonkok/gpu-cc-fix
gpu: rootfs fixes
2025-10-27 10:18:13 +01:00
Alex Lyn
418d5f724e Merge pull request #11971 from lifupan/fupan_blk_ratelimit
runtime-rs: Support disk rate limiter for dragonball
2025-10-27 17:12:47 +08:00
Alex Lyn
f86ac595a8 Merge pull request #11973 from Apokleos/enhance-oci-spec
runtime-rs: Enhancements for items within OCI Spec
2025-10-27 16:15:00 +08:00
Alex Lyn
690dad5528 runtime-rs: Ensure complete cleanup of stale Device Cgroups
The previous procedure failed to reliably ensure that all unused Device
Cgroups were completely removed, a failure consistently verified by CI
tests.

This change introduces a more robust and thorough cleanup mechanism. The
goal is to prevent previous issues—likely stemming from improper use of
Rust mutable references—that caused the modifications to be ineffective
or incomplete.

This ensures a clean environment and reliable CI test execution.

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2025-10-27 12:47:48 +08:00
Alex Lyn
25ab615da5 Merge pull request #11913 from Apokleos/dedicated-error-rs
CI: Add dedicated expected error message for runtime-rs
2025-10-27 10:47:07 +08:00
Zvonko Kaiser
39848e0983 gpu: rootfs fixes
Build only from Ubuntu repositories do not mix with developer.nvidia.com

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>

Update tools/osbuilder/rootfs-builder/nvidia/nvidia_chroot.sh

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-26 19:36:55 +01:00
stevenhorsman
aec0ceb860 gatekeeper: Update mariner tests name
In https://github.com/kata-containers/kata-containers/pull/11972
the auto-generate-policy: yes matrix parameter was removed
which updates the name of the name, so sync this change
in required-tests.yaml

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-10-25 17:51:31 +02:00
Kevin Zhao
e2dbe87a99 tests: Fix cca test failure on arm64 and other architectures
Fix the wrong test with appendProtectionDevice on arm64

Signed-off-by: Kevin Zhao <kevin.zhao@linaro.org>
2025-10-25 13:54:35 +02:00
dependabot[bot]
99ae3607dc build(deps): bump astral-tokio-tar in /src/tools/agent-ctl
Bumps [astral-tokio-tar](https://github.com/astral-sh/tokio-tar) from 0.5.5 to 0.5.6.
- [Release notes](https://github.com/astral-sh/tokio-tar/releases)
- [Changelog](https://github.com/astral-sh/tokio-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/tokio-tar/compare/v0.5.5...v0.5.6)

---
updated-dependencies:
- dependency-name: astral-tokio-tar
  dependency-version: 0.5.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-25 13:53:24 +02:00
Dan Mihai
61ee4d7f8b Merge pull request #11951 from burgerdev/watchable
genpolicy: allow non-watchable ConfigMaps
2025-10-24 08:38:55 -07:00
Steve Horsman
ac601ecd45 Merge pull request #11964 from Amulyam24/k8s-ppc64le
github: migrate k8s job to a different runner on ppc64le
2025-10-24 15:55:59 +01:00
Dan Mihai
ac3ea973ee Merge pull request #11958 from microsoft/danmihai1/policy-tests-upstream5
tests: k8s: auto-generate policy for additional tests
2025-10-24 07:18:00 -07:00
Amulyam24
9876cbffd6 github: migrate k8s job to a different runner on ppc64le
Migrate the k8s job to a different runner and use a long running cluster
instead of creating the cluster on every run.

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2025-10-24 18:20:11 +05:30
Steve Horsman
5713072385 Merge pull request #11974 from fidencio/topic/payload-after-build-upload-latest-charts
actions: Push a `0.0.0-dev` chart package to the registries
2025-10-24 13:13:02 +01:00
Alex Lyn
e539432a91 CI: Add dedicated expected error message for runtime-rs
Runtime-rs has its dedicated error message, we need handle it
separately.

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2025-10-24 20:08:59 +08:00
Steve Horsman
60022c9556 Merge pull request #11972 from microsoft/danmihai1/no-mariner-policy
gha: no policy for cbl-mariner during ci
2025-10-24 12:03:52 +01:00
Fabiano Fidêncio
ebc1d64096 actions: Push a 0.0.0-dev chart package to the registries
This will help immensely projects consuming the kata-deploy helm chart
to use configuration options added during the development cycle that are
waiting for a release to be out ... allowing very early tests of the
stack.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-24 11:44:27 +02:00
Alex Lyn
91db25ef02 runtime-rs: Reset capabilities for exec processes
By default, `kubectl exec` inherits some capabilities from the
container, which could pose a security risk in a confidential
environment.

This change modifies the agent policy to strictly enforce that any
process started via `ExecProcessRequest` has no Linux capabilities.
This prevents potential privilege escalation within an exec session,
adhering to the principle of least privilege.

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2025-10-24 15:42:17 +08:00
Alex Lyn
2de6fa520d runtime-rs: Reset ApparmorProfile with Non value
As in CoCo cases, the ApparmorProfile setting within runtime-go is set with None,
we should align it with runtime-go.

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2025-10-24 15:40:45 +08:00
Dan Mihai
b8c1215d99 gha: no policy for cbl-mariner during ci
Temporarily disable the auto-generated Agent Policy on Mariner hosts,
to workaround the new test failures on these hosts.

When re-enabling auto-generated policy in the future, that would be
better achieved with a tests/integration/kubernetes/gha-run.sh change.
Those changes are easier to test compared with GHA YAML changes.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-10-24 04:00:36 +00:00
Fupan Li
9fda9905a7 runtime-rs: Support disk rate limiter for dragonball
This PR adds code that passes disk limiter parameters to
dragonball vmm..

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2025-10-24 10:39:53 +08:00
Markus Rudy
acc7974602 genpolicy: allow non-watchable ConfigMaps
If a ConfigMap has more than 8 files it will not be mounted watchable
[1]. However, genpolicy assumes that ConfigMaps are always mounted at a
watchable path, so containers with large ConfigMap mounts fail
verification.

This commit allows mounting ConfigMaps from watchable and non-watchable
directories. ConfigMap mounts can't be meaningfully verified anyway, so
the exact location of the data does not matter, except that we stay in
the sandbox data dirs.

[1]: 0ce3f5fc6f/docs/design/inotify.md (L11-L21)

Fixes: #11777
Signed-off-by: Markus Rudy <mr@edgeless.systems>
2025-10-23 15:45:17 +02:00
Fabiano Fidêncio
94adc58342 tests: Ensure helm secret for kata-deploy installation is cleaned up
Every now and then, in case a failure happens, helm leaves the secret
behind without cleaning it up, leading to issues in the consecutive
runs.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-23 11:15:13 +02:00
Fabiano Fidêncio
12a515826d tools: Install Golang from a reliable mirror (follow-up)
Aurélien has moved to a reliable mirror for our tests, but we missed
that our tools Dockerfiles could benefit from the same change, which is
added now.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-23 11:15:13 +02:00
Fabiano Fidêncio
560425f31f build: kernel: Bump version to trigger signed builds for arm64 GPU
Although we saw this happening, we expected it to NOT happen ...

As the kernel is not signed, but we expect it to be (the cached
version), then we're bailing. :-/

Let's ensure a full rebuild of kernels happen and we'll be good from
that point onwards.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-23 11:15:13 +02:00
Zvonko Kaiser
0b11190fcf gpu: Add Arm64 kernel signing
Adopt working amd64 workflow to arm64

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-10-22 21:05:32 +02:00
Mikko Ylinen
1beda258b8 qemu: nvidia: tdx: add quote-generation-socket for attestation to work
Add TDX QGS quote-generation-socket TDX QEMU object params for
attestation to work in NVGPU+TDX environment.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2025-10-22 21:01:35 +02:00
Hyounggyu Choi
2c805900a4 Merge pull request #11891 from stevenhorsman/signature-tests-with-initdata
tests/k8s: Add initdata variants of signature verification and registry authentication tests
2025-10-22 20:27:26 +02:00
Fabiano Fidêncio
ba912e6a84 kata-deploy: Adapt nydus installation to MULTI_INSTALL_SUFFIX
By doing this we can ensure that more than one instance of
nydus-snapshotter can be running inside the cluster, which is super
useful for doing A-B "upgrades" (where we install a new version of
kata-containers + nydus on B, while A is still running, and then only
uninstall A after making sure that B is working as expected).

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-22 20:25:03 +02:00
Fupan Li
5615c9af84 Merge pull request #11722 from RuoqingHe/2025-08-25-move-mem-agent-to-libs
libs: Move mem-agent into libs workspace
2025-10-22 11:23:33 +02:00
Fabiano Fidêncio
ded336405f kata-deploy: All qemu variants use .hypervisors.qemu.*
We've been wrongly trying to set up the `${shim}` (as the qemu-snp, for
instance) as the hypervisor name in the kata-containers configuration
file, leading to an `tomlq` breaking as all the .hypervisors.qemu* shims
are tied to the `qemu` hypervisor, and it happens regardless of the shim
having a different name, or the hypervisor being experimental or not.

```sh
$ grep "hypervisor.qemu*" src/runtime/config/configuration-*
src/runtime/config/configuration-qemu-cca.toml.in:[hypervisor.qemu]
src/runtime/config/configuration-qemu-coco-dev.toml.in:[hypervisor.qemu]
src/runtime/config/configuration-qemu-nvidia-gpu-snp.toml.in:[hypervisor.qemu]
src/runtime/config/configuration-qemu-nvidia-gpu-tdx.toml.in:[hypervisor.qemu]
src/runtime/config/configuration-qemu-nvidia-gpu.toml.in:[hypervisor.qemu]
src/runtime/config/configuration-qemu-se.toml.in:[hypervisor.qemu]
src/runtime/config/configuration-qemu-snp.toml.in:[hypervisor.qemu]
src/runtime/config/configuration-qemu-tdx.toml.in:[hypervisor.qemu]
src/runtime/config/configuration-qemu.toml.in:[hypervisor.qemu]

$ grep "hypervisor.qemu*" src/runtime-rs/config/configuration-*
src/runtime-rs/config/configuration-qemu-runtime-rs.toml.in:[hypervisor.qemu]
src/runtime-rs/config/configuration-qemu-se-runtime-rs.toml.in:[hypervisor.qemu]
```

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-22 10:23:12 +02:00
Ruoqing He
000f707205 libs: mem-agent: Add missing #[cfg(test)]
`tests` module inside `memcg` module should be gated behind `test`, add
`[#cfg(test)]` to make those tests work properly.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-10-22 03:26:35 +00:00
Ruoqing He
831f3ab616 libs: mem-agent: Skip tests require root
Some tests from mem-agent requires root privilege, use
`skip_if_not_root` to skip those tests if they were not executed under
root user.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-10-22 03:26:35 +00:00
Ruoqing He
ac539baeaa libs: Ignore clippy precedence and identity_op
Ignoring `precedence` and `identity_op` clippy warning suggested by rust
1.85.1 for now.

```console
error: operator precedence can trip the unwary
   --> mem-agent/src/compact.rs:273:61
    |
273 | ...                   total_free_movable_pages += count * 1 << order;
    |                                                   ^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(count * 1) << order`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
    = note: `-D clippy::precedence` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::precedence)]`

    Checking kata-types v0.1.0 (/root/riscv/kata-containers/src/libs/kata-types)
error: this operation has no effect
   --> mem-agent/src/compact.rs:273:61
    |
273 | ...                   total_free_movable_pages += count * 1 << order;
    |                                                   ^^^^^^^^^ help: consider reducing it to: `count`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op
    = note: `-D clippy::identity-op` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::identity_op)]`
```

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-10-22 03:26:35 +00:00
Ruoqing He
4dec1a32eb libs: Allow clippy type_complexity
Prefixing with `#[allow(clippy::type_complexity)]` to silence this
warning, the return type is documented in comments.

```console
error: very complex type used. Consider factoring parts into `type` definitions
   --> mem-agent/src/mglru.rs:184:6
    |
184 | ) -> Result<HashMap<String, (usize, HashMap<usize, MGenLRU>)>> {
    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
    = note: `-D clippy::type-complexity` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::type_complexity)]`
```

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-10-22 03:26:35 +00:00
Ruoqing He
241e6db237 libs: Fix clippy absurd_extreme_comparisons
Manually fix `redundant_field_names ` clippy warning by testing equality
against 0 as suggested by rust 1.85.1, since `mem-agent` is now a member
of `libs` workspace.

```console
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
  --> mem-agent/src/psi.rs:62:8
   |
62 |       if reader
   |  ________^
63 | |         .read_line(&mut first_line)
64 | |         .map_err(|e| anyhow!("reader.read_line failed: {}", e))?
65 | |         <= 0
   | |____________^
   |
   = help: because `0` is the minimum value for this type, the case where the two sides are not equal never occurs, consider using `reader
                   .read_line(&mut first_line)
                   .map_err(|e| anyhow!("reader.read_line failed: {}", e))? == 0` instead
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#absurd_extreme_comparisons
   = note: `#[deny(clippy::absurd_extreme_comparisons)]` on by default
```

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-10-22 03:26:35 +00:00
Ruoqing He
495e012160 libs: Fix clippy redundant_field_names
Manually fix `redundant_field_names` clippy warning as suggested by rust
1.85.1, since `mem-agent` is now a member of `libs` workspace.

```console
error: redundant field names in struct initialization
   --> mem-agent/src/memcg.rs:441:13
    |
441 |             numa_id: numa_id,
    |             ^^^^^^^^^^^^^^^^ help: replace it with: `numa_id`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
    = note: `-D clippy::redundant-field-names` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::redundant_field_names)]`
```

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-10-22 03:26:35 +00:00
Ruoqing He
96c1175580 libs: Fix clippy manual_strip
Manually fix `manual_strip` clippy warning as suggested by rust 1.85.1,
since `mem-agent` is now a member of `libs` workspace.

```console
error: stripping a prefix manually
   --> mem-agent/src/mglru.rs:284:29
    |
284 |         u32::from_str_radix(&content[2..], 16)
    |                             ^^^^^^^^^^^^^
    |
note: the prefix was tested here
   --> mem-agent/src/mglru.rs:283:13
    |
283 |     let r = if content.starts_with("0x") {
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip
    = note: `-D clippy::manual-strip` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::manual_strip)]`
help: try using the `strip_prefix` method
    |
283 ~     let r = if let Some(<stripped>) = content.strip_prefix("0x") {
284 ~         u32::from_str_radix(<stripped>, 16)
    |
```

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-10-22 03:26:35 +00:00
Ruoqing He
2dc0b14512 libs: Fix clippy field_reassign_with_default
Manually fix `field_reassign_with_default` clippy warning as suggested
by rust 1.85.1, since `mem-agent` is now a member of `libs` workspace.

```console
error: field assignment outside of initializer for an instance created with Default::default()
   --> mem-agent/src/memcg.rs:874:21
    |
874 |                     numa_cg.numa_id = numa;
    |                     ^^^^^^^^^^^^^^^^^^^^^^^
    |
note: consider initializing the variable with `memcg::CgroupConfig { numa_id: numa, ..Default::default() }` and removing relevant reassignments
   --> mem-agent/src/memcg.rs:873:21
    |
873 |                     let mut numa_cg = CgroupConfig::default();
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
    = note: `-D clippy::field-reassign-with-default` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::field_reassign_with_default)]`
```

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-10-22 03:26:35 +00:00
Ruoqing He
b399ac7f6d libs: Fix clippy derivable_impls
Fix `derivable_impls` clippy warning as suggested by rust 1.85.1, since
`mem-agent` is now a member of `libs` workspace.

```console
error: this `impl` can be derived
   --> mem-agent/src/memcg.rs:123:1
    |
123 | / impl Default for CgroupConfig {
124 | |     fn default() -> Self {
125 | |         Self {
126 | |             no_subdir: false,
...   |
132 | | }
    | |_^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
    = note: `-D clippy::derivable-impls` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::derivable_impls)]`
help: replace the manual implementation with a derive attribute
    |
117 + #[derive(Default)]
118 ~ pub struct CgroupConfig {
    |
```

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-10-22 03:26:35 +00:00
Ruoqing He
55bafa257d libs: Fix clippy redundant_pattern_matching
Fix `redundant_pattern_matching` clippy warning as suggested by rust
1.85.1, since `mem-agent` is now a member of `libs` workspace.

```console
error: redundant pattern matching, consider using `is_some()`
   --> mem-agent/src/memcg.rs:595:40
    |
595 | ...                   if let Some(_) = config_map.get_mut(path) {
    |                       -------^^^^^^^--------------------------- help: try: `if config_map.get_mut(path).is_some()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
    = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::redundant_pattern_matching)]`
```

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-10-22 03:26:35 +00:00
Ruoqing He
a9f415ade5 libs: Fix clippy needless_bool
Fix `needless_bool` clippy warning as suggested by rust 1.85.1, since
`mem-agent` is now a member of `libs` workspace.

```console
error: this if-then-else expression returns a bool literal
   --> mem-agent/src/memcg.rs:855:17
    |
855 | /                 if configs.is_empty() {
856 | |                     true
857 | |                 } else {
858 | |                     false
859 | |                 }
    | |_________________^ help: you can reduce it to: `configs.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool
    = note: `-D clippy::needless-bool` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::needless_bool)]`
```

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-10-22 03:26:35 +00:00
Ruoqing He
6959bc1b3c libs: Fix clippy for_kv_map
Fix `for_kv_map` clippy warning as suggested by rust 1.85.1, since
`mem-agent` is now a member of `libs` workspace.

```console

error: you seem to want to iterate on a map's keys
   --> mem-agent/src/memcg.rs:822:43
    |
822 |                 for (single_config, _) in &secs_map.cgs {
    |                                           ^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map
help: use the corresponding method
    |
822 |                 for single_config in secs_map.cgs.keys() {
    |                     ~~~~~~~~~~~~~    ~~~~~~~~~~~~~~~~~~~
```

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-10-22 03:26:35 +00:00
Ruoqing He
702665ee8b libs: Fix clippy manual_map
Fix `manual_map` clippy warning as suggested by rust 1.85.1, since
`mem-agent` is now a member of `libs` workspace.

```console
error: manual implementation of `Option::map`
   --> mem-agent/src/memcg.rs:375:21
    |
375 | /                     if let Some(hmg) = hmg.get(&(*numa_id as usize)) {
376 | |                         Some((*numa_id, Numa::new(hmg, path, psi_path)))
377 | |                     } else {
378 | |                         None
379 | |                     }
    | |_____________________^ help: try: `hmg.get(&(*numa_id as usize)).map(|hmg| (*numa_id, Numa::new(hmg, path, psi_path)))`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map
    = note: `-D clippy::manual-map` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::manual_map)]`
```

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-10-22 03:26:35 +00:00
Ruoqing He
b47a382d00 libs: Fix clippy into_iter_on_ref
Fix `into_iter_on_ref` clippy warning as suggested by rust 1.85.1, since
`mem-agent` is now a member of `libs` workspace.

```console
error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `Vec`
    --> mem-agent/src/memcg.rs:1122:27
     |
1122 |         for info in infov.into_iter() {
     |                           ^^^^^^^^^ help: call directly: `iter_mut`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
     = note: `-D clippy::into-iter-on-ref` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::into_iter_on_ref)]`
```

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-10-22 03:26:35 +00:00