[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] One more thing about block device locking
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] One more thing about block device locking |
Date: |
Fri, 23 Apr 2010 14:57:18 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Thunderbird/3.0.4 |
Am 23.04.2010 10:00, schrieb Richard W.M. Jones:
> On Fri, Apr 23, 2010 at 09:07:28AM +0400, Michael Tokarev wrote:
>> So we'll have to either
>> trial and error, or open "normally", check
>> if it's a block device and re-open with that
>> flag set.
>
> Perhaps I'm missing something, but why can't you stat(2) the name
> first to see if it's a block device (ie. S_ISBLK(st_mode)) then add
> the O_EXCL flag or not as appropriate?
We already have two different open functions for regular files and
devices (and yes, the detection uses stat).
Kevin