Skip to content

Commit e3c5cf2

Browse files
committed
update block device module detection to handle vms
Signed-off-by: Zen <[email protected]>
1 parent d38bb2b commit e3c5cf2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/ugrd/fs/mounts.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "desultory"
2-
__version__ = "7.1.3"
2+
__version__ = "7.1.4"
33

44
from pathlib import Path
55
from re import search
@@ -1070,6 +1070,9 @@ def resolve_blkdev_kmod(self, device) -> list[str]:
10701070
kmods.append("virtio_blk")
10711071
elif device_name.startswith("sd"):
10721072
kmods.append("sd_mod")
1073+
if self["virtual_machine"]:
1074+
self.logger.info(f"Auto-enabling virtio_scsi for virtual machine block device: {c_(device_name, 'cyan')}")
1075+
kmods.append("virtio_scsi")
10731076
elif device_name.startswith("mmcblk"):
10741077
kmods.append("mmc_block")
10751078
elif device_name.startswith("sr"):

src/ugrd/kmod/platform.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from zenlib.util import colorize as c_
2-
from zenlib.util import contains, unset
2+
from zenlib.util import contains
33

44
__version__ = "0.1.0"
55

@@ -28,7 +28,6 @@ def get_platform_info(self):
2828
self["_dmi_system_vendor"] = f.read().strip()
2929

3030

31-
@unset("virtual_machine", "virtual_machine is already set, skipping VM detection.", log_level=10)
3231
@contains("hostonly", "hostonly is not enabled, skipping VM detection.", log_level=30)
3332
def autodetect_virtual_machine(self):
3433
"""Detects if the system is running in a virtual machine, adds relevant kernel modules to the list.

0 commit comments

Comments
 (0)