@@ -84,6 +84,7 @@ enum path_check_state {
#define EMC_CLARIION "emc_clariion"
#define READSECTOR0 "readsector0"
#define CCISS_TUR "cciss_tur"
+#define RBD "rbd"
#define DEFAULT_CHECKER DIRECTIO
@@ -1136,6 +1136,23 @@ scsi_sysfs_pathinfo (struct path * pp)
}
static int
+rbd_sysfs_pathinfo (struct path * pp)
+{
+ sprintf(pp->vendor_id, "Ceph");
+ sprintf(pp->product_id, "RBD");
+
+ condlog(3, "%s: vendor = %s product = %s", pp->dev, pp->vendor_id,
+ pp->product_id);
+ /*
+ * set the hwe configlet pointer
+ */
+ pp->hwe = find_hwe(conf->hwtable, pp->vendor_id, pp->product_id, NULL);
+
+ /* should we fake host / bus / target / lun so print looks nice */
+ return 0;
+}
+
+static int
ccw_sysfs_pathinfo (struct path * pp)
{
struct udev_device *parent;
@@ -1337,6 +1354,8 @@ sysfs_pathinfo(struct path * pp)
pp->bus = SYSFS_BUS_CCW;
if (!strncmp(pp->dev,"sd", 2))
pp->bus = SYSFS_BUS_SCSI;
+ if (!strncmp(pp->dev,"rbd", 3))
+ pp->bus = SYSFS_BUS_RBD;
if (pp->bus == SYSFS_BUS_UNDEF)
return 0;
@@ -1349,6 +1368,9 @@ sysfs_pathinfo(struct path * pp)
} else if (pp->bus == SYSFS_BUS_CCISS) {
if (cciss_sysfs_pathinfo(pp))
return 1;
+ } else if (pp->bus == SYSFS_BUS_RBD) {
+ if (rbd_sysfs_pathinfo(pp))
+ return 1;
}
return 0;
}
@@ -52,6 +52,7 @@ enum sysfs_buses {
SYSFS_BUS_IDE,
SYSFS_BUS_CCW,
SYSFS_BUS_CCISS,
+ SYSFS_BUS_RBD,
};
enum pathstates {
rbd is a block device interface for Ceph. It does not support any SCSI commands, so this patch adds bus detection and virtual vendor/product pathinfo. Signed-off-by: Mike Christie <mchristi@redhat.com> --- libmultipath/checkers.h | 1 + libmultipath/discovery.c | 22 ++++++++++++++++++++++ libmultipath/structs.h | 1 + 3 files changed, 24 insertions(+)