]> git.proxmox.com Git - qemu-server.git/commitdiff
add hyperv enlightments : hv_reset, hv_vpindex, hv_runtime
authorAlexandre Derumier <aderumier@odiso.com>
Fri, 20 May 2016 08:26:08 +0000 (10:26 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 7 Jun 2016 08:08:25 +0000 (10:08 +0200)
add them by default for qemu 2.6
(support is already present in qemu 2.5, but we don't want to break live migration for current running vm)

vpindex && runtime need host kernel 4.4

Theses 3 enlightements are needed by windows to use vmbus
http://searchwindowsserver.techtarget.com/definition/Microsoft-Virtual-Machine-Bus-VMBus

details :

- When Hyper-V "vpindex" is on, guest can use MSR HV_X64_MSR_VP_INDEX
to get virtual processor ID.

- Hyper-V "runtime" enlightement feature allows to use MSR
HV_X64_MSR_VP_RUNTIME to get the time the virtual processor consumes
running guest code, as well as the time the hypervisor spends running
code on behalf of that guest.

- Hyper-V "reset" allows guest to reset VM.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/QemuServer.pm

index 9b8110e0fecc3efe65d5fbd6927673b0777b6926..df8321afcc717a0399971b07dd974217a9c00006 100644 (file)
@@ -2991,6 +2991,12 @@ sub config_to_command {
                push @$cpuFlags , 'hv_vapic' if !$nokvm;
                push @$cpuFlags , 'hv_time' if !$nokvm;
 
+               if (qemu_machine_feature_enabled ($machine_type, $kvmver, 2, 6)) {
+                   push @$cpuFlags , 'hv_reset' if !$nokvm;
+                   push @$cpuFlags , 'hv_vpindex' if !$nokvm;
+                   push @$cpuFlags , 'hv_runtime' if !$nokvm;
+               }
+
            } else {
                push @$cpuFlags , 'hv_spinlocks=0xffff' if !$nokvm;
            }