]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
nodedev: improve DASD detection
authorBoris Fiuczynski <fiuczy@linux.ibm.com>
Wed, 19 Jun 2024 12:29:15 +0000 (14:29 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 20 Jun 2024 07:34:19 +0000 (09:34 +0200)
In newer DASD driver versions the ID_TYPE tag is supported. This tag is
missing after a system reboot but when the ccw device is set offline and
online the tag is included. To fix this version independently we need to
check if devices detected as type disk is actually a DASD to maintain
the node object consistency and not end up with multiple node objects
for DASDs.

Resolves: https://issues.redhat.com/browse/RHEL-39497
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/node_device/node_device_udev.c

index 84848a3d5c9eafaca632a056167f875b66df56dc..2ccf694580d7870881094e50fdbbf8b902c32c4c 100644 (file)
@@ -1067,6 +1067,10 @@ udevProcessStorage(struct udev_device *device,
             storage->drive_type = g_strdup("sd");
         else if (udevKludgeStorageType(def) != 0)
             goto cleanup;
+    } else {
+        /* A detected disk might be a DASD */
+        if (STREQ(def->caps->data.storage.drive_type, "disk"))
+            udevFixupStorageType(def, "/dev/dasd", "dasd");
     }
 
     if (STREQ(def->caps->data.storage.drive_type, "cd") ||