Re: [PATCH] remote: Make remote_daemon depend on qemu_protocol.h
On 8/8/22 22:59, Michal Prívozník wrote: > On 7/20/22 10:41, He Zhe wrote: >> We sometimes meet the following parallel compililation issue, since >> remote_daemon depends on remote_protocol.h qemu_protocol.h and >> lxc_protocol.h, >> which are usually generated due to remote_driver . >> >> | FAILED: src/virtnetworkd.p/remote_remote_daemon_dispatch.c.o >> | x86_64-wrs-linux-gcc ... >> | In file included from >> ../libvirt-8.1.0/src/remote/remote_daemon_dispatch.c:26: >> | ../libvirt-8.1.0/src/remote/remote_daemon.h:30:10: fatal error: >> qemu_protocol.h: No such file or directory >> |30 | #include "qemu_protocol.h" >> | | ^ >> | compilation terminated. >> >> This patch adds the headers as dependencies of remote_daemon to make sure >> they >> are always in place in advance. >> >> Signed-off-by: He Zhe >> --- >> src/remote/meson.build | 23 +-- >> 1 file changed, 13 insertions(+), 10 deletions(-) > Hm.. I'm failing to reproduce the build error, even though I put > sleep(5) into both src/rpc/gendispatch.pl and src/rpc/genprotocol.pl and > I try in a machine with 384 cores. I even wrapped rpcgen in a shell > script to insert a short sleep. > > In the commit message you mention libvirt-8.1.0, does this problem still > occurs even with the current master? Thanks for taking care of this. Yes, this is a rare case. We build libvirt everyday and only saw this twice so far. We haven't upgraded to a newer version. Even if it's done, we might not expect it's reproduced soon...indeed Looking at the meson.build, the dependencies are still missing on current master. Zhe > > Michal >
Re: Test failures on macOS 12
> On 10 Jun 2022, at 11:34, Andrea Bolognani wrote: > > On Fri, May 06, 2022 at 03:00:14AM -0700, Andrea Bolognani wrote: >> I'm trying to enable CI coverage for macOS 12, but I'm running into a >> couple of issues that I'm not sure how to handle. >> >> Note that the test suite currently passes on macOS 11[1], so these >> failures have to be a consequence to changes made to macOS that we >> haven't yet learned how to cope with. >> >> The first one is in vircryptotest: >> >> Encrypt aes265cbc ... Expected ciphertext doesn't match >> >> I've added some debug statements and it looks like the generated data >> is different every time, which seems like a pretty good indication >> that virrandommock is not being picked up correctly. This is not the >> only test program that uses that specific mock though, so I'm not >> sure what makes it fail when all the others are succeeding. >> >> The other issue is in qemuxml2argvtest: >> >> error : virCommandWait:2752 : internal error: Child process >>(/usr/libexec/qemu/vhost-user/test-vhost-user-gpu --print-capabilities) >>unexpected fatal signal 6: dyld[8896]: symbol not found in flat >>namespace '_virQEMUCapsGet' >> error : qemuVhostUserFillDomainGPU:394 : operation failed: Unable to >>find a satisfying vhost-user-gpu I don’t see this one. What I see instead is failures on qemucapabilitiestest. The tests seems to depend on a particular install path for the qemu-system- binaries: binary = g_strdup_printf("/usr/bin/qemu-system-%s", data->archName); On macOS, there is something called “system integrity protection” which makes it a bit more difficult to add stuff to /usr/bin. However, I don’t really think that’s the problem. I ran some tests with: VIR_TEST_DEBUG=1 VIR_TEST_RANGE=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69 /Users/ddd/Work/libvirt/build/tests/qemucapabilitiestest The error I get seem to point to ‘hvf’ been unexected in the output: 15) 6.2.0 (x86_64)... In '/Users/ddd/Work/libvirt/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml': Offset 7557 Expect [c] Actual [hvf'/> > >> So the various virFileWrapperAddPrefix() calls that cause the >> contents of tests/qemuvhostuserdata/ to override the host's own >> vhostuser configuration are still effective, but for some reason the >> trivial test-vhost-user-gpu shell script can't be run successfully >> because an internal libvirt symbol can't be found somehow? Confusing. >> >> Roman, does any of this ring a bell? Any chance you could >> investigate? macOS 12 has been out for a while now so I'd be very >> keen to have it added to CI. > > Roman, any chance you can find some time to investigate the test > failures documented above? I'm afraid I've reached the limit of my > ability to debug macOS-specific behavior :( > > -- > Andrea Bolognani / Red Hat / Virtualization >
Re: Test failures on macOS 12
Hi Andrea, I saw your call to Sergio and Marc-André on IRC, and I thought I would spend a few minutes inviestigating. > On 10 Jun 2022, at 11:34, Andrea Bolognani wrote: > > On Fri, May 06, 2022 at 03:00:14AM -0700, Andrea Bolognani wrote: >> I'm trying to enable CI coverage for macOS 12, but I'm running into a >> couple of issues that I'm not sure how to handle. >> >> Note that the test suite currently passes on macOS 11[1], so these >> failures have to be a consequence to changes made to macOS that we >> haven't yet learned how to cope with. >> >> The first one is in vircryptotest: >> >> Encrypt aes265cbc ... Expected ciphertext doesn't match >> >> I've added some debug statements and it looks like the generated data >> is different every time, which seems like a pretty good indication >> that virrandommock is not being picked up correctly. This is not the >> only test program that uses that specific mock though, so I'm not >> sure what makes it fail when all the others are succeeding. I believe that the following patch fixes this one: From: Christophe de Dinechin Date: Mon, 8 Aug 2022 20:14:08 +0200 Subject: [PATCH] tests: Pass the flat_namespace option to the linker This fixes vircryptotest on macOS 12 (Monterey). The test relies on library injection (using DYLD_INSERT_LIBRARIES) to replace the normal random functions with functions giving predictable results, defined in virrandommock.c. However, using DYLD_INSERT_LIBRARIES only works when building with flat namespaces. Adding the -Wl,-flat_namespace option to the linker fixes the problem. The option was already defined in the top-level meson.build, but had been forgotten in the test linker arguments. Signed-off-by: Christophe de Dinechin Signed-off-by: Christophe de Dinechin --- tests/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/meson.build b/tests/meson.build index bc9d8ccc4c..d6b1bb2bf0 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -28,6 +28,7 @@ tests_dep = declare_dependency( ], link_args: ( libvirt_export_dynamic ++ libvirt_flat_namespace + coverage_flags ), ) -- 2.37.1 Could you please check? >> >> The other issue is in qemuxml2argvtest: >> >> error : virCommandWait:2752 : internal error: Child process >>(/usr/libexec/qemu/vhost-user/test-vhost-user-gpu --print-capabilities) >>unexpected fatal signal 6: dyld[8896]: symbol not found in flat >>namespace '_virQEMUCapsGet' >> error : qemuVhostUserFillDomainGPU:394 : operation failed: Unable to >>find a satisfying vhost-user-gpu >> >> So the various virFileWrapperAddPrefix() calls that cause the >> contents of tests/qemuvhostuserdata/ to override the host's own >> vhostuser configuration are still effective, but for some reason the >> trivial test-vhost-user-gpu shell script can't be run successfully >> because an internal libvirt symbol can't be found somehow? Confusing. >> >> Roman, does any of this ring a bell? Any chance you could >> investigate? macOS 12 has been out for a while now so I'd be very >> keen to have it added to CI. > > Roman, any chance you can find some time to investigate the test > failures documented above? I'm afraid I've reached the limit of my > ability to debug macOS-specific behavior :( > > -- > Andrea Bolognani / Red Hat / Virtualization >
[libvirt PATCH] rpm: merge mingw sub-packages into native spec
One specfile containing both native and mingw builds is the new best practice for Fedora. This reduces the maint burden and ensures the mingw packages don't fall behind. Signed-off-by: Daniel P. Berrangé --- .gitlab-ci.yml| 2 +- libvirt.spec.in | 287 meson.build | 17 +-- mingw-libvirt.spec.in | 327 -- 4 files changed, 293 insertions(+), 340 deletions(-) delete mode 100644 mingw-libvirt.spec.in diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6a8b89729f..39c5f8fb6d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,7 +33,7 @@ include: - meson dist -C build --no-tests - if test -x /usr/bin/rpmbuild && test "$RPM" != "skip"; then -rpmbuild --clean --nodeps --define "_topdir $PWD/rpmbuild/" -ta build/meson-dist/libvirt-*.tar.xz; +rpmbuild --clean --nodeps --define "_without_mingw 1" --define "_topdir $PWD/rpmbuild/" -ta build/meson-dist/libvirt-*.tar.xz; mv rpmbuild/RPMS/x86_64/ libvirt-rpms/; else meson compile -C build; diff --git a/libvirt.spec.in b/libvirt.spec.in index a238edf2aa..fe386bfef2 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -197,6 +197,10 @@ %define qemu_moddir %{_libdir}/qemu %define qemu_datadir %{_datadir}/qemu +%define with_mingw 0 +%if 0%{?fedora} +%define with_mingw 0%{!?_without_mingw:1} +%endif # RHEL releases provide stable tool chains and so it is safe to turn # compiler warning into errors without being worried about frequent @@ -393,6 +397,36 @@ BuildRequires: libtirpc-devel BuildRequires: firewalld-filesystem %endif +%if %{with_mingw} +BuildRequires: mingw32-filesystem +BuildRequires: mingw32-gcc +BuildRequires: mingw32-binutils +BuildRequires: mingw32-glib2 >= 2.48 +BuildRequires: mingw32-libgpg-error +BuildRequires: mingw32-libgcrypt +BuildRequires: mingw32-gnutls +BuildRequires: mingw32-gettext +BuildRequires: mingw32-libxml2 +BuildRequires: mingw32-portablexdr +BuildRequires: mingw32-dlfcn +BuildRequires: mingw32-libssh2 +BuildRequires: mingw32-curl + +BuildRequires: mingw64-filesystem +BuildRequires: mingw64-gcc +BuildRequires: mingw64-binutils +BuildRequires: mingw64-glib2 >= 2.48 +BuildRequires: mingw64-libgpg-error +BuildRequires: mingw64-libgcrypt +BuildRequires: mingw64-gnutls +BuildRequires: mingw64-gettext +BuildRequires: mingw64-libxml2 +BuildRequires: mingw64-portablexdr +BuildRequires: mingw64-dlfcn +BuildRequires: mingw64-libssh2 +BuildRequires: mingw64-curl +%endif + %description Libvirt is a C toolkit to interact with the virtualization capabilities of recent versions of Linux (and other OSes). The main package includes @@ -948,6 +982,25 @@ Requires: libvirt-daemon-driver-network = %{version}-%{release} %description nss Libvirt plugin for NSS for translating domain names into IP addresses. +%if %{with_mingw} +%package -n mingw32-libvirt +Summary: %{summary} +Obsoletes: mingw32-libvirt-static < 7.0.0 +BuildArch: noarch + +%description -n mingw32-libvirt +MinGW Windows libvirt virtualization library. + +%package -n mingw64-libvirt +Summary: %{summary} +Obsoletes: mingw64-libvirt-static < 7.0.0 +BuildArch: noarch + +%description -n mingw64-libvirt +MinGW Windows libvirt virtualization library. + +%{?mingw_debug_package} +%endif %prep @@ -1191,6 +1244,84 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) %meson_build +%if %{with_mingw} +%mingw_meson \ + --auto-features=enabled \ + -Ddriver_remote=enabled \ + -Ddriver_test=enabled \ + -Ddriver_esx=enabled \ + -Dcurl=enabled \ + -Ddocs=enabled \ + -Dapparmor=disabled \ + -Dapparmor_profiles=disabled \ + -Dattr=disabled \ + -Daudit=disabled \ + -Dbash_completion=disabled \ + -Dblkid=disabled \ + -Dcapng=disabled \ + -Ddriver_bhyve=disabled \ + -Ddriver_hyperv=disabled \ + -Ddriver_interface=disabled \ + -Ddriver_libvirtd=disabled \ + -Ddriver_libxl=disabled \ + -Ddriver_lxc=disabled \ + -Ddriver_network=disabled \ + -Ddriver_openvz=disabled \ + -Ddriver_qemu=disabled \ + -Ddriver_secrets=disabled \ + -Ddriver_vbox=disabled \ + -Ddriver_vmware=disabled \ + -Ddriver_vz=disabled \ + -Ddtrace=disabled \ + -Dexpensive_tests=enabled \ + -Dfirewalld=disabled \ + -Dfirewalld_zone=disabled \ + -Dfuse=disabled \ + -Dglusterfs=disabled \ + -Dhost_validate=disabled \ + -Dlibiscsi=disabled \ + -Dlibnl=disabled \ + -Dlibpcap=disabled \ + -Dlibssh2=disabled \ + -Dlibssh=disabled \ + -Dlogin_shell=disabled \ + -Dnetcf=disabled \ + -Dnls=disabled \ + -Dnss=disabled \ + -Dnumactl=disabled \ + -Dnumad=disabled \ + -Dopenwsman=disabled \ + -Dpciaccess=disabled \ + -Dpm_utils=disabled \ + -Dpolkit=disabled \ + -Dreadline=disabled \ + -Drpath=disabled \ + -Dsanlock=disabled \ + -Dsasl=disabled \ + -Dsecdriver_apparmor=disabled \ + -Dsecdriver_selinux=disabled \ + -Dselinux=disabled \ + -Dstorage_dir=disabled \ + -Dstorage_disk=disabled \ +
Re: [libvirt PATCH] conf: Simplify IOMMU device validation
On a Monday in 2022, Andrea Bolognani wrote: Instead of duplicating the list of attributes that are not allowed for some of the IOMMU models, use two separate switch statements: one for the attributes and one for the address. Signed-off-by: Andrea Bolognani --- src/conf/domain_validate.c | 22 +- 1 file changed, 9 insertions(+), 13 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature
Re: [libvirt PATCH] conf: Simplify IOMMU device validation
On Mon, Aug 08, 2022 at 05:41:16PM +0200, Andrea Bolognani wrote: > Instead of duplicating the list of attributes that are not > allowed for some of the IOMMU models, use two separate switch > statements: one for the attributes and one for the address. > > Signed-off-by: Andrea Bolognani > --- > src/conf/domain_validate.c | 22 +- > 1 file changed, 9 insertions(+), 13 deletions(-) Reviewed-by: Pavel Hrdina signature.asc Description: PGP signature
Re: [PATCH v2 0/7] qemu: remove support for query-cpus
On Mon, Aug 08, 2022 at 05:15:01PM +0200, Paolo Bonzini wrote: > The query-cpus-fast command was introduced in 2.12, therefore query-cpus > is never used on supported versions of QEMU. Remove the logic to parse > its output, as well as the parameters to choose between the two commands. > > Since most tests were still mocking the query-cpus command, the expected > results of QEMU monitor commands have to be converted as well. > > Thanks, > > Paolo > > v1->v2: do not query capability, regenerate test output [Peter] > hopefully patch 3/7 is not mangled [Pavel] > > Paolo Bonzini (7): > tests: remove duplicate cpuinfo test > tests: drop "-fast" from query-cpus-fast tests > tests: convert ppc64 tests to query-cpus-fast > tests: convert x86_64 tests to query-cpus-fast > tests: remove query-cpus tests > qemu: remove support for query-cpus > qemu: deprecate query-cpus-fast capability Reviewed-by: Pavel Hrdina signature.asc Description: PGP signature
[libvirt PATCH] conf: Simplify IOMMU device validation
Instead of duplicating the list of attributes that are not allowed for some of the IOMMU models, use two separate switch statements: one for the attributes and one for the address. Signed-off-by: Andrea Bolognani --- src/conf/domain_validate.c | 22 +- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 88205c64e0..1c78a3d31c 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -2633,6 +2633,7 @@ virDomainIOMMUDefValidate(const virDomainIOMMUDef *iommu) { switch (iommu->model) { case VIR_DOMAIN_IOMMU_MODEL_SMMUV3: +case VIR_DOMAIN_IOMMU_MODEL_VIRTIO: if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT || iommu->caching_mode != VIR_TRISTATE_SWITCH_ABSENT || iommu->eim != VIR_TRISTATE_SWITCH_ABSENT || @@ -2643,8 +2644,15 @@ virDomainIOMMUDefValidate(const virDomainIOMMUDef *iommu) virDomainIOMMUModelTypeToString(iommu->model)); return -1; } -G_GNUC_FALLTHROUGH; +break; +case VIR_DOMAIN_IOMMU_MODEL_INTEL: +case VIR_DOMAIN_IOMMU_MODEL_LAST: +break; +} + +switch (iommu->model) { +case VIR_DOMAIN_IOMMU_MODEL_SMMUV3: case VIR_DOMAIN_IOMMU_MODEL_INTEL: if (iommu->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { virReportError(VIR_ERR_XML_ERROR, @@ -2655,18 +2663,6 @@ virDomainIOMMUDefValidate(const virDomainIOMMUDef *iommu) break; case VIR_DOMAIN_IOMMU_MODEL_VIRTIO: -if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT || -iommu->caching_mode != VIR_TRISTATE_SWITCH_ABSENT || -iommu->eim != VIR_TRISTATE_SWITCH_ABSENT || -iommu->iotlb != VIR_TRISTATE_SWITCH_ABSENT || -iommu->aw_bits != 0) { -virReportError(VIR_ERR_XML_ERROR, - _("iommu model '%s' doesn't support additional attributes"), - virDomainIOMMUModelTypeToString(iommu->model)); -return -1; -} -break; - case VIR_DOMAIN_IOMMU_MODEL_LAST: break; } -- 2.37.1
Re: [PATCH v2 0/7] qemu: remove support for query-cpus
On Mon, Aug 08, 2022 at 17:15:01 +0200, Paolo Bonzini wrote: > The query-cpus-fast command was introduced in 2.12, therefore query-cpus > is never used on supported versions of QEMU. Remove the logic to parse > its output, as well as the parameters to choose between the two commands. > > Since most tests were still mocking the query-cpus command, the expected > results of QEMU monitor commands have to be converted as well. > > Thanks, > > Paolo > > v1->v2: do not query capability, regenerate test output [Peter] > hopefully patch 3/7 is not mangled [Pavel] > > Paolo Bonzini (7): > tests: remove duplicate cpuinfo test > tests: drop "-fast" from query-cpus-fast tests > tests: convert ppc64 tests to query-cpus-fast > tests: convert x86_64 tests to query-cpus-fast > tests: remove query-cpus tests > qemu: remove support for query-cpus > qemu: deprecate query-cpus-fast capability Series: Reviewed-by: Peter Krempa
[PATCH v2 4/7] tests: convert x86_64 tests to query-cpus-fast
All supported versions of QEMU include the query-cpus-fast QMP command. In preparation for dropping support for the old "query-cpus" commands, convert the JSON output for x86 tests to the new format, and drop the "halted" field from the expected output as it is not available anymore. The CPU properties were obtained from the query-hotpluggable-cpus output in tests/qemumonitorjsondata. CPU, thread_id, and qom_path are renamed respectively to cpu-index, qom-path and thread-id, while nip and halted are removed. Signed-off-by: Paolo Bonzini --- ...json-cpuinfo-x86-basic-pluggable-cpus.json | 65 --- ...nitorjson-cpuinfo-x86-basic-pluggable.data | 5 -- ...onitorjson-cpuinfo-x86-node-full-cpus.json | 16 ++--- ...qemumonitorjson-cpuinfo-x86-node-full.data | 2 - tests/qemumonitorjsontest.c | 4 +- 5 files changed, 48 insertions(+), 44 deletions(-) diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable-cpus.json index 7a4973195c..c4250dae1d 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable-cpus.json +++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable-cpus.json @@ -3,47 +3,62 @@ { "arch": "x86", "current": true, - "CPU": 0, - "qom_path": "/machine/unattached/device[0]", - "pc": -2130415978, - "halted": true, - "thread_id": 518291 + "cpu-index": 0, + "props": { +"core-id": 0, +"thread-id": 0, +"socket-id": 0 + }, + "qom-path": "/machine/unattached/device[0]", + "thread-id": 518291 }, { "arch": "x86", "current": false, - "CPU": 1, - "qom_path": "/machine/unattached/device[2]", - "pc": -2130415978, - "halted": true, - "thread_id": 518292 + "cpu-index": 1, + "props": { +"core-id": 1, +"thread-id": 0, +"socket-id": 0 + }, + "qom-path": "/machine/unattached/device[2]", + "thread-id": 518292 }, { "arch": "x86", "current": false, - "CPU": 2, - "qom_path": "/machine/unattached/device[3]", - "pc": -2130415978, - "halted": true, - "thread_id": 518294 + "cpu-index": 2, + "props": { +"core-id": 1, +"thread-id": 1, +"socket-id": 0 + }, + "qom-path": "/machine/unattached/device[3]", + "thread-id": 518294 }, { "arch": "x86", "current": false, - "CPU": 3, - "qom_path": "/machine/unattached/device[4]", - "pc": -2130415978, - "halted": true, - "thread_id": 518295 + "cpu-index": 3, + "props": { +"core-id": 0, +"thread-id": 0, +"socket-id": 1 + }, + "qom-path": "/machine/unattached/device[4]", + "thread-id": 518295 }, { "arch": "x86", "current": false, - "CPU": 4, - "qom_path": "/machine/unattached/device[5]", - "pc": -2130415978, - "halted": true, - "thread_id": 518296 + "cpu-index": 4, + "props": { +"core-id": 0, +"thread-id": 1, +"socket-id": 1 + }, + "qom-path": "/machine/unattached/device[5]", + "thread-id": 518296 } ], "id": "libvirt-22" diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable.data b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable.data index 9a1788d947..93cefb9dd2 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable.data +++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable.data @@ -7,7 +7,6 @@ type='qemu64-x86_64-cpu' qom_path='/machine/unattached/device[0]' topology: socket='0' core='0' thread='0' vcpus='1' -halted [vcpu libvirt-id='1'] online=yes hotpluggable=no @@ -17,7 +16,6 @@ type='qemu64-x86_64-cpu' qom_path='/machine/unattached/device[2]' topology: socket='0' core='0' thread='1' vcpus='1' -halted [vcpu libvirt-id='2'] online=yes hotpluggable=no @@ -27,7 +25,6 @@ type='qemu64-x86_64-cpu' qom_path='/machine/unattached/device[3]' topology: socket='0' core='1' thread='0' vcpus='1' -halted [vcpu libvirt-id='3'] online=yes hotpluggable=no @@ -37,7 +34,6 @@ type='qemu64-x86_64-cpu' qom_path='/machine/unattached/device[4]' topology: socket='0' core='1' thread='1' vcpus='1' -halted [vcpu libvirt-id='4'] online=yes hotpluggable=no @@ -47,7 +43,6 @@ type='qemu64-x86_64-cpu' qom_path='/machine/unattached/device[5]' topology: socket='1' core='0' thread='0' vcpus='1' -halted [vcpu libvirt-id='5'] online=no hotpluggable=yes diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full-cpus.json
[PATCH v2 5/7] tests: remove query-cpus tests
All tests now use query-cpus-fast. Since the QEMU driver will lose support for query-cpus soon, go ahead and remove support for testing it. Signed-off-by: Paolo Bonzini --- tests/qemumonitorjsontest.c | 117 +--- 1 file changed, 15 insertions(+), 102 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 0001df7bb3..9d8a315103 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1291,7 +1291,6 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUsEqual(struct qemuMonitorQueryCpusEntr static int testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(qemuMonitorTest *test, struct qemuMonitorQueryCpusEntry *expect, - bool fast, size_t num) { struct qemuMonitorQueryCpusEntry *cpudata = NULL; @@ -1300,7 +1299,7 @@ testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(qemuMonitorTest *test, int ret = -1; if (qemuMonitorJSONQueryCPUs(qemuMonitorTestGetMonitor(test), - , , true, fast) < 0) + , , true, true) < 0) goto cleanup; if (ncpudata != num) { @@ -1326,72 +1325,6 @@ testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(qemuMonitorTest *test, } -static int -testQemuMonitorJSONqemuMonitorJSONQueryCPUs(const void *opaque) -{ -const testGenericData *data = opaque; -virDomainXMLOption *xmlopt = data->xmlopt; -struct qemuMonitorQueryCpusEntry expect_slow[] = { -{0, 17622, (char *) "/machine/unattached/device[0]", true}, -{1, 17624, (char *) "/machine/unattached/device[1]", true}, -{2, 17626, (char *) "/machine/unattached/device[2]", true}, -{3, 17628, NULL, true}, -}; -g_autoptr(qemuMonitorTest) test = NULL; - -if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema))) -return -1; - -qemuMonitorTestSkipDeprecatedValidation(test, true); - -if (qemuMonitorTestAddItem(test, "query-cpus", - "{" - "\"return\": [" - "{" - "\"current\": true," - "\"CPU\": 0," - "\"qom_path\": \"/machine/unattached/device[0]\"," - "\"pc\": -2130530478," - "\"halted\": true," - "\"thread_id\": 17622" - "}," - "{" - "\"current\": false," - "\"CPU\": 1," - "\"qom_path\": \"/machine/unattached/device[1]\"," - "\"pc\": -2130530478," - "\"halted\": true," - "\"thread_id\": 17624" - "}," - "{" - "\"current\": false," - "\"CPU\": 2," - "\"qom_path\": \"/machine/unattached/device[2]\"," - "\"pc\": -2130530478," - "\"halted\": true," - "\"thread_id\": 17626" - "}," - "{" - "\"current\": false," - "\"CPU\": 3," - "\"pc\": -2130530478," - "\"halted\": true," - "\"thread_id\": 17628" - "}" - "]," - "\"id\": \"libvirt-7\"" - "}") < 0) -return -1; - -/* query-cpus */ -if (testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(test, expect_slow, - false, 4)) -return -1; - -return 0; -} - - static int testQemuMonitorJSONqemuMonitorJSONQueryCPUsFast(const void *opaque) { @@ -1425,8 +1358,7 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUsFast(const void *opaque) return -1; /* query-cpus-fast */ -if (testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(test, expect_fast, - true, 2)) +if (testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(test, expect_fast, 2))
[PATCH v2 7/7] qemu: deprecate query-cpus-fast capability
All supported versions of QEMU have the command. Signed-off-by: Paolo Bonzini --- src/qemu/qemu_capabilities.c | 1 - src/qemu/qemu_capabilities.h | 2 +- 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.aarch64.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 - tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml | 1 - tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml | 1 - tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_7.0.0.aarch64.xml | 1 - tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 1 - tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_7.1.0.x86_64.xml | 1 - tests/qemuhotplugtest.c | 2 -- 38 files changed, 1 insertion(+), 39 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index c2c55f4800..ca1f32beca 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -468,7 +468,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "qcow2-luks", /* QEMU_CAPS_QCOW2_LUKS */ "pcie-pci-bridge", /* QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE */ "seccomp-blacklist", /* X_QEMU_CAPS_SECCOMP_BLACKLIST */ - "query-cpus-fast", /* QEMU_CAPS_QUERY_CPUS_FAST */ + "query-cpus-fast", /* X_QEMU_CAPS_QUERY_CPUS_FAST */ "disk-write-cache", /* QEMU_CAPS_DISK_WRITE_CACHE */ /* 290 */ @@ -1212,7 +1212,6 @@ struct virQEMUCapsStringFlags virQEMUCapsCommands[] = { { "query-cpu-model-expansion", QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION }, { "query-cpu-definitions", QEMU_CAPS_QUERY_CPU_DEFINITIONS }, { "query-named-block-nodes", QEMU_CAPS_QUERY_NAMED_BLOCK_NODES }, -{ "query-cpus-fast", QEMU_CAPS_QUERY_CPUS_FAST }, { "qom-list-properties", QEMU_CAPS_QOM_LIST_PROPERTIES }, { "blockdev-del", QEMU_CAPS_BLOCKDEV_DEL }, { "query-current-machine", QEMU_CAPS_QUERY_CURRENT_MACHINE }, diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 8f3090e2ce..20b1034ca5 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -447,7 +447,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ QEMU_CAPS_QCOW2_LUKS, /* qcow2 format support LUKS encryption */ QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE, /* -device pcie-pci-bridge */ X_QEMU_CAPS_SECCOMP_BLACKLIST, /* -sandbox.elevateprivileges */ -QEMU_CAPS_QUERY_CPUS_FAST, /* query-cpus-fast command */ +X_QEMU_CAPS_QUERY_CPUS_FAST, /* query-cpus-fast command */ QEMU_CAPS_DISK_WRITE_CACHE, /* qemu block frontends support write-cache param */ /* 290 */ diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml index 6d4cc74a4d..d31168271b 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml @@ -97,7 +97,6 @@ - diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml index b5cee8476c..240bf4e7e8 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml @@ -137,7 +137,6 @@ - diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.xml index 88a1a7d0be..5cceb1e3a1 100644 ---
[PATCH v2 2/7] tests: drop "-fast" from query-cpus-fast tests
All supported versions of QEMU include the query-cpus-fast QMP command. In preparation for dropping support for the old "query-cpus" commands, remove the "-fast" suffix from both x86-full-fast and s390-fast. Signed-off-by: Paolo Bonzini --- ...-fast-cpus.json => qemumonitorjson-cpuinfo-s390-cpus.json} | 0 ...hotplug.json => qemumonitorjson-cpuinfo-s390-hotplug.json} | 0 ...uinfo-s390-fast.data => qemumonitorjson-cpuinfo-s390.data} | 0 ...t-cpus.json => qemumonitorjson-cpuinfo-x86-full-cpus.json} | 0 ...lug.json => qemumonitorjson-cpuinfo-x86-full-hotplug.json} | 0 ...6-full-fast.data => qemumonitorjson-cpuinfo-x86-full.data} | 0 tests/qemumonitorjsontest.c | 4 ++-- 7 files changed, 2 insertions(+), 2 deletions(-) rename tests/qemumonitorjsondata/{qemumonitorjson-cpuinfo-s390-fast-cpus.json => qemumonitorjson-cpuinfo-s390-cpus.json} (100%) rename tests/qemumonitorjsondata/{qemumonitorjson-cpuinfo-s390-fast-hotplug.json => qemumonitorjson-cpuinfo-s390-hotplug.json} (100%) rename tests/qemumonitorjsondata/{qemumonitorjson-cpuinfo-s390-fast.data => qemumonitorjson-cpuinfo-s390.data} (100%) rename tests/qemumonitorjsondata/{qemumonitorjson-cpuinfo-x86-full-fast-cpus.json => qemumonitorjson-cpuinfo-x86-full-cpus.json} (100%) rename tests/qemumonitorjsondata/{qemumonitorjson-cpuinfo-x86-full-fast-hotplug.json => qemumonitorjson-cpuinfo-x86-full-hotplug.json} (100%) rename tests/qemumonitorjsondata/{qemumonitorjson-cpuinfo-x86-full-fast.data => qemumonitorjson-cpuinfo-x86-full.data} (100%) diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-cpus.json similarity index 100% rename from tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-cpus.json rename to tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-cpus.json diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-hotplug.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-hotplug.json similarity index 100% rename from tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-hotplug.json rename to tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-hotplug.json diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast.data b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390.data similarity index 100% rename from tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast.data rename to tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390.data diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-cpus.json similarity index 100% rename from tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast-cpus.json rename to tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-cpus.json diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast-hotplug.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-hotplug.json similarity index 100% rename from tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast-hotplug.json rename to tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-hotplug.json diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast.data b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full.data similarity index 100% rename from tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast.data rename to tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full.data diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 54ff240e97..d0a12d14e0 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -3115,8 +3115,8 @@ mymain(void) DO_TEST_CPU_DATA("ecx"); DO_TEST_CPU_INFO("x86-basic-pluggable", 8); +DO_TEST_CPU_INFO_FAST("x86-full", 11); DO_TEST_CPU_INFO("x86-node-full", 8); -DO_TEST_CPU_INFO_FAST("x86-full-fast", 11); DO_TEST_CPU_INFO_FAST("x86-dies", 16); DO_TEST_CPU_INFO("ppc64-basic", 24); @@ -3125,7 +3125,7 @@ mymain(void) DO_TEST_CPU_INFO("ppc64-hotplug-4", 24); DO_TEST_CPU_INFO("ppc64-no-threads", 16); -DO_TEST_CPU_INFO_FAST("s390-fast", 2); +DO_TEST_CPU_INFO_FAST("s390", 2); #define DO_TEST_BLOCK_NODE_DETECT(testname) \ do { \ -- 2.37.1
[PATCH v2 6/7] qemu: remove support for query-cpus
The query-cpus-fast command was introduced in 2.12, therefore query-cpus is never used on supported versions of QEMU. Remove the logic to parse its output, as well as the parameters to choose between the two commands. Signed-off-by: Paolo Bonzini --- src/qemu/qemu_domain.c | 22 -- src/qemu/qemu_monitor.c | 29 ++-- src/qemu/qemu_monitor.h | 6 ++--- src/qemu/qemu_monitor_json.c | 44 +++- src/qemu/qemu_monitor_json.h | 3 +-- tests/qemumonitorjsontest.c | 4 ++-- 6 files changed, 30 insertions(+), 78 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 69e0c9e217..bb25266959 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9618,22 +9618,18 @@ qemuDomainRefreshVcpuInfo(virQEMUDriver *driver, size_t maxvcpus = virDomainDefGetVcpusMax(vm->def); size_t i, j; bool hotplug; -bool fast; bool validTIDs = true; int rc; int ret = -1; hotplug = qemuDomainSupportsNewVcpuHotplug(vm); -fast = virQEMUCapsGet(QEMU_DOMAIN_PRIVATE(vm)->qemuCaps, - QEMU_CAPS_QUERY_CPUS_FAST); - -VIR_DEBUG("Maxvcpus %zu hotplug %d fast query %d", maxvcpus, hotplug, fast); +VIR_DEBUG("Maxvcpus %zu hotplug %d", maxvcpus, hotplug); if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) return -1; rc = qemuMonitorGetCPUInfo(qemuDomainGetMonitor(vm), , maxvcpus, - hotplug, fast); + hotplug); qemuDomainObjExitMonitor(vm); @@ -9641,7 +9637,7 @@ qemuDomainRefreshVcpuInfo(virQEMUDriver *driver, goto cleanup; /* - * The query-cpus[-fast] commands return information + * The query-cpus-fast commands return information * about the vCPUs, including the OS level PID that * is executing the vCPU. * @@ -9766,7 +9762,6 @@ qemuDomainRefreshVcpuHalted(virQEMUDriver *driver, size_t maxvcpus = virDomainDefGetVcpusMax(vm->def); g_autoptr(virBitmap) haltedmap = NULL; size_t i; -bool fast; /* Not supported currently for TCG, see qemuDomainRefreshVcpuInfo */ if (vm->def->virtType == VIR_DOMAIN_VIRT_QEMU) @@ -9774,21 +9769,14 @@ qemuDomainRefreshVcpuHalted(virQEMUDriver *driver, /* The halted state is interesting only on s390(x). On other platforms * the data would be stale at the time when it would be used. - * Calling qemuMonitorGetCpuHalted() can adversely affect the running - * VM's performance unless QEMU supports query-cpus-fast. */ -if (!ARCH_IS_S390(vm->def->os.arch) || -!virQEMUCapsGet(QEMU_DOMAIN_PRIVATE(vm)->qemuCaps, -QEMU_CAPS_QUERY_CPUS_FAST)) +if (!ARCH_IS_S390(vm->def->os.arch)) return 0; if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) return -1; -fast = virQEMUCapsGet(QEMU_DOMAIN_PRIVATE(vm)->qemuCaps, - QEMU_CAPS_QUERY_CPUS_FAST); -haltedmap = qemuMonitorGetCpuHalted(qemuDomainGetMonitor(vm), maxvcpus, -fast); +haltedmap = qemuMonitorGetCpuHalted(qemuDomainGetMonitor(vm), maxvcpus); qemuDomainObjExitMonitor(vm); if (!haltedmap) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 0c0b07d4a5..9d20acdc11 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1565,16 +1565,16 @@ qemuMonitorGetCPUInfoLegacy(struct qemuMonitorQueryCpusEntry *cpuentries, * * This function stitches together data retrieved via query-hotpluggable-cpus * which returns entities on the hotpluggable level (which may describe more - * than one guest logical vcpu) with the output of query-cpus (or - * query-cpus-fast), having an entry per enabled guest logical vcpu. + * than one guest logical vcpu) with the output of query-cpus-fast, + * having an entry per enabled guest logical vcpu. * * query-hotpluggable-cpus conveys following information: * - topology information and number of logical vcpus this entry creates * - device type name of the entry that needs to be used when hotplugging * - qom path in qemu which can be used to map the entry against - * query-cpus[-fast] + * query-cpus-fast * - * query-cpus[-fast] conveys following information: + * query-cpus-fast conveys following information: * - thread id of a given guest logical vcpu * - order in which the vcpus were inserted * - qom path to allow mapping the two together @@ -1609,7 +1609,7 @@ qemuMonitorGetCPUInfoHotplug(struct qemuMonitorQueryHotpluggableCpusEntry *hotpl for (i = 0; i < nhotplugvcpus; i++) totalvcpus += hotplugvcpus[i].vcpus; -/* trim '/thread...' suffix from the data returned by query-cpus[-fast] */ +/* trim '/thread...' suffix from the data returned by query-cpus-fast */ for (i = 0; i < ncpuentries; i++) { if (cpuentries[i].qom_path
[PATCH v2 0/7] qemu: remove support for query-cpus
The query-cpus-fast command was introduced in 2.12, therefore query-cpus is never used on supported versions of QEMU. Remove the logic to parse its output, as well as the parameters to choose between the two commands. Since most tests were still mocking the query-cpus command, the expected results of QEMU monitor commands have to be converted as well. Thanks, Paolo v1->v2: do not query capability, regenerate test output [Peter] hopefully patch 3/7 is not mangled [Pavel] Paolo Bonzini (7): tests: remove duplicate cpuinfo test tests: drop "-fast" from query-cpus-fast tests tests: convert ppc64 tests to query-cpus-fast tests: convert x86_64 tests to query-cpus-fast tests: remove query-cpus tests qemu: remove support for query-cpus qemu: deprecate query-cpus-fast capability src/qemu/qemu_capabilities.c | 1 - src/qemu/qemu_capabilities.h | 2 +- src/qemu/qemu_domain.c| 22 +- src/qemu/qemu_monitor.c | 29 +- src/qemu/qemu_monitor.h | 6 +- src/qemu/qemu_monitor_json.c | 44 +-- src/qemu/qemu_monitor_json.h | 3 +- .../qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 1 - .../caps_3.1.0.x86_64.xml | 1 - .../caps_4.0.0.aarch64.xml| 1 - .../qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 1 - .../caps_4.0.0.riscv32.xml| 1 - .../caps_4.0.0.riscv64.xml| 1 - .../qemucapabilitiesdata/caps_4.0.0.s390x.xml | 1 - .../caps_4.0.0.x86_64.xml | 1 - .../caps_4.1.0.x86_64.xml | 1 - .../caps_4.2.0.aarch64.xml| 1 - .../qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 1 - .../qemucapabilitiesdata/caps_4.2.0.s390x.xml | 1 - .../caps_4.2.0.x86_64.xml | 1 - .../caps_5.0.0.aarch64.xml| 1 - .../qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 1 - .../caps_5.0.0.riscv64.xml| 1 - .../caps_5.0.0.x86_64.xml | 1 - .../qemucapabilitiesdata/caps_5.1.0.sparc.xml | 1 - .../caps_5.1.0.x86_64.xml | 1 - .../caps_5.2.0.aarch64.xml| 1 - .../qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 1 - .../caps_5.2.0.riscv64.xml| 1 - .../qemucapabilitiesdata/caps_5.2.0.s390x.xml | 1 - .../caps_5.2.0.x86_64.xml | 1 - .../caps_6.0.0.aarch64.xml| 1 - .../qemucapabilitiesdata/caps_6.0.0.s390x.xml | 1 - .../caps_6.0.0.x86_64.xml | 1 - .../caps_6.1.0.x86_64.xml | 1 - .../caps_6.2.0.aarch64.xml| 1 - .../qemucapabilitiesdata/caps_6.2.0.ppc64.xml | 1 - .../caps_6.2.0.x86_64.xml | 1 - .../caps_7.0.0.aarch64.xml| 1 - .../qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 1 - .../caps_7.0.0.x86_64.xml | 1 - .../caps_7.1.0.x86_64.xml | 1 - tests/qemuhotplugtest.c | 2 - ...umonitorjson-cpuinfo-ppc64-basic-cpus.json | 64 ++--- ...itorjson-cpuinfo-ppc64-hotplug-1-cpus.json | 176 ++-- ...itorjson-cpuinfo-ppc64-hotplug-2-cpus.json | 264 ++ ...itorjson-cpuinfo-ppc64-hotplug-4-cpus.json | 264 ++ ...mumonitorjson-cpuinfo-ppc64-hotplug-4.data | 8 - ...torjson-cpuinfo-ppc64-no-threads-cpus.json | 88 +++--- ...=> qemumonitorjson-cpuinfo-s390-cpus.json} | 0 ...qemumonitorjson-cpuinfo-s390-hotplug.json} | 0 ...data => qemumonitorjson-cpuinfo-s390.data} | 0 ...json-cpuinfo-x86-basic-pluggable-cpus.json | 65 +++-- ...nitorjson-cpuinfo-x86-basic-pluggable.data | 5 - ...qemumonitorjson-cpuinfo-x86-full-cpus.json | 154 +- ...onitorjson-cpuinfo-x86-full-fast-cpus.json | 126 - ...torjson-cpuinfo-x86-full-fast-hotplug.json | 115 ...qemumonitorjson-cpuinfo-x86-full-fast.data | 109 ...onitorjson-cpuinfo-x86-node-full-cpus.json | 16 +- ...qemumonitorjson-cpuinfo-x86-node-full.data | 2 - tests/qemumonitorjsontest.c | 102 +-- 61 files changed, 626 insertions(+), 1076 deletions(-) rename tests/qemumonitorjsondata/{qemumonitorjson-cpuinfo-s390-fast-cpus.json => qemumonitorjson-cpuinfo-s390-cpus.json} (100%) rename tests/qemumonitorjsondata/{qemumonitorjson-cpuinfo-s390-fast-hotplug.json => qemumonitorjson-cpuinfo-s390-hotplug.json} (100%) rename tests/qemumonitorjsondata/{qemumonitorjson-cpuinfo-s390-fast.data => qemumonitorjson-cpuinfo-s390.data} (100%) delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast-cpus.json delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast-hotplug.json delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast.data --
[PATCH v2 1/7] tests: remove duplicate cpuinfo test
All supported versions of QEMU include the query-cpus-fast QMP command. In preparation for dropping support for the old "query-cpus" commands, remove the query-cpus version of the x86-full test. Signed-off-by: Paolo Bonzini --- ...qemumonitorjson-cpuinfo-x86-full-cpus.json | 104 ...umonitorjson-cpuinfo-x86-full-hotplug.json | 115 -- .../qemumonitorjson-cpuinfo-x86-full.data | 109 - tests/qemumonitorjsontest.c | 1 - 4 files changed, 329 deletions(-) delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-cpus.json delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-hotplug.json delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full.data diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-cpus.json deleted file mode 100644 index 16f5cc41dc..00 --- a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-cpus.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "return": [ -{ - "arch": "x86", - "current": true, - "CPU": 0, - "qom_path": "/machine/unattached/device[0]", - "pc": 1042686, - "halted": false, - "thread_id": 895040 -}, -{ - "arch": "x86", - "current": false, - "CPU": 1, - "qom_path": "/machine/peripheral/vcpu1", - "pc": 4294967280, - "halted": false, - "thread_id": 895056 -}, -{ - "arch": "x86", - "current": false, - "CPU": 2, - "qom_path": "/machine/peripheral/vcpu2", - "pc": 4294967280, - "halted": false, - "thread_id": 895057 -}, -{ - "arch": "x86", - "current": false, - "CPU": 3, - "qom_path": "/machine/peripheral/vcpu3", - "pc": 4294967280, - "halted": false, - "thread_id": 895058 -}, -{ - "arch": "x86", - "current": false, - "CPU": 4, - "qom_path": "/machine/peripheral/vcpu4", - "pc": 4294967280, - "halted": false, - "thread_id": 895059 -}, -{ - "arch": "x86", - "current": false, - "CPU": 5, - "qom_path": "/machine/peripheral/vcpu5", - "pc": 4294967280, - "halted": false, - "thread_id": 895060 -}, -{ - "arch": "x86", - "current": false, - "CPU": 6, - "qom_path": "/machine/peripheral/vcpu6", - "pc": 4294967280, - "halted": false, - "thread_id": 895061 -}, -{ - "arch": "x86", - "current": false, - "CPU": 7, - "qom_path": "/machine/peripheral/vcpu7", - "pc": 4294967280, - "halted": false, - "thread_id": 895062 -}, -{ - "arch": "x86", - "current": false, - "CPU": 8, - "qom_path": "/machine/peripheral/vcpu8", - "pc": 4294967280, - "halted": false, - "thread_id": 895063 -}, -{ - "arch": "x86", - "current": false, - "CPU": 9, - "qom_path": "/machine/peripheral/vcpu9", - "pc": 4294967280, - "halted": false, - "thread_id": 895064 -}, -{ - "arch": "x86", - "current": false, - "CPU": 10, - "qom_path": "/machine/peripheral/vcpu10", - "pc": 4294967280, - "halted": false, - "thread_id": 895065 -} - ], - "id": "libvirt-52" -} diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-hotplug.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-hotplug.json deleted file mode 100644 index aff5aa3c9b..00 --- a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-hotplug.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "return": [ -{ - "props": { -"core-id": 0, -"thread-id": 0, -"socket-id": 10 - }, - "vcpus-count": 1, - "qom-path": "/machine/peripheral/vcpu10", - "type": "Broadwell-x86_64-cpu" -}, -{ - "props": { -"core-id": 0, -"thread-id": 0, -"socket-id": 9 - }, - "vcpus-count": 1, - "qom-path": "/machine/peripheral/vcpu9", - "type": "Broadwell-x86_64-cpu" -}, -{ - "props": { -"core-id": 0, -"thread-id": 0, -"socket-id": 8 - }, - "vcpus-count": 1, - "qom-path": "/machine/peripheral/vcpu8", - "type": "Broadwell-x86_64-cpu" -}, -{ - "props": { -"core-id": 0, -"thread-id": 0, -"socket-id": 7 - }, - "vcpus-count": 1, - "qom-path": "/machine/peripheral/vcpu7", - "type": "Broadwell-x86_64-cpu" -}, -{ - "props": { -"core-id": 0, -"thread-id": 0, -"socket-id": 6 - }, - "vcpus-count": 1, - "qom-path": "/machine/peripheral/vcpu6", - "type": "Broadwell-x86_64-cpu" -}, -{ - "props": { -"core-id": 0, -"thread-id": 0, -"socket-id": 5 - }, -
[PATCH v2 3/7] tests: convert ppc64 tests to query-cpus-fast
All supported versions of QEMU include the query-cpus-fast QMP command. In preparation for dropping support for the old "query-cpus" commands, convert the JSON output for PPC tests to the new format, and drop the "halted" field from the expected output as it is not available anymore. The CPU properties were obtained from the query-hotpluggable-cpus output in tests/qemumonitorjsondata. CPU, thread_id, and qom_path are renamed respectively to cpu-index, qom-path and thread-id, while nip and halted are removed. Signed-off-by: Paolo Bonzini --- ...umonitorjson-cpuinfo-ppc64-basic-cpus.json | 64 ++--- ...itorjson-cpuinfo-ppc64-hotplug-1-cpus.json | 176 ++-- ...itorjson-cpuinfo-ppc64-hotplug-2-cpus.json | 264 ++ ...itorjson-cpuinfo-ppc64-hotplug-4-cpus.json | 264 ++ ...mumonitorjson-cpuinfo-ppc64-hotplug-4.data | 8 - ...torjson-cpuinfo-ppc64-no-threads-cpus.json | 88 +++--- tests/qemumonitorjsontest.c | 10 +- 7 files changed, 461 insertions(+), 413 deletions(-) diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-basic-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-basic-cpus.json index 27a3d8b89f..d1d3406958 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-basic-cpus.json +++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-basic-cpus.json @@ -3,74 +3,58 @@ { "arch": "ppc", "current": true, - "CPU": 0, - "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[0]", - "halted": false, - "thread_id": 21925 + "cpu-index": 0, + "qom-path": "/machine/unattached/device[1]/thread[0]", + "thread-id": 21925 }, { "arch": "ppc", "current": false, - "CPU": 1, - "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[1]", - "halted": false, - "thread_id": 21926 + "cpu-index": 1, + "qom-path": "/machine/unattached/device[1]/thread[1]", + "thread-id": 21926 }, { "arch": "ppc", "current": false, - "CPU": 2, - "nip": -4611686018422360608, - "qom_path": "/machine/unattached/device[1]/thread[2]", - "halted": false, - "thread_id": 21927 + "cpu-index": 2, + "qom-path": "/machine/unattached/device[1]/thread[2]", + "thread-id": 21927 }, { "arch": "ppc", "current": false, - "CPU": 3, - "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[3]", - "halted": false, - "thread_id": 21928 + "cpu-index": 3, + "qom-path": "/machine/unattached/device[1]/thread[3]", + "thread-id": 21928 }, { "arch": "ppc", "current": false, - "CPU": 4, - "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[4]", - "halted": false, - "thread_id": 21930 + "cpu-index": 4, + "qom-path": "/machine/unattached/device[1]/thread[4]", + "thread-id": 21930 }, { "arch": "ppc", "current": false, - "CPU": 5, - "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[5]", - "halted": false, - "thread_id": 21931 + "cpu-index": 5, + "qom-path": "/machine/unattached/device[1]/thread[5]", + "thread-id": 21931 }, { "arch": "ppc", "current": false, - "CPU": 6, - "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[6]", - "halted": false, - "thread_id": 21932 + "cpu-index": 6, + "qom-path": "/machine/unattached/device[1]/thread[6]", + "thread-id": 21932 }, { "arch": "ppc", "current": false, - "CPU": 7, - "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[7]", - "halted": false, - "thread_id": 21933 + "cpu-index": 7, + "qom-path": "/machine/unattached/device[1]/thread[7]", + "thread-id": 21933 } ], "id": "libvirt-12" diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-1-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-1-cpus.json index 7771cbc636..1516ccb99f 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-1-cpus.json +++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-1-cpus.json @@ -3,146 +3,162 @@ { "arch": "ppc", "current": true, - "CPU": 0, - "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[0]", - "halted": false, - "thread_id": 21925 + "cpu-index": 0, + "props": { +"core-id": 0 + }, + "qom-path": "/machine/unattached/device[1]/thread[0]", + "thread-id": 21925 }, { "arch": "ppc", "current": false, - "CPU": 1, -
Re: [PATCH 3/7] tests: convert ppc64 tests to query-cpus-fast
On 8/8/22 16:44, Pavel Hrdina wrote: diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads-cpus.json index 31a3905e43..0ee53ae471 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads-cpus.json +++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads-cpus.json @@ -3,74 +3,82 @@ { "arch": "ppc", "current": true, - "CPU": 0, - "nip": -46116860184chine/unattached/device[2]/thread[0]", + "thread-id": 35233 }, This hunk doesn't look correct and doesn't apply on top of current master. Weird, this is not in the file that I have sent. git send-email or sendmail bug?!? Paolo
Re: [PATCH] remote: Make remote_daemon depend on qemu_protocol.h
On 7/20/22 10:41, He Zhe wrote: > We sometimes meet the following parallel compililation issue, since > remote_daemon depends on remote_protocol.h qemu_protocol.h and lxc_protocol.h, > which are usually generated due to remote_driver . > > | FAILED: src/virtnetworkd.p/remote_remote_daemon_dispatch.c.o > | x86_64-wrs-linux-gcc ... > | In file included from > ../libvirt-8.1.0/src/remote/remote_daemon_dispatch.c:26: > | ../libvirt-8.1.0/src/remote/remote_daemon.h:30:10: fatal error: > qemu_protocol.h: No such file or directory > |30 | #include "qemu_protocol.h" > | | ^ > | compilation terminated. > > This patch adds the headers as dependencies of remote_daemon to make sure they > are always in place in advance. > > Signed-off-by: He Zhe > --- > src/remote/meson.build | 23 +-- > 1 file changed, 13 insertions(+), 10 deletions(-) Hm.. I'm failing to reproduce the build error, even though I put sleep(5) into both src/rpc/gendispatch.pl and src/rpc/genprotocol.pl and I try in a machine with 384 cores. I even wrapped rpcgen in a shell script to insert a short sleep. In the commit message you mention libvirt-8.1.0, does this problem still occurs even with the current master? Michal
Re: [PATCH 7/7] qemu: deprecate query-cpus-fast capability
On Mon, Aug 08, 2022 at 15:06:08 +0200, Paolo Bonzini wrote: > All supported versions of QEMU have the command. > > Signed-off-by: Paolo Bonzini > --- > src/qemu/qemu_capabilities.c | 4 ++-- > src/qemu/qemu_capabilities.h | 2 +- > tests/qemuhotplugtest.c | 2 -- > 3 files changed, 3 insertions(+), 5 deletions(-) > > diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c > index c2c55f4800..1eb006e3ef 100644 > --- a/src/qemu/qemu_capabilities.c > +++ b/src/qemu/qemu_capabilities.c > @@ -468,7 +468,7 @@ VIR_ENUM_IMPL(virQEMUCaps, >"qcow2-luks", /* QEMU_CAPS_QCOW2_LUKS */ >"pcie-pci-bridge", /* QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE */ >"seccomp-blacklist", /* X_QEMU_CAPS_SECCOMP_BLACKLIST */ > - "query-cpus-fast", /* QEMU_CAPS_QUERY_CPUS_FAST */ > + "query-cpus-fast", /* X_QEMU_CAPS_QUERY_CPUS_FAST */ >"disk-write-cache", /* QEMU_CAPS_DISK_WRITE_CACHE */ > >/* 290 */ > @@ -1212,7 +1212,7 @@ struct virQEMUCapsStringFlags virQEMUCapsCommands[] = { > { "query-cpu-model-expansion", QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION }, > { "query-cpu-definitions", QEMU_CAPS_QUERY_CPU_DEFINITIONS }, > { "query-named-block-nodes", QEMU_CAPS_QUERY_NAMED_BLOCK_NODES }, > -{ "query-cpus-fast", QEMU_CAPS_QUERY_CPUS_FAST }, > +{ "query-cpus-fast", X_QEMU_CAPS_QUERY_CPUS_FAST }, We no longer need to actually probe this capability, so this line should be dropped. This will require that the output files are re-generated, but we can do that before pushing.
Re: [PATCH 3/7] tests: convert ppc64 tests to query-cpus-fast
On Mon, Aug 08, 2022 at 03:06:04PM +0200, Paolo Bonzini wrote: > All supported versions of QEMU include the query-cpus-fast QMP command. > In preparation for dropping support for the old "query-cpus" commands, > convert the JSON output for PPC tests to the new format, and drop the > "halted" field from the expected output as it is not available anymore. > > The CPU properties were obtained from the query-hotpluggable-cpus output > in tests/qemumonitorjsondata. CPU, thread_id, and qom_path are renamed > respectively to cpu-index, qom-path and thread-id, while nip and halted > are removed. > > Signed-off-by: Paolo Bonzini > --- > ...umonitorjson-cpuinfo-ppc64-basic-cpus.json | 64 ++--- > ...itorjson-cpuinfo-ppc64-hotplug-1-cpus.json | 176 ++-- > ...itorjson-cpuinfo-ppc64-hotplug-2-cpus.json | 264 ++ > ...itorjson-cpuinfo-ppc64-hotplug-4-cpus.json | 264 ++ > ...mumonitorjson-cpuinfo-ppc64-hotplug-4.data | 8 - > ...torjson-cpuinfo-ppc64-no-threads-cpus.json | 88 +++--- > tests/qemumonitorjsontest.c | 10 +- > 7 files changed, 461 insertions(+), 413 deletions(-) [...] > diff --git > a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads-cpus.json > > b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads-cpus.json > index 31a3905e43..0ee53ae471 100644 > --- > a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads-cpus.json > +++ > b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads-cpus.json > @@ -3,74 +3,82 @@ > { >"arch": "ppc", >"current": true, > - "CPU": 0, > - "nip": -46116860184chine/unattached/device[2]/thread[0]", > + "thread-id": 35233 > }, This hunk doesn't look correct and doesn't apply on top of current master. Otherwise looks good. signature.asc Description: PGP signature
Re: [PATCH] conf: Check IOMMU for unsupported attributes
On a Monday in 2022, Michal Privoznik wrote: Currently, it's possible to pass various attributes to an IOMMU's element hoping that we enable them in underlying hypervisor. However, depending on the IOMMU model, some of these attributes can't be enabled and are simply ignored. This is suboptimal and we should reject such configuration in the validate phase. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2101633 Signed-off-by: Michal Privoznik --- src/conf/domain_validate.c | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature
[PATCH 5/7] tests: remove query-cpus tests
All tests now use query-cpus-fast. Since the QEMU driver will lose support for query-cpus soon, go ahead and remove support for testing it. Signed-off-by: Paolo Bonzini --- tests/qemumonitorjsontest.c | 117 +--- 1 file changed, 15 insertions(+), 102 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 0001df7bb3..9d8a315103 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1291,7 +1291,6 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUsEqual(struct qemuMonitorQueryCpusEntr static int testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(qemuMonitorTest *test, struct qemuMonitorQueryCpusEntry *expect, - bool fast, size_t num) { struct qemuMonitorQueryCpusEntry *cpudata = NULL; @@ -1300,7 +1299,7 @@ testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(qemuMonitorTest *test, int ret = -1; if (qemuMonitorJSONQueryCPUs(qemuMonitorTestGetMonitor(test), - , , true, fast) < 0) + , , true, true) < 0) goto cleanup; if (ncpudata != num) { @@ -1326,72 +1325,6 @@ testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(qemuMonitorTest *test, } -static int -testQemuMonitorJSONqemuMonitorJSONQueryCPUs(const void *opaque) -{ -const testGenericData *data = opaque; -virDomainXMLOption *xmlopt = data->xmlopt; -struct qemuMonitorQueryCpusEntry expect_slow[] = { -{0, 17622, (char *) "/machine/unattached/device[0]", true}, -{1, 17624, (char *) "/machine/unattached/device[1]", true}, -{2, 17626, (char *) "/machine/unattached/device[2]", true}, -{3, 17628, NULL, true}, -}; -g_autoptr(qemuMonitorTest) test = NULL; - -if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema))) -return -1; - -qemuMonitorTestSkipDeprecatedValidation(test, true); - -if (qemuMonitorTestAddItem(test, "query-cpus", - "{" - "\"return\": [" - "{" - "\"current\": true," - "\"CPU\": 0," - "\"qom_path\": \"/machine/unattached/device[0]\"," - "\"pc\": -2130530478," - "\"halted\": true," - "\"thread_id\": 17622" - "}," - "{" - "\"current\": false," - "\"CPU\": 1," - "\"qom_path\": \"/machine/unattached/device[1]\"," - "\"pc\": -2130530478," - "\"halted\": true," - "\"thread_id\": 17624" - "}," - "{" - "\"current\": false," - "\"CPU\": 2," - "\"qom_path\": \"/machine/unattached/device[2]\"," - "\"pc\": -2130530478," - "\"halted\": true," - "\"thread_id\": 17626" - "}," - "{" - "\"current\": false," - "\"CPU\": 3," - "\"pc\": -2130530478," - "\"halted\": true," - "\"thread_id\": 17628" - "}" - "]," - "\"id\": \"libvirt-7\"" - "}") < 0) -return -1; - -/* query-cpus */ -if (testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(test, expect_slow, - false, 4)) -return -1; - -return 0; -} - - static int testQemuMonitorJSONqemuMonitorJSONQueryCPUsFast(const void *opaque) { @@ -1425,8 +1358,7 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUsFast(const void *opaque) return -1; /* query-cpus-fast */ -if (testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(test, expect_fast, - true, 2)) +if (testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(test, expect_fast, 2))
[PATCH 6/7] qemu: remove support for query-cpus
The query-cpus-fast command was introduced in 2.12, therefore query-cpus is never used on supported versions of QEMU. Remove the logic to parse its output, as well as the parameters to choose between the two commands. Signed-off-by: Paolo Bonzini --- src/qemu/qemu_domain.c | 22 -- src/qemu/qemu_monitor.c | 29 ++-- src/qemu/qemu_monitor.h | 6 ++--- src/qemu/qemu_monitor_json.c | 44 +++- src/qemu/qemu_monitor_json.h | 3 +-- tests/qemumonitorjsontest.c | 4 ++-- 6 files changed, 30 insertions(+), 78 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 69e0c9e217..bb25266959 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9618,22 +9618,18 @@ qemuDomainRefreshVcpuInfo(virQEMUDriver *driver, size_t maxvcpus = virDomainDefGetVcpusMax(vm->def); size_t i, j; bool hotplug; -bool fast; bool validTIDs = true; int rc; int ret = -1; hotplug = qemuDomainSupportsNewVcpuHotplug(vm); -fast = virQEMUCapsGet(QEMU_DOMAIN_PRIVATE(vm)->qemuCaps, - QEMU_CAPS_QUERY_CPUS_FAST); - -VIR_DEBUG("Maxvcpus %zu hotplug %d fast query %d", maxvcpus, hotplug, fast); +VIR_DEBUG("Maxvcpus %zu hotplug %d", maxvcpus, hotplug); if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) return -1; rc = qemuMonitorGetCPUInfo(qemuDomainGetMonitor(vm), , maxvcpus, - hotplug, fast); + hotplug); qemuDomainObjExitMonitor(vm); @@ -9641,7 +9637,7 @@ qemuDomainRefreshVcpuInfo(virQEMUDriver *driver, goto cleanup; /* - * The query-cpus[-fast] commands return information + * The query-cpus-fast commands return information * about the vCPUs, including the OS level PID that * is executing the vCPU. * @@ -9766,7 +9762,6 @@ qemuDomainRefreshVcpuHalted(virQEMUDriver *driver, size_t maxvcpus = virDomainDefGetVcpusMax(vm->def); g_autoptr(virBitmap) haltedmap = NULL; size_t i; -bool fast; /* Not supported currently for TCG, see qemuDomainRefreshVcpuInfo */ if (vm->def->virtType == VIR_DOMAIN_VIRT_QEMU) @@ -9774,21 +9769,14 @@ qemuDomainRefreshVcpuHalted(virQEMUDriver *driver, /* The halted state is interesting only on s390(x). On other platforms * the data would be stale at the time when it would be used. - * Calling qemuMonitorGetCpuHalted() can adversely affect the running - * VM's performance unless QEMU supports query-cpus-fast. */ -if (!ARCH_IS_S390(vm->def->os.arch) || -!virQEMUCapsGet(QEMU_DOMAIN_PRIVATE(vm)->qemuCaps, -QEMU_CAPS_QUERY_CPUS_FAST)) +if (!ARCH_IS_S390(vm->def->os.arch)) return 0; if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) return -1; -fast = virQEMUCapsGet(QEMU_DOMAIN_PRIVATE(vm)->qemuCaps, - QEMU_CAPS_QUERY_CPUS_FAST); -haltedmap = qemuMonitorGetCpuHalted(qemuDomainGetMonitor(vm), maxvcpus, -fast); +haltedmap = qemuMonitorGetCpuHalted(qemuDomainGetMonitor(vm), maxvcpus); qemuDomainObjExitMonitor(vm); if (!haltedmap) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 0c0b07d4a5..9d20acdc11 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1565,16 +1565,16 @@ qemuMonitorGetCPUInfoLegacy(struct qemuMonitorQueryCpusEntry *cpuentries, * * This function stitches together data retrieved via query-hotpluggable-cpus * which returns entities on the hotpluggable level (which may describe more - * than one guest logical vcpu) with the output of query-cpus (or - * query-cpus-fast), having an entry per enabled guest logical vcpu. + * than one guest logical vcpu) with the output of query-cpus-fast, + * having an entry per enabled guest logical vcpu. * * query-hotpluggable-cpus conveys following information: * - topology information and number of logical vcpus this entry creates * - device type name of the entry that needs to be used when hotplugging * - qom path in qemu which can be used to map the entry against - * query-cpus[-fast] + * query-cpus-fast * - * query-cpus[-fast] conveys following information: + * query-cpus-fast conveys following information: * - thread id of a given guest logical vcpu * - order in which the vcpus were inserted * - qom path to allow mapping the two together @@ -1609,7 +1609,7 @@ qemuMonitorGetCPUInfoHotplug(struct qemuMonitorQueryHotpluggableCpusEntry *hotpl for (i = 0; i < nhotplugvcpus; i++) totalvcpus += hotplugvcpus[i].vcpus; -/* trim '/thread...' suffix from the data returned by query-cpus[-fast] */ +/* trim '/thread...' suffix from the data returned by query-cpus-fast */ for (i = 0; i < ncpuentries; i++) { if (cpuentries[i].qom_path
[PATCH 7/7] qemu: deprecate query-cpus-fast capability
All supported versions of QEMU have the command. Signed-off-by: Paolo Bonzini --- src/qemu/qemu_capabilities.c | 4 ++-- src/qemu/qemu_capabilities.h | 2 +- tests/qemuhotplugtest.c | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index c2c55f4800..1eb006e3ef 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -468,7 +468,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "qcow2-luks", /* QEMU_CAPS_QCOW2_LUKS */ "pcie-pci-bridge", /* QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE */ "seccomp-blacklist", /* X_QEMU_CAPS_SECCOMP_BLACKLIST */ - "query-cpus-fast", /* QEMU_CAPS_QUERY_CPUS_FAST */ + "query-cpus-fast", /* X_QEMU_CAPS_QUERY_CPUS_FAST */ "disk-write-cache", /* QEMU_CAPS_DISK_WRITE_CACHE */ /* 290 */ @@ -1212,7 +1212,7 @@ struct virQEMUCapsStringFlags virQEMUCapsCommands[] = { { "query-cpu-model-expansion", QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION }, { "query-cpu-definitions", QEMU_CAPS_QUERY_CPU_DEFINITIONS }, { "query-named-block-nodes", QEMU_CAPS_QUERY_NAMED_BLOCK_NODES }, -{ "query-cpus-fast", QEMU_CAPS_QUERY_CPUS_FAST }, +{ "query-cpus-fast", X_QEMU_CAPS_QUERY_CPUS_FAST }, { "qom-list-properties", QEMU_CAPS_QOM_LIST_PROPERTIES }, { "blockdev-del", QEMU_CAPS_BLOCKDEV_DEL }, { "query-current-machine", QEMU_CAPS_QUERY_CURRENT_MACHINE }, diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 8f3090e2ce..20b1034ca5 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -447,7 +447,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ QEMU_CAPS_QCOW2_LUKS, /* qcow2 format support LUKS encryption */ QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE, /* -device pcie-pci-bridge */ X_QEMU_CAPS_SECCOMP_BLACKLIST, /* -sandbox.elevateprivileges */ -QEMU_CAPS_QUERY_CPUS_FAST, /* query-cpus-fast command */ +X_QEMU_CAPS_QUERY_CPUS_FAST, /* query-cpus-fast command */ QEMU_CAPS_DISK_WRITE_CACHE, /* qemu block frontends support write-cache param */ /* 290 */ diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 3c9dac241a..133145a23a 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -443,8 +443,6 @@ testQemuHotplugCpuPrepare(const char *test, priv = data->vm->privateData; -virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_QUERY_CPUS_FAST); - if (data->modern) virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); -- 2.37.1
[PATCH 3/7] tests: convert ppc64 tests to query-cpus-fast
All supported versions of QEMU include the query-cpus-fast QMP command. In preparation for dropping support for the old "query-cpus" commands, convert the JSON output for PPC tests to the new format, and drop the "halted" field from the expected output as it is not available anymore. The CPU properties were obtained from the query-hotpluggable-cpus output in tests/qemumonitorjsondata. CPU, thread_id, and qom_path are renamed respectively to cpu-index, qom-path and thread-id, while nip and halted are removed. Signed-off-by: Paolo Bonzini --- ...umonitorjson-cpuinfo-ppc64-basic-cpus.json | 64 ++--- ...itorjson-cpuinfo-ppc64-hotplug-1-cpus.json | 176 ++-- ...itorjson-cpuinfo-ppc64-hotplug-2-cpus.json | 264 ++ ...itorjson-cpuinfo-ppc64-hotplug-4-cpus.json | 264 ++ ...mumonitorjson-cpuinfo-ppc64-hotplug-4.data | 8 - ...torjson-cpuinfo-ppc64-no-threads-cpus.json | 88 +++--- tests/qemumonitorjsontest.c | 10 +- 7 files changed, 461 insertions(+), 413 deletions(-) diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-basic-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-basic-cpus.json index 27a3d8b89f..d1d3406958 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-basic-cpus.json +++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-basic-cpus.json @@ -3,74 +3,58 @@ { "arch": "ppc", "current": true, - "CPU": 0, - "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[0]", - "halted": false, - "thread_id": 21925 + "cpu-index": 0, + "qom-path": "/machine/unattached/device[1]/thread[0]", + "thread-id": 21925 }, { "arch": "ppc", "current": false, - "CPU": 1, - "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[1]", - "halted": false, - "thread_id": 21926 + "cpu-index": 1, + "qom-path": "/machine/unattached/device[1]/thread[1]", + "thread-id": 21926 }, { "arch": "ppc", "current": false, - "CPU": 2, - "nip": -4611686018422360608, - "qom_path": "/machine/unattached/device[1]/thread[2]", - "halted": false, - "thread_id": 21927 + "cpu-index": 2, + "qom-path": "/machine/unattached/device[1]/thread[2]", + "thread-id": 21927 }, { "arch": "ppc", "current": false, - "CPU": 3, - "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[3]", - "halted": false, - "thread_id": 21928 + "cpu-index": 3, + "qom-path": "/machine/unattached/device[1]/thread[3]", + "thread-id": 21928 }, { "arch": "ppc", "current": false, - "CPU": 4, - "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[4]", - "halted": false, - "thread_id": 21930 + "cpu-index": 4, + "qom-path": "/machine/unattached/device[1]/thread[4]", + "thread-id": 21930 }, { "arch": "ppc", "current": false, - "CPU": 5, - "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[5]", - "halted": false, - "thread_id": 21931 + "cpu-index": 5, + "qom-path": "/machine/unattached/device[1]/thread[5]", + "thread-id": 21931 }, { "arch": "ppc", "current": false, - "CPU": 6, - "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[6]", - "halted": false, - "thread_id": 21932 + "cpu-index": 6, + "qom-path": "/machine/unattached/device[1]/thread[6]", + "thread-id": 21932 }, { "arch": "ppc", "current": false, - "CPU": 7, - "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[7]", - "halted": false, - "thread_id": 21933 + "cpu-index": 7, + "qom-path": "/machine/unattached/device[1]/thread[7]", + "thread-id": 21933 } ], "id": "libvirt-12" diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-1-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-1-cpus.json index 7771cbc636..1516ccb99f 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-1-cpus.json +++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-1-cpus.json @@ -3,146 +3,162 @@ { "arch": "ppc", "current": true, - "CPU": 0, - "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[0]", - "halted": false, - "thread_id": 21925 + "cpu-index": 0, + "props": { +"core-id": 0 + }, + "qom-path": "/machine/unattached/device[1]/thread[0]", + "thread-id": 21925 }, { "arch": "ppc", "current": false, - "CPU": 1, -
[PATCH 4/7] tests: convert x86_64 tests to query-cpus-fast
All supported versions of QEMU include the query-cpus-fast QMP command. In preparation for dropping support for the old "query-cpus" commands, convert the JSON output for x86 tests to the new format, and drop the "halted" field from the expected output as it is not available anymore. The CPU properties were obtained from the query-hotpluggable-cpus output in tests/qemumonitorjsondata. CPU, thread_id, and qom_path are renamed respectively to cpu-index, qom-path and thread-id, while nip and halted are removed. Signed-off-by: Paolo Bonzini --- ...json-cpuinfo-x86-basic-pluggable-cpus.json | 65 --- ...nitorjson-cpuinfo-x86-basic-pluggable.data | 5 -- ...onitorjson-cpuinfo-x86-node-full-cpus.json | 16 ++--- ...qemumonitorjson-cpuinfo-x86-node-full.data | 2 - tests/qemumonitorjsontest.c | 4 +- 5 files changed, 48 insertions(+), 44 deletions(-) diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable-cpus.json index 7a4973195c..c4250dae1d 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable-cpus.json +++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable-cpus.json @@ -3,47 +3,62 @@ { "arch": "x86", "current": true, - "CPU": 0, - "qom_path": "/machine/unattached/device[0]", - "pc": -2130415978, - "halted": true, - "thread_id": 518291 + "cpu-index": 0, + "props": { +"core-id": 0, +"thread-id": 0, +"socket-id": 0 + }, + "qom-path": "/machine/unattached/device[0]", + "thread-id": 518291 }, { "arch": "x86", "current": false, - "CPU": 1, - "qom_path": "/machine/unattached/device[2]", - "pc": -2130415978, - "halted": true, - "thread_id": 518292 + "cpu-index": 1, + "props": { +"core-id": 1, +"thread-id": 0, +"socket-id": 0 + }, + "qom-path": "/machine/unattached/device[2]", + "thread-id": 518292 }, { "arch": "x86", "current": false, - "CPU": 2, - "qom_path": "/machine/unattached/device[3]", - "pc": -2130415978, - "halted": true, - "thread_id": 518294 + "cpu-index": 2, + "props": { +"core-id": 1, +"thread-id": 1, +"socket-id": 0 + }, + "qom-path": "/machine/unattached/device[3]", + "thread-id": 518294 }, { "arch": "x86", "current": false, - "CPU": 3, - "qom_path": "/machine/unattached/device[4]", - "pc": -2130415978, - "halted": true, - "thread_id": 518295 + "cpu-index": 3, + "props": { +"core-id": 0, +"thread-id": 0, +"socket-id": 1 + }, + "qom-path": "/machine/unattached/device[4]", + "thread-id": 518295 }, { "arch": "x86", "current": false, - "CPU": 4, - "qom_path": "/machine/unattached/device[5]", - "pc": -2130415978, - "halted": true, - "thread_id": 518296 + "cpu-index": 4, + "props": { +"core-id": 0, +"thread-id": 1, +"socket-id": 1 + }, + "qom-path": "/machine/unattached/device[5]", + "thread-id": 518296 } ], "id": "libvirt-22" diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable.data b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable.data index 9a1788d947..93cefb9dd2 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable.data +++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable.data @@ -7,7 +7,6 @@ type='qemu64-x86_64-cpu' qom_path='/machine/unattached/device[0]' topology: socket='0' core='0' thread='0' vcpus='1' -halted [vcpu libvirt-id='1'] online=yes hotpluggable=no @@ -17,7 +16,6 @@ type='qemu64-x86_64-cpu' qom_path='/machine/unattached/device[2]' topology: socket='0' core='0' thread='1' vcpus='1' -halted [vcpu libvirt-id='2'] online=yes hotpluggable=no @@ -27,7 +25,6 @@ type='qemu64-x86_64-cpu' qom_path='/machine/unattached/device[3]' topology: socket='0' core='1' thread='0' vcpus='1' -halted [vcpu libvirt-id='3'] online=yes hotpluggable=no @@ -37,7 +34,6 @@ type='qemu64-x86_64-cpu' qom_path='/machine/unattached/device[4]' topology: socket='0' core='1' thread='1' vcpus='1' -halted [vcpu libvirt-id='4'] online=yes hotpluggable=no @@ -47,7 +43,6 @@ type='qemu64-x86_64-cpu' qom_path='/machine/unattached/device[5]' topology: socket='1' core='0' thread='0' vcpus='1' -halted [vcpu libvirt-id='5'] online=no hotpluggable=yes diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full-cpus.json
[PATCH 2/7] tests: drop "-fast" from query-cpus-fast tests
All supported versions of QEMU include the query-cpus-fast QMP command. In preparation for dropping support for the old "query-cpus" commands, remove the "-fast" suffix from both x86-full-fast and s390-fast. Signed-off-by: Paolo Bonzini --- ...-fast-cpus.json => qemumonitorjson-cpuinfo-s390-cpus.json} | 0 ...hotplug.json => qemumonitorjson-cpuinfo-s390-hotplug.json} | 0 ...uinfo-s390-fast.data => qemumonitorjson-cpuinfo-s390.data} | 0 ...t-cpus.json => qemumonitorjson-cpuinfo-x86-full-cpus.json} | 0 ...lug.json => qemumonitorjson-cpuinfo-x86-full-hotplug.json} | 0 ...6-full-fast.data => qemumonitorjson-cpuinfo-x86-full.data} | 0 tests/qemumonitorjsontest.c | 4 ++-- 7 files changed, 2 insertions(+), 2 deletions(-) rename tests/qemumonitorjsondata/{qemumonitorjson-cpuinfo-s390-fast-cpus.json => qemumonitorjson-cpuinfo-s390-cpus.json} (100%) rename tests/qemumonitorjsondata/{qemumonitorjson-cpuinfo-s390-fast-hotplug.json => qemumonitorjson-cpuinfo-s390-hotplug.json} (100%) rename tests/qemumonitorjsondata/{qemumonitorjson-cpuinfo-s390-fast.data => qemumonitorjson-cpuinfo-s390.data} (100%) rename tests/qemumonitorjsondata/{qemumonitorjson-cpuinfo-x86-full-fast-cpus.json => qemumonitorjson-cpuinfo-x86-full-cpus.json} (100%) rename tests/qemumonitorjsondata/{qemumonitorjson-cpuinfo-x86-full-fast-hotplug.json => qemumonitorjson-cpuinfo-x86-full-hotplug.json} (100%) rename tests/qemumonitorjsondata/{qemumonitorjson-cpuinfo-x86-full-fast.data => qemumonitorjson-cpuinfo-x86-full.data} (100%) diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-cpus.json similarity index 100% rename from tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-cpus.json rename to tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-cpus.json diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-hotplug.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-hotplug.json similarity index 100% rename from tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-hotplug.json rename to tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-hotplug.json diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast.data b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390.data similarity index 100% rename from tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast.data rename to tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390.data diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-cpus.json similarity index 100% rename from tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast-cpus.json rename to tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-cpus.json diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast-hotplug.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-hotplug.json similarity index 100% rename from tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast-hotplug.json rename to tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-hotplug.json diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast.data b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full.data similarity index 100% rename from tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast.data rename to tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full.data diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 54ff240e97..d0a12d14e0 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -3115,8 +3115,8 @@ mymain(void) DO_TEST_CPU_DATA("ecx"); DO_TEST_CPU_INFO("x86-basic-pluggable", 8); +DO_TEST_CPU_INFO_FAST("x86-full", 11); DO_TEST_CPU_INFO("x86-node-full", 8); -DO_TEST_CPU_INFO_FAST("x86-full-fast", 11); DO_TEST_CPU_INFO_FAST("x86-dies", 16); DO_TEST_CPU_INFO("ppc64-basic", 24); @@ -3125,7 +3125,7 @@ mymain(void) DO_TEST_CPU_INFO("ppc64-hotplug-4", 24); DO_TEST_CPU_INFO("ppc64-no-threads", 16); -DO_TEST_CPU_INFO_FAST("s390-fast", 2); +DO_TEST_CPU_INFO_FAST("s390", 2); #define DO_TEST_BLOCK_NODE_DETECT(testname) \ do { \ -- 2.37.1
[PATCH 1/7] tests: remove duplicate cpuinfo test
All supported versions of QEMU include the query-cpus-fast QMP command. In preparation for dropping support for the old "query-cpus" commands, remove the query-cpus version of the x86-full test. Signed-off-by: Paolo Bonzini --- ...qemumonitorjson-cpuinfo-x86-full-cpus.json | 104 ...umonitorjson-cpuinfo-x86-full-hotplug.json | 115 -- .../qemumonitorjson-cpuinfo-x86-full.data | 109 - tests/qemumonitorjsontest.c | 1 - 4 files changed, 329 deletions(-) delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-cpus.json delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-hotplug.json delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full.data diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-cpus.json deleted file mode 100644 index 16f5cc41dc..00 --- a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-cpus.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "return": [ -{ - "arch": "x86", - "current": true, - "CPU": 0, - "qom_path": "/machine/unattached/device[0]", - "pc": 1042686, - "halted": false, - "thread_id": 895040 -}, -{ - "arch": "x86", - "current": false, - "CPU": 1, - "qom_path": "/machine/peripheral/vcpu1", - "pc": 4294967280, - "halted": false, - "thread_id": 895056 -}, -{ - "arch": "x86", - "current": false, - "CPU": 2, - "qom_path": "/machine/peripheral/vcpu2", - "pc": 4294967280, - "halted": false, - "thread_id": 895057 -}, -{ - "arch": "x86", - "current": false, - "CPU": 3, - "qom_path": "/machine/peripheral/vcpu3", - "pc": 4294967280, - "halted": false, - "thread_id": 895058 -}, -{ - "arch": "x86", - "current": false, - "CPU": 4, - "qom_path": "/machine/peripheral/vcpu4", - "pc": 4294967280, - "halted": false, - "thread_id": 895059 -}, -{ - "arch": "x86", - "current": false, - "CPU": 5, - "qom_path": "/machine/peripheral/vcpu5", - "pc": 4294967280, - "halted": false, - "thread_id": 895060 -}, -{ - "arch": "x86", - "current": false, - "CPU": 6, - "qom_path": "/machine/peripheral/vcpu6", - "pc": 4294967280, - "halted": false, - "thread_id": 895061 -}, -{ - "arch": "x86", - "current": false, - "CPU": 7, - "qom_path": "/machine/peripheral/vcpu7", - "pc": 4294967280, - "halted": false, - "thread_id": 895062 -}, -{ - "arch": "x86", - "current": false, - "CPU": 8, - "qom_path": "/machine/peripheral/vcpu8", - "pc": 4294967280, - "halted": false, - "thread_id": 895063 -}, -{ - "arch": "x86", - "current": false, - "CPU": 9, - "qom_path": "/machine/peripheral/vcpu9", - "pc": 4294967280, - "halted": false, - "thread_id": 895064 -}, -{ - "arch": "x86", - "current": false, - "CPU": 10, - "qom_path": "/machine/peripheral/vcpu10", - "pc": 4294967280, - "halted": false, - "thread_id": 895065 -} - ], - "id": "libvirt-52" -} diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-hotplug.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-hotplug.json deleted file mode 100644 index aff5aa3c9b..00 --- a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-hotplug.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "return": [ -{ - "props": { -"core-id": 0, -"thread-id": 0, -"socket-id": 10 - }, - "vcpus-count": 1, - "qom-path": "/machine/peripheral/vcpu10", - "type": "Broadwell-x86_64-cpu" -}, -{ - "props": { -"core-id": 0, -"thread-id": 0, -"socket-id": 9 - }, - "vcpus-count": 1, - "qom-path": "/machine/peripheral/vcpu9", - "type": "Broadwell-x86_64-cpu" -}, -{ - "props": { -"core-id": 0, -"thread-id": 0, -"socket-id": 8 - }, - "vcpus-count": 1, - "qom-path": "/machine/peripheral/vcpu8", - "type": "Broadwell-x86_64-cpu" -}, -{ - "props": { -"core-id": 0, -"thread-id": 0, -"socket-id": 7 - }, - "vcpus-count": 1, - "qom-path": "/machine/peripheral/vcpu7", - "type": "Broadwell-x86_64-cpu" -}, -{ - "props": { -"core-id": 0, -"thread-id": 0, -"socket-id": 6 - }, - "vcpus-count": 1, - "qom-path": "/machine/peripheral/vcpu6", - "type": "Broadwell-x86_64-cpu" -}, -{ - "props": { -"core-id": 0, -"thread-id": 0, -"socket-id": 5 - }, -
[PATCH 0/7] qemu: remove support for query-cpus
The query-cpus-fast command was introduced in 2.12, therefore query-cpus is never used on supported versions of QEMU. Remove the logic to parse its output, as well as the parameters to choose between the two commands. Since most tests were still mocking the query-cpus command, the expected results of QEMU monitor commands have to be converted as well. Thanks, Paolo Paolo Bonzini (7): tests: remove duplicate cpuinfo test tests: drop "-fast" from query-cpus-fast tests tests: convert ppc64 tests to query-cpus-fast tests: convert x86_64 tests to query-cpus-fast tests: remove query-cpus tests qemu: remove support for query-cpus qemu: deprecate query-cpus-fast capability src/qemu/qemu_capabilities.c | 4 +- src/qemu/qemu_capabilities.h | 2 +- src/qemu/qemu_domain.c| 22 +- src/qemu/qemu_monitor.c | 29 +- src/qemu/qemu_monitor.h | 6 +- src/qemu/qemu_monitor_json.c | 44 +-- src/qemu/qemu_monitor_json.h | 3 +- tests/qemuhotplugtest.c | 2 - ...umonitorjson-cpuinfo-ppc64-basic-cpus.json | 64 ++--- ...itorjson-cpuinfo-ppc64-hotplug-1-cpus.json | 176 ++-- ...itorjson-cpuinfo-ppc64-hotplug-2-cpus.json | 264 ++ ...itorjson-cpuinfo-ppc64-hotplug-4-cpus.json | 264 ++ ...mumonitorjson-cpuinfo-ppc64-hotplug-4.data | 8 - ...torjson-cpuinfo-ppc64-no-threads-cpus.json | 88 +++--- ...=> qemumonitorjson-cpuinfo-s390-cpus.json} | 0 ...qemumonitorjson-cpuinfo-s390-hotplug.json} | 0 ...data => qemumonitorjson-cpuinfo-s390.data} | 0 ...json-cpuinfo-x86-basic-pluggable-cpus.json | 65 +++-- ...nitorjson-cpuinfo-x86-basic-pluggable.data | 5 - ...qemumonitorjson-cpuinfo-x86-full-cpus.json | 154 +- ...onitorjson-cpuinfo-x86-full-fast-cpus.json | 126 - ...torjson-cpuinfo-x86-full-fast-hotplug.json | 115 ...qemumonitorjson-cpuinfo-x86-full-fast.data | 109 ...onitorjson-cpuinfo-x86-node-full-cpus.json | 16 +- ...qemumonitorjson-cpuinfo-x86-node-full.data | 2 - tests/qemumonitorjsontest.c | 102 +-- 26 files changed, 628 insertions(+), 1042 deletions(-) rename tests/qemumonitorjsondata/{qemumonitorjson-cpuinfo-s390-fast-cpus.json => qemumonitorjson-cpuinfo-s390-cpus.json} (100%) rename tests/qemumonitorjsondata/{qemumonitorjson-cpuinfo-s390-fast-hotplug.json => qemumonitorjson-cpuinfo-s390-hotplug.json} (100%) rename tests/qemumonitorjsondata/{qemumonitorjson-cpuinfo-s390-fast.data => qemumonitorjson-cpuinfo-s390.data} (100%) delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast-cpus.json delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast-hotplug.json delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast.data -- 2.37.1
[PATCH] conf: Check IOMMU for unsupported attributes
Currently, it's possible to pass various attributes to an IOMMU's element hoping that we enable them in underlying hypervisor. However, depending on the IOMMU model, some of these attributes can't be enabled and are simply ignored. This is suboptimal and we should reject such configuration in the validate phase. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2101633 Signed-off-by: Michal Privoznik --- src/conf/domain_validate.c | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index d4d72037d5..88205c64e0 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -2632,8 +2632,20 @@ static int virDomainIOMMUDefValidate(const virDomainIOMMUDef *iommu) { switch (iommu->model) { -case VIR_DOMAIN_IOMMU_MODEL_INTEL: case VIR_DOMAIN_IOMMU_MODEL_SMMUV3: +if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT || +iommu->caching_mode != VIR_TRISTATE_SWITCH_ABSENT || +iommu->eim != VIR_TRISTATE_SWITCH_ABSENT || +iommu->iotlb != VIR_TRISTATE_SWITCH_ABSENT || +iommu->aw_bits != 0) { +virReportError(VIR_ERR_XML_ERROR, + _("iommu model '%s' doesn't support additional attributes"), + virDomainIOMMUModelTypeToString(iommu->model)); +return -1; +} +G_GNUC_FALLTHROUGH; + +case VIR_DOMAIN_IOMMU_MODEL_INTEL: if (iommu->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { virReportError(VIR_ERR_XML_ERROR, _("iommu model '%s' can't have address"), @@ -2643,6 +2655,18 @@ virDomainIOMMUDefValidate(const virDomainIOMMUDef *iommu) break; case VIR_DOMAIN_IOMMU_MODEL_VIRTIO: +if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT || +iommu->caching_mode != VIR_TRISTATE_SWITCH_ABSENT || +iommu->eim != VIR_TRISTATE_SWITCH_ABSENT || +iommu->iotlb != VIR_TRISTATE_SWITCH_ABSENT || +iommu->aw_bits != 0) { +virReportError(VIR_ERR_XML_ERROR, + _("iommu model '%s' doesn't support additional attributes"), + virDomainIOMMUModelTypeToString(iommu->model)); +return -1; +} +break; + case VIR_DOMAIN_IOMMU_MODEL_LAST: break; } -- 2.35.1
Re: [PATCH] news: qemu: Add support for zero-copy migration
On 7/22/22 10:49, Fangge Jin wrote: > Signed-off-by: Fangge Jin > --- > NEWS.rst | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/NEWS.rst b/NEWS.rst > index 79aad652e8..0eb3299e3b 100644 > --- a/NEWS.rst > +++ b/NEWS.rst > @@ -42,6 +42,11 @@ v8.5.0 (2022-07-01) > A new ``VIR_MIGRATE_POSTCOPY_RESUME`` flag (``virsh migrate > --postcopy-resume``) > was introduced for recovering from a failed post-copy migration. > > + * qemu: Add support for zero-copy migration > + > +With QEMU 7.1.0, libvirt can enable zerocopy for parallel migration. > This is Trailing space. > +implmented by adding a new ``VIR_MIGRATE_ZEROCOPY`` flag(``virsh migrate > --zerocopy``). > + >* Introduce thread_pool_min and thread_pool_max attributes to IOThread > > New attributes ``thread_pool_min`` and ``thread_pool_max`` were > introduced Fixed and pushed. Reviewed-by: Michal Privoznik Michal
Re: [PATCH 00/11] qemu & hypervisor: move helper job functions
On 8/3/22 14:43, Kristina Hanicova wrote: > This series moves helper functions from qemu so that they can be used by > other hypervisors or BeginJob / EndJob functions which will be > generalized and moved in one of the following series as well. > > Kristina Hanicova (11): > qemu & hypervisor: move qemuDomainObjResetAgentJob() into hypervisor > qemu & hypervisor: move qemuDomainObjResetAsyncJob() into hypervisor > qemu: propagate virDomainJobObj into qemuDomainObjPreserveJob() > qemu & hypervisor: move qemuDomainObjPreserveJob() into hypervisor > qemu & hypervisor: move qemuDomainObjClearJob() into hypervisor > libxl: use virDomainObjClearJob() instead of libxlDomainObjFreeJob() > LXC: use virDomainObjClearJob() instead of virLXCDomainObjFreeJob() > CH: use virDomainObjClearJob() instead of virCHDomainObjFreeJob() > qemu & hypervisor: move qemuDomainTrackJob() into hypervisor > qemu: move virDomainNestedJobAllowed into hypervisor > qemu: move virDomainObjCanSetJob() into hypervisor > > src/ch/ch_domain.c | 10 +-- > src/hypervisor/domain_job.c | 99 +++ > src/hypervisor/domain_job.h | 18 + > src/libvirt_private.syms| 7 ++ > src/libxl/libxl_domain.c| 9 +-- > src/lxc/lxc_domain.c| 7 +- > src/qemu/qemu_domain.c | 2 +- > src/qemu/qemu_domainjob.c | 129 > src/qemu/qemu_domainjob.h | 7 -- > src/qemu/qemu_process.c | 2 +- > 10 files changed, 142 insertions(+), 148 deletions(-) > Reviewed-by: Michal Privoznik Michal