On Wed, Mar 19, 2025 at 10:18:08AM +0000, Peter Maydell wrote:
> On Wed, 19 Mar 2025 at 08:29, Gerd Hoffmann <kra...@redhat.com> wrote:
> > qemu_create() works only once in case libvirt hands us a
> > file handle instead of a filename.
> 
> If we have to work on a filehandle, we have the problem
> that if the host crashes after the ftruncate() and
> before the write() of the new data then we just lost
> the contents of the var store. Working on filenames
> would let us do "write new file and then rename in to
> position".

Yes.  Drawback of the libvirt filehandle passing is that
this rename trick is not going to work.

> If you need to try to operate on a filehandle
> in a "don't lose the data for crashes mid-write" that
> gets tricky. Do we care ?

Do we have a chance to care?

Probably this is still better than what we had before.  Pflash updates
are slow and need lots of vmexits, so I guess there is a higher chance
to end up with a corrupted varstore in case of a host reset in a
unpleasent moment.

take care,
  Gerd


Reply via email to