qemu-block
[Top][All Lists]
Advanced

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

Re: [PATCH 04/16] qemu-file: Don't call qemu_fflush() for read only file


From: Juan Quintela
Subject: Re: [PATCH 04/16] qemu-file: Don't call qemu_fflush() for read only files
Date: Tue, 30 May 2023 19:26:40 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Richard Henderson <richard.henderson@linaro.org> wrote:
> On 5/30/23 10:06, Juan Quintela wrote:
>> Richard Henderson <richard.henderson@linaro.org> wrote:
>>> On 5/30/23 05:28, Juan Quintela wrote:
>>>> This was the only caller for read only files.  So change the test for
>>>> an assert in qemu_fflush().
>>>
>>>
>>> Not a fan, as fflush(stdin) is well-defined.
>> I guess you mean this:
>>         For input streams associated with seekable files (e.g., disk
>> files, but
>>         not pipes or terminals), fflush() discards any buffered data  that  
>> has
>>         been fetched from the underlying file, but has not been consumed by 
>> the
>>         application.
>
> Yes, in that, importantly, it does not assert.

I can let it do nothing if it makes you feel better.

>> Two things:
>> - Current code just do nothing for imput streams
>> - We only call it from qemu_fclose()
>
> Pardon?  There are nearly 30 calls to qemu_fflush.

None of them in a file that is not open for writting.

>> - If we drop anything from the input stream, migration get broken.
>
> I'm not talking about dropping anything.  Obviously QEMUFile works
> different from stdio, and therefore resetting the file state to that
> of the unbuffered data is not relevant.

Ok, if you feel so strong, I will change the assert() to a check that
does nothing.

Later, Juan.




reply via email to

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