Added function get_enabled to export vring enable status.#284
Added function get_enabled to export vring enable status.#284WeiChungHsu wants to merge 0 commit into
Conversation
|
Do you have an example how the corresponding change looks on the |
When the Vring is disabled (and queue set to not ready), the vhu_vsock_thread.rs still try to iterate and read RX queue, therefore, it hang at this line: Furthermore, it hang because this Queue iter() operation return error at this line: My solution in vhu_vsock_thread.rs: |
Hm. But shouldn't it error out in that case versus hanging? I do not fully understand where the hang would happen. Ideally, I think it would be great if we can avoid easy footguns by designing the API in a way that avoids them altogether. I assume chances are that people will forget this check in other implementations too? |
|
@WeiChungHsu can you fix CI issues and rebase this? |
Hi, Couple days ago, I created a PR for Sorry for my late reply. |
Yes, I am working on it now. |
e613696 to
8b80093
Compare
|
@WeiChungHsu please avoid merging from main, instead rebase this PR on current main. |
Summary of the PR
Added function get_enabled to export vring enable status.
Please summarize here why the changes in this PR are needed.
I am working on snapshot/restore feature for vhost-device-vsock crate. And during snapshot, system sends "FrontendReq::SET_VRING_ENABLE, enable false" to vhost-device-vsock device. Then the vring was disabled. However, the vring tx/rx queue still execute iter() which will return error and then system (vring) hang because vring has been disabled.
My proposed solution to solve this snapshot/restore hang issue is adding vring enable status checking before access/iter() the vring. Therefore, we need this get_enabled function to check if vring is enabled or disabled. I believe in the future, other vhost device may have similar hang issue when it executes snapshot.
Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s), and the commit message has max 60 characters for thesummary and max 75 characters for each description line.
test.
Release" section of CHANGELOG.md (if no such section exists, please create one).
unsafecode is properly documented.