[libvirt] [PATCH v2 5/5] storage: Ignore block devices that fail format detection

John Ferlan jferlan at redhat.com
Tue Nov 24 20:57:16 UTC 2015


Prior to commit id '98322052' failure to saferead the block device would
cause an error to be logged and the device to be skipped while attempting
to discover/create a stable target path for a new LUN (NPIV).

This was because virStorageBackendSCSIFindLUs ignored errors from
processLU and virStorageBackendSCSINewLun.

Ignoring the failure allowed a multipath device with an "active" and
"ghost" to be present on the host with the "ghost" block device being
ignored. This patch will return a -2 to the caller indicating the desire
to ignore the block device since it cannot be used directly rather than
fail the pool startup.

Signed-off-by: John Ferlan <jferlan at redhat.com>
 src/storage/storage_backend_scsi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c
index cc2c5d7..27c90f6 100644
--- a/src/storage/storage_backend_scsi.c
+++ b/src/storage/storage_backend_scsi.c
@@ -224,8 +224,10 @@ virStorageBackendSCSINewLun(virStoragePoolObjPtr pool,
         goto cleanup;
-    if (virStorageBackendUpdateVolInfo(vol, true,
-                                       VIR_STORAGE_VOL_OPEN_DEFAULT, 0) < 0)
+    /* Allow a volume read failure to ignore or skip this block file */
+    if ((retval = virStorageBackendUpdateVolInfo(vol, true,
+                                                 VIR_STORAGE_VOL_OPEN_DEFAULT,
+                                                 VIR_STORAGE_VOL_READ_ERROR)) < 0)
         goto cleanup;
     if (!(vol->key = virStorageBackendSCSISerial(vol->target.path)))

More information about the libvir-list mailing list