]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Generate command line for dirty-ring-size
authorHyman Huang(黄勇) <huangy81@chinatelecom.cn>
Tue, 23 Nov 2021 14:36:59 +0000 (09:36 -0500)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 14 Dec 2021 12:18:53 +0000 (13:18 +0100)
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>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/kvm-features.args

index 65e7d77a079ce9aeca8611371e2a5685eb52ba82..8199a11b74e1d57785181e383bb0bcd80029f8db 100644 (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:
index 371c382b47069d7fd9438bdfac26ffe0a6487775..17893637366f71b1ad202134eed06c02f956696a 100644 (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 \