#include "snapshot_conf.h"
#include "virfdstream.h"
#include "virfile.h"
+#include "cpu_conf.h"
#define VIR_FROM_THIS VIR_FROM_HYPERV
if (virDomainDefSetVcpus(def, processorSettingData->data->VirtualQuantity) < 0)
return NULL;
+ if (processorSettingData->data->ExposeVirtualizationExtensions) {
+ g_autoptr(Win32_Processor) processors = NULL;
+ const char *cpuFeature = NULL;
+
+ if (hypervGetProcessorList(priv, NULL, &processors) < 0)
+ return NULL;
+
+ if (STREQ_NULLABLE(processors->data->Manufacturer, "GenuineIntel"))
+ cpuFeature = "vmx";
+ else if (STREQ_NULLABLE(processors->data->Manufacturer, "AuthenticAMD"))
+ cpuFeature = "svm";
+
+ if (cpuFeature) {
+ def->cpu = virCPUDefNew();
+ def->cpu->mode = VIR_CPU_MODE_HOST_PASSTHROUGH;
+ def->cpu->type = VIR_CPU_TYPE_GUEST;
+
+ if (virCPUDefAddFeature(def->cpu, cpuFeature, VIR_CPU_FEATURE_REQUIRE) < 0)
+ return NULL;
+ }
+ }
+
def->os.type = VIR_DOMAIN_OSTYPE_HVM;
/* Generation 2 VMs use UEFI firmware */
string AddressOnParent
string VirtualQuantityUnits
boolean LimitCPUID
+ uint64 HwThreadsPerCore
boolean LimitProcessorFeatures
uint64 MaxProcessorsPerNumaNode
uint64 MaxNumaNodesPerSocket
+ boolean EnableHostResourceProtection
+ string CpuGroupId
+ boolean HideHypervisorPresent
+ boolean ExposeVirtualizationExtensions
end