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

filter out snapshot from VirtualSystemSettingData #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rbalwani
Copy link

If virtual machine has checkpoint we currently return first result which can belong to VM or checkpoint. This will cause unexpected failures while deleting or resizing virtual machine. This pull request fixes this issue by filtering out snapshots.

@rbalwani rbalwani requested review from liwonMS and madhanrm February 12, 2025 02:53

// filter out the snapshot realized system type
if systemType != "Microsoft:Hyper-V:Snapshot:Realized" {
return vssd, nil

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we find the instance we're looking for before the end of the list, won't we leak the wmi instances after this one? Seems like it would be safer to just clone the one we want to return then defer close the whole collection.

Copy link
Author

@rbalwani rbalwani Feb 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that is possible, will update PR

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

Successfully merging this pull request may close these issues.

5 participants