qemu: Be more selective when determining cdrom for taint messaging
qemu: Be more selective when determining cdrom for taint messaging

https://bugzilla.redhat.com/show_bug.cgi?id=1471225

Commit id '99a2d6af2' was a bit too aggressive with determining whether
the provided path was a "physical" cd-rom in order to generate a taint
message due to the possibility of some guest and host trying to control
the tray. For cd-rom guest devices backed to some VIR_STORAGE_TYPE_FILE
storage, this wouldn't be a problem and as such it shouldn't be a problem
for guest devices using some sort of block device on the host such as
iSCSI, LVM, or a Disk pool would present.

So before issuing a taint message, let's check if the provided path of
the VIR_STORAGE_TYPE_BLOCK backed device is a "known" physical cdrom name
by comparing the beginning of the path w/ "/dev/cdrom" and "/dev/sr".
Also since it's possible the provided path could resolve to some /dev/srN
device, let's get that path as well and perform the same check.

Signed-off-by: John Ferlan <87558058f6f829e5ec976c8ef960720af4ff9c7d@redhat.com>

andreabolognani/libvirt,jardasgit/libvirt,libvirt/libvirt,libvirt/libvirt,crobinso/libvirt,andreabolognani/libvirt,jfehlig/libvirt,fabianfreyer/libvirt,fabianfreyer/libvirt,jfehlig/libvirt,libvirt/libvirt,eskultety/libvirt,olafhering/libvirt,jardasgit/libvirt,zippy2/libvirt,eskultety/libvirt,andreabolognani/libvirt,fabianfreyer/libvirt,nertpinx/libvirt,jardasgit/libvirt,eskultety/libvirt,eskultety/libvirt,libvirt/libvirt,eskultety/libvirt,nertpinx/libvirt,jfehlig/libvirt,andreabolognani/libvirt,jardasgit/libvirt,nertpinx/libvirt,jfehlig/libvirt,fabianfreyer/libvirt,jardasgit/libvirt,nertpinx/libvirt,fabianfreyer/libvirt,nertpinx/libvirt,crobinso/libvirt,olafhering/libvirt,olafhering/libvirt,zippy2/libvirt,zippy2/libvirt,zippy2/libvirt,crobinso/libvirt,olafhering/libvirt,andreabolognani/libvirt,crobinso/libvirt