[GH-ISSUE #137] ISO storage pool uses case sensitive extensions #112

Closed
opened 2026-02-27 16:37:59 +03:00 by kerem · 1 comment
Owner

Originally created by @cc-daveloper on GitHub (Oct 25, 2013).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/137

The match for .iso and .img are case sensitive when they should be case insensitive to also match for .ISO and .IMG. The primary impetus is that M$ and others commonly distribute their images with the upper case .IMG extension.

Originally created by @cc-daveloper on GitHub (Oct 25, 2013). Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/137 The match for .iso and .img are case sensitive when they should be case insensitive to also match for .ISO and .IMG. The primary impetus is that M$ and others commonly distribute their images with the upper case .IMG extension.
kerem closed this issue 2026-02-27 16:38:00 +03:00
Author
Owner

@jansauerbrey commented on GitHub (Oct 27, 2013):

In addition to the upper behaiviour, I use LVM volumes which do not have any .img endings. So the check to show only *.img files within the storage pool results in no hdd entry for me.

Is it possible to remove or disable this check for img again since normally within your pool you should have only your images?

Thanks
Jan

P.S: I use ubuntu 12.04 and the newest version 3.3.4

P.P.S:

For my issue I checked the code and edited the server.py as follows:


$ diff server.py.ORIG server.py
277c277,280

< if stg.info()[0] != 0:

        stg_type = get_xml_path(stg.XMLDesc(0), "/pool/@type")
        if stg_type == 'logical':
  image_type = 'raw'
        elif stg.info()[0] != 0:

464,465c467,473
< for img in stg.listVolumes():

< if re.findall(".img", img):

            stg_type = get_xml_path(stg.XMLDesc(0), "/pool/@type")
            if stg_type == 'dir':
                for img in stg.listVolumes():
                    if re.findall(".img", img):
                        disk.append(img)
            else:
                for img in stg.listVolumes():

546c555,563

< if re.findall(".img", name) or re.findall(".iso", name):

        stg_type = get_xml_path(stg.XMLDesc(0), "/pool/@type")
        if stg_type == 'dir':
            if re.findall(".img", name) or re.findall(".iso", name):
                vol = stg.storageVolLookupByName(name)
                xml = vol.XMLDesc(0)
                size = vol.info()[1]
                volume_format = get_xml_path(xml, "/volume/target/format/@type")
                volume_info[name] = size, volume_format
        else:

First change addresses problems with apparmor when driver type is set to 'None'
Second and third change address missing handling of logical storage pools.

<!-- gh-comment-id:27170991 --> @jansauerbrey commented on GitHub (Oct 27, 2013): In addition to the upper behaiviour, I use LVM volumes which do not have any .img endings. So the check to show only *.img files within the storage pool results in no hdd entry for me. Is it possible to remove or disable this check for img again since normally within your pool you should have only your images? Thanks Jan P.S: I use ubuntu 12.04 and the newest version 3.3.4 P.P.S: For my issue I checked the code and edited the server.py as follows: --- $ diff server.py.ORIG server.py 277c277,280 ## < if stg.info()[0] != 0: > ``` > stg_type = get_xml_path(stg.XMLDesc(0), "/pool/@type") > if stg_type == 'logical': > image_type = 'raw' > elif stg.info()[0] != 0: > ``` > > 464,465c467,473 > < for img in stg.listVolumes(): > > ## < if re.findall(".img", img): > > ``` > stg_type = get_xml_path(stg.XMLDesc(0), "/pool/@type") > if stg_type == 'dir': > for img in stg.listVolumes(): > if re.findall(".img", img): > disk.append(img) > else: > for img in stg.listVolumes(): > ``` > > 546c555,563 > > ## < if re.findall(".img", name) or re.findall(".iso", name): > > ``` > stg_type = get_xml_path(stg.XMLDesc(0), "/pool/@type") > if stg_type == 'dir': > if re.findall(".img", name) or re.findall(".iso", name): > vol = stg.storageVolLookupByName(name) > xml = vol.XMLDesc(0) > size = vol.info()[1] > volume_format = get_xml_path(xml, "/volume/target/format/@type") > volume_info[name] = size, volume_format > else: > ``` > > --- First change addresses problems with apparmor when driver type is set to 'None' Second and third change address missing handling of logical storage pools.
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#112
No description provided.