openanolis / dragonball-sandbox

Dragonball-sandbox is a collection of Rust crates to help build custom Virtual Machine Monitors and hypervisors.
Apache License 2.0
89 stars 42 forks source link

dbs-virtio-devices: Clear resources when removing virtio-net and vsock devices #277

Closed justxuewei closed 1 year ago

justxuewei commented 1 year ago

This PR implements functionaility of clearing resources for virtio-net and virtio-vsock devices.

For virtio-net devices, the removed resource is its event hanlder.

For virtio-vsock devices, the removed resources are its event handler and a socket on the host.

Fixes: #273

codecov[bot] commented 1 year ago

Codecov Report

Merging #277 (7da8349) into main (804bd6e) will decrease coverage by 0.08%. The diff coverage is 13.04%.

@@            Coverage Diff             @@
##             main     #277      +/-   ##
==========================================
- Coverage   90.51%   90.44%   -0.08%     
==========================================
  Files          82       82              
  Lines       24574    24597      +23     
==========================================
+ Hits        22243    22246       +3     
- Misses       2331     2351      +20     
Flag Coverage Δ
dbs-address-space 95.30% <ø> (ø)
dbs-allocator 94.98% <ø> (ø)
dbs-arch 96.37% <ø> (ø)
dbs-boot 94.90% <ø> (ø)
dbs-device 92.95% <ø> (ø)
dbs-interrupt 90.42% <ø> (ø)
dbs-legacy-devices 92.77% <ø> (ø)
dbs-miniball ?
dbs-upcall 94.31% <ø> (ø)
dbs-utils 91.25% <ø> (ø)
dbs-virtio-devices 87.34% <13.04%> (-0.13%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
crates/dbs-virtio-devices/src/net.rs 85.71% <0.00%> (-0.86%) :arrow_down:
crates/dbs-virtio-devices/src/vsock/device.rs 79.49% <0.00%> (-3.48%) :arrow_down:
...bs-virtio-devices/src/vsock/backend/unix_stream.rs 95.45% <100.00%> (+0.10%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

studychao commented 1 year ago

please help fix the clippy warnings.