[libvirt PATCH 0/3] acouple of net-metadata fixes
by Ján Tomko
Ján Tomko (3):
remote: add VIR_ERR_NO_NETWORK_METADATA to daemonErrorLogFilter
virsh: remove trailing whitespace even when editing the description
vsh: introduce vshEditString
src/remote/remote_daemon.c | 1 +
tools/virsh-domain.c | 21 +--------------------
tools/virsh-network.c | 20 +-------------------
tools/vsh.c | 27 +++++++++++++++++++++++++++
tools/vsh.h | 1 +
5 files changed, 31 insertions(+), 39 deletions(-)
--
2.43.2
2 months, 1 week
[libvirt PATCH V3 0/4] add loongarch support for libvirt
by Xianglai Li
Hello, Everyone:
This patch series adds libvirt support for loongarch.Although the bios
path and name has not been officially integrated into qemu and we think
there are still many shortcomings, we try to push a version of patch to
the community according to the opinions of the community, hoping to
listen to everyone's opinions. Anyway we have a version of libvirt that
supports loongarch.
You can also get libvirt's patch from the link below:
https://gitlab.com/lixianglai/libvirt
branch: loongarch
Since the patch associated with loongarch has not yet been submitted to
the virt-manager community, we are providing a temporary patch with
loongarch for the time being patch's virt-manager, the open source work
of virt-manager adding loongarch will be followed up later or
synchronized with the open source libvirt.
You can get the virt-manager code with loongarch patch from the link below:
https://github.com/lixianglai/virt-manager
branch: loongarch
loongarch's virtual machine bios is not yet available in qemu,So you need to compile loongarch UEFI yourself,
you can refer to the following link to compile UEFI:
https://github.com/tianocore/edk2-platforms/blob/master/Platform/Loongson...
Here we provide compiled UEFI for ease of testing,you can get it from the following link:
https://github.com/lixianglai/LoongarchVirtFirmware
(Note: You should clone the repository using git instead of downloading the file via wget or you'll get xml)
We named the bios QEMU_EFI.fd, QEMU_VARS.fd is used to store pflash images of non-volatile variables.
After installing qemu-system-loongarch64,You can install the loongarch bios by executing the script
install-loongarch-virt-firmware.sh
Since there is no fedora operating system that supports the loongarch
architecture, you can find an iso that supports loongarch at the link below for testing purposes:
https://github.com/fedora-remix-loongarch/releases-info
The operating system provided above may have minor problems of one kind or another,
but you can also find out from the following link that openEuler's operating system supports loongarch:
https://muug.ca/mirror/openeuler/openEuler-22.03-LTS/ISO/loongarch64/
Well, if you have completed the above steps I think you can now install loongarch virtual machine,
you can install it through the virt-manager graphical interface, or install it through vrit-install,
here is an example of installing it using virt-install:
virt-install \
--virt-type=qemu \
--name loongarch-test \
--memory 4096 \
--vcpus=4 \
--arch=loongarch64 \
--boot cdrom \
--disk device=cdrom,bus=scsi,path=/root/livecd-fedora-mate-4.loongarch64.iso \
--disk path=/var/lib/libvirt/images/debian12-loongarch64.qcow2,size=10,format=qcow2,bus=scsi \
--network network=default \
--osinfo archlinux \
--video=virtio \
--graphics=vnc,listen=0.0.0.0
CHANGES
V2->V3:
1.Delete redundant header files in cpu_loongarch.c
2.Fixed code formatting issues
3.Modify the commit message of [PATCH 2/4]
4.Remove useless test cases for loongarch,
Rebuild loongarch's test case based on the latest code.
V1->V2:
1.Modify the link addresses of virtu-manager and firmeware in the cover
letter. Please obtain the code and firmware from the latest link
address.
2.Rename the bios name. Delete the loongarch bios name from libvirt
and use the json file to obtain the bios path.
3.Refer to riscv64 to simplify the implementation of loongarch cpu
driver.And fix some code style errors.
4.Delete unnecessary or redundant device enablement.Such as USB NEC.
5.Add some test cases for loongarch.
Xianglai Li (4):
Add loongarch cpu support
Support for loongarch64 in the QEMU driver
Implement the method of getting host info for loongarch
Add test script for loongarch
src/conf/schemas/basictypes.rng | 1 +
src/cpu/cpu.c | 2 +
src/cpu/cpu_loongarch.c | 58 +
src/cpu/cpu_loongarch.h | 25 +
src/cpu/meson.build | 1 +
src/qemu/qemu_capabilities.c | 16 +-
src/qemu/qemu_command.c | 7 +-
src/qemu/qemu_domain.c | 40 +-
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_validate.c | 1 +
src/util/virarch.c | 13 +-
src/util/virarch.h | 13 +-
src/util/virhostcpu.c | 7 +-
src/util/virsysinfo.c | 3 +-
.../qemu_8.2.0-tcg-virt.loongarch64.xml | 163 +
.../qemu_8.2.0-virt.loongarch64.xml | 167 +
tests/domaincapstest.c | 4 +-
.../caps_8.2.0_loongarch64.replies | 30121 ++++++++++++++++
.../caps_8.2.0_loongarch64.xml | 175 +
.../qemucaps2xmloutdata/caps.loongarch64.xml | 28 +
...o-type-loongarch64.loongarch64-latest.args | 34 +
...eo-type-loongarch64.loongarch64-latest.xml | 45 +
.../default-video-type-loongarch64.xml | 18 +
...-models.loongarch64-latest.abi-update.args | 44 +
...t-models.loongarch64-latest.abi-update.xml | 79 +
...irt-default-models.loongarch64-latest.args | 44 +
...virt-default-models.loongarch64-latest.xml | 79 +
.../loongarch64-virt-default-models.xml | 24 +
...ch64-virt-graphics.loongarch64-latest.args | 56 +
...rch64-virt-graphics.loongarch64-latest.xml | 116 +
.../loongarch64-virt-graphics.xml | 48 +
...ch64-virt-headless.loongarch64-latest.args | 52 +
...rch64-virt-headless.loongarch64-latest.xml | 102 +
.../loongarch64-virt-headless.xml | 42 +
...minimal.loongarch64-latest.abi-update.args | 31 +
...-minimal.loongarch64-latest.abi-update.xml | 26 +
...rch64-virt-minimal.loongarch64-latest.args | 31 +
...arch64-virt-minimal.loongarch64-latest.xml | 26 +
.../loongarch64-virt-minimal.xml | 15 +
tests/qemuxmlconftest.c | 7 +
tests/testutilshostcpus.h | 10 +
41 files changed, 31749 insertions(+), 26 deletions(-)
create mode 100644 src/cpu/cpu_loongarch.c
create mode 100644 src/cpu/cpu_loongarch.h
create mode 100644 tests/domaincapsdata/qemu_8.2.0-tcg-virt.loongarch64.xml
create mode 100644 tests/domaincapsdata/qemu_8.2.0-virt.loongarch64.xml
create mode 100644 tests/qemucapabilitiesdata/caps_8.2.0_loongarch64.replies
create mode 100644 tests/qemucapabilitiesdata/caps_8.2.0_loongarch64.xml
create mode 100644 tests/qemucaps2xmloutdata/caps.loongarch64.xml
create mode 100644 tests/qemuxmlconfdata/default-video-type-loongarch64.loongarch64-latest.args
create mode 100644 tests/qemuxmlconfdata/default-video-type-loongarch64.loongarch64-latest.xml
create mode 100644 tests/qemuxmlconfdata/default-video-type-loongarch64.xml
create mode 100644 tests/qemuxmlconfdata/loongarch64-virt-default-models.loongarch64-latest.abi-update.args
create mode 100644 tests/qemuxmlconfdata/loongarch64-virt-default-models.loongarch64-latest.abi-update.xml
create mode 100644 tests/qemuxmlconfdata/loongarch64-virt-default-models.loongarch64-latest.args
create mode 100644 tests/qemuxmlconfdata/loongarch64-virt-default-models.loongarch64-latest.xml
create mode 100644 tests/qemuxmlconfdata/loongarch64-virt-default-models.xml
create mode 100644 tests/qemuxmlconfdata/loongarch64-virt-graphics.loongarch64-latest.args
create mode 100644 tests/qemuxmlconfdata/loongarch64-virt-graphics.loongarch64-latest.xml
create mode 100644 tests/qemuxmlconfdata/loongarch64-virt-graphics.xml
create mode 100644 tests/qemuxmlconfdata/loongarch64-virt-headless.loongarch64-latest.args
create mode 100644 tests/qemuxmlconfdata/loongarch64-virt-headless.loongarch64-latest.xml
create mode 100644 tests/qemuxmlconfdata/loongarch64-virt-headless.xml
create mode 100644 tests/qemuxmlconfdata/loongarch64-virt-minimal.loongarch64-latest.abi-update.args
create mode 100644 tests/qemuxmlconfdata/loongarch64-virt-minimal.loongarch64-latest.abi-update.xml
create mode 100644 tests/qemuxmlconfdata/loongarch64-virt-minimal.loongarch64-latest.args
create mode 100644 tests/qemuxmlconfdata/loongarch64-virt-minimal.loongarch64-latest.xml
create mode 100644 tests/qemuxmlconfdata/loongarch64-virt-minimal.xml
--
2.39.1
2 months, 1 week
[PATCH 0/5] multiple memory backend support for CPR Live Updates
by mgalaxy@akamai.com
From: Michael Galaxy <mgalaxy(a)akamai.com>
CPR-based support for whole-hypervisor kexec-based live updates is
making progress on qemu-devel. In support of this, we need NUMA to be
support in these kinds of environments. To do this we use a technology
called PMEM (persistent memory), which underpin the ability for
CPR Live Updates to work so that QEMU memory can remain in RAM and
be recovered after the kexec has completed.
Our systems are highly NUMA-aware, and so this patch series enables
NUMA awareness for live update and also allows live migrations to work.
Further, we make a small change that allows live migrations to work
between *non* PMEM-based systems and PMEM-based systems (and
vice-versa). This allows for seemless upgrades from non-live-compatible
systems to live-update-compatible sytems without any downtime.
Michael Galaxy (5):
qemu.conf changes to support multiple memory backend directories
Update cleanup routines to handle multiple memory backing paths
instead of just one.
Implement multiple memory backing paths
Support live migration between file-backed memory and anonymous
memory.
Update unit test to support multiple memory backends
src/qemu/qemu_command.c | 8 ++-
src/qemu/qemu_conf.c | 140 ++++++++++++++++++++++++++++++++++++----
src/qemu/qemu_conf.h | 14 ++--
src/qemu/qemu_domain.c | 24 +++++--
src/qemu/qemu_driver.c | 31 +++++----
src/qemu/qemu_hotplug.c | 6 +-
src/qemu/qemu_process.c | 45 +++++++------
src/qemu/qemu_process.h | 13 ++--
tests/testutilsqemu.c | 5 +-
9 files changed, 217 insertions(+), 69 deletions(-)
--
2.25.1
2 months, 1 week
[libvirt PATCH 0/5] implement virDomainGraphicsReload
by Ján Tomko
https://issues.redhat.com/browse/RHEL-16333
Based on the patches Huawei sent back in 2021:
https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/LD...
* rebased
* renamed
* simplified (removed virTypedParams from the API and the requirement to
specify the type)
Ján Tomko (1):
remote: implement virDomainGraphicsReload
Zheng Yan (4):
qemu_capabilities: Add QEMU_CAPS_DISPLAY_RELOAD
libvirt: Introduce virDomainGraphicsReload API
qemu: implement qemuDomainGraphicsReload
virsh: Introduce domdisplay-reload command
docs/manpages/virsh.rst | 15 ++++++
include/libvirt/libvirt-domain.h | 18 +++++++
src/driver-hypervisor.h | 6 +++
src/libvirt-domain.c | 50 +++++++++++++++++
src/libvirt_public.syms | 5 ++
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_driver.c | 54 +++++++++++++++++++
src/qemu/qemu_monitor.c | 10 ++++
src/qemu/qemu_monitor.h | 5 ++
src/qemu/qemu_monitor_json.c | 23 ++++++++
src/qemu/qemu_monitor_json.h | 4 ++
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 13 ++++-
src/remote_protocol-structs | 6 +++
.../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+hvf.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 +
.../qemucapabilitiesdata/caps_7.1.0_ppc64.xml | 1 +
.../caps_7.1.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml | 1 +
.../caps_7.2.0_x86_64+hvf.xml | 1 +
.../caps_7.2.0_x86_64.xml | 1 +
.../caps_8.0.0_riscv64.xml | 1 +
.../caps_8.0.0_x86_64.xml | 1 +
.../qemucapabilitiesdata/caps_8.1.0_s390x.xml | 1 +
.../caps_8.1.0_x86_64.xml | 1 +
.../caps_8.2.0_aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_8.2.0_s390x.xml | 1 +
.../caps_8.2.0_x86_64.xml | 1 +
.../caps_9.0.0_x86_64.xml | 1 +
tools/virsh-domain.c | 45 ++++++++++++++++
40 files changed, 281 insertions(+), 1 deletion(-)
--
2.43.2
2 months, 2 weeks
[PATCH 00/25] qemu: Remove use of '-usb' to instantiate controllers
by Peter Krempa
This patchset removes the use of '-usb' legacy controller specification.
For the vast majority of platforms/machines (most of the irrelevant
ones) which don't actually have a concept of implicit USB qemu ignores
the '-usb' argument.
For the relevant platforms libvirt would already pick exactly the
same controller and thus '-usb' wouldn't be used at all.
There's a small handful of ARM boards 'realview' and 'versatilepb' where
libvirt would pick the wrong one as default if some controllers were
compiled out and thus reallistically '-usb' would have effect for those
although would be unusable as libvirt's bus name for the bus is incorret
and thus no devices would be usable.
For the two mostly obsolete board types this series can break ABI in the
aforementioned corner case.
Other than that this removes all the legacy code which makes USB
controller selection utterly confusing.
Peter Krempa (25):
tests: Replace mentions of the removed 'qemucapabilitiesnumbering'
tool
qemucapabilitiesdata: Document faked caps dumps
testutilshostcpus: Add support for VIR_ARCH_ARMV7L
qemucapabilitiestest: Add test dump for 'armv7l' architecture
qemu: domain: Add checkers for 'microvm' machine type
qemu: Add basic framework for 'microvm' machine type
qemuxmlconfdata: Add tests for USB controller selection with
'versatilepb' machine on aarch64 qemu binary
qemuxmlconfdata: Add tests for USB controller selection with
'versatilepb' machine on arm qemu binary
qemuDomainDefAddDefaultDevices: Handle defaults for all ARM arches
together
qemuDomainControllerDefPostParse: Use proper enum value for default
USB controller model
qemuDomainDefAddDefaultDevices: Populate default USB for 'versatilepb'
and 'realview' ARM machines
qemuDomainControllerDefPostParse: Use 'pci-ohci' as last-resort
fallback USB controller
qemuxmlconftest: Add test for 'realview' machine
qemuxmlconftest: Add test data for an ARM machine where qemu doesn't
honour -usb
qemuxml2conftest: Consolidate usb controller tests for 'pseries'
machine
qemuxmlconftest: Add test case when default USB controller for
'pseries' is compiled out
qemuxmlconftest: Add test data for USB selection with 'g3beige'
machine on ppc64
qemuxmlconftest: Add test data for USB selection with 'mac99' machine
on ppc64
qemuxmlconftest: Add test data for USB selection with 'powernv'
machine on ppc64
qemuxmlconftest: Add test data for USB selection with 'mac99' machine
on ppc
qemu: command: Don't downgrade to '-usb' for x86 based machines
qemu: command: Don't downgrade to '-usb' with 'pseries' machines
qemu: command: Don't downgrade to '-usb' for ppc based machines
qemu: command: Don't downgrade to '-usb' for arm based machines
qemu: command: Remove fallback '-usb' handling
src/qemu/qemu_command.c | 87 +-
src/qemu/qemu_domain.c | 63 +-
src/qemu/qemu_domain.h | 1 +
tests/domaincapsdata/qemu_8.2.0.armv7l.xml | 175 +
tests/domaincapstest.c | 5 +-
tests/qemucapabilitiesdata/README.rst | 18 +-
.../caps_8.2.0_armv7l.replies | 35062 ++++++++++++++++
.../caps_8.2.0_armv7l.xml | 326 +
tests/qemucaps2xmloutdata/caps.armv7l.xml | 26 +
...usb-minimal.aarch64-latest.abi-update.args | 30 +
...ousb-minimal.aarch64-latest.abi-update.xml | 21 +
.../aarch64-nousb-minimal.aarch64-latest.args | 30 +
.../aarch64-nousb-minimal.aarch64-latest.xml | 21 +
.../qemuxmlconfdata/aarch64-nousb-minimal.xml | 15 +
...iew-minimal.aarch64-latest.abi-update.args | 31 +
...view-minimal.aarch64-latest.abi-update.xml | 22 +
...rch64-realview-minimal.aarch64-latest.args | 31 +
...arch64-realview-minimal.aarch64-latest.xml | 22 +
.../aarch64-realview-minimal.xml | 14 +
...epb-minimal.aarch64-latest.abi-update.args | 32 +
...lepb-minimal.aarch64-latest.abi-update.xml | 25 +
...64-versatilepb-minimal.aarch64-latest.args | 32 +
...h64-versatilepb-minimal.aarch64-latest.xml | 25 +
.../aarch64-versatilepb-minimal.xml | 14 +
.../arm-vexpressa9-basic.aarch64-latest.args | 1 -
.../arm-vexpressa9-nodevs.aarch64-latest.args | 1 -
.../arm-vexpressa9-virtio.aarch64-latest.args | 1 -
...lepb-minimal.armv7l-latest.abi-update.args | 32 +
...ilepb-minimal.armv7l-latest.abi-update.xml | 27 +
...v7l-versatilepb-minimal.armv7l-latest.args | 32 +
...mv7l-versatilepb-minimal.armv7l-latest.xml | 27 +
.../armv7l-versatilepb-minimal.xml | 13 +
.../disk-arm-virtio-sd.aarch64-latest.args | 1 -
.../microvm.x86_64-latest.args | 34 +
.../qemuxmlconfdata/microvm.x86_64-latest.xml | 29 +
tests/qemuxmlconfdata/microvm.xml | 20 +
...c-mac99-minimal.ppc-latest.abi-update.args | 32 +
...pc-mac99-minimal.ppc-latest.abi-update.xml | 26 +
.../ppc-mac99-minimal.ppc-latest.args | 32 +
.../ppc-mac99-minimal.ppc-latest.xml | 26 +
tests/qemuxmlconfdata/ppc-mac99-minimal.xml | 12 +
...beige-minimal.ppc64-latest.abi-update.args | 33 +
...3beige-minimal.ppc64-latest.abi-update.xml | 29 +
.../ppc64-g3beige-minimal.ppc64-latest.args | 33 +
.../ppc64-g3beige-minimal.ppc64-latest.xml | 29 +
.../qemuxmlconfdata/ppc64-g3beige-minimal.xml | 12 +
...mac99-minimal.ppc64-latest.abi-update.args | 33 +
...-mac99-minimal.ppc64-latest.abi-update.xml | 29 +
.../ppc64-mac99-minimal.ppc64-latest.args | 33 +
.../ppc64-mac99-minimal.ppc64-latest.xml | 29 +
tests/qemuxmlconfdata/ppc64-mac99-minimal.xml | 12 +
...ernv9-minimal.ppc64-latest.abi-update.args | 33 +
...wernv9-minimal.ppc64-latest.abi-update.xml | 29 +
.../ppc64-powernv9-minimal.ppc64-latest.args | 33 +
.../ppc64-powernv9-minimal.ppc64-latest.xml | 29 +
.../ppc64-powernv9-minimal.xml | 12 +
.../sparc-minimal.sparc-latest.args | 1 -
...default-fallback-g3beige.ppc64-latest.args | 33 +
...-default-fallback-g3beige.ppc64-latest.xml | 34 +
...sb-controller-default-fallback-g3beige.xml | 1 +
...r-default-fallback-mac99.ppc64-latest.args | 33 +
...er-default-fallback-mac99.ppc64-latest.xml | 34 +
.../usb-controller-default-fallback-mac99.xml | 1 +
...default-fallback-mac99ppc.ppc-latest.args} | 9 +-
...r-default-fallback-mac99ppc.ppc-latest.xml | 31 +
...b-controller-default-fallback-mac99ppc.xml | 1 +
...default-fallback-nousb.aarch64-latest.args | 31 +
...-default-fallback-nousb.aarch64-latest.xml | 23 +
.../usb-controller-default-fallback-nousb.xml | 1 +
...efault-fallback-powernv9.ppc64-latest.args | 33 +
...default-fallback-powernv9.ppc64-latest.xml | 34 +
...b-controller-default-fallback-powernv9.xml | 1 +
...ault-fallback-realview.aarch64-latest.args | 31 +
...fault-fallback-realview.aarch64-latest.xml | 23 +
...b-controller-default-fallback-realview.xml | 1 +
...ck-versatilepb-aarch64.aarch64-latest.args | 32 +
...ack-versatilepb-aarch64.aarch64-latest.xml | 25 +
...r-default-fallback-versatilepb-aarch64.xml | 1 +
...back-versatilepb-armv7l.armv7l-latest.args | 32 +
...lback-versatilepb-armv7l.armv7l-latest.xml | 27 +
...er-default-fallback-versatilepb-armv7l.xml | 1 +
...ntroller-default-g3beige.ppc64-latest.args | 33 +
...ontroller-default-g3beige.ppc64-latest.xml | 34 +
.../usb-controller-default-g3beige.xml | 23 +
...controller-default-mac99.ppc64-latest.args | 33 +
...-controller-default-mac99.ppc64-latest.xml | 34 +
.../usb-controller-default-mac99.xml | 23 +
...ontroller-default-mac99ppc.ppc-latest.args | 32 +
...controller-default-mac99ppc.ppc-latest.xml | 31 +
.../usb-controller-default-mac99ppc.xml | 23 +
...ntroller-default-nousb.aarch64-latest.args | 31 +
...ontroller-default-nousb.aarch64-latest.xml | 23 +
.../usb-controller-default-nousb.xml | 17 +
...troller-default-powernv9.ppc64-latest.args | 33 +
...ntroller-default-powernv9.ppc64-latest.xml | 34 +
.../usb-controller-default-powernv9.xml | 23 +
...ault-pseries.ppc64-latest.abi-update.args} | 0
...fault-pseries.ppc64-latest.abi-update.xml} | 0
...troller-default-pseries.ppc64-latest.args} | 0
...ntroller-default-pseries.ppc64-latest.xml} | 0
...xml => usb-controller-default-pseries.xml} | 0
...oller-default-realview.aarch64-latest.args | 31 +
...roller-default-realview.aarch64-latest.xml | 23 +
.../usb-controller-default-realview.xml | 16 +
...fault-unavailable-g3beige.ppc64-latest.err | 1 +
...fault-unavailable-g3beige.ppc64-latest.xml | 34 +
...controller-default-unavailable-g3beige.xml | 1 +
...fault-unavailable-i440fx.x86_64-latest.err | 1 +
...default-unavailable-mac99.ppc64-latest.err | 1 +
...default-unavailable-mac99.ppc64-latest.xml | 34 +
...b-controller-default-unavailable-mac99.xml | 1 +
...efault-unavailable-mac99ppc.ppc-latest.err | 1 +
...efault-unavailable-mac99ppc.ppc-latest.xml | 31 +
...ontroller-default-unavailable-mac99ppc.xml | 1 +
...ault-unavailable-nousb.aarch64-latest.args | 31 +
...fault-unavailable-nousb.aarch64-latest.xml | 23 +
...b-controller-default-unavailable-nousb.xml | 1 +
...ault-unavailable-powernv9.ppc64-latest.err | 1 +
...ault-unavailable-powernv9.ppc64-latest.xml | 34 +
...ontroller-default-unavailable-powernv9.xml | 1 +
...fault-unavailable-pseries.ppc64-latest.err | 1 +
...fault-unavailable-pseries.ppc64-latest.xml | 38 +
...controller-default-unavailable-pseries.xml | 1 +
...t-unavailable-realview.aarch64-latest.args | 31 +
...lt-unavailable-realview.aarch64-latest.xml | 23 +
...ontroller-default-unavailable-realview.xml | 1 +
...le-versatilepb-aarch64.aarch64-latest.args | 32 +
...ble-versatilepb-aarch64.aarch64-latest.xml | 25 +
...efault-unavailable-versatilepb-aarch64.xml | 1 +
...lable-versatilepb-armv7l.armv7l-latest.err | 1 +
...lable-versatilepb-armv7l.armv7l-latest.xml | 27 +
...default-unavailable-versatilepb-armv7l.xml | 1 +
...lt-versatilepb-aarch64.aarch64-latest.args | 32 +
...ult-versatilepb-aarch64.aarch64-latest.xml | 25 +
...controller-default-versatilepb-aarch64.xml | 16 +
...ault-versatilepb-armv7l.armv7l-latest.args | 32 +
...fault-versatilepb-armv7l.armv7l-latest.xml | 27 +
...-controller-default-versatilepb-armv7l.xml | 15 +
...ntroller-implicit-isapc.x86_64-latest.args | 1 -
...troller-implicit-microvm.x86_64-latest.err | 1 +
...troller-implicit-microvm.x86_64-latest.xml | 25 +
.../usb-controller-implicit-microvm.xml | 17 +
...rovm-minimal.x86_64-latest.abi-update.args | 31 +
...crovm-minimal.x86_64-latest.abi-update.xml | 23 +
.../x86_64-microvm-minimal.x86_64-latest.args | 31 +
.../x86_64-microvm-minimal.x86_64-latest.xml | 23 +
.../x86_64-microvm-minimal.xml | 14 +
tests/qemuxmlconftest.c | 140 +-
tests/testutilshostcpus.h | 10 +
149 files changed, 38588 insertions(+), 107 deletions(-)
create mode 100644 tests/domaincapsdata/qemu_8.2.0.armv7l.xml
create mode 100644 tests/qemucapabilitiesdata/caps_8.2.0_armv7l.replies
create mode 100644 tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml
create mode 100644 tests/qemucaps2xmloutdata/caps.armv7l.xml
create mode 100644 tests/qemuxmlconfdata/aarch64-nousb-minimal.aarch64-latest.abi-update.args
create mode 100644 tests/qemuxmlconfdata/aarch64-nousb-minimal.aarch64-latest.abi-update.xml
create mode 100644 tests/qemuxmlconfdata/aarch64-nousb-minimal.aarch64-latest.args
create mode 100644 tests/qemuxmlconfdata/aarch64-nousb-minimal.aarch64-latest.xml
create mode 100644 tests/qemuxmlconfdata/aarch64-nousb-minimal.xml
create mode 100644 tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.args
create mode 100644 tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml
create mode 100644 tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.args
create mode 100644 tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml
create mode 100644 tests/qemuxmlconfdata/aarch64-realview-minimal.xml
create mode 100644 tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.abi-update.args
create mode 100644 tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.abi-update.xml
create mode 100644 tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.args
create mode 100644 tests/qemuxmlconfdata/aarch64-versatilepb-minimal.aarch64-latest.xml
create mode 100644 tests/qemuxmlconfdata/aarch64-versatilepb-minimal.xml
create mode 100644 tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.args
create mode 100644 tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.xml
create mode 100644 tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.args
create mode 100644 tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml
create mode 100644 tests/qemuxmlconfdata/armv7l-versatilepb-minimal.xml
create mode 100644 tests/qemuxmlconfdata/microvm.x86_64-latest.args
create mode 100644 tests/qemuxmlconfdata/microvm.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/microvm.xml
create mode 100644 tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.args
create mode 100644 tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.abi-update.xml
create mode 100644 tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.args
create mode 100644 tests/qemuxmlconfdata/ppc-mac99-minimal.ppc-latest.xml
create mode 100644 tests/qemuxmlconfdata/ppc-mac99-minimal.xml
create mode 100644 tests/qemuxmlconfdata/ppc64-g3beige-minimal.ppc64-latest.abi-update.args
create mode 100644 tests/qemuxmlconfdata/ppc64-g3beige-minimal.ppc64-latest.abi-update.xml
create mode 100644 tests/qemuxmlconfdata/ppc64-g3beige-minimal.ppc64-latest.args
create mode 100644 tests/qemuxmlconfdata/ppc64-g3beige-minimal.ppc64-latest.xml
create mode 100644 tests/qemuxmlconfdata/ppc64-g3beige-minimal.xml
create mode 100644 tests/qemuxmlconfdata/ppc64-mac99-minimal.ppc64-latest.abi-update.args
create mode 100644 tests/qemuxmlconfdata/ppc64-mac99-minimal.ppc64-latest.abi-update.xml
create mode 100644 tests/qemuxmlconfdata/ppc64-mac99-minimal.ppc64-latest.args
create mode 100644 tests/qemuxmlconfdata/ppc64-mac99-minimal.ppc64-latest.xml
create mode 100644 tests/qemuxmlconfdata/ppc64-mac99-minimal.xml
create mode 100644 tests/qemuxmlconfdata/ppc64-powernv9-minimal.ppc64-latest.abi-update.args
create mode 100644 tests/qemuxmlconfdata/ppc64-powernv9-minimal.ppc64-latest.abi-update.xml
create mode 100644 tests/qemuxmlconfdata/ppc64-powernv9-minimal.ppc64-latest.args
create mode 100644 tests/qemuxmlconfdata/ppc64-powernv9-minimal.ppc64-latest.xml
create mode 100644 tests/qemuxmlconfdata/ppc64-powernv9-minimal.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-g3beige.ppc64-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-g3beige.ppc64-latest.xml
create mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-g3beige.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-mac99.ppc64-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-mac99.ppc64-latest.xml
create mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-mac99.xml
rename tests/qemuxmlconfdata/{usb-controller-default-unavailable-i440fx.x86_64-latest.args => usb-controller-default-fallback-mac99ppc.ppc-latest.args} (80%)
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-mac99ppc.ppc-latest.xml
create mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-mac99ppc.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.aarch64-latest.xml
create mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-nousb.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-powernv9.ppc64-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-powernv9.ppc64-latest.xml
create mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-powernv9.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml
create mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-realview.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-aarch64.aarch64-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-aarch64.aarch64-latest.xml
create mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-aarch64.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.armv7l-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.armv7l-latest.xml
create mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-g3beige.ppc64-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-g3beige.ppc64-latest.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-g3beige.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-mac99.ppc64-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-mac99.ppc64-latest.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-mac99.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-mac99ppc.ppc-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-mac99ppc.ppc-latest.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-mac99ppc.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-nousb.aarch64-latest.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-nousb.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-powernv9.ppc64-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-powernv9.ppc64-latest.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-powernv9.xml
rename tests/qemuxmlconfdata/{ppc64-usb-controller.ppc64-latest.abi-update.args => usb-controller-default-pseries.ppc64-latest.abi-update.args} (100%)
rename tests/qemuxmlconfdata/{ppc64-usb-controller.ppc64-latest.abi-update.xml => usb-controller-default-pseries.ppc64-latest.abi-update.xml} (100%)
rename tests/qemuxmlconfdata/{ppc64-usb-controller.ppc64-latest.args => usb-controller-default-pseries.ppc64-latest.args} (100%)
rename tests/qemuxmlconfdata/{ppc64-usb-controller.ppc64-latest.xml => usb-controller-default-pseries.ppc64-latest.xml} (100%)
rename tests/qemuxmlconfdata/{ppc64-usb-controller.xml => usb-controller-default-pseries.xml} (100%)
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-realview.aarch64-latest.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-realview.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-g3beige.ppc64-latest.err
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-g3beige.ppc64-latest.xml
create mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-g3beige.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-i440fx.x86_64-latest.err
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99.ppc64-latest.err
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99.ppc64-latest.xml
create mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99ppc.ppc-latest.err
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99ppc.ppc-latest.xml
create mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-mac99ppc.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.aarch64-latest.xml
create mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-nousb.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-powernv9.ppc64-latest.err
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-powernv9.ppc64-latest.xml
create mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-powernv9.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-pseries.ppc64-latest.err
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-pseries.ppc64-latest.xml
create mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-pseries.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.aarch64-latest.xml
create mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-realview.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-aarch64.aarch64-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-aarch64.aarch64-latest.xml
create mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-aarch64.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.err
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-armv7l.armv7l-latest.xml
create mode 120000 tests/qemuxmlconfdata/usb-controller-default-unavailable-versatilepb-armv7l.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-versatilepb-aarch64.aarch64-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-versatilepb-aarch64.aarch64-latest.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-versatilepb-aarch64.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-versatilepb-armv7l.armv7l-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-versatilepb-armv7l.armv7l-latest.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-default-versatilepb-armv7l.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-implicit-microvm.x86_64-latest.err
create mode 100644 tests/qemuxmlconfdata/usb-controller-implicit-microvm.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/usb-controller-implicit-microvm.xml
create mode 100644 tests/qemuxmlconfdata/x86_64-microvm-minimal.x86_64-latest.abi-update.args
create mode 100644 tests/qemuxmlconfdata/x86_64-microvm-minimal.x86_64-latest.abi-update.xml
create mode 100644 tests/qemuxmlconfdata/x86_64-microvm-minimal.x86_64-latest.args
create mode 100644 tests/qemuxmlconfdata/x86_64-microvm-minimal.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/x86_64-microvm-minimal.xml
--
2.43.0
2 months, 2 weeks
[libvirt] [PATCH 0/4] virtlogd: timestamp option to prepend timestamp
by Shaleen Bathla
Description
====================================================
Add timestamp option to virtlogd.conf
When timestamp=1, let virtlogd prepend timestamps at start of line,
i.e. append timestamp after '\n' character.
This can be a useful debugging feature to help us see timestamp along
with commands/operations run inside the VM
Previous discussion link :
https://listman.redhat.com/archives/libvir-list/2023-August/241562.html
Test
=====================================================
Set timestamp = 1 in virtlogd.conf
systemctl restart libvirtd
If VM's xml has something like :
<devices>
...
<console type='pty'>
<log file='/var/log/libvirt/vm-serial0.log' append='on'/>
<target type='serial' port='0'/>
</console>
</devices>
Sample Output of /var/log/libvirt/vm-serial0.log:
...
2024-02-22 09:36:33.898+0000 Last login: Sat Feb 10 10:48:00 on ttyS0^M
2024-02-22 09:36:33.953+0000 [root@localhost ~]# ll^H^[[K^H^[[K^M
2024-02-22 09:36:36.930+0000 [root@localhost ~]# ls^M
2024-02-22 09:36:38.224+0000 anaconda-ks.cfg original-ks.cfg test.py tmp x.txt^M
2024-02-22 09:36:38.226+0000 [root@localhost ~]# ^M
2024-02-22 09:36:40.062+0000 [root@localhost ~]# l^H^[[Kyo^M
2024-02-22 09:36:44.292+0000 -bash: yo: command not found^M
2024-02-22 09:36:44.293+0000 [root@localhost ~]#
Shaleen Bathla (4):
logging: virtlogd: Add option to append timestamp to domain logs
util: virrotatingfile: Introduce virRotatingFileWriterAppendTimestamp
util: virrotatingfile: virtlogd timestamp appending logic
tests: virrotatingfiletest: update virRotatingFileWriterAppend
src/logging/log_daemon_config.c | 3 ++
src/logging/log_daemon_config.h | 1 +
src/logging/log_handler.c | 10 +++--
src/logging/test_virtlogd.aug.in | 1 +
src/logging/virtlogd.aug | 1 +
src/logging/virtlogd.conf | 4 ++
src/util/virrotatingfile.c | 69 +++++++++++++++++++++++++++++++-
src/util/virrotatingfile.h | 3 +-
tests/virrotatingfiletest.c | 34 ++++++++--------
9 files changed, 104 insertions(+), 22 deletions(-)
--
2.39.3
2 months, 2 weeks
[PATCH 00/10] Subject: [PATCH 00/10] Code cleanup
by Artem Chernyshev
Several functions was modified to become invariant. Change
their type to void and remove unnecessary checks of their
return values.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Artem Chernyshev (10):
conf: domain_conf: virDomainHostdevInsert/virDomainNetInsert to void
libxl: libxlMakeDomainCapabilities to void
virtime: virTimeMillisNowRaw to void
conf: virDomainGraphicsListenAppendAddress() to void
conf: virDomainDefMaybeAddInput() to void
virbitmap: virBitmapToData() to void
tools: cmdDomblkinfoGet() to void
vireventglib: virEventRunDefaultImpl() to void
vsh: vshCompleterFilter() to void
vsh: vshInitDebug() to void
examples/c/misc/event-test.c | 5 +-
include/libvirt/libvirt-event.h | 2 +-
src/ch/ch_monitor.c | 5 +-
src/conf/domain_conf.c | 35 +++-------
src/conf/domain_conf.h | 8 +--
src/conf/virdomainjob.c | 7 +-
src/hypervisor/domain_driver.c | 5 +-
src/libxl/libxl_capabilities.c | 40 ++++--------
src/libxl/libxl_capabilities.h | 2 +-
src/libxl/libxl_domain.c | 16 ++---
src/libxl/libxl_domain.h | 2 +-
src/libxl/libxl_driver.c | 17 ++---
src/libxl/xen_common.c | 25 +++----
src/libxl/xen_common.h | 2 +-
src/libxl/xen_xl.c | 3 +-
src/lxc/lxc_driver.c | 6 +-
src/nwfilter/nwfilter_dhcpsnoop.c | 18 ++---
src/qemu/qemu_agent.c | 6 +-
src/qemu/qemu_backup.c | 3 +-
src/qemu/qemu_dbus.c | 3 +-
src/qemu/qemu_domain.c | 35 ++++------
src/qemu/qemu_domainjob.c | 22 +++----
src/qemu/qemu_domainjob.h | 4 +-
src/qemu/qemu_driver.c | 19 +++---
src/qemu/qemu_hotplug.c | 6 +-
src/qemu/qemu_migration.c | 4 +-
src/qemu/qemu_nbdkit.c | 3 +-
src/qemu/qemu_process.c | 12 ++--
src/qemu/qemu_tpm.c | 3 +-
src/rpc/virnetdaemon.c | 6 +-
src/storage/storage_backend_iscsi_direct.c | 4 +-
src/util/virbitmap.c | 6 +-
src/util/virbitmap.h | 2 +-
src/util/virevent.c | 7 +-
src/util/vireventglib.c | 4 +-
src/util/vireventglib.h | 2 +-
src/util/virfdstream.c | 3 +-
src/util/virhostcpu.c | 4 +-
src/util/virhostuptime.c | 3 +-
src/util/virtime.c | 48 ++++----------
src/util/virtime.h | 14 ++--
src/vbox/vbox_common.c | 4 +-
src/vmx/vmx.c | 3 +-
src/vz/vz_driver.c | 38 +++++------
src/vz/vz_sdk.c | 14 ++--
src/vz/vz_utils.c | 16 ++---
src/vz/vz_utils.h | 2 +-
tests/domaincapstest.c | 3 +-
tests/objecteventtest.c | 76 ++++++++++------------
tests/qemucapsprobe.c | 5 +-
tests/qemumonitortestutils.c | 8 +--
tests/virbitmaptest.c | 3 +-
tests/virnetsockettest.c | 3 +-
tools/virsh-completer-domain.c | 6 +-
tools/virsh-domain-monitor.c | 10 +--
tools/virsh-domain.c | 15 ++---
tools/vsh.c | 24 +++----
57 files changed, 231 insertions(+), 420 deletions(-)
--
2.43.0
2 months, 2 weeks
[PATCH] remote_protocol: Fix ACL on REMOTE_PROC_NODE_DEVICE_DEFINE_XML
by Boris Fiuczynski
Adding 'save' ACL to REMOTE_PROC_NODE_DEVICE_DEFINE_XML to make
REMOTE_PROC_NODE_DEVICE_UPDATE ACLs meaningful.
Fixes: 69f9e7dbc24657e85761f03574779540d0f18315
Signed-off-by: Boris Fiuczynski <fiuczy(a)linux.ibm.com>
---
src/remote/remote_protocol.x | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index ffe865965d..71ae0cf6c1 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -6903,6 +6903,7 @@ enum remote_procedure {
/**
* @generate: both
* @acl: node_device:write
+ * @acl: node_device:save
*/
REMOTE_PROC_NODE_DEVICE_DEFINE_XML = 428,
--
2.42.0
2 months, 2 weeks
[RFC 0/4] meson: Enable -Wundef
by Andrea Bolognani
A few days ago I have posted a patch[1] that addresses an issue
introduced when a meson check was dropped but some uses of the
corresponding WITH_ macro were not removed at the same time.
That got me thinking about what we can do to prevent such scenarios
from happening again in the future. I have come up with something
that I think would be effective, but since applying the approach
throughout the entire codebase would require a non-trivial amount of
work, I figured I'd ask for feedback before embarking on it.
The idea is that there are two types of macros we can use for
conditional compilation: external ones, coming from the OS or other
libraries, and internal ones, which are the result of meson tests.
The external ones (e.g. SIOCSIFFLAGS, __APPLE__) are usually only
defined if they apply, so it is correct to check for their presence
with #ifdef. Using #if will also work, as undefined macros evaluate
to zero, but it's not good practice to use them that way. If -Wundef
has been passed to the compiler, those incorrect uses will be
reported (only on platforms where they are not defined, of course).
The internal ones (e.g. WITH_QEMU, WITH_STRUCT_IFREQ) are similar,
but in this case we control their definition. This means that using
means that the feature is not available on the machine we're building
on, but it could also mean that we've removed the meson check and
forgot to update all users of the macro. In this case, -Wundef would
work 100% reliably to detect the issue: if the meson check doesn't
exist, neither will the macro, regardless of what platform we're
building on.
So the approach I'm suggesting is to use a syntax-check rule to
ensure that internal macros are only ever checked with #if instead of
Of course this requires a full sweep to fix all cases in which we're
not already doing things according to the proposal. Should be fairly
easy, if annoying. A couple of examples are included here for
demonstration purposes.
The bigger impact is going to be on the build system. Right now we
generally only define WITH_ macros if the check passed, but that will
have to change and the result is going to be quite a bit of
additional meson code I'm afraid.
Thoughts?
[1] https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/message/S...
Andrea Bolognani (4):
configmake: Check for WIN32 correctly
meson: Always define WITH_*_DECL macros
syntax-check: Ensure WITH_ macros are used correctly
meson: Enable -Wundef
build-aux/syntax-check.mk | 5 +++++
configmake.h.in | 2 +-
meson.build | 3 +++
tests/virmockstathelpers.c | 28 ++++++++++++++--------------
4 files changed, 23 insertions(+), 15 deletions(-)
--
2.43.2
2 months, 2 weeks