1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-01 16:36:06 +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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
catborise 2026-11-08 14:40:26 +03:00
parent 1ddc941b2d
commit f94124c891
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)