Ian Jackson wrote: > > Ideally, the host would provide variation of fdatasync() which flushes > > data to hard storage in the same way that kernel filesystem journal > > writes can do, and Qemu would use that. > > Another question arises: do we want bdrv_flush to call (eventually) > fsync or fdatasync ? If the latter we need to make sure that we call > fsync instead when necessary, for example when a cow file is extended.
I'm imagining that fdatasync() will flush the necessary metadata, including file size, when a file is extended. As would O_DSYNC. I could be wrong, but I think it's expected to do that, as I recall VxFS doing something like that with O_DSYNC. Then again, even if it's meant to, that doesn't mean it does... -- Jamie