qemu: Generate command line for dirty-ring-size

On QEMU command line it's represented by the dirty-ring-size
attribute of KVM accelerator.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Hyman Huang(黄勇) 2021-11-23 09:36:59 -05:00 committed by Michal Privoznik
parent 5d18d740d8
commit 359e9f5cf4
2 changed files with 10 additions and 1 deletions

View File

@ -7213,6 +7213,15 @@ qemuBuildAccelCommandLine(virCommand *cmd,
case VIR_DOMAIN_VIRT_KVM:
virBufferAddLit(&buf, "kvm");
/*
* only handle the kvm case, tcg case use the legacy style
* 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);
}
break;
case VIR_DOMAIN_VIRT_KQEMU:

View File

@ -12,7 +12,7 @@ QEMU_AUDIO_DRV=none \
-S \
-object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
-machine pc,usb=off,dump-guest-core=off \
-accel kvm \
-accel kvm,dirty-ring-size=4096 \
-cpu host,kvm=off,kvm-hint-dedicated=on,kvm-poll-control=on \
-m 214 \
-realtime mlock=off \