[PR #430] [MERGED] fix an infinite loop when attaching an ISO to non-WebVirtMgr domain #654

Closed
opened 2026-02-27 16:40:02 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/retspen/webvirtmgr/pull/430
Author: @Nowaker
Created: 9/15/2014
Status: Merged
Merged: 10/6/2014
Merged by: @retspen

Base: masterHead: feature/mount-iso-to-arbitrary-domains


📝 Commits (2)

  • 06cd926 fix an infinite loop when attaching an ISO to non-WebVirtMgr domain
  • f4dbf78 live mount ISO

📊 Changes

1 file changed (+12 additions, -7 deletions)

View changed files

📝 vrtManager/instance.py (+12 -7)

📄 Description

Infinite loop happens when domain XML is created outside of WebVirtMgr. WVM expects CD-ROM entry after hard drives.

Failing:

    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/iso/archlinux-2014.09.03-dual.iso'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' target='0' unit='1'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/ssd/5be1d57b-d5b1-4278-a807-d8dfefe3598a_vda.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>

Working:

    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/hdd/sdfsdfsdf.img'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/iso/FreeBSD-10.0-RELEASE-amd64-dvd1.iso'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' target='0' unit='1'/>
    </disk>

This fixes it. Added a simple Python equivalent of non-first level break.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/retspen/webvirtmgr/pull/430 **Author:** [@Nowaker](https://github.com/Nowaker) **Created:** 9/15/2014 **Status:** ✅ Merged **Merged:** 10/6/2014 **Merged by:** [@retspen](https://github.com/retspen) **Base:** `master` ← **Head:** `feature/mount-iso-to-arbitrary-domains` --- ### 📝 Commits (2) - [`06cd926`](https://github.com/retspen/webvirtmgr/commit/06cd926fbaeab61e52cc38386d12e4791c6e2eb2) fix an infinite loop when attaching an ISO to non-WebVirtMgr domain - [`f4dbf78`](https://github.com/retspen/webvirtmgr/commit/f4dbf78a90505a67fe67c0855ba4fdd74d916584) live mount ISO ### 📊 Changes **1 file changed** (+12 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `vrtManager/instance.py` (+12 -7) </details> ### 📄 Description Infinite loop happens when domain XML is created outside of WebVirtMgr. WVM expects CD-ROM entry after hard drives. Failing: ``` xml <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/iso/archlinux-2014.09.03-dual.iso'/> <target dev='hda' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='1' target='0' unit='1'/> </disk> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/ssd/5be1d57b-d5b1-4278-a807-d8dfefe3598a_vda.qcow2'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </disk> ``` Working: ``` xml <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/hdd/sdfsdfsdf.img'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/iso/FreeBSD-10.0-RELEASE-amd64-dvd1.iso'/> <target dev='hda' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='1' target='0' unit='1'/> </disk> ``` This fixes it. Added a simple Python equivalent of [non-first level `break`](http://stackoverflow.com/a/189685/504845). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 16:40:02 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtmgr#654
No description provided.