Re: [PATCH 2/3] fdstream: introduce virFDStreamOpenBlockDevice

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

 



  Daniel P. Berrange wrote:

> On Fri, Aug 15, 2014 at 12:55:58PM +0400, Roman Bogorodskiy wrote:
> >   Daniel P. Berrange wrote:
> > 
> > > On Fri, Aug 15, 2014 at 12:44:21PM +0400, Roman Bogorodskiy wrote:
> > > > virStorageBackendVolDownloadLocal and virStorageBackendVolUploadLocal
> > > > use virFDStreamOpenFile function to work with the volume fd.
> > > > 
> > > > virFDStreamOpenFile calls virFDStreamOpenFileInternal that implements
> > > > handling of the non-blocking I/O. If a file is not a character device and
> > > > not a fifo, it uses libvirt_iohelper.
> > > > 
> > > > On FreeBSD, it doesn't work as expected because disks are exposed as
> > > > character devices.
> > > 
> > > Why does that cause a problem ? The reason we use iohelper is because
> > > POSIX does not have O_NONBLOCK work on plain files, so we need to use
> > > the iohelper so that we have a pipe we can set O_NONBLOCK on. If FreeBSD
> > > disks are character devices though, O_NONBLOCK should work fine on them
> > > avoiding the need for iohelper.
> > 
> > O_NONBLOCK doesn't work for some reason, at least on ZFS volumes:
> > fcntl() fails with:
> > 
> > fcntl: Inappropriate ioctl for device
> > 
> > I have asked a question on an appropriate mailing list:
> > 
> > https://lists.freebsd.org/pipermail/freebsd-fs/2014-August/019923.html
> > 
> > I've also included a test program I use to reproduce that there.
> 
> Ah ok, so can you update the commit message to explicitly mention
> that ZFS character devices are unusual in not supporting O_NOBLOBKJ

I did some more checks and it looks like O_NONBLOCK is not supported not
only on ZFS volumes, but on other disk drivers as well; I got the same
result for SATA and memory disks.

I'll update a commit message to say something like this:

> On FreeBSD, it doesn't work as expected because disks are exposed as
> character devices and do not support O_NONBLOCK.

I'll wait for other comments to avoid resending the series just because
of a commit message change.

Roman Bogorodskiy

Attachment: pgpIGxGsjIo_P.pgp
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]