1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 09:26:03 +00:00

fix(vrtManager): an ISO put in a host CD-ROM drive is read

A CD-ROM of type block (a host drive) kept its type when an ISO was
inserted, and libvirt reads only source/@dev for that type, so the drive
stayed empty. Inserting an ISO now makes it a file drive.
This commit is contained in:
catborise 2026-11-08 14:40:26 +03:00
parent d567bbf687
commit 38b5306fee
2 changed files with 8 additions and 0 deletions

View file

@ -1139,6 +1139,7 @@ class wvmInstance(wvmConnect):
for source in disk.findall("source"):
disk.remove(source)
if path:
disk.set("type", "file") # a host drive (type block) reads source/@dev only
disk.insert(1, etree.Element("source", file=path))
try:
self.instance.updateDeviceFlags(etree.tostring(disk).decode(), affect)