Signed-off-by: Lin Ma <lma(a)suse.de>
---
src/qemu/qemu_command.c | 20 +++++++++++++++++---
tests/qemuxml2argvdata/kvm-features.args | 2 +-
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 656cf55c1e..0b72aed72a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7067,9 +7067,23 @@ qemuBuildAccelCommandLine(virCommand *cmd,
* not that either kvm or tcg can be specified by libvirt
* so do not worry about the conflict of specifying both
* */
- if (def->features[VIR_DOMAIN_FEATURE_KVM] == VIR_TRISTATE_SWITCH_ON
&&
- def->kvm_features->features[VIR_DOMAIN_KVM_DIRTY_RING] ==
VIR_TRISTATE_SWITCH_ON) {
- virBufferAsprintf(&buf, ",dirty-ring-size=%d",
def->kvm_features->dirty_ring_size);
+ if (def->features[VIR_DOMAIN_FEATURE_KVM] == VIR_TRISTATE_SWITCH_ON) {
+ if (def->kvm_features->features[VIR_DOMAIN_KVM_DIRTY_RING] ==
+ VIR_TRISTATE_SWITCH_ON) {
+ virBufferAsprintf(&buf, ",dirty-ring-size=%d",
+ def->kvm_features->dirty_ring_size);
+ }
+
+ if (def->kvm_features->features[VIR_DOMAIN_KVM_NOTIFY_VMEXIT] ==
+ VIR_TRISTATE_SWITCH_ON) {
+ virBufferAsprintf(&buf, ",notify-vmexit=%s",
+ def->kvm_features->notify_vmexit.mode);
+ if (def->kvm_features->notify_vmexit.notify_window &&
+ STRNEQ(def->kvm_features->notify_vmexit.mode,
"disable")) {
+ virBufferAsprintf(&buf, ",notify-window=%u",
+
def->kvm_features->notify_vmexit.notify_window);
+ }
+ }
}
break;
diff --git a/tests/qemuxml2argvdata/kvm-features.args
b/tests/qemuxml2argvdata/kvm-features.args
index 9c8236c210..36b7eb3557 100644
--- a/tests/qemuxml2argvdata/kvm-features.args
+++ b/tests/qemuxml2argvdata/kvm-features.args
@@ -11,7 +11,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-S \
-object
secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes
\
-machine pc,usb=off,dump-guest-core=off \
--accel kvm,dirty-ring-size=4096 \
+-accel kvm,dirty-ring-size=4096,notify-vmexit=run,notify-window=16384 \
-cpu host,kvm=off,kvm-hint-dedicated=on,kvm-poll-control=on \
-m size=219136k \
-overcommit mem-lock=off \
--
2.41.0