Skip to content

Remove CD-ROM from block devices - #485

Open
Cristi1324 wants to merge 1 commit into
cloudbase:masterfrom
Cristi1324:fix-cdrom-in-block-devices
Open

Remove CD-ROM from block devices#485
Cristi1324 wants to merge 1 commit into
cloudbase:masterfrom
Cristi1324:fix-cdrom-in-block-devices

Conversation

@Cristi1324

Copy link
Copy Markdown
Contributor
image

MAJOR_COLUMN_INDEX = 4

# lsblk TYPE values that are not migration volumes (CD-ROM, loopback, etc.).
_NON_VOLUME_BLOCK_DEVICE_TYPES = frozenset({"part", "rom", "loop"})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, considering that we don't migrate loopback devices in the first place, I wonder how "loop" can be encountered during OS morphing.

@Dany9966 Dany9966 Aug 5, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead of filtering out the types, filter in?

Suggested change
_NON_VOLUME_BLOCK_DEVICE_TYPES = frozenset({"part", "rom", "loop"})
_VOLUME_BLOCK_DEVICE_TYPES = frozenset({"disk", "part"})
            if (len(parts) >= 2
                    and parts[1] in _VOLUME_BLOCK_DEVICE_TYPES):
                volume_devs.append("/dev/%s" % parts[0])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually that method should return only disk block devices. So only return disk types.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, considering that we don't migrate loopback devices in the first place, I wonder how "loop" can be encountered during OS morphing.

No, but the lsblk command returns the devices available on the minion, so it apperently returns the loop devices on the minion machine. Not sure why it does that, iirc this didn't happen in the past.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants