On Tue, 2017-03-21 at 18:55 +0100, Paolo Bonzini wrote: > > > Since real HW has this capability, there exist certain > > auxiliary systems that are built on it. Having similar > > semantics available in QEMU allows me to build a virtual > > machine that works with these systems without modifying > > them in any way. > > How does real hardware do it? I suppose you'd do it with a firmware > setup menu or something like that; would it be enough to add a way to > modify bootindex during runtime?
On the real hardware the "boot once" really means *once* i.e. it only affects the next reboot regardless of how the next boot is triggered (reset button, power button, software, etc.). After the next boot the normal boot order is automatically restored. Theoretically it should be possible to get a close approximation of this by changing the main boot order, waiting for the boot to happen and then restoring the original order back. This would require having some process that constantly monitors what QEMU is doing so that it can notice when the boot happens and then restore the order. I'm trying to avoid having such a process if possible, which in this case means that QEMU would need to restore the order by itself.