Re: [PATCH 11/35] util: file: Add helper to determine whether a path is a CDROM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 01, 2018 at 20:25:09 -0400, John Ferlan wrote:
> 
> 
> On 04/25/2018 11:15 AM, Peter Krempa wrote:
> > 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@xxxxxxxxxx>
> > ---
> >  src/libvirt_private.syms |  1 +
> >  src/util/virfile.c       | 56 +++++++++++++++++++++++++++++++++++++++++++++++-
> >  src/util/virfile.h       |  2 ++
> >  3 files changed, 58 insertions(+), 1 deletion(-)
> > 
> 
> Should this be a replacement for qemuDomainFilePathIsHostCDROM used for
> qemuDomainObjCheckDiskTaint?

Very good point. This code is actually "inspired" by the code that qemu
uses for CDROM detection, so I think we should actually use it instead
of the string checks.

> Not a problem with this code, but I think there should only be one place
> that we determine host CDROM and it doesn't matter to me the mechanism.
> Just trying to avoid multiple means to get the same answer.

I agree. If it is deemed that it's okay to do ioctl()s on the cdrom
device for libvirt I'll gladly replace the existing code. The advantage
of the ioctl based code is that it works regardless of the name of the
device.

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux