Skip to content

Commit

Permalink
F #6298: Add options and timers for HyperV
Browse files Browse the repository at this point in the history
This commits add a curated list of hyperv (and timers) options when enabled for the
VM. It adds HYPERV_TIMERS, which are added to the clock element
when HYPERV is selected.
  • Loading branch information
rsmontero committed Sep 20, 2023
1 parent dca8684 commit 4bcb6f7
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
24 changes: 22 additions & 2 deletions src/vmm/LibVirtDriverKVM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2112,9 +2112,29 @@ int LibVirtDriver::deployment_description_kvm(
file << "\t</features>" << endl;
}

if ( localtime )
if ( localtime || hyperv )
{
file << "\t<clock offset='localtime'/>" << endl;
string htimers;

get_attribute(vm, host, cluster, "HYPERV_TIMERS", htimers);

file << "\t<clock";

if ( localtime )
{
file << " offset='localtime'>" << endl;
}
else //UTC is set as the clock offset by default
{
file << " offset='utc'>" << endl;
}

if (!htimers.empty())
{
file << htimers << endl;
}

file << "\t</clock>" << endl;
}

if ( guest_agent )
Expand Down
22 changes: 21 additions & 1 deletion src/vmm_mad/exec/vmm_exec_kvm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
# - MODEL
# * RAW: raw attribute value is appended to that on the VM template
# * HYPERV_OPTIONS: options used for FEATURES = [ HYPERV = yes ]
# * HYPERV_TIMERS: timers added when HYPERV is set to yes in FEATURES
# * SPICE_OPTIONS
# * Q35_ROOT_PORTS: Number of PCI ports allocated for VMs of type q35.
# * OVMF_UEFIS: List of firmware available to users (full path in the hosts)
Expand Down Expand Up @@ -99,7 +100,26 @@ NIC = [

#RAW = "<devices><serial type=\"pty\"><source path=\"/dev/pts/5\"/><target port=\"0\"/></serial><console type=\"pty\" tty=\"/dev/pts/5\"><source path=\"/dev/pts/5\"/><target port=\"0\"/></console></devices>"

HYPERV_OPTIONS = "<relaxed state='on'/><vapic state='on'/><spinlocks state='on' retries='4096'/>"
HYPERV_OPTIONS = "
<relaxed state='on'/>
<vapic state='on'/>
<spinlocks state='on' retries='8191'/>
<vpindex state='on'/>
<runtime state='on'/>
<synic state='on'/>
<stimer state='on'/>
<reset state='off'/>
<frequencies state='on'/>
<reenlightenment state='off'/>
<tlbflush state='on'/>
<ipi state='on'/>
<evmcs state='off'/>"

HYPERV_TIMERS = "
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
<timer name='hypervclock' present='yes'/>"

SPICE_OPTIONS = "
<video>
Expand Down

0 comments on commit 4bcb6f7

Please sign in to comment.