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

Return Futures from Controller Methods #85

Open
1 of 6 tasks
oberien opened this issue Jun 14, 2017 · 1 comment
Open
1 of 6 tasks

Return Futures from Controller Methods #85

oberien opened this issue Jun 14, 2017 · 1 comment

Comments

@oberien
Copy link
Collaborator

oberien commented Jun 14, 2017

Action-performing methods should return a future which resolves as soon as the performed action is confirmed by qemu / the GA.

  • io_attach: Resolves when {return: {}} is returned by qemu. When waking up from suspend it resolves after attaching the devices. If all devices are already attached, an instataneously resolving future will be returned.
  • io_force_attach: ~
  • io_detach: Resolves when DEVICE_DELETED is returned by qemu as often as the number of devices to be disconnected.
  • action: Resolves based on the previous action taken.
  • suspend: Resolves when SUSPEND is returned by qemu.
  • shutdown: Resolves when SHUTDOWN or SUSPEND_DISK is returned by qemu.
@main--
Copy link
Owner

main-- commented Jun 14, 2017

Consider doing this a little differently: Instead of just dumping naked device add commands into the stream, implement what is essentially an RPC wrapper where you add a single device asynchronously. It also needs to have a lock so we don't have multiple concurrent calls (or else we have no clue what call a return belongs with (?)). Then io attach/detach just calls that for every device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants