Dimitris Aragiorgis 3307ed7b3f raw-posix: Introduce hdev_is_sg()
Until now, an SG device was identified only by checking if its path
started with "/dev/sg". Then, hdev_open() would set the bs->sg flag
accordingly. The patch relies on the actual properties of the device
instead of the specified file path.

To this end, test for an SG device (e.g. /dev/sg0) by ensuring that
all of the following holds:

 - The specified file name corresponds to a character device
 - The device supports the SG_GET_VERSION_NUM ioctl
 - The device supports the SG_GET_SCSI_ID ioctl

Signed-off-by: Dimitris Aragiorgis <dimara@arrikto.com>
Message-id: 1435056300-14924-6-git-send-email-dimara@arrikto.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-06-23 15:08:52 +01:00
..
2015-06-22 18:20:40 +02:00
2015-06-22 18:20:40 +02:00
2015-06-23 15:08:52 +01:00
2015-06-23 15:08:52 +01:00
2014-12-10 10:31:19 +01:00
2015-04-28 15:36:09 +02:00
2015-06-22 18:20:40 +02:00
2015-06-12 15:54:01 +02:00
2015-06-23 15:08:52 +01:00
2015-04-28 15:36:08 +02:00
2015-06-22 18:20:40 +02:00
2014-08-15 15:07:14 +02:00
2015-06-23 15:06:17 +01:00