-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Virt cdrom fix #57479
Virt cdrom fix #57479
Conversation
Pretty sure this will get merged after the code thaw 🧊 🌞 |
you mean it's likely not to hit Sodium? |
Rebased on master, added more tests and fixed an uncovered bug in the target name generation code |
rebased on master |
Updated on latest master |
salt/modules/virt.py
Outdated
"{0}{1}".format(prefix, string.ascii_lowercase[i]) | ||
for i in range(disks_count) | ||
if "{0}{1}".format(prefix, string.ascii_lowercase[i]) not in targets | ||
][0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but logically it should be more effective if we'll not build the entire list to just get the first item. Maybe something like this?
for i in range(disks_count):
ret = "{0}{1}".format(prefix, string.ascii_lowercase[i])
if ret not in targets:
return ret
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, I'll change that then
@DmitryKuzmenko Just included your suggestion |
cdrom sources can't be of format qcow2. Force raw as the default if needed when creating VM with source_file set for the cdrom.
Fixes issue saltstack#57477.
When a DVD device on a VM has a remote source, virt.update needs to be able to handle detaching it and attaching a file image live.
rebased on master |
What does this PR do?
This issue fixes some issues with the handling of CDROM images attaching and changing on VM created or updated by
virt.init()
andvirt.update()
functions.What issues does this PR fix or reference?
Fixes: #57477
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
Yes