[PATCH v2 0/4] Ring support (Libvirt)

huangy81 at chinatelecom.cn huangy81 at chinatelecom.cn
Wed Jun 23 14:58:14 UTC 2021


From: Hyman Huang(黄勇) <huangy81 at chinatelecom.cn>

v2
- split patchset into 4 patches

- leave out the tcg case when building commandline. 

- handle the VIR_DOMAIN_KVM_DIRTY_RING case independently in ,
  virDomainFeatureDefParse and virDomainDefFeaturesCheckABIStability,
  do not integrate it with other cases...

- add dirty ring size check in virDomainDefFeaturesCheckABIStability

- modify zero checks on integers of dirty ring size in a explicit way.

- set the default value of dirty ring size in a post-parser callback.

- check the absence of kvm_feature in a explicit way.

- code clean of virTristateSwitchTypeToString function.

this version's modification base on Peter's advices mostly, thanks
a lot, please review !

Best Regards !
Hyman Huang(黄勇)

v1
since qemu has introduced a dirty ring feature in 6.1.0, may be it's
the right time to introduce dirty ring in libvirt meanwhile.

this patch add feature named 'dirty-ring', which enable dirty ring
feature when starting vm. to try this out, three things has done
in this patchset:

- introduce QEMU_CAPS_ACCEL so the the libvirt can use it to select 
  the right option when specifying the accelerator type.

- switch the option "-machine accel=xxx" to "-accel xxx" when specifying
  accelerator type once libvirt build QEMU command line, so that 
  dirty-ring-size property can be passed to qemu when start vm.

- introduce dirty_ring_size to hold the ring size configured by user
  and pass dirty_ring_size when building qemu commandline if dirty 
  ring feature enabled.

though dirty ring is per-cpu logically, the size of dirty ring is 
registered by 'struct kvm' in QEMU. so we would like to place the 
dirty_ring_size as a property of vm in Libvirt as the QEMU do.

the dirty ring feature is disabled by default, and if enabled, the
default value of ring size if 4096 if size not configured. 

for more details about dirty ring and "-accel" option, please refer to:
https://lore.kernel.org/qemu-devel/20210108165050.406906-10-peterx@redhat.com/
https://lore.kernel.org/qemu-devel/3aa73987-40e8-3619-0723-9f17f73850bd@redhat.com/

please review, Thanks!

Best Regards !

Hyman Huang(黄勇) (4):
  qemu_capabilities: introduce QEMU_CAPS_ACCEL
  qemu_command: switch accelerator option to new style
  conf: introduce dirty_ring_size in struct "_virDomainDef"
  qemu: support dirty ring feature

 docs/formatdomain.rst                              | 16 +++---
 docs/schemas/domaincommon.rng                      | 10 ++++
 src/conf/domain_conf.c                             | 66 ++++++++++++++++++++++
 src/conf/domain_conf.h                             |  4 ++
 src/qemu/qemu_capabilities.c                       |  2 +
 src/qemu/qemu_capabilities.h                       |  1 +
 src/qemu/qemu_command.c                            | 42 +++++++++++++-
 tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml   |  1 +
 tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml  |  1 +
 tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml |  1 +
 tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml   |  1 +
 tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml  |  1 +
 tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml    |  1 +
 tests/qemucapabilitiesdata/caps_3.0.0.riscv32.xml  |  1 +
 tests/qemucapabilitiesdata/caps_3.0.0.riscv64.xml  |  1 +
 tests/qemucapabilitiesdata/caps_3.0.0.s390x.xml    |  1 +
 tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml    |  1 +
 tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_4.0.0.aarch64.xml  |  1 +
 tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml    |  1 +
 tests/qemucapabilitiesdata/caps_4.0.0.riscv32.xml  |  1 +
 tests/qemucapabilitiesdata/caps_4.0.0.riscv64.xml  |  1 +
 tests/qemucapabilitiesdata/caps_4.0.0.s390x.xml    |  1 +
 tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml  |  1 +
 tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml    |  1 +
 tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml    |  1 +
 tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml  |  1 +
 tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml    |  1 +
 tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml  |  1 +
 tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml    |  1 +
 tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml  |  1 +
 tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml    |  1 +
 tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml  |  1 +
 tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml    |  1 +
 tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml    |  1 +
 tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml   |  1 +
 ...64-default-cpu-kvm-virt-4.2.aarch64-latest.args |  3 +-
 .../aarch64-features-sve.aarch64-latest.args       |  3 +-
 .../channel-unix-guestfwd.x86_64-latest.args       |  3 +-
 .../clock-timer-armvtimer.aarch64-latest.args      |  3 +-
 .../console-virtio-unix.x86_64-latest.args         |  3 +-
 .../cpu-Icelake-Server-pconfig.x86_64-3.1.0.args   |  3 +-
 .../cpu-Icelake-Server-pconfig.x86_64-latest.args  |  3 +-
 .../cpu-tsc-frequency.x86_64-4.0.0.args            |  3 +-
 .../cpu-tsc-high-frequency.x86_64-latest.args      |  3 +-
 .../default-video-type-aarch64.aarch64-latest.args |  3 +-
 .../default-video-type-ppc64.ppc64-latest.args     |  3 +-
 .../default-video-type-s390x.s390x-latest.args     |  3 +-
 .../disk-cdrom-network.x86_64-2.12.0.args          |  3 +-
 .../disk-cdrom-network.x86_64-latest.args          |  3 +-
 .../disk-network-http.x86_64-latest.args           |  3 +-
 .../hugepages-memaccess3.x86_64-latest.args        |  3 +-
 .../intel-iommu-aw-bits.x86_64-latest.args         |  3 +-
 .../intel-iommu-caching-mode.x86_64-latest.args    |  3 +-
 .../intel-iommu-device-iotlb.x86_64-latest.args    |  3 +-
 .../intel-iommu-eim.x86_64-latest.args             |  3 +-
 ...ty-sev-missing-platform-info.x86_64-2.12.0.args |  3 +-
 .../launch-security-sev.x86_64-2.12.0.args         |  3 +-
 .../launch-security-sev.x86_64-6.0.0.args          |  3 +-
 ...emfd-memory-default-hugepage.x86_64-latest.args |  3 +-
 .../memfd-memory-numa.x86_64-latest.args           |  3 +-
 .../memory-hotplug-virtio-pmem.x86_64-5.2.0.args   |  3 +-
 .../memory-hotplug-virtio-pmem.x86_64-latest.args  |  3 +-
 .../os-firmware-bios.x86_64-latest.args            |  3 +-
 ...irmware-efi-no-enrolled-keys.x86_64-latest.args |  3 +-
 .../os-firmware-efi-secboot.x86_64-latest.args     |  3 +-
 .../os-firmware-efi.x86_64-latest.args             |  3 +-
 .../parallel-unix-chardev.x86_64-latest.args       |  3 +-
 ...4-default-cpu-kvm-pseries-2.7.ppc64-latest.args |  3 +-
 ...4-default-cpu-kvm-pseries-3.1.ppc64-latest.args |  3 +-
 ...4-default-cpu-kvm-pseries-4.2.ppc64-latest.args |  3 +-
 ...efault-cpu-kvm-ccw-virtio-2.7.s390x-latest.args |  3 +-
 ...efault-cpu-kvm-ccw-virtio-4.2.s390x-latest.args |  3 +-
 .../smartcard-passthrough-unix.x86_64-latest.args  |  3 +-
 .../usb-redir-unix.x86_64-latest.args              |  3 +-
 .../vhost-user-fs-fd-memory.x86_64-latest.args     |  3 +-
 .../virtio-rng-builtin.x86_64-5.2.0.args           |  3 +-
 .../virtio-rng-builtin.x86_64-latest.args          |  3 +-
 .../virtio-rng-egd-unix.x86_64-5.2.0.args          |  3 +-
 .../virtio-rng-egd-unix.x86_64-latest.args         |  3 +-
 ...86_64-default-cpu-kvm-pc-4.2.x86_64-latest.args |  3 +-
 ...6_64-default-cpu-kvm-q35-4.2.x86_64-latest.args |  3 +-
 91 files changed, 263 insertions(+), 54 deletions(-)

-- 
1.8.3.1





More information about the libvir-list mailing list