> It should be possible to change prefetching and copy-on-read while the > VM is running. For example, having to shut down a VM in order to > pause the prefetching is not workable. In the QED image streaming > tree there are monitor commands for this: > > http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/stream-command
I took a quick look at the code. Using a monitor command to dynamically control copy-on-read and prefetching is a good idea. This should be adopted in FVD as well. On another note, I saw that the code does not support (copy_on_read=off && stream=on). My previous benchmarking shows that copy_on_read does slow down other normal reads and writes, because it needs to save data to disk. For example, numbers in my papers show that, on ext3, FVD with copy_on_read=on actually boots a VM slower than QCOW2 does, even if FVD's copy-on-read is already heavily optimized and is not on the critical path of read (i.e., callback is invoked and data is returned to the VM first, and then save copy-on-read data asynchronously in the background). Therefore, it might be possible that a user does not want to enable copy-on-read and only wants to do prefetching when resources are idle.