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 ()
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 return_ dict=True) 0.3.1-x86_ 64-disk. img") grub/menu. lst")
r'kernel\ 1 no_timer_check console=', line) grub/menu. lst", content)
import guestfs
import re
g = guestfs.GuestFS (python_
g.add_drive ("cirros-
g.launch ()
g.mount ("/dev/sda1", "/")
lines = g.read_lines ("/boot/
lines = [re.sub (r'^kernel(.*) console=',
for line in lines]
content = "\n".join (lines)
g.write ("/boot/
g.shutdown ()
g.close ()