no logical change, only code movement (and fix a comment typo). Backports commit 26aa3d9aecbb6fe9bce808a1d127191bdf3cc3d2 from qemu Also backports commit 5502b66fc7d0bebd08b9b7017cb7e8b5261c3a2d