Easy with virt-customize. In this example I’m adding the nosmt
option to the command line:
$ virt-customize -a rhel7.img \ --edit '/etc/default/grub: s/^GRUB_CMDLINE_LINUX="/GRUB_CMDLINE_LINUX="nosmt /' \ --run-command 'grub2-mkconfig -o /boot/grub2/grub.cfg'