Comment 5 for bug 1312199

Revision history for this message
Richard Jones (rjones-redhat) wrote :

Yes you're correct. I thought that qemu (TCG) exported a CPUID leaf so we could detect it, but it seems that it does not. As you say the kernel parameter would have to be added, either using -append (separate kernel) or by modifying the disk image.

Here's a short Python script that can modify the disk image (not suggesting we use it, this is just as a demonstration):

#!/usr/bin/python
import guestfs
import re
g = guestfs.GuestFS (python_return_dict=True)
g.add_drive ("cirros-0.3.1-x86_64-disk.img")
g.launch ()
g.mount ("/dev/sda1", "/")
lines = g.read_lines ("/boot/grub/menu.lst")
lines = [re.sub (r'^kernel(.*) console=',
                 r'kernel\1 no_timer_check console=', line)
         for line in lines]
content = "\n".join (lines)
g.write ("/boot/grub/menu.lst", content)
g.shutdown ()
g.close ()