Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx> --- src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 16 ++++++++++++++++ 3 files changed, 18 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7d1edf14c3..6c1d8e6353 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -141,6 +141,7 @@ VIR_ENUM_IMPL(virDomainHyperVMode, VIR_DOMAIN_HYPERV_MODE_LAST, "none", "custom", + "passthrough", ); VIR_ENUM_IMPL(virDomainBoot, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 169fc17039..abf7b37dc8 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -158,6 +158,7 @@ VIR_ENUM_DECL(virDomainOS); typedef enum { VIR_DOMAIN_HYPERV_MODE_NONE = 0, VIR_DOMAIN_HYPERV_MODE_CUSTOM, + VIR_DOMAIN_HYPERV_MODE_PASSTHROUGH, VIR_DOMAIN_HYPERV_MODE_LAST } virDomainHyperVMode; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 0d62a735f6..adbac46936 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6789,6 +6789,22 @@ qemuBuildCpuCommandLine(virCommand *cmd, } if (def->features[VIR_DOMAIN_FEATURE_HYPERV] != VIR_DOMAIN_HYPERV_MODE_NONE) { + switch ((virDomainHyperVMode) def->features[VIR_DOMAIN_FEATURE_HYPERV]) { + case VIR_DOMAIN_HYPERV_MODE_CUSTOM: + break; + + case VIR_DOMAIN_HYPERV_MODE_PASSTHROUGH: + virBufferAsprintf(&buf, ",hv-%s=on", "passthrough"); + break; + + case VIR_DOMAIN_HYPERV_MODE_NONE: + case VIR_DOMAIN_HYPERV_MODE_LAST: + default: + virReportEnumRangeError(virDomainHyperVMode, + def->features[VIR_DOMAIN_FEATURE_HYPERV]); + return -1; + } + for (i = 0; i < VIR_DOMAIN_HYPERV_LAST; i++) { switch ((virDomainHyperv) i) { case VIR_DOMAIN_HYPERV_RELAXED: -- 2.31.1