On Thu, Mar 24, 2011 at 09:46:09AM -0700, Jordan Justen wrote: > 2011/3/24 Gleb Natapov <g...@redhat.com>: > > On Wed, Mar 23, 2011 at 03:32:41PM -0700, Jordan Justen wrote: > >> By the way, today OVMF attempts to store NV-Var data in a file on the > >> disk, but this cannot support variables at runtime. (This is why I > >> sent in the patch for using -pflash on x86/x86-64.) > >> > > And this file is stored always at the same location? If it is then then > > problem is solved! But what do you mean by "this cannot support > > variables at runtime"? > > The variables can be set while the OS is running, and the OS has > exclusive control over the disk at that time. Today in OVMF we set > variables into memory during this time, and hope that memory it still > around after a reset. This does not provide realistic non-volatile > UEFI variable support. KVM preserve memory during reset, but we better not rely on that.
> > What we really need is flash memory. (See my 'hw/pc: Support system > flash memory' patch.) Storing boot file only on flash memory will require to distribute the flash image along with disk image. > > But, there is nothing stopping us from also storing the variables on > the disk (during the firmware boot), and also using them as a backup. > This will still require at least one reboot for variables to be saved in a filesystem, but this is better then nothing. > Additionally, we can add yet another backup system of looking for > known os-loader executable paths. This would be needed if a disk > image were ever to be transferred from a real machine to a VM image. > But, this would require firmware updates as new UEFI OS loader install > paths are added. Also, let's hope no OS decides to generate a random > path for the OS loader. :) > Firmware updates in a VM is very easy, so not a big deal. -- Gleb.