|
|
e9bfca |
From adae4d57b007b99cb246c3a3e8b02189b19ce2c4 Mon Sep 17 00:00:00 2001
|
|
|
e9bfca |
From: Pino Toscano <ptoscano@redhat.com>
|
|
|
e9bfca |
Date: Fri, 27 Jul 2018 12:10:38 +0200
|
|
|
e9bfca |
Subject: [PATCH] daemon: inspect: ignore fstab devs that cannot be resolved
|
|
|
e9bfca |
(RHBZ#1608131)
|
|
|
e9bfca |
|
|
|
e9bfca |
If the /etc/fstab of a guest contains devices specified with UUID or
|
|
|
e9bfca |
LABEL, then the new OCaml inspection code will report the findfs failure
|
|
|
e9bfca |
as general failure of the inspection. OTOH, the old C inspection code
|
|
|
e9bfca |
simply ignored all the devices that cannot be resolved.
|
|
|
e9bfca |
|
|
|
e9bfca |
Hence, restore the old behaviour by ignoring unresolvable devices.
|
|
|
e9bfca |
---
|
|
|
e9bfca |
daemon/inspect_fs_unix_fstab.ml | 12 ++++++++++--
|
|
|
e9bfca |
1 file changed, 10 insertions(+), 2 deletions(-)
|
|
|
e9bfca |
|
|
|
e9bfca |
diff --git a/daemon/inspect_fs_unix_fstab.ml b/daemon/inspect_fs_unix_fstab.ml
|
|
|
e9bfca |
index edb797e3f..170440d2c 100644
|
|
|
e9bfca |
--- a/daemon/inspect_fs_unix_fstab.ml
|
|
|
e9bfca |
+++ b/daemon/inspect_fs_unix_fstab.ml
|
|
|
e9bfca |
@@ -115,12 +115,20 @@ and check_fstab_entry md_map root_mountable os_type aug entry =
|
|
|
e9bfca |
if String.is_prefix spec "UUID=" then (
|
|
|
e9bfca |
let uuid = String.sub spec 5 (String.length spec - 5) in
|
|
|
e9bfca |
let uuid = shell_unquote uuid in
|
|
|
e9bfca |
- Mountable.of_device (Findfs.findfs_uuid uuid)
|
|
|
e9bfca |
+ (* Just ignore the device if the UUID cannot be resolved. *)
|
|
|
e9bfca |
+ try
|
|
|
e9bfca |
+ Mountable.of_device (Findfs.findfs_uuid uuid)
|
|
|
e9bfca |
+ with
|
|
|
e9bfca |
+ Failure _ -> return None
|
|
|
e9bfca |
)
|
|
|
e9bfca |
else if String.is_prefix spec "LABEL=" then (
|
|
|
e9bfca |
let label = String.sub spec 6 (String.length spec - 6) in
|
|
|
e9bfca |
let label = shell_unquote label in
|
|
|
e9bfca |
- Mountable.of_device (Findfs.findfs_label label)
|
|
|
e9bfca |
+ (* Just ignore the device if the label cannot be resolved. *)
|
|
|
e9bfca |
+ try
|
|
|
e9bfca |
+ Mountable.of_device (Findfs.findfs_label label)
|
|
|
e9bfca |
+ with
|
|
|
e9bfca |
+ Failure _ -> return None
|
|
|
e9bfca |
)
|
|
|
e9bfca |
(* Resolve /dev/root to the current device.
|
|
|
e9bfca |
* Do the same for the / partition of the *BSD
|
|
|
e9bfca |
--
|
|
|
e9bfca |
2.17.1
|
|
|
e9bfca |
|