[PATCH Libvirt v3 08/10] qemu_monitor: Implement qemuMonitorQueryVcpuDirtyLimit

2023-09-05 Thread ~hyman
From: Hyman Huang(黄勇) Implement qemuMonitorQueryVcpuDirtyLimit which query vcpu dirty limit info by calling qmp 'query-vcpu-dirty-limit'. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_monitor.c | 12 +++ src/qemu/qemu_monitor.h | 17 ++ src/qemu/qemu_monitor_json.c | 6

[PATCH Libvirt v3 04/10] qemu_driver: Implement qemuDomainSetVcpuDirtyLimit

2023-09-05 Thread ~hyman
From: Hyman Huang(黄勇) Implement qemuDomainSetVcpuDirtyLimit, which can be used to set or cancel the upper limit of the dirty page rate for virtual CPUs. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_driver.c | 131 +++ src/qemu/qemu_monitor.c | 13

[PATCH Libvirt v3 09/10] qemu_driver: Extend dirtlimit statistics for domGetStats

2023-09-05 Thread ~hyman
From: Hyman Huang(黄勇) Extend dirtylimit statistics for domGetStats to display the information of the upper limit of dirty page rate for virtual CPUs. Signed-off-by: Hyman Huang(黄勇) --- include/libvirt/libvirt-domain.h | 1 + src/libvirt-domain.c | 9 ++ src/qemu/qemu_driver.c

[PATCH Libvirt v3 07/10] virsh: Introduce limit-dirty-page-rate api

2023-09-05 Thread ~hyman
From: Hyman Huang(黄勇) Introduce limit-dirty-page-rate virsh api to set or cancel dirty page rate upper limit for virtual CPUs. Usage is below: $ virsh limit-dirty-page-rate --rate \ [--vcpu ] [--config] [--live] [--current] Set the dirty page rate upper limit for the given vcpu specified by

[PATCH Libvirt v3 10/10] virsh: Introduce command 'virsh domstats --dirtylimit'

2023-09-05 Thread ~hyman
From: Hyman Huang(黄勇) Introduce command 'virsh domstats --dirtylimit' for reporting dirty page rate upper limit (megabyte/s) infomation. The info is listed as follows: Domain: 'vm' dirtylimit.vcpu.0.limit=10 dirtylimit.vcpu.0.current=16 dirtylimit.vcpu.1.limit=10 dirtylimit.vcpu.1.curren

[PATCH Libvirt v3 05/10] domain_validate: Export virDomainDefHasDirtyLimitStartupVcpus symbol

2023-09-05 Thread ~hyman
From: Hyman Huang(黄勇) Export virDomainDefHasDirtyLimitStartupVcpus as a util function, which could be used in qemu_process.c file for the next commit. Signed-off-by: Hyman Huang(黄勇) --- src/conf/domain_validate.c | 2 +- src/conf/domain_validate.h | 2 ++ src/libvirt_private.syms | 1 + 3 fi

[PATCH Libvirt v3 03/10] libvirt: Add virDomainSetVcpuDirtyLimit API

2023-09-05 Thread ~hyman
From: Hyman Huang(黄勇) Introduce virDomainSetVcpuDirtyLimit API to set or cancel the dirty page rate upper limit. The API will throttle the virtual CPU as needed to keep their dirty page rate within the limit. Since it just throttles the virtual CPU, which dirties memory, read processes in the gu

[PATCH Libvirt v3 06/10] qemu_process: Setup dirty limit after launching VM

2023-09-05 Thread ~hyman
From: Hyman Huang(黄勇) The dirty_limit attribute in XML requires setting up the upper limit of dirty page rate once after launching the VM, so add the implementation. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_process.c | 44 + 1 file changed, 44 in

[PATCH Libvirt v3 02/10] conf: Introduce XML for dirty limit configuration

2023-09-05 Thread ~hyman
From: Hyman Huang(黄勇) The upper limit (megabyte/s) of the dirty page rate configured by the user can be tracked by the XML. To allow this, add the following XML: ... 3 ... The "dirty_limit" attribute in "vcpu" sub-element within "vcpus" element allows to set an upper limi

[PATCH Libvirt v3 01/10] qemu_capabilities: Introduce QEMU_CAPS_VCPU_DIRTY_LIMIT capability

2023-09-05 Thread ~hyman
From: Hyman Huang(黄勇) set-vcpu-dirty-limit/cancel-vcpu-dirty-limit/query-vcpu-dirty-limit were introduced since qemu >=7.1.0. Introduce corresponding capability. Signed-off-by: Hyman Huang(黄勇) --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h

[PATCH Libvirt v3 00/10] Support dirty page rate upper limit

2023-09-05 Thread ~hyman
Hi, This is the latest version for the series, please review. Thanks, Yong v3: - rebase on master and fix conflicts - refactor the comments and update the version tag v2: The patch set introduce a new API virDomainSetVcpuDirtyLimit to allow upper Apps to set upper limits of dirty page rate for v

[libvirt PATCH v2] ch: Fix cloud-hypervisor version processing

2023-09-05 Thread Praveen K Paladugu
Refactor the version processing logic in ch driver to support versions from non-release cloud-hypervisor binaries. This version also supports versions with branch prefixes in them. Signed-off-by: Praveen K Paladugu --- src/ch/ch_conf.c | 39 --- 1 file changed

Re: [PATCH 00/51] Finish conversion of all test cases in qemuxml2argvtest to real capabilities

2023-09-05 Thread Ján Tomko
On a Tuesday in 2023, Peter Krempa wrote: This series converts all outstanding test cases to use real capabilities. In the process few cases of pointless tests or features which are supported by every version of qemu were identified and addressed. To simplify the bulk of the conversion I've opt

Re: [PATCH 21/51] virQEMUCapsAddCPUDefinitions: Fill in cpu type in data and node it's used only in tests

2023-09-05 Thread Ján Tomko
s/node/note/ in the commit summary On a Tuesday in 2023, Peter Krempa wrote: 'virQEMUCapsAddCPUDefinitions' is used solely to populate fake cpu models for the fake-caps tests. Note that and also populate the 'type' field so that default cpu type can be propagated properly. Signed-off-by: Peter

Re: [PATCH 00.5/51] securityselinuxlabeltest: Convert to testQemuInsertRealCaps

2023-09-05 Thread Ján Tomko
On a Tuesday in 2023, Peter Krempa wrote: Use the modern infrastructure to populate capabilities cache with real capabilities instead of the faked one which will be soon removed. Signed-off-by: Peter Krempa --- tests/securityselinuxlabeltest.c | 11 +-- 1 file changed, 5 insertions(+), 6

[PATCH 00.5/51] securityselinuxlabeltest: Convert to testQemuInsertRealCaps

2023-09-05 Thread Peter Krempa
Use the modern infrastructure to populate capabilities cache with real capabilities instead of the faked one which will be soon removed. Signed-off-by: Peter Krempa --- tests/securityselinuxlabeltest.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/security

Re: [PATCH 00/51] Finish conversion of all test cases in qemuxml2argvtest to real capabilities

2023-09-05 Thread Peter Krempa
On Tue, Sep 05, 2023 at 16:23:27 +0200, Peter Krempa wrote: > This series converts all outstanding test cases to use real > capabilities. > > In the process few cases of pointless tests or features which are > supported by every version of qemu were identified and addressed. > > To simplify the b

[PATCH 37/51] qemuxml2argvtest: Consolidate and modernize CPU topology testing

2023-09-05 Thread Peter Krempa
Move the 'smp-dies' test case into 'cpu-topology4' and remove unnecessary cruft. Remove cpu definition from 'cpu-topology2' as it's not relevant to the test case. Remove 'smp' case as it's covered by the rest. Use real capabilities for all of them. Signed-off-by: Peter Krempa --- args =>

[PATCH 48/51] testutilsqemu: Unexport 'testQemuCapsInit'

2023-09-05 Thread Peter Krempa
Signed-off-by: Peter Krempa --- tests/testutilsqemu.c | 2 +- tests/testutilsqemu.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 05b28699c8..bb3e1b52c5 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -10

[PATCH 49/51] qemu: capabilities: Unexport 'virQEMUCapsAddMachine'

2023-09-05 Thread Peter Krempa
It's no longer needed in tests as we are no longer adding fake machines. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 2 +- src/qemu/qemu_capspriv.h | 14 -- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/

[PATCH 30/51] qemuxml2argvtest: Assume QEMU_CAPS_PIIX3_USB_UHCI for all fake-caps tests

2023-09-05 Thread Peter Krempa
To minimize further churn when coverting to real capabilities, assume that all fake-caps machines support the piix3 USB controller. Since we already have solid testing of USB controllers, this will have effect only in cases when it's not relevant to the test itself. Signed-off-by: Peter Krempa -

[PATCH 51/51] qemu: capabilities: Remove 'virQEMUCapsAddCPUDefinitions'

2023-09-05 Thread Peter Krempa
The function was used only to fill the cpu models into fake capabilities, whic no longer exists. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 40 src/qemu/qemu_capabilities.h | 5 - 2 files changed, 45 deletions(-) diff --git a/src/qem

[PATCH 22/51] qemuxml2argvtest: Modernize negative testing for hugepages

2023-09-05 Thread Peter Krempa
Use proper version for negative case of 'hugepages-memaccess3' QEMU allowed to configure a memory backend for default ram since qemu-5.2. Fix the test to use real capability data. Signed-off-by: Peter Krempa --- ...rr => hugepages-default-1G-nodeset-2M.x86_64-latest.err} | 0 ...id.err => hugep

[PATCH 45/51] testutilsqemu: Drop fake machine capability data for 'x86_64'

2023-09-05 Thread Peter Krempa
Now that all tests were converted to use real capabilities we can drop x86_64 from the tooling to create fake capabilities. Signed-off-by: Peter Krempa --- tests/testutilsqemu.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu

[PATCH 25/51] qemuxml2argvtest: Enable 'seccomp' sandbox in all fake caps tests

2023-09-05 Thread Peter Krempa
In order to minimize further churn, make all fake-caps test assume that the seccomp sandbox is supported. Signed-off-by: Peter Krempa --- tests/qemuxml2argvdata/acpi-table.args | 1 + tests/qemuxml2argvdata/autoindex.args | 1 + tests/qemuxml2ar

[PATCH 46/51] qemustatusxml2xmltest: Remove capabilities infrastructure

2023-09-05 Thread Peter Krempa
The status XML doesn't require any capabilities to be parsed and formatted back. Remove all qemuCaps related code. Signed-off-by: Peter Krempa --- tests/qemustatusxml2xmltest.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/tests/qemustatusxml2xmltest.c b/

[PATCH 38/51] qemuxml2argvtest: Modernize test cases using 'host-model' CPU

2023-09-05 Thread Peter Krempa
Modernize test cases using 'host-mode' cpu type, where the actual CPU doesn't isn't important. As using the host cpu from the 'latest' capabilities data would cause test churn in case the host cpu changes in the future, convert them using the overriden Haswell cpu. Signed-off-by: Peter Krempa --

[PATCH 50/51] qemuxml2argvtest: Remove cpu model faking for fake-caps tests

2023-09-05 Thread Peter Krempa
Now that all fake-caps testing was removed we can also remove the filling of the fake caps by cpu models. Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 49 1 file changed, 49 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml

[PATCH 14/51] qemuxml2argvtest: Remove duplicated test invocations

2023-09-05 Thread Peter Krempa
Few tests were invoked multiple times either with identical or equivalent config. Remove those invocations. Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 92ff7e4b1c..8709028

[PATCH 21/51] virQEMUCapsAddCPUDefinitions: Fill in cpu type in data and node it's used only in tests

2023-09-05 Thread Peter Krempa
'virQEMUCapsAddCPUDefinitions' is used solely to populate fake cpu models for the fake-caps tests. Note that and also populate the 'type' field so that default cpu type can be propagated properly. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 4 1 file changed, 4 insertions

[PATCH 33/51] qemuxml2argvtest: Assume QEMU_CAPS_USB_HOST_HOSTDEVICE and QEMU_CAPS_DEVICE_QEMU_XHCI for fake-caps tests

2023-09-05 Thread Peter Krempa
Assume the two features modern qemus have to bring the test data closer to the 'latest' real-caps versions. Signed-off-by: Peter Krempa --- tests/qemuxml2argvdata/controller-order.args | 2 +- tests/qemuxml2argvdata/pcie-expander-bus.args| 2 ++ tests/qemuxml2argvdata/pci

[PATCH 40/51] qemuxml2argvtest: Modernize 'cpu-minimum' cases

2023-09-05 Thread Peter Krempa
Use real capabilities, but select the fake 'Haswell' host CPU for test stability. Signed-off-by: Peter Krempa --- .../{cpu-minimum1.args => cpu-minimum1.x86_64-latest.args}| 2 +- .../{cpu-minimum2.args => cpu-minimum2.x86_64-latest.args}| 2 +- tests/qemuxml2argvtest.c

[PATCH 41/51] qemuxml2argvtest: Modernize 'cpu-strict' case

2023-09-05 Thread Peter Krempa
Use the fake Haswell processor definition and augment the list of features to make the test pass. Signed-off-by: Peter Krempa --- ...u-strict1.args => cpu-strict1.x86_64-latest.args} | 2 +- tests/qemuxml2argvdata/cpu-strict1.xml | 12 +++- tests/qemuxml2argvtest.c

[PATCH 28/51] qemuxml2argvtest: Improve default usb controller testing

2023-09-05 Thread Peter Krempa
Improve testing of an explicitly requested USB controller without a model being provided. For this purpose the 'usb-controller' case is renamed to 'usb-controller-default-i440fx'; 'usb-controller-default-q35' is moved up to form a group. In both cases tests are covnerted to use DO_TEST_CAPS_LATEST

[PATCH 43/51] qemuxml2argvtest: Modernize 'cpu-exact' cases

2023-09-05 Thread Peter Krempa
Use real capabilities, but select the fake 'Haswell' host CPU for test stability. Signed-off-by: Peter Krempa --- .../{cpu-exact1.args => cpu-exact1.x86_64-latest.args}| 0 ...back.args => cpu-exact2-nofallback.x86_64-latest.args} | 0 .../{cpu-exact2.args => cpu-exact2.x86_64-latest.args}

[PATCH 23/51] qemuxml2argvtest: Modernize 'numatune' tests

2023-09-05 Thread Peter Krempa
The 'numatune-memory' case is completely dropped as it's sufficiently covered by 'numatune-memnode'. The positive fake-caps version of 'numatune-memnode' is dropped as it's covered by the two existing real caps invocations. 'numatune-memory-invalid-nodeset', 'numatune-memnode-invalid-mode', 'numa

[PATCH 39/51] qemuxml2argvtest: Modernize 'cpu-Haswell' test cases

2023-09-05 Thread Peter Krempa
Modernize all test cases which set 'Haswell' as the host cpu model. Signed-off-by: Peter Krempa --- ...X.args => cpu-Haswell-noTSX.x86_64-latest.args} | 0 ...Haswell.args => cpu-Haswell.x86_64-latest.args} | 0 ...swell2.args => cpu-Haswell2.x86_64-latest.args} | 0 ...swell3.args => cpu-Has

[PATCH 34/51] qemuxml2argvtest: Assume QEMU_CAPS_QXL_VRAM64, QEMU_CAPS_(QXL|VGA)_VGAMEM for fake-caps tests

2023-09-05 Thread Peter Krempa
Assume the features modern qemus have to bring the test data closer to the 'latest' real-caps versions. Signed-off-by: Peter Krempa --- tests/qemuxml2argvdata/graphics-sdl.args| 2 +- tests/qemuxml2argvdata/pcie-root-port.args | 2 +- tests/qemuxml2argvdata/pcie-swit

[PATCH 47/51] testutilsqemu: Drop infrastructure for fake-caps testing

2023-09-05 Thread Peter Krempa
Remove all the code for adding fake machines into the testing capability cache as we no longer have any machines in it. Signed-off-by: Peter Krempa --- tests/testutilsqemu.c | 144 +++--- 1 file changed, 9 insertions(+), 135 deletions(-) diff --git a/tests/te

[PATCH 31/51] qemuxml2argvtest: Assume QEMU_CAPS_DEVICE_PCIE_ROOT_PORT for fake-caps tests

2023-09-05 Thread Peter Krempa
Assume the support for the 'pcie-root-port' all modern qemus have to bring the test data closer to the 'latest' real-caps versions. Signed-off-by: Peter Krempa --- tests/qemuxml2argvdata/autoindex.args| 2 +- tests/qemuxml2argvdata/pcie-expander-bus.args| 2 +- te

[PATCH 27/51] qemuxml2argvtest: Add tests for auto-added USB controllers

2023-09-05 Thread Peter Krempa
There are per-machine type variations on which usb controller will be picked on an x86_64 machine. Add test cases where a USB controller is completely missing to cover all 3 cases ('isapc', 'pc', 'q35') when an USB controller is not explicitly requested by the user. Signed-off-by: Peter Krempa --

[PATCH 35/51] qemuxml2argvtest: Properly modernize 'clock-hpet-off' test case

2023-09-05 Thread Peter Krempa
Since qemu-8.0 a new way to disable 'hpet' via -machine was added. Properly test both branches with real capabilities. Signed-off-by: Peter Krempa --- .../clock-hpet-off.x86_64-7.2.0.args | 39 +++ ...args => clock-hpet-off.x86_64-latest.args} | 4 +- tests/qemuxml2argv

[PATCH 42/51] qemuxml2argvtest: Modernize 'cpu-(no)fallback' test

2023-09-05 Thread Peter Krempa
Previously without modern capabilities the test was relying on a CPU model which was not entered into a fake list of supported cpus. With real capabilities we have to pick a CPU model which is supported by libvirt but in some version is not supported by qemu. I've picked EPYC-Milan, which was intr

[PATCH 36/51] qemuxml2argvtest: Modernize migration/restore tests

2023-09-05 Thread Peter Krempa
As these were using DO_TEST_FULL the churn-reducing patches didn't influence these. Signed-off-by: Peter Krempa --- ...migrate-numa-unaligned.x86_64-latest.args} | 13 +++ ...igrate.args => migrate.x86_64-latest.args} | 9 ++--- args => restore-v2-fd.x86_64-latest.args} | 11 +++--- ...

[PATCH 44/51] qemuxml2argvtest: Modernize rest of the test cases

2023-09-05 Thread Peter Krempa
The rest of the test cases has no change in the output now that we've assumed some flags. Remove the fake-caps test macros after conversion. Signed-off-by: Peter Krempa --- ...fx-ide-address-conflict.x86_64-latest.err} | 0 ...err => 440fx-wrong-root.x86_64-latest.err} | 0 ...ble.args => a

[PATCH 29/51] qemuxml2argvtest: Consolidate testing of 'xhci' controllers

2023-09-05 Thread Peter Krempa
Rename the 'usb-controller-explicit-(unavailable-)q35' test case to 'usb-controller-nec-xhci'. Since this also covers what 'usb-controller-xhci' was testing the latter is removed. Other 'usb-xhci' test cases which were using the NEC controller are also renamed to contain the name. In case of 'usb

[PATCH 19/51] qemuxml2argvtest: Remove FLAG_SKIP_LEGACY_CPUS

2023-09-05 Thread Peter Krempa
Remove the notion of legacy cpus as there are no test cases using it any more. Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 27 +-- tests/testutilsqemu.h| 5 ++--- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/tests/qemuxml2argvtest.c

[PATCH 26/51] qemuxml2argvtest: Consolidate tests for usb controllers

2023-09-05 Thread Peter Krempa
Move all controller related tests together and consolidate naming of the test cases. Signed-off-by: Peter Krempa --- ...gs => usb-controller-ich9-autoassign.args} | 0 ...xml => usb-controller-ich9-autoassign.xml} | 0 ...rgs => usb-controller-ich9-companion.args} | 0 xml => usb-controll

[PATCH 12/51] qemuxml2argvtest: Remove old chardev tests

2023-09-05 Thread Peter Krempa
All tests have already a real capability variant. Signed-off-by: Peter Krempa --- .../qemuxml2argvdata/console-compat-auto.args | 36 --- .../console-compat-chardev.args | 36 --- tests/qemuxml2argvdata/console-compat.args| 35 -- .../paralle

[PATCH 32/51] qemuxml2argvtest: Assume QEMU_CAPS_CPU_MIGRATABLE and QEMU_CAPS_SMP_DIES for fake-caps tests

2023-09-05 Thread Peter Krempa
Assume the two features modern qemus have to bring the test data closer to the 'latest' real-caps versions. Signed-off-by: Peter Krempa --- tests/qemuxml2argvdata/cpu-cache-disable.args | 2 +- tests/qemuxml2argvdata/cpu-cache-emulate-l3.args | 2 +- tests/qemuxml2ar

[PATCH 10/51] qemu_capabilities: Retire QEMU_CAPS_DEVICE_VFIO_PCI

2023-09-05 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 3 +-- src/qemu/qemu_capabilities.h | 2 +- tests/qemucapabilitiesdata/caps_4.2.0_aarch64.xml | 1 - tests/qemucapabilitiesdata/caps_4.2.0_ppc64.xml | 1 - tests/qemucapabili

[PATCH 15/51] qemuxml2argvtest: Remove fake-caps invocations of tests which also real caps version

2023-09-05 Thread Peter Krempa
Drop tests which already are tested with real caps, thus the fake caps version doesn't bring much value. Signed-off-by: Peter Krempa --- tests/qemuxml2argvdata/cpu-host-model.args| 40 --- .../graphics-egl-headless.args| 33 --- tests/qemuxml2argvt

[PATCH 17/51] qemuxml2argvtest: Use real caps for 'cpu-host-model-fallback' test case

2023-09-05 Thread Peter Krempa
Similarly to 'cpu-host-model' add a real capability invocation for each version we support and remove the old fake caps invocation. Signed-off-by: Peter Krempa --- ...cpu-host-model-fallback.x86_64-4.2.0.args} | 7 ++-- .../cpu-host-model-fallback.x86_64-5.0.0.args | 33 ++ .../

[PATCH 13/51] qemuxml2argvtest: Simplify invocation of GIC tests

2023-09-05 Thread Peter Krempa
Change DO_TEST_GIC so that it accepts the version and switch it to use DO_TEST_CAPS_ARCH_VER_FULL internally which will ensure that the output filenames conform to the format we use for real capabilities. This also allows us to convert a few of versioned tests to use this improved macro. Signed-o

[PATCH 09/51] qemu: Always assume support for QEMU_CAPS_DEVICE_VFIO_PCI

2023-09-05 Thread Peter Krempa
The 'display' option for the 'vfio-pci' device was added in qemu-2.12 and can't be compiled out. Assume support for the flag. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 11 --- src/qemu/qemu_validate.c| 6 -- tes

[PATCH 07/51] qemu: Always assume support for QEMU_CAPS_CPU_CACHE

2023-09-05 Thread Peter Krempa
All supported qemu versions have this feature and it can't be compiled out. The logic is a bit more complex in this instance as the flag is asserted if: if (ARCH_IS_X86(qemuCaps->arch) && virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION)) { virQEMUCapsSet(qemuCaps,

[PATCH 18/51] qemuxml2argvtest: Use real caps for 'cpu-host-model-nofallback' test case

2023-09-05 Thread Peter Krempa
Similarly to 'cpu-host-model' add a real capability invocation for each version we support and remove the old fake caps invocation. Signed-off-by: Peter Krempa --- .../cpu-host-model-nofallback.err | 1 - ...pu-host-model-nofallback.x86_64-4.2.0.args | 33 ++ ...pu-h

[PATCH 16/51] qemuxml2argvtest: Use proper version in negative 'virtio-options-memballoon-freepage-reporting' case

2023-09-05 Thread Peter Krempa
The feature is supported since qemu-5.1. Use real qemu-5.0 caps for the test. Signed-off-by: Peter Krempa --- ...rtio-options-memballoon-freepage-reporting.x86_64-5.0.0.err} | 0 tests/qemuxml2argvtest.c| 2 +- 2 files changed, 1 insertion(+), 1 deletion(-

[PATCH 06/51] qemuxml2argvtest: Drop 'monitor-json' case

2023-09-05 Thread Peter Krempa
QMP monitor is the only thing we support at this point, thus all other tests test the same thing. Signed-off-by: Peter Krempa --- tests/qemuxml2argvdata/monitor-json.args | 34 tests/qemuxml2argvdata/monitor-json.xml | 25 - tests/qemuxml2argvtest.c

[PATCH 05/51] qemuxml2argvtest: testAddCPUModels: Remove non-x86_64 fake cpu models

2023-09-05 Thread Peter Krempa
At this point only x86_64 is using fake machines, and for real machines we don't populate the fake cpu models. Thus we can remove everything non-x86_64. Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 30 -- 1 file changed, 30 deletions(-) diff --git a/tes

[PATCH 11/51] qemuxml2argvtest: Add missing versioned test cases for 'cpu-host-model'

2023-09-05 Thread Peter Krempa
We've forgot to add test invocations with real caps for qemu versions starting with 6.2. Signed-off-by: Peter Krempa --- .../cpu-host-model.x86_64-6.2.0.args | 39 +++ .../cpu-host-model.x86_64-7.0.0.args | 39 +++ .../cpu-host-model.x86_64-7.1.0

[PATCH 04/51] qemuxml2argvtest: Clean up host CPU if overriden

2023-09-05 Thread Peter Krempa
If a test uses ARG_CAPS_HOST_CPU_MODEL feature we override the global host cpu model to the selected CPU but don't clear it afterwards. This can trip up fake caps tests following a test which uses this feature. This does not happen with real caps, because unless overriden, the host cpu from capabi

[PATCH 08/51] qemu: capabilities: Retire QEMU_CAPS_CPU_CACHE

2023-09-05 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 7 +-- src/qemu/qemu_capabilities.h | 2 +- tests/qemucapabilitiesdata/caps_4.2.0_x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_5.0.0_x86_64.xml | 1 - tests/qemucapabili

[PATCH 03/51] qemu: capabilities: Preserve location of the default machine type when stripping aliases for tests

2023-09-05 Thread Peter Krempa
Internally the preferred machine which is 'pc' for x86_64 must be kept in the first place in the array of machines. This was not the case when stripping the machine aliases for use in tests (so that test output stays stable) where we've created a new entry for the alias. This means that the origina

[PATCH 02/51] qemu: capabilities: Retire QEMU_CAPS_ICH9_DISABLE_S* and QEMU_CAPS_ICH9_DISABLE_S* capabilities

2023-09-05 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 12 src/qemu/qemu_capabilities.h | 8 tests/qemucapabilitiesdata/caps_4.2.0_x86_64.xml | 4 tests/qemucapabilitiesdata/caps_5.0.0_x86_64.xml | 4 ---

[PATCH 01/51] qemu: Always assume support for QEMU_CAPS_PIIX_DISABLE_S* and QEMU_CAPS_ICH9_DISABLE_S*

2023-09-05 Thread Peter Krempa
The support for PIIX power management was added in qemu commit v1.0-3094-g459ae5ea5a and the suport for ICH9 power management was added in qemu commit v2.2.0-542-g6ac0d8d44c and both can't be compiled out. This means we can always assume support for these features. Remove the validation and imposs

[PATCH 00/51] Finish conversion of all test cases in qemuxml2argvtest to real capabilities

2023-09-05 Thread Peter Krempa
This series converts all outstanding test cases to use real capabilities. In the process few cases of pointless tests or features which are supported by every version of qemu were identified and addressed. To simplify the bulk of the conversion I've opted to simply set the most common capabilitie

Re: [PATCH] storage_util: Drop getDeviceType()

2023-09-05 Thread Ján Tomko
On a Tuesday in 2023, Michal Privoznik wrote: The sole purpose of getDeviceType() is to parse a file that contains one integer (and a newline character). Well, we already have a function for that: virFileReadValueInt(). Use the latter and drop the former. Signed-off-by: Michal Privoznik --- src

[PATCH] storage_util: Drop getDeviceType()

2023-09-05 Thread Michal Privoznik
The sole purpose of getDeviceType() is to parse a file that contains one integer (and a newline character). Well, we already have a function for that: virFileReadValueInt(). Use the latter and drop the former. Signed-off-by: Michal Privoznik --- src/storage/storage_util.c | 75 --

Re: [PATCH 0/3] ch: Couple of format directive fixes

2023-09-05 Thread Ján Tomko
On a Tuesday in 2023, Michal Privoznik wrote: *** BLURB HERE *** Michal Prívozník (3): ch: Use uint for @maxvcpus in virCHDomainRefreshThreadInfo() ch: Use int for @niothreads in virCHMonitorGetIOThreads() ch: Use proper format directive for @i in virCHProcessSetupIOThreads() src/ch/ch_domai

[PATCH 3/3] ch: Use proper format directive for @i in virCHProcessSetupIOThreads()

2023-09-05 Thread Michal Privoznik
The @i variable inside of virCHProcessSetupIOThreads() is a typical loop counter - it's declared as size_t. But when passed to VIR_DEBUG an invalid format directive is used (%ld). Fix that. Signed-off-by: Michal Privoznik --- src/ch/ch_process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 1/3] ch: Use uint for @maxvcpus in virCHDomainRefreshThreadInfo()

2023-09-05 Thread Michal Privoznik
The @maxvcpus variable inside of virCHDomainRefreshThreadInfo() holds retval of virDomainDefGetVcpusMax() which returns an unsigned int. Also, the variable is then passed to VIR_WARN() with incorrect format directive (%ld). Switch variable to uint and fix the format directive. Signed-off-by: Micha

[PATCH 2/3] ch: Use int for @niothreads in virCHMonitorGetIOThreads()

2023-09-05 Thread Michal Privoznik
The @niothreads inside of virCHMonitorGetIOThreads() is declared as of size_t type. This would work, except the variable is then passed to VIR_DEBUG with incorrect format directive (%ld) and returned. But the function returns an int not size_t. Fix the variable declaration and format directive. S

[PATCH 0/3] ch: Couple of format directive fixes

2023-09-05 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (3): ch: Use uint for @maxvcpus in virCHDomainRefreshThreadInfo() ch: Use int for @niothreads in virCHMonitorGetIOThreads() ch: Use proper format directive for @i in virCHProcessSetupIOThreads() src/ch/ch_domain.c | 4 ++-- src/ch/ch_monitor.c | 4 ++--

Re: [PATCH] fix virCgroupGetMemoryStat arguments order

2023-09-05 Thread Martin Kletzander
On Mon, Sep 04, 2023 at 02:44:48PM +0300, Dmitry Frolov wrote: Reviewing the sources, I noticed that, argumets order in virCgroupGetMemoryStat() function call does not correspond to the function declaration: -instead of *activeAnon, &meminfo->inactive_anon is passed; -instead of *inactiveAnon,

Re: [PATCH Libvirt v2 00/10] Support dirty page rate upper limit

2023-09-05 Thread Yong Huang
On Tue, Sep 5, 2023 at 6:22 PM Martin Kletzander wrote: > Sorry for not looking into this earlier, but it's been quite a while and > I, personally, received only patches 2, 6, 5, 9, and 10 from this > series. I, however, see the rest in the archive, so the issue is > probably somewhere on my par

Re: [PATCH Libvirt v2 00/10] Support dirty page rate upper limit

2023-09-05 Thread Martin Kletzander
Sorry for not looking into this earlier, but it's been quite a while and I, personally, received only patches 2, 6, 5, 9, and 10 from this series. I, however, see the rest in the archive, so the issue is probably somewhere on my part. Would you mind resending the second version again, ideally re

Re: [PATCH 8/8] build: Decrease maximum stack frame size to 2048

2023-09-05 Thread Peter Krempa
On Tue, Sep 05, 2023 at 11:05:17 +0200, Michal Prívozník wrote: > On 9/5/23 09:43, Peter Krempa wrote: > > On Mon, Sep 04, 2023 at 16:09:00 +0200, Michal Prívozník wrote: > >> On 8/30/23 13:59, Peter Krempa wrote: > >>> After recent cleanups we can now restrict the maximum stack frame size > >>> to

Re: [PATCH 8/8] build: Decrease maximum stack frame size to 2048

2023-09-05 Thread Michal Prívozník
On 9/5/23 09:43, Peter Krempa wrote: > On Mon, Sep 04, 2023 at 16:09:00 +0200, Michal Prívozník wrote: >> On 8/30/23 13:59, Peter Krempa wrote: >>> After recent cleanups we can now restrict the maximum stack frame size >>> to 2k. >>> >>> Signed-off-by: Peter Krempa >>> --- >>> meson.build | 2 +-

[PATCH] fix virCgroupGetMemoryStat arguments order

2023-09-05 Thread Dmitry Frolov
Reviewing the sources, I noticed that, argumets order in virCgroupGetMemoryStat() function call does not correspond to the function declaration: -instead of *activeAnon, &meminfo->inactive_anon is passed; -instead of *inactiveAnon, &meminfo->active_anon is passed; -instead of *activeFile, &me

Re: [PATCH 8/8] build: Decrease maximum stack frame size to 2048

2023-09-05 Thread Daniel P . Berrangé
On Tue, Sep 05, 2023 at 09:43:47AM +0200, Peter Krempa wrote: > On Mon, Sep 04, 2023 at 16:09:00 +0200, Michal Prívozník wrote: > > On 8/30/23 13:59, Peter Krempa wrote: > > > After recent cleanups we can now restrict the maximum stack frame size > > > to 2k. > > > > > > Signed-off-by: Peter Kremp

Re: [libvirt PATCH v8 26/37] qemu: improve error handling when restarting nbdkit

2023-09-05 Thread Peter Krempa
On Thu, Aug 31, 2023 at 16:40:06 -0500, Jonathon Jongsma wrote: > Change the return value for qemuNbdkitProcessRestart() and > qemuNbdkitStorageSourceManageProcess() to return an error status. The > main effect of this change is that when libvirt starts up and reconnects > to an already-running dom

Re: [libvirt PATCH v8 25/37] qemu: Monitor nbdkit process for exit

2023-09-05 Thread Peter Krempa
On Thu, Aug 31, 2023 at 16:40:05 -0500, Jonathon Jongsma wrote: > Adds the ability to monitor the nbdkit process so that we can take > action in case the child exits unexpectedly. > > When the nbdkit process exits, we pause the vm, restart nbdkit, and then > resume the vm. This allows the vm to co

Re: [libvirt PATCH v8 24/37] qemu: Add Taint for nbdkit restart failure

2023-09-05 Thread Peter Krempa
On Thu, Aug 31, 2023 at 16:40:04 -0500, Jonathon Jongsma wrote: > Since the restart handler will trigger at an arbitrary time (when the > nbdkit process crashes, for instance), it's difficult to provide > feedback to the user if the restart is unsuccessful. Rather than just > relying on a warning i

Re: Pure Python binding?

2023-09-05 Thread Peter Krempa
On Tue, Sep 05, 2023 at 09:00:45 +0200, Philipp Hahn wrote: > Hello, > > "pip install libvirt-python" does not work in several cases as that requires > the low-level C library, compilers, tools, and Python header files to be > installed. This prevents the use of "libvirt" in scenarios, where "root

Re: [PATCH 8/8] build: Decrease maximum stack frame size to 2048

2023-09-05 Thread Peter Krempa
On Mon, Sep 04, 2023 at 16:09:00 +0200, Michal Prívozník wrote: > On 8/30/23 13:59, Peter Krempa wrote: > > After recent cleanups we can now restrict the maximum stack frame size > > to 2k. > > > > Signed-off-by: Peter Krempa > > --- > > meson.build | 2 +- > > 1 file changed, 1 insertion(+), 1

Pure Python binding?

2023-09-05 Thread Philipp Hahn
Hello, "pip install libvirt-python" does not work in several cases as that requires the low-level C library, compilers, tools, and Python header files to be installed. This prevents the use of "libvirt" in scenarios, where "root" privileges are not available to install these dependencies, e.g