lvm2/improve_probing.diff
2016-01-28 04:41:36 +00:00

31 lines
845 B
Diff

Index: LVM2.2.02.141/lib/filters/filter-type.c
===================================================================
--- LVM2.2.02.141.orig/lib/filters/filter-type.c
+++ LVM2.2.02.141/lib/filters/filter-type.c
@@ -12,6 +12,11 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <sys/ioctl.h>
+#include <linux/fs.h>
+#undef MAJOR
+#undef MINOR
+#undef MKDEV
#include "lib.h"
#include "filter.h"
@@ -28,6 +33,13 @@ static int _passes_lvm_type_device_filte
return 0;
}
+ /* Skip cdrom device */
+ #define CDROM_GET_CAPABILITY 0x5331
+ if (ioctl(dev->fd, CDROM_GET_CAPABILITY) >= 0) {
+ log_debug_devs("%s: Skipping: cdrom device", name );
+ return 0;
+ }
+
return 1;
}