qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Safely reopening image files by stashing fds


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] Safely reopening image files by stashing fds
Date: Fri, 5 Aug 2011 10:27:00 +0100

On Fri, Aug 5, 2011 at 10:04 AM, Paolo Bonzini <address@hidden> wrote:
> On 08/05/2011 10:40 AM, Stefan Hajnoczi wrote:
>>
>> 4. Implement bdrv_reopen()
>>
>> First call bdrv_extract_fds() to stash the file descriptors, then close
>> the
>> block device.  Try opening the new image but if that fails, reopen using
>> the
>> stashed file descriptors.
>
> Why not do the latter unconditionally?

Because you cannot change O_DIRECT on an open fd :(.  This is why
we're going through this pain.

The only method I've found that works is to open("/proc/self/fd/X",
new_flags) but that's non-portable.

Stefan



reply via email to

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