kimchi-project / kimchi

An HTML5 management interface for KVM guests
https://github.com/kimchi-project/kimchi/releases/latest
Other
3.08k stars 365 forks source link

Resolve issue #1222: Cannot attach existing (but empty) logical volume to VM #1258

Closed a-a closed 5 years ago

a-a commented 5 years ago

When attaching to existing logical volumes, the file is tested against a list of VALID_RAW_CONTENT which is not always completely sensible for cases where lvm is used to manage logical volumes. As an example, the logical volume's "device" /dev/example-group/example-disk would be a symlink back to /dev/dm-1, and as the symlink is checked, it would fail validation.

This change adds a behavior to check if the file is a symlink, and if so, to check whether the symlink points back to a /dev/dm-* device, and if so, the device is considered valid. If the file is not a symlink, the original logic is retained.