}
+static int
+udevProcessDASD(struct udev_device *device,
+ virNodeDeviceDefPtr def)
+{
+ virNodeDevCapStoragePtr storage = &def->caps->data.storage;
+
+ if (udevGetStringSysfsAttr(device, "device/uid", &storage->serial) < 0)
+ return -1;
+
+ return udevProcessDisk(device, def);
+}
+
+
/* This function exists to deal with the case in which a driver does
* not provide a device type in the usual place, but udev told us it's
* a storage device, and we can make a good guess at what kind of
def->sysfs_path);
return 0;
}
+
+ /* For Direct Access Storage Devices (DASDs) there are
+ * currently no identifiers in udev besides ID_PATH. Since
+ * ID_TYPE=disk does not exist on DASDs they fall through
+ * the udevProcessStorage detection logic. */
+ if (STRPREFIX(def->caps->data.storage.block, "/dev/dasd")) {
+ def->caps->data.storage.drive_type = g_strdup("dasd");
+ VIR_DEBUG("Found storage type '%s' for device "
+ "with sysfs path '%s'",
+ def->caps->data.storage.drive_type,
+ def->sysfs_path);
+ return 0;
+ }
VIR_DEBUG("Could not determine storage type "
"for device with sysfs path '%s'", def->sysfs_path);
return -1;
ret = udevProcessFloppy(device, def);
} else if (STREQ(def->caps->data.storage.drive_type, "sd")) {
ret = udevProcessSD(device, def);
+ } else if (STREQ(def->caps->data.storage.drive_type, "dasd")) {
+ ret = udevProcessDASD(device, def);
} else {
VIR_DEBUG("Unsupported storage type '%s'",
def->caps->data.storage.drive_type);