qemu-e2k/block
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
..
accounting.c
archipelago.c
backup.c Include qapi/qmp/qerror.h exactly where needed 2015-06-22 18:20:41 +02:00
blkdebug.c block: Move flag inheritance to bdrv_open_inherit() 2015-06-12 17:04:59 +02:00
blkverify.c block: Move flag inheritance to bdrv_open_inherit() 2015-06-12 17:04:59 +02:00
block-backend.c block-backend: Introduce blk_drain() 2015-06-23 15:06:16 +01:00
bochs.c
cloop.c
commit.c Include qapi/qmp/qerror.h exactly where needed 2015-06-22 18:20:41 +02:00
curl.c qerror: Move #include out of qerror.h 2015-06-22 18:20:40 +02:00
dmg.c qerror: Move #include out of qerror.h 2015-06-22 18:20:40 +02:00
gluster.c
io.c Fix migration in case of scsi-generic 2015-06-23 15:08:52 +01:00
iscsi.c Fix migration in case of scsi-generic 2015-06-23 15:08:52 +01:00
linux-aio.c
Makefile.objs throttle: Add throttle group infrastructure 2015-06-12 14:00:00 +01:00
mirror.c Include qapi/qmp/qerror.h exactly where needed 2015-06-22 18:20:41 +02:00
nbd-client.c
nbd-client.h
nbd.c
nfs.c
null.c block/null: Support reopen 2015-04-28 15:36:09 +02:00
parallels.c block/parallels: improve image writing performance further 2015-05-22 09:37:32 +01:00
qapi.c qerror: Finally unused, clean up 2015-06-22 18:20:40 +02:00
qcow2-cache.c qcow2: style fixes in qcow2-cache.c 2015-05-22 17:08:01 +02:00
qcow2-cluster.c qcow2/qcow: protect against uninitialized encryption key 2015-05-22 17:08:01 +02:00
qcow2-refcount.c qcow2: make qcow2_cache_put() a void function 2015-05-22 17:08:01 +02:00
qcow2-snapshot.c qerror: Move #include out of qerror.h 2015-06-22 18:20:40 +02:00
qcow2.c qerror: Clean up QERR_ macros to expand into a single string 2015-06-22 18:20:40 +02:00
qcow2.h qcow2: Add DEFAULT_L2_CACHE_CLUSTERS 2015-06-12 15:54:01 +02:00
qcow.c Include qapi/qmp/qerror.h exactly where needed 2015-06-22 18:20:41 +02:00
qed-check.c
qed-cluster.c
qed-gencb.c
qed-l2-cache.c
qed-table.c
qed.c qerror: Clean up QERR_ macros to expand into a single string 2015-06-22 18:20:40 +02:00
qed.h
quorum.c Include qapi/qmp/qerror.h exactly where needed 2015-06-22 18:20:41 +02:00
raw_bsd.c
raw-aio.h
raw-posix.c raw-posix: Introduce hdev_is_sg() 2015-06-23 15:08:52 +01:00
raw-win32.c qerror: Move #include out of qerror.h 2015-06-22 18:20:40 +02:00
rbd.c Convert (ffs(val) - 1) to ctz32(val) 2015-04-28 15:36:08 +02:00
sheepdog.c sheepdog: fix resource leak with sd_snapshot_create 2015-05-08 14:11:10 +03:00
snapshot.c Include qapi/qmp/qerror.h exactly where needed 2015-06-22 18:20:41 +02:00
ssh.c qerror: Move #include out of qerror.h 2015-06-22 18:20:40 +02:00
stream.c Include qapi/qmp/qerror.h exactly where needed 2015-06-22 18:20:41 +02:00
throttle-groups.c throttle: Check current timers before updating any_timer_armed[] 2015-06-23 15:06:16 +01:00
vdi.c block: use bdrv_get_device_or_node_name() in error messages 2015-04-28 15:36:09 +02:00
vhdx-endian.c
vhdx-log.c qerror: Move #include out of qerror.h 2015-06-22 18:20:40 +02:00
vhdx.c block: use bdrv_get_device_or_node_name() in error messages 2015-04-28 15:36:09 +02:00
vhdx.h
vmdk.c Include qapi/qmp/qerror.h exactly where needed 2015-06-22 18:20:41 +02:00
vpc.c block: use bdrv_get_device_or_node_name() in error messages 2015-04-28 15:36:09 +02:00
vvfat.c vvfat: add a label option 2015-06-23 15:06:17 +01:00
win32-aio.c
write-threshold.c