<div dir="ltr">I always appreciate when someone with the knowledge takes the time to explain why a specific solution works - thank you, <span style="font-size:12.8px;white-space:nowrap">Laszlo</span>.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 15, 2016 at 6:08 AM, Laszlo Ersek <span dir="ltr"><<a href="mailto:lersek@redhat.com" target="_blank">lersek@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 04/15/16 10:45, Philip Abernethy wrote:<br>
> I'm using extra/ovmf on my machine and just had to add<br>
><br>
> nvram = [<br>
>    "/usr/share/ovmf/ovmf_x64.bin:/usr/share/ovmf/ovmf_x64.bin"<br>
> ]<br>
<br>
Ouch. That hurt. A lot.<br>
<br>
- Elements in the nvram list are pairs.<br>
<br>
- Each pair has a first component, and a second component.<br>
<br>
- The first component is a firmware binary.<br>
<br>
- The second component is a variable store template that is compatible<br>
  with the firmware binary in the first component.<br>
<br>
- When you create a new virtual machine with libvirt, you specify the<br>
  firmware binary that you want to use. This is a selection from the<br>
  first column.<br>
<br>
- Libvirt will map your selection to the second component (the varstore<br>
  template that is compatible with the firmware binary that you<br>
  selected).<br>
<br>
- For the new VM, it will create a copy of that varstore template.<br>
<br>
- This copy is called the VM's own private variable store. Generally, it<br>
  lives under /var/lib/libvirt/qemu/nvram/.<br>
<br>
- The VM will use the firmware binary (= first component) directly.<br>
<br>
- The VM will never use the varstore template (= second component). It<br>
  will use its own private varstore, which came into existence as a copy<br>
  of the varstore template (= second component).<br>
<br>
- When you upgrade your OVMF package, the VM will pick up the upgraded<br>
  firmware binary the next time it is shut down and relaunched. The VM's<br>
  private varstore will not be affected by the package upgrade in any<br>
  way. That's the *entire point* of the split files scheme.<br>
<br>
For example, on my laptop, I have<br>
<br>
  nvram = [<br>
    "/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd",<br>
    "/usr/share/OVMF/OVMF_CODE.secboot.fd:/usr/share/OVMF/OVMF_VARS.fd",<br>
    "/home/virt-images/OVMF_CODE.32.fd:/home/virt-images/OVMF_VARS.fd",<br>
    "/home/virt-images/OVMF_CODE.3264.fd:/home/virt-images/OVMF_VARS.fd",<br>
    "/home/virt-images/OVMF_CODE.fd:/home/virt-images/OVMF_VARS.fd",<br>
    "/usr/share/AAVMF/AAVMF_CODE.fd:/usr/share/AAVMF/AAVMF_VARS.fd",<br>
    "/usr/share/AAVMF/AAVMF_CODE.verbose.fd:/usr/share/AAVMF/AAVMF_VARS.fd"<br>
  ]<br>
<br>
* If I pick the<br>
<br>
    /home/virt-images/OVMF_CODE.3264.fd<br>
<br>
  firmware binary (which is the first component of the 4th element),<br>
  then libvirt will map it to the<br>
<br>
    /home/virt-images/OVMF_VARS.fd<br>
<br>
  variable store template (which is the second component of the 4th<br>
  element). Then the new VM's own varstore will be created as a copy of<br>
<br>
    /home/virt-images/OVMF_VARS.fd<br>
<br>
* If I pick<br>
<br>
    /usr/share/AAVMF/AAVMF_CODE.verbose.fd<br>
<br>
  (1st component of the 7th element) then libvirt will map it to the<br>
<br>
    /usr/share/AAVMF/AAVMF_VARS.fd<br>
<br>
  varstore template (2nd component of the 7th element). The new VM's own<br>
  varstore will be then created as a copy of this latter file.<br>
<br>
* Assuming that on an ArchLinux host, you have the following two files:<br>
<br>
    /usr/share/ovmf/x64/ovmf_code_x64.bin -- firmware binary<br>
    /usr/share/ovmf/x64/ovmf_vars_x64.bin -- varstore template that is<br>
                                             compatible with the above<br>
<br>
  Your nvram list should look like:<br>
<br>
    nvram = [<br>
      "/usr/share/ovmf/x64/ovmf_code_x64.bin:/usr/share/ovmf/x64/ovmf_vars_x64.bin"<br>
    ]<br>
<br>
* If you use Gerd's "edk2.git-ovmf-x64" package, then:<br>
<br>
    nvram = [<br>
      "/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd:/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd"<br>
      "/usr/share/edk2.git/ovmf-x64/OVMF_CODE-need-smm.fd:/usr/share/edk2.git/ovmf-x64/OVMF_VARS-need-smm.fd"<br>
      "/usr/share/edk2.git/ovmf-x64/OVMF_CODE-with-csm.fd:/usr/share/edk2.git/ovmf-x64/OVMF_VARS-with-csm.fd"<br>
    ]<br>
<br>
  and when you create a new VM, you should pick the first one:<br>
<br>
    /usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd<br>
<br>
  unless you have specific reasons for picking the second or the third.<br>
<span class="HOEnZb"><font color="#888888"><br>
Laszlo<br>
</font></span></blockquote></div><br></div>