]> xenbits.xensource.com Git - libvirt.git/commit
util: file: Add helper to determine whether a path is a CDROM
authorPeter Krempa <pkrempa@redhat.com>
Mon, 23 Apr 2018 15:41:14 +0000 (17:41 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 7 May 2018 13:17:06 +0000 (15:17 +0200)
commitf3282d1f9b677f1bb41e084af3972a73f93a77eb
tree5a92fb898f6a3aab7fec7d57b37c92f879b6cefd
parenta33a3b1006db84e4a0e8b4e8f561aff546466c58
util: file: Add helper to determine whether a path is a CDROM

Add detection mechanism which will allow to check whether a path to a
block device is a physical CDROM drive. This will be useful once we will
need to pass it to hypervisors.

The linux implementation uses an ioctl to do the detection, while the
fallback uses a simple string prefix match.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/libvirt_private.syms
src/util/virfile.c
src/util/virfile.h