On 2 July 2012 11:01, Kevin Wolf <kw...@redhat.com> wrote: > Reading from block devices during device initialisation breaks > migration, so I'd like to see it go away wherever possible. Reading in > the whole image file doesn't sound like something for which a good > excuse exists, you can do that as well during the first access.
It's much nicer to be able to produce an error message ("file doesn't exist", "file is too short for this flash device") at device startup rather than miles later on at first access, and pulling in a 64K file at startup is a simple implementation. Why complicate things by adding code for "if this is the first access then read in the file"? I would have thought migration would be simpler with a "read whole file at startup" implementation, because in that case the required migration state is always "this block of memory", rather than "sometimes this block of memory and sometimes a flag which says we haven't initialised the memory and will need to do a file read". -- PMM