diff mbox

multipath-tools/libmultipath discovery.c

Message ID 20100811230550.32654.qmail@sourceware.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

bmarzins@sourceware.org Aug. 11, 2010, 11:05 p.m. UTC
None
diff mbox

Patch

--- multipath-tools/libmultipath/discovery.c	2010/06/23 16:28:07	1.32.2.14
+++ multipath-tools/libmultipath/discovery.c	2010/08/11 23:05:50	1.32.2.15
@@ -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