Skip to content
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

Cancel running vcpus when exiting #1

Open
petrutlucian94 opened this issue Jul 9, 2019 · 0 comments
Open

Cancel running vcpus when exiting #1

petrutlucian94 opened this issue Jul 9, 2019 · 0 comments

Comments

@petrutlucian94
Copy link
Owner

petrutlucian94 commented Jul 9, 2019

We'll need to gracefully stop vcpus when the guest initiates a shutdown. One issue is that the WhpVirtualProcessor objects are moved to the vcpu runner loop and are no longer available afterwards.

A few ideas:

  1. Have the vcpu loop use a WhpVirtualProcessor reference instead of owning it
    • it needs to become Send+Sync, which may not be safe/desired, considering that WhpVirtualProcessor embeds the emulator context
    • if the vcpu thread gets a WhpVirtualProcessor reference, rust requires it to have a static lifetime
  2. Clone the WhpVirtualProcessor or libwhp;:VirtualProcessor objects
    • WhpVirtualProcessor owns a VirtualProcessor object, which implements Drop
    • WhpVirtualProcessor might become quite beefy, including objects that we use in order to emulate Kvm's API (e.g. pio/mmio events, etc)
  3. Implement a "cancel_vcpu" method on the partition object
    • We'd need to handle errors raised when canceling an already destroyed vcpu
    • doesn't seem too clean as we're duplicating functionality
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

No branches or pull requests

1 participant