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

CA-172039: Remove race conditions in VM.revert #2258

Merged
merged 2 commits into from
Jun 17, 2015

Conversation

simonjbeaumont
Copy link
Contributor

No description provided.

The Message_forwarding layer reverted the some of the VM's fields on the master
before sending the operation to relevant host. This will generate some Xapi
events and can cause issues if they result in updates to Xenopsd metadata.

As a concrete example, consider a halted VM that has no GPU passthrough; then:

  1. Snapshot the VM;
  2. Assign it a GPU for passthrough;
  3. Start the VM;
  4. Revert the VM to the snapshot (1).

This will cause an error because the PCI that is assigned for passthrough is
stored in the VM.other_config field. When this is reverted it will generate
a Xapi event which results in Xenopsd being told that the VM has no PCIs
anymore and so Xenopsd removes its knowledge of the PCI device.

However, this is racing with the VM.hard_shutdown that is part of the VM.revert
call which can then fail when it gets to the PCI.unplug operation since the PCI
has been removed from the Xenopsd database.

This changeset moves the VM.hard_shutdown logic before the reversion of the VM
record.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Make the checks with the appropriate VM marked.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
@johnelse
Copy link
Contributor

Looks good to merge once it's built.

simonjbeaumont added a commit that referenced this pull request Jun 17, 2015
CA-172039: Remove race conditions in VM.revert
@simonjbeaumont simonjbeaumont merged commit 53cf5e5 into xapi-project:master Jun 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants