Bug#800845: autopkgtest: Add support for nested VMs
Christian Seiler
christian at iwakd.de
Fri Mar 4 17:17:44 UTC 2016
On 04.03.2016 13:16, Martin Pitt wrote:
> Christian Seiler [2016-03-04 12:54 +0100]:
>> - if x86_64 and default QEMU command:
>> - if vmx in CPU flags:
>> use -cpu kvm64,+vmx,+lahf_lm
>> - else if svm in CPU flags:
>> use -cpu kvm64,+svm,+lahf_lm
>> - otherwise: don't pass -cpu
>>
>> That way, you have the same CPU on any hardware, with the exception
>> of the vendor-specific VT extensions.
>>
>> If you're agreeable to that, I'll prepare a patch.
>
> Sounds great!
I've attached three patches:
0001-Support-nested-KVM-by-default-by-emulating-a-CPU-wit.patch
This addresses the KVM issue. I've only done this for x86_64,
because I don't think VMX extensions exist for pure x86_32 CPUs.
Also, you can use an i386 VM image with x86_64, so I don't think this
is an issue.
Works fine here, both under Debian and Ubuntu.
The other two patches are unrelated, but I noticed them while working
on the code:
0002-setup-testbed-reduce-grub-timeout-on-Debian-systems.patch
On Debian systems, grub has a default timeout of 5s - which means that
boot of VM images is always delayed by that amount. This patch reduces
that timeout to 1s to speed things up. I'm unsure about decreasing it
to zero, because on Debian I know of now way of getting a grub menu if
you really need it if the timeout is zero. But if you think a timeout
of 0 is fine, feel free to change this. (I tested both locally, 0 also
works.)
0003-adt-virt-qemu-make-i386-arch-work-by-default.patch
On pure 32bit x86 systems adt-virt-qemu is currently broken, because
os.uname()[4] is i686 typically, but the qemu binary ends in -i386.
I've added a generic system to map architecture names. because I can
easily imagine this also occurs for some other architectures.
Reproducer is in the commit message (needs 32bit kernel + userland in
VM image though!).
Regards,
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Support-nested-KVM-by-default-by-emulating-a-CPU-wit.patch
Type: text/x-patch
Size: 4044 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/autopkgtest-devel/attachments/20160304/fc08a58a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-setup-testbed-reduce-grub-timeout-on-Debian-systems.patch
Type: text/x-patch
Size: 1541 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/autopkgtest-devel/attachments/20160304/fc08a58a/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-adt-virt-qemu-make-i386-arch-work-by-default.patch
Type: text/x-patch
Size: 2101 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/autopkgtest-devel/attachments/20160304/fc08a58a/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/autopkgtest-devel/attachments/20160304/fc08a58a/attachment.sig>
More information about the autopkgtest-devel
mailing list