Skip to content

Commit

Permalink
Catch ENODEV as well when checking if a device is available
Browse files Browse the repository at this point in the history
This triggers on kernel updates on Arch without rebooting first so
let's make sure we handle it as well.
  • Loading branch information
DaanDeMeyer committed Mar 12, 2024
1 parent 43aaa3e commit ea9ef16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mkosi/qemu.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ def available(self, log: bool = False) -> bool:
try:
os.close(self.open())
except OSError as e:
if e.errno not in (errno.ENOENT, errno.EPERM, errno.EACCES):
if e.errno not in (errno.ENOENT, errno.ENODEV, errno.EPERM, errno.EACCES):
raise e

if log and e.errno == errno.ENOENT:
if log and e.errno in (errno.ENOENT, errno.ENODEV):
logging.warning(f"{self.device()} not found. Not adding {self.description()} to the virtual machine.")

if log and e.errno in (errno.EPERM, errno.EACCES):
Expand Down

0 comments on commit ea9ef16

Please sign in to comment.