-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vmm: support VFIO device #99
Conversation
Burning1020
commented
Dec 4, 2023
•
edited
Loading
edited
- Support VFIO device in vmm.
- Run libc::connect() in spawn_blocking to avoid blocking other task.
- Return OK() if sandbox is in CREATED state.
- Return io error in cmd pre_exec
3f52e80
to
1290b92
Compare
It would be better to split three commits, a little confusing to review if mixed together |
vmm/sandbox/src/network/mod.rs
Outdated
{ | ||
Ok(interface) => interface, | ||
Err(e) => { | ||
warn!("failed to parse network interface: {}, paas it", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pass
@@ -266,6 +266,20 @@ impl NetworkInterface { | |||
} | |||
} | |||
} | |||
// find the pci device for unknown type interface, maybe it is a physical interface. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it certain that all physical interface with unknown type? Or is there any possibility that any other inferface with unknown type, will it cause any problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it certain that all physical interface with unknown type? Or is there any possibility that any other inferface with unknown type, will it cause any problem?
We checked the netlink.LinkDeserialize() golang code, every type does have a correspond struct, but some of the structs do not be used, so we centralize them by Unknown type.
247c514
to
5da472e
Compare
Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
.map_err(|_| anyhow!("hvsock retry {}ms timeout", HVSOCK_RETRY_TIMEOUT_IN_MS))? | ||
}) | ||
.await | ||
.map_err(|e| anyhow!("failed to spawn blocking task: {}", e))? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the timeout removed when waiting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have three kinds of "connectiing" method for unix socket, vsock and hvsock. All the methonds only handle the connecting, leaving the timeout be handled in the upper caller, e.g. new_ttrpc_client
.
let start_time = SystemTime::now(); | ||
loop { | ||
tokio::task::spawn_blocking(move || loop { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have to change it to async?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have called sync function UnixStream::connect()
, thus it's better put it in a spawn_blocking
vmm/sandbox/src/network/mod.rs
Outdated
{ | ||
Ok(interface) => interface, | ||
Err(e) => { | ||
warn!("failed to parse network interface: {}, pass it", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignore it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good
Signed-off-by: Zhang Tianyang <burning9699@gmail.com>