Skip to contentSkip to conversation

multipath-tools/libmultipath discovery.c

PATCH [email protected] 1 participant 1 message Aug 11, 2010 Device mapper

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: [email protected] 2010-08-11 23:05:50

Modified files:
libmultipath : discovery.c

Log message:

	Fix for bz #576600
	Patch to allow multipath to handle virtio devices. Mostly for testing purposes.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/discovery.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.32.2.14&r2=1.32.2.15

libmultipath/discovery.c +7 -0
@@ -481,6 +481,7 @@
 	char attr_path[FILE_NAME_SIZE];
 	char attr_buff[FILE_NAME_SIZE];
 	unsigned int unused;
+	char vdisk;
 
 	pp->bus = SYSFS_BUS_UNDEF;
 
@@ -489,6 +490,12 @@
 		strcpy(pp->product_id, "GNBD");
 		pp->hwe = find_hwe(conf->hwtable, pp->vendor_id, pp->product_id);
 		return 0;
+	} else if (sscanf(pp->dev, "vd%c", &vdisk) == 1 &&
+		   'a' <= vdisk && vdisk <= 'z'){
+		strcpy(pp->vendor_id,  "VIRTIO");
+		strcpy(pp->product_id, "VIRTIO");
+		pp->hwe = find_hwe(conf->hwtable, pp->vendor_id, pp->product_id);
+		return 0;
 	}
 	/*
 	 * This is ugly : we should be able to do a simple