qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] raw-posix.c: remove raw device access for cdrom


From: Laurent Vivier
Subject: Re: [Qemu-devel] [PATCH] raw-posix.c: remove raw device access for cdrom
Date: Thu, 02 Jul 2015 15:58:28 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0


On 02/07/2015 15:47, Paolo Bonzini wrote:
> 
> 
> On 02/07/2015 14:24, Laurent Vivier wrote:
>>
>> #ifdef __FreeBSD__
>>     if (S_ISCHR(st.st_mode)) {
>>         /*
>>          * The file is a char device (disk), which on FreeBSD isn't behind
>>          * a pager, so force all requests to be aligned. This is needed
>>          * so QEMU makes sure all IO operations on the device are aligned
>>          * to sector size, or else FreeBSD will reject them with EINVAL.
>>          */
>>         s->needs_alignment = true;
>>     }
>> #endif
> 
> So on FreeBSD and Apple /dev/r* is the equivalent of BDRV_O_NO_CACHE?

This is what I understand (MacOS is a derivative from FreeBSD)

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/hdiutil.1.html

DEVICE SPECIAL FILES

Since any /dev entry can be treated as a raw disk image, it is worth
noting which devices can be accessed when and how. /dev/rdisk nodes are
character-special devices, but are "raw" in the BSD sense and force
block-aligned I/O. They are closer to the physical disk than the buffer
cache. /dev/disk nodes, on the other hand, are buffered block-special
devices and are used primarily by the kernel's filesystem code.

Laurent



reply via email to

[Prev in Thread] Current Thread [Next in Thread]