[libvirt PATCH v2 0/2] Code style documentation
by Tim Wiederhake
Some additions and clarifications to libvirt's code style
documentation, based on points of feedback that are given
regularly on the mailing list.
V1: https://listman.redhat.com/archives/libvir-list/2022-January/msg00631.html
Changes since V1:
* patch 1: Do create typedefs for public types, do not for private types
* patches 2 and 3: Pushed
* patch 4 (now 2): Rewritten examples as requested
Tim Wiederhake (2):
docs: coding-style: Clarify on virXXXPtr types
docs: coding-style: One variable declaration per line
docs/coding-style.rst | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
--
2.31.1
2 years, 11 months
[PATCH v3 0/7] virdnsmasq: Lookup DNSMASQ in PATH
by Michal Privoznik
v3 of:
https://listman.redhat.com/archives/libvir-list/2022-January/msg00386.html
diff to v2:
- Make dnsmasqCapsGetBinaryPath() fail if dnsmasq is not found
- Change the way caps are constructed in networkxml2conftest
- More code cleanup
However, as I was going through the code I realized that what we really
do is check dnsmasq's version against the minimal required one (2.67).
No actual capabilities are parsed. This is due to cleanup merged earlier
this release (v8.0.0-rc1~138 and commits around). While we could drop
more code I figured it may be worth keeping it for future use. I mean,
one day we might want to have an capability for give feature.
Michal Prívozník (7):
virdnsmasq: Drop @binaryPath argument from dnsmasqCapsNewEmpty()
lib: Prefer g_autoptr(dnsmasqCaps) instead of explicit unref
virdnsmasq: Lookup DNSMASQ in PATH
virdnsmasq: Require non NULL @caps in dnsmasqCapsGetBinaryPath()
networkxml2conftest: Use dnsmasqCapsNewFromBinary() to construct caps
virdnsmasq: Drop dnsmasqCapsNewFromBuffer()
virdnsmasq: Join dnsmasqCapsNewEmpty() and dnsmasqCapsNewFromBinary()
src/libvirt_private.syms | 1 -
src/util/virdnsmasq.c | 50 ++++++++-----------------------------
src/util/virdnsmasq.h | 1 -
tests/meson.build | 1 +
tests/networkmock.c | 46 ++++++++++++++++++++++++++++++++++
tests/networkxml2conftest.c | 46 ++++++++++++++++++++++++++++++----
6 files changed, 98 insertions(+), 47 deletions(-)
create mode 100644 tests/networkmock.c
--
2.34.1
2 years, 11 months
[PATCH v2] libselinux: Strip spaces before values in config
by Vit Mojzis
Spaces before values in /etc/selinux/config should be ignored just as
spaces after them are.
E.g. "SELINUXTYPE= targeted" should be a valid value.
Fixes:
# sed -i 's/^SELINUXTYPE=/SELINUXTYPE= /g' /etc/selinux/config
# dnf install <any_package>
...
RPM: error: selabel_open: (/etc/selinux/ targeted/contexts/files/file_contexts) No such file or directory
RPM: error: Plugin selinux: hook tsm_pre failed
...
Error: Could not run transaction.
Signed-off-by: Vit Mojzis <vmojzis(a)redhat.com>
---
libselinux/src/selinux_config.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/libselinux/src/selinux_config.c b/libselinux/src/selinux_config.c
index 97f81a8b..d2e49ee1 100644
--- a/libselinux/src/selinux_config.c
+++ b/libselinux/src/selinux_config.c
@@ -92,6 +92,7 @@ int selinux_getenforcemode(int *enforce)
FILE *cfg = fopen(SELINUXCONFIG, "re");
if (cfg) {
char *buf;
+ char *tag;
int len = sizeof(SELINUXTAG) - 1;
buf = malloc(selinux_page_size);
if (!buf) {
@@ -101,21 +102,24 @@ int selinux_getenforcemode(int *enforce)
while (fgets_unlocked(buf, selinux_page_size, cfg)) {
if (strncmp(buf, SELINUXTAG, len))
continue;
+ tag = buf+len;
+ while (isspace(*tag))
+ tag++;
if (!strncasecmp
- (buf + len, "enforcing", sizeof("enforcing") - 1)) {
+ (tag, "enforcing", sizeof("enforcing") - 1)) {
*enforce = 1;
ret = 0;
break;
} else
if (!strncasecmp
- (buf + len, "permissive",
+ (tag, "permissive",
sizeof("permissive") - 1)) {
*enforce = 0;
ret = 0;
break;
} else
if (!strncasecmp
- (buf + len, "disabled",
+ (tag, "disabled",
sizeof("disabled") - 1)) {
*enforce = -1;
ret = 0;
@@ -176,7 +180,10 @@ static void init_selinux_config(void)
if (!strncasecmp(buf_p, SELINUXTYPETAG,
sizeof(SELINUXTYPETAG) - 1)) {
- type = strdup(buf_p + sizeof(SELINUXTYPETAG) - 1);
+ buf_p += sizeof(SELINUXTYPETAG) - 1;
+ while (isspace(*buf_p))
+ buf_p++;
+ type = strdup(buf_p);
if (!type) {
free(line_buf);
fclose(fp);
@@ -199,6 +206,8 @@ static void init_selinux_config(void)
} else if (!strncmp(buf_p, REQUIRESEUSERS,
sizeof(REQUIRESEUSERS) - 1)) {
value = buf_p + sizeof(REQUIRESEUSERS) - 1;
+ while (isspace(*value))
+ value++;
intptr = &require_seusers;
} else {
continue;
--
2.30.2
2 years, 11 months
[PATCH 0/3] qemu: Add caps for qemu-7.0 dev cycle and re-enable JSON for -device
by Peter Krempa
Note that I've truncated the auto-generated stuff out of patches 2/3 and
3/3.
For full version:
git fetch https://gitlab.com/pipo.sk/libvirt.git device-json-reenable
Also note that I've based this on the 'staging' branch of qemu.git
currently, which means that there's a small possibility that the pull
request will be rejected. I'll make sure to verify that before pushing.
Peter Krempa (3):
qemuxml2(argv|xml)data: x86-kvm-32-on-64: Add machine type
tests: qemucapabilities: Add test data for the qemu-7.0 development
cycle
qemu: capabilities: Re-enable JSON syntax for -device
src/qemu/qemu_capabilities.c | 6 +-
src/qemu/qemu_capabilities.h | 5 +-
.../domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 230 +
.../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 236 +
tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 230 +
.../caps_7.0.0.x86_64.replies | 37261 ++++++++++++++++
.../caps_7.0.0.x86_64.xml | 3717 ++
.../audio-alsa-best.x86_64-latest.args | 4 +-
.../audio-alsa-full.x86_64-latest.args | 4 +-
.../audio-alsa-minimal.x86_64-latest.args | 4 +-
.../audio-coreaudio-best.x86_64-latest.args | 4 +-
.../audio-coreaudio-full.x86_64-latest.args | 4 +-
...audio-coreaudio-minimal.x86_64-latest.args | 4 +-
...udio-default-nographics.x86_64-latest.args | 4 +-
.../audio-default-sdl.x86_64-latest.args | 6 +-
.../audio-default-spice.x86_64-latest.args | 6 +-
.../audio-default-vnc.x86_64-latest.args | 6 +-
.../audio-file-best.x86_64-latest.args | 4 +-
.../audio-file-full.x86_64-latest.args | 4 +-
.../audio-file-minimal.x86_64-latest.args | 4 +-
.../audio-jack-full.x86_64-latest.args | 4 +-
.../audio-jack-minimal.x86_64-latest.args | 4 +-
.../audio-many-backends.x86_64-latest.args | 14 +-
.../audio-none-best.x86_64-latest.args | 4 +-
.../audio-none-full.x86_64-latest.args | 4 +-
.../audio-none-minimal.x86_64-latest.args | 4 +-
.../audio-oss-best.x86_64-latest.args | 4 +-
.../audio-oss-full.x86_64-latest.args | 4 +-
.../audio-oss-minimal.x86_64-latest.args | 4 +-
.../audio-pulseaudio-best.x86_64-latest.args | 4 +-
.../audio-pulseaudio-full.x86_64-latest.args | 4 +-
...udio-pulseaudio-minimal.x86_64-latest.args | 4 +-
.../audio-sdl-best.x86_64-latest.args | 4 +-
.../audio-sdl-full.x86_64-latest.args | 4 +-
.../audio-sdl-minimal.x86_64-latest.args | 4 +-
.../audio-spice-best.x86_64-latest.args | 4 +-
.../audio-spice-full.x86_64-latest.args | 4 +-
.../audio-spice-minimal.x86_64-latest.args | 4 +-
.../blkdeviotune-group-num.x86_64-latest.args | 8 +-
...blkdeviotune-max-length.x86_64-latest.args | 8 +-
.../blkdeviotune-max.x86_64-latest.args | 8 +-
.../blkdeviotune.x86_64-latest.args | 8 +-
.../channel-unix-guestfwd.x86_64-latest.args | 4 +-
.../console-compat-auto.x86_64-latest.args | 8 +-
.../console-compat-chardev.x86_64-latest.args | 8 +-
.../console-compat.x86_64-latest.args | 6 +-
.../console-virtio-unix.x86_64-latest.args | 10 +-
.../controller-usb-order.x86_64-latest.args | 8 +-
.../controller-virtio-scsi.x86_64-latest.args | 24 +-
...-Icelake-Server-pconfig.x86_64-latest.args | 4 +-
.../cpu-host-model.x86_64-latest.args | 10 +-
.../cpu-translation.x86_64-latest.args | 4 +-
.../cputune-cpuset-big-id.x86_64-latest.args | 6 +-
.../devices-acpi-index.x86_64-latest.args | 16 +-
.../disk-aio-io_uring.x86_64-latest.args | 6 +-
.../disk-aio.x86_64-latest.args | 8 +-
...-backing-chains-noindex.x86_64-latest.args | 16 +-
.../disk-blockio.x86_64-latest.args | 8 +-
.../disk-boot-cdrom.x86_64-latest.args | 6 +-
.../disk-boot-disk.x86_64-latest.args | 6 +-
.../disk-cache.x86_64-latest.args | 14 +-
.../disk-cdrom-bus-other.x86_64-latest.args | 6 +-
...m-empty-network-invalid.x86_64-latest.args | 4 +-
.../disk-cdrom-network.x86_64-latest.args | 10 +-
.../disk-cdrom-tray.x86_64-latest.args | 10 +-
.../disk-cdrom.x86_64-latest.args | 10 +-
.../disk-copy_on_read.x86_64-latest.args | 12 +-
.../disk-detect-zeroes.x86_64-latest.args | 8 +-
.../disk-discard.x86_64-latest.args | 8 +-
.../disk-error-policy.x86_64-latest.args | 8 +-
.../disk-floppy-q35.x86_64-latest.args | 12 +-
.../disk-floppy-tray.x86_64-latest.args | 10 +-
.../disk-floppy.x86_64-latest.args | 8 +-
.../disk-fmt-qcow.x86_64-latest.args | 6 +-
.../disk-geometry.x86_64-latest.args | 6 +-
.../disk-ide-split.x86_64-latest.args | 8 +-
.../disk-ide-wwn.x86_64-latest.args | 6 +-
.../disk-ioeventfd.x86_64-latest.args | 12 +-
.../disk-metadata-cache.x86_64-latest.args | 8 +-
.../disk-network-gluster.x86_64-latest.args | 8 +-
.../disk-network-http.x86_64-latest.args | 10 +-
.../disk-network-iscsi.x86_64-latest.args | 18 +-
.../disk-network-nbd.x86_64-latest.args | 12 +-
.../disk-network-nfs.x86_64-latest.args | 6 +-
...-network-rbd-encryption.x86_64-latest.args | 12 +-
...sk-network-rbd-no-colon.x86_64-latest.args | 8 +-
.../disk-network-rbd.x86_64-latest.args | 14 +-
...isk-network-source-auth.x86_64-latest.args | 8 +-
...isk-network-tlsx509-nbd.x86_64-latest.args | 4 +-
.../disk-no-boot.x86_64-latest.args | 8 +-
.../disk-nvme.x86_64-latest.args | 12 +-
.../disk-order.x86_64-latest.args | 12 +-
.../disk-readonly-disk.x86_64-latest.args | 8 +-
.../disk-rotation.x86_64-latest.args | 12 +-
.../disk-sata-device.x86_64-latest.args | 8 +-
.../disk-scsi-device-auto.x86_64-latest.args | 10 +-
.../disk-scsi-disk-split.x86_64-latest.args | 20 +-
.../disk-scsi-disk-vpd.x86_64-latest.args | 12 +-
.../disk-scsi-disk-wwn.x86_64-latest.args | 12 +-
...sk-scsi-lun-passthrough.x86_64-latest.args | 12 +-
.../disk-scsi.x86_64-latest.args | 26 +-
.../disk-serial.x86_64-latest.args | 8 +-
.../disk-shared.x86_64-latest.args | 14 +-
.../disk-slices.x86_64-latest.args | 14 +-
.../disk-snapshot.x86_64-latest.args | 10 +-
.../disk-source-pool-mode.x86_64-latest.args | 12 +-
.../disk-source-pool.x86_64-latest.args | 14 +-
.../disk-transient.x86_64-latest.args | 6 +-
...sk-usb-device-removable.x86_64-latest.args | 8 +-
.../disk-usb-device.x86_64-latest.args | 8 +-
.../disk-vhostuser.x86_64-latest.args | 8 +-
.../disk-virtio-queues.x86_64-latest.args | 8 +-
...irtio-scsi-reservations.x86_64-latest.args | 10 +-
.../disk-virtio.x86_64-latest.args | 10 +-
.../encrypted-disk-usage.x86_64-latest.args | 6 +-
.../encrypted-disk.x86_64-latest.args | 6 +-
.../eoi-disabled.x86_64-latest.args | 4 +-
.../eoi-enabled.x86_64-latest.args | 4 +-
.../event_idx.x86_64-latest.args | 12 +-
...d-memory-numa-topology4.x86_64-latest.args | 4 +-
.../fips-enabled.x86_64-latest.args | 6 +-
.../floppy-drive-fat.x86_64-latest.args | 6 +-
.../qemuxml2argvdata/fs9p.x86_64-latest.args | 6 +-
.../genid-auto.x86_64-latest.args | 4 +-
.../qemuxml2argvdata/genid.x86_64-latest.args | 4 +-
...egl-headless-rendernode.x86_64-latest.args | 6 +-
.../graphics-egl-headless.x86_64-latest.args | 6 +-
...s-spice-agent-file-xfer.x86_64-latest.args | 8 +-
...aphics-spice-agentmouse.x86_64-latest.args | 10 +-
...s-spice-auto-socket-cfg.x86_64-latest.args | 4 +-
...phics-spice-auto-socket.x86_64-latest.args | 4 +-
...phics-spice-compression.x86_64-latest.args | 8 +-
...hics-spice-egl-headless.x86_64-latest.args | 6 +-
...pice-gl-auto-rendernode.x86_64-latest.args | 6 +-
.../graphics-spice-no-args.x86_64-latest.args | 6 +-
.../graphics-spice-qxl-vga.x86_64-latest.args | 8 +-
.../graphics-spice-sasl.x86_64-latest.args | 6 +-
.../graphics-spice-socket.x86_64-latest.args | 4 +-
.../graphics-spice-timeout.x86_64-latest.args | 14 +-
...raphics-spice-usb-redir.x86_64-latest.args | 16 +-
.../graphics-spice.x86_64-latest.args | 8 +-
...ics-vnc-auto-socket-cfg.x86_64-latest.args | 6 +-
...raphics-vnc-auto-socket.x86_64-latest.args | 4 +-
...aphics-vnc-egl-headless.x86_64-latest.args | 6 +-
...hics-vnc-no-listen-attr.x86_64-latest.args | 6 +-
.../graphics-vnc-none.x86_64-latest.args | 4 +-
.../graphics-vnc-policy.x86_64-latest.args | 6 +-
.../graphics-vnc-power.x86_64-latest.args | 6 +-
...remove-generated-socket.x86_64-latest.args | 6 +-
.../graphics-vnc-sasl.x86_64-latest.args | 6 +-
...-vnc-socket-new-cmdline.x86_64-latest.args | 4 +-
.../graphics-vnc-socket.x86_64-latest.args | 4 +-
...graphics-vnc-tls-secret.x86_64-latest.args | 4 +-
.../graphics-vnc-tls.x86_64-latest.args | 4 +-
.../graphics-vnc-websocket.x86_64-latest.args | 4 +-
.../graphics-vnc.x86_64-latest.args | 6 +-
...tdev-mdev-display-ramfb.x86_64-latest.args | 8 +-
...play-spice-egl-headless.x86_64-latest.args | 6 +-
...ev-display-spice-opengl.x86_64-latest.args | 6 +-
...isplay-vnc-egl-headless.x86_64-latest.args | 6 +-
...ostdev-mdev-display-vnc.x86_64-latest.args | 6 +-
.../hostdev-scsi-lsi.x86_64-latest.args | 20 +-
...ostdev-scsi-virtio-scsi.x86_64-latest.args | 22 +-
.../hugepages-memaccess3.x86_64-latest.args | 2 +-
.../hugepages-nvdimm.x86_64-latest.args | 4 +-
.../hyperv-off.x86_64-latest.args | 4 +-
.../hyperv-panic.x86_64-latest.args | 2 +-
.../hyperv-passthrough.x86_64-latest.args | 2 +-
.../hyperv-stimer-direct.x86_64-latest.args | 2 +-
.../hyperv.x86_64-latest.args | 2 +-
.../input-linux.x86_64-latest.args | 4 +-
.../intel-iommu-aw-bits.x86_64-latest.args | 2 +-
...ntel-iommu-caching-mode.x86_64-latest.args | 2 +-
...ntel-iommu-device-iotlb.x86_64-latest.args | 2 +-
.../intel-iommu-eim.x86_64-latest.args | 2 +-
.../intel-iommu.x86_64-latest.args | 2 +-
...threads-virtio-scsi-pci.x86_64-latest.args | 10 +-
.../kvmclock+eoi-disabled.x86_64-latest.args | 4 +-
...nch-security-sev-direct.x86_64-latest.args | 4 +-
...luks-disks-source-qcow2.x86_64-latest.args | 16 +-
.../luks-disks-source.x86_64-latest.args | 14 +-
.../luks-disks.x86_64-latest.args | 8 +-
...memory-default-hugepage.x86_64-latest.args | 4 +-
.../memfd-memory-numa.x86_64-latest.args | 6 +-
...y-hotplug-nvdimm-access.x86_64-latest.args | 8 +-
...ry-hotplug-nvdimm-align.x86_64-latest.args | 8 +-
...ry-hotplug-nvdimm-label.x86_64-latest.args | 8 +-
...ory-hotplug-nvdimm-pmem.x86_64-latest.args | 8 +-
...hotplug-nvdimm-readonly.x86_64-latest.args | 8 +-
.../memory-hotplug-nvdimm.x86_64-latest.args | 8 +-
...mory-hotplug-virtio-mem.x86_64-latest.args | 10 +-
...ory-hotplug-virtio-pmem.x86_64-latest.args | 8 +-
.../misc-no-reboot.x86_64-latest.args | 4 +-
.../mlock-off.x86_64-latest.args | 2 +-
.../mlock-on.x86_64-latest.args | 2 +-
.../name-escape.x86_64-latest.args | 20 +-
.../net-vdpa.x86_64-latest.args | 4 +-
.../net-vhostuser.x86_64-latest.args | 8 +-
.../numatune-hmat.x86_64-latest.args | 4 +-
...emnode-restrictive-mode.x86_64-latest.args | 4 +-
.../numatune-memnode.x86_64-latest.args | 4 +-
.../numatune-system-memory.x86_64-latest.args | 2 +-
.../os-firmware-bios.x86_64-latest.args | 16 +-
...re-efi-no-enrolled-keys.x86_64-latest.args | 6 +-
...os-firmware-efi-secboot.x86_64-latest.args | 16 +-
.../os-firmware-efi.x86_64-latest.args | 16 +-
.../panic-double.x86_64-latest.args | 4 +-
.../panic-no-address.x86_64-latest.args | 8 +-
.../qemuxml2argvdata/panic.x86_64-latest.args | 8 +-
...arallel-parport-chardev.x86_64-latest.args | 8 +-
.../parallel-tcp-chardev.x86_64-latest.args | 8 +-
.../parallel-unix-chardev.x86_64-latest.args | 8 +-
...pi-root-hotplug-disable.x86_64-latest.args | 4 +-
...cpi-root-hotplug-enable.x86_64-latest.args | 4 +-
.../pci-serial-dev-chardev.x86_64-latest.args | 8 +-
...cie-root-port-nohotplug.x86_64-latest.args | 18 +-
.../pv-spinlock-disabled.x86_64-latest.args | 4 +-
.../pv-spinlock-enabled.x86_64-latest.args | 4 +-
.../qemu-ns.x86_64-latest.args | 6 +-
...rial-dev-chardev-iobase.x86_64-latest.args | 8 +-
.../serial-dev-chardev.x86_64-latest.args | 8 +-
.../serial-file-chardev.x86_64-latest.args | 8 +-
.../serial-file-log.x86_64-latest.args | 6 +-
.../serial-many-chardev.x86_64-latest.args | 10 +-
.../serial-pty-chardev.x86_64-latest.args | 8 +-
...erial-spiceport-nospice.x86_64-latest.args | 6 +-
.../serial-spiceport.x86_64-latest.args | 12 +-
.../serial-tcp-chardev.x86_64-latest.args | 8 +-
...rial-tcp-telnet-chardev.x86_64-latest.args | 8 +-
...p-tlsx509-chardev-notls.x86_64-latest.args | 10 +-
...-tlsx509-chardev-verify.x86_64-latest.args | 10 +-
...ial-tcp-tlsx509-chardev.x86_64-latest.args | 10 +-
...-tlsx509-secret-chardev.x86_64-latest.args | 10 +-
.../serial-udp-chardev.x86_64-latest.args | 10 +-
.../serial-unix-chardev.x86_64-latest.args | 8 +-
.../serial-vc-chardev.x86_64-latest.args | 8 +-
...rtcard-passthrough-unix.x86_64-latest.args | 8 +-
.../tpm-emulator-tpm2-enc.x86_64-latest.args | 6 +-
...pm-emulator-tpm2-pstate.x86_64-latest.args | 6 +-
.../tpm-emulator-tpm2.x86_64-latest.args | 6 +-
.../tpm-emulator.x86_64-latest.args | 6 +-
.../tpm-passthrough-crb.x86_64-latest.args | 6 +-
.../tpm-passthrough.x86_64-latest.args | 6 +-
.../tseg-explicit-size.x86_64-latest.args | 10 +-
.../usb-redir-unix.x86_64-latest.args | 14 +-
...vhost-user-fs-fd-memory.x86_64-latest.args | 2 +-
...vhost-user-fs-hugepages.x86_64-latest.args | 12 +-
...host-user-gpu-secondary.x86_64-latest.args | 10 +-
.../vhost-user-vga.x86_64-latest.args | 8 +-
.../vhost-vsock-auto.x86_64-latest.args | 6 +-
.../vhost-vsock.x86_64-latest.args | 6 +-
...eo-bochs-display-device.x86_64-latest.args | 8 +-
...video-qxl-device-vram64.x86_64-latest.args | 6 +-
...o-qxl-sec-device-vram64.x86_64-latest.args | 8 +-
...eo-ramfb-display-device.x86_64-latest.args | 8 +-
...video-virtio-vga-gpu-gl.x86_64-latest.args | 8 +-
.../virtio-9p-createmode.x86_64-latest.args | 14 +-
.../virtio-9p-multidevs.x86_64-latest.args | 12 +-
.../virtio-lun.x86_64-latest.args | 12 +-
...virtio-non-transitional.x86_64-latest.args | 42 +-
...-options-controller-ats.x86_64-latest.args | 12 +-
...ptions-controller-iommu.x86_64-latest.args | 12 +-
...tions-controller-packed.x86_64-latest.args | 12 +-
...virtio-options-disk-ats.x86_64-latest.args | 8 +-
...rtio-options-disk-iommu.x86_64-latest.args | 8 +-
...tio-options-disk-packed.x86_64-latest.args | 8 +-
.../virtio-options-fs-ats.x86_64-latest.args | 8 +-
...virtio-options-fs-iommu.x86_64-latest.args | 8 +-
...irtio-options-fs-packed.x86_64-latest.args | 8 +-
...irtio-options-input-ats.x86_64-latest.args | 8 +-
...tio-options-input-iommu.x86_64-latest.args | 8 +-
...io-options-input-packed.x86_64-latest.args | 8 +-
...-options-memballoon-ats.x86_64-latest.args | 4 +-
...loon-freepage-reporting.x86_64-latest.args | 4 +-
...ptions-memballoon-iommu.x86_64-latest.args | 4 +-
...tions-memballoon-packed.x86_64-latest.args | 4 +-
.../virtio-options-net-ats.x86_64-latest.args | 8 +-
...irtio-options-net-iommu.x86_64-latest.args | 8 +-
...rtio-options-net-packed.x86_64-latest.args | 8 +-
.../virtio-options-rng-ats.x86_64-latest.args | 8 +-
...irtio-options-rng-iommu.x86_64-latest.args | 8 +-
...rtio-options-rng-packed.x86_64-latest.args | 8 +-
...irtio-options-video-ats.x86_64-latest.args | 8 +-
...tio-options-video-iommu.x86_64-latest.args | 8 +-
...io-options-video-packed.x86_64-latest.args | 8 +-
.../virtio-options.x86_64-latest.args | 28 +-
.../virtio-rng-builtin.x86_64-latest.args | 6 +-
.../virtio-rng-egd-unix.x86_64-latest.args | 6 +-
.../virtio-transitional.x86_64-latest.args | 26 +-
.../watchdog-device.x86_64-latest.args | 8 +-
.../watchdog-dump.x86_64-latest.args | 8 +-
.../watchdog-injectnmi.x86_64-latest.args | 8 +-
.../watchdog.x86_64-latest.args | 6 +-
.../x86-kvm-32-on-64.x86_64-latest.args | 2 +-
tests/qemuxml2argvdata/x86-kvm-32-on-64.xml | 2 +-
...-default-cpu-kvm-pc-4.2.x86_64-latest.args | 6 +-
...default-cpu-kvm-q35-4.2.x86_64-latest.args | 14 +-
...efault-cpu-tcg-features.x86_64-latest.args | 10 +-
...-default-cpu-tcg-pc-4.2.x86_64-latest.args | 6 +-
...default-cpu-tcg-q35-4.2.x86_64-latest.args | 14 +-
.../x86_64-pc-graphics.x86_64-latest.args | 20 +-
.../x86_64-pc-headless.x86_64-latest.args | 16 +-
.../x86_64-q35-graphics.x86_64-latest.args | 34 +-
.../x86_64-q35-headless.x86_64-latest.args | 30 +-
.../x86-kvm-32-on-64.x86_64-latest.xml | 2 +-
305 files changed, 42883 insertions(+), 1202 deletions(-)
create mode 100644 tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml
create mode 100644 tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml
create mode 100644 tests/domaincapsdata/qemu_7.0.0.x86_64.xml
create mode 100644 tests/qemucapabilitiesdata/caps_7.0.0.x86_64.replies
create mode 100644 tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml
--
2.34.1
2 years, 11 months
[libvirt PATCH 0/4] Code style documentation
by Tim Wiederhake
Some additions and clarifications to libvirt's code style
documentation, based on points of feedback that are given
regularly on the mailing list.
Tim Wiederhake (4):
docs: coding-style: Clarify on virXXXPtr types
docs: coding-style: Rewrite section on shortening comparisons
docs: coding-style: Remove "no_memory" as acceptable goto target
docs: coding-style: One variable declaration per line
docs/coding-style.rst | 79 ++++++++++++++++++++++++++++++-------------
1 file changed, 56 insertions(+), 23 deletions(-)
--
2.31.1
2 years, 11 months
[libvirt PATCH 0/3] Bump some min versions
by Daniel P. Berrangé
Given previous platforms we've dropped, we can bump the min
compilers.
Daniel P. Berrangé (3):
configure: bump min required GCC to 7.4.0
configure: bump min required CLang to 6.0 / XCode 10.0
examples: drop some conditionals checks from macros
config.h | 14 +++++++-------
examples/c/misc/event-test.c | 14 ++------------
2 files changed, 9 insertions(+), 19 deletions(-)
--
2.33.1
2 years, 11 months
[RFC 0/1] qemu: update index for serial device using taget.port
by divya
Issue
-----
The port being provided in the xml file of the domain is not being used for the
creation of qemu command.
On adding the serial device :
<serial>
<target type='serial' port='3'/>
</serial>
Generated qemu command will look like :
/usr/libexec/qemu-kvm ...\
-device isa-serial,chardev=charserial0,id=serial0
Actually it should be :
/usr/libexec/qemu-kvm ...\
-device isa-serial,chardev=charserial0,id=serial0,index=3
Patch
-----
Out already for the correction :
https://listman.redhat.com/archives/libvir-list/2018-April/msg02302.html
This patch was not followed up. According to me there are multiple reasons
Reasons for not following up
----------------------------
Index : specifies the index number of a connector port. If not specified, the
index is automatically incremented. This logic exists both on qemu as well as
libvirt.
https://github.com/qemu/qemu/blob/master/hw/char/serial-isa.c#L62
Issue 1:
If we want two isa-serial devices and for the first one is we mention the port
to be 3, then for the next device it not automatically assign the port number
4 which will throw the following error :
error: internal error: process exited while connecting to monitor:
2021-11-12T11:05:31.169987Z qemu-kvm: -device
isa-serial,chardev=charserial2,id=serial2,index=5: Max. supported number of ISA
serial ports is 4.
But we are left with 3 ports (0,1,2) which are unused. So ideally we should
have used them.
Issue 2:
It is possible that two devices get the same port address which might lead to a
lot of ambiguity. Example: we want two devices and for the second one we
provide the index 0. Then from default logic the first device will be allotted
port 0 and the second device will overwrite it and get port 0.
Solution :
----------
Port allocation logic
1. Precedence should be given to serial devices as we only have the first 4
ports for them.
1.1. Check the command line/xml file, scan for all the devices mentioned
and then start with the isa-serial devices for port allocation.
2.Maintain a buffer(bitmap) for marking the allocated ports.
3.While assigning a port to the device
3.1. If no port is provided by the user : provide the next available port.
3.2. Else check:
3.2.1. If the port is already allocated : throw the error.
3.2.2. Else allocate the port.
3.3. If out of ports : throw error -> qemu throws the error.
Libvirt manages the port numbers with the similar logic(auto increment) along
with the above mentioned bug. Hence need to add the above patch along with the
Port allocation logic.
root (1):
update index for serial device using taget.port
src/conf/domain_conf.c | 70 +++++++++++++++++--
src/qemu/qemu_command.c | 20 ++++--
tests/qemuhotplugtest.c | 1 -
...g-console-compat-2-live+console-virtio.xml | 4 +-
.../qemuhotplug-console-compat-2-live.xml | 4 +-
tests/qemuxml2argvdata/bios.args | 2 +-
.../qemuxml2argvdata/console-compat-auto.args | 2 +-
.../console-compat-chardev.args | 2 +-
tests/qemuxml2argvdata/console-compat.args | 2 +-
.../qemuxml2argvdata/console-virtio-many.args | 2 +-
tests/qemuxml2argvdata/controller-order.args | 2 +-
.../name-escape.x86_64-2.11.0.args | 4 +-
tests/qemuxml2argvdata/name-escape.xml | 1 +
.../q35-virt-manager-basic.args | 2 +-
.../serial-dev-chardev-iobase.args | 2 +-
.../qemuxml2argvdata/serial-dev-chardev.args | 2 +-
.../qemuxml2argvdata/serial-file-chardev.args | 2 +-
tests/qemuxml2argvdata/serial-file-log.args | 2 +-
.../qemuxml2argvdata/serial-many-chardev.args | 4 +-
.../qemuxml2argvdata/serial-pty-chardev.args | 2 +-
tests/qemuxml2argvdata/serial-spiceport.args | 2 +-
.../qemuxml2argvdata/serial-tcp-chardev.args | 2 +-
.../serial-tcp-telnet-chardev.args | 2 +-
.../serial-tcp-tlsx509-chardev-notls.args | 8 ++-
.../serial-tcp-tlsx509-chardev-notls.xml | 18 ++++-
.../serial-tcp-tlsx509-chardev-verify.args | 4 +-
.../serial-tcp-tlsx509-chardev-verify.xml | 2 +-
.../serial-tcp-tlsx509-chardev.args | 4 +-
.../serial-tcp-tlsx509-chardev.xml | 2 +-
.../serial-tcp-tlsx509-secret-chardev.args | 4 +-
.../serial-tcp-tlsx509-secret-chardev.xml | 2 +-
.../qemuxml2argvdata/serial-udp-chardev.args | 4 +-
.../qemuxml2argvdata/serial-unix-chardev.args | 4 +-
.../serial-unix-chardev.x86_64-latest.args | 4 +-
tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +-
tests/qemuxml2argvdata/user-aliases.args | 4 +-
.../virtio-9p-createmode.x86_64-latest.args | 2 +-
.../virtio-9p-multidevs.x86_64-latest.args | 2 +-
.../x86_64-pc-graphics.x86_64-latest.args | 2 +-
.../x86_64-pc-headless.x86_64-latest.args | 2 +-
.../x86_64-q35-graphics.x86_64-latest.args | 2 +-
.../x86_64-q35-headless.x86_64-latest.args | 2 +-
.../serial-tcp-tlsx509-chardev.xml | 2 +-
43 files changed, 149 insertions(+), 65 deletions(-)
--
2.27.0
2 years, 11 months
[PATCH] tests: Report expected monitor command for simulated commands
by Michal Privoznik
There are two tests currently that simulate QMP talk:
qemucapabilitiestest and qemuhotplugtest. In both cases they
check whether currently executed command is the one for which
reply was provided. If not an error message is reported. However,
the error message contains only the actual command and not the
expected one. This makes it harder to navigate through .replies
files.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tests/qemumonitortestutils.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c
index f7a0a37685..073ae5d73a 100644
--- a/tests/qemumonitortestutils.c
+++ b/tests/qemumonitortestutils.c
@@ -648,7 +648,8 @@ qemuMonitorTestProcessCommandVerbatim(qemuMonitorTest *test,
ret = qemuMonitorTestAddResponse(test, data->response);
} else {
if (data->cmderr) {
- qemuMonitorTestError("%s: %s", data->cmderr, cmdstr);
+ qemuMonitorTestError("%s: %s expected %s",
+ data->cmderr, cmdstr, data->command_name);
} else {
qemuMonitorTestErrorInvalidCommand(data->command_name, cmdstr);
}
--
2.34.1
2 years, 11 months
[PATCH partially-for-8.0 00/17] qemu: Fix use-after free when redefining snapshots and cleanup the code
by Peter Krempa
Patches 1 and 2 should be pushed for 8.0 as the bug was introduced in
this dev cycle and the patches are specifically kept very simple.
The rest of the series refactors the snapshot validation and helper code
to have less weird semantics which lead to this bug.
Peter Krempa (17):
qemuSnapshotRedefine: Rename 'def' to 'snapdef'
qemuSnapshotRedefine: Fix use of snapshot definition after free
virDomainMomentAssignDef: Simplify error handling
virDomainSnapshotRedefineValidate: Fix validation of
VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY flag
virDomainSnapshotAlignDisks: Improve function comment
virDomainSnapshotAlignDisks: Convert @default_snapshot to
virDomainSnapshotLocation
virDomainSnapshotAlignDisks: Move 'require_match' selection logic
inside
virDomainSnapshotAlignDisks: Allow alternate domain definition when
redefining
virDomainSnapshotRedefineValidate: Unexport
virDomainSnapshotRedefinePrep: Use 'snapdef' for snapshot definition
object
virDomainSnapshotRedefineValidate: Don't modify the snapshot
definition
testDomainSnapshotCreateXML: Extract snapshot redefinition code
qemuSnapshotCreate: Use 'snapdef' instead of 'def'
qemuSnapshotCreate: Standardize handling of the reference on @snapdef
qemuDomainSnapshotLoad: Refactor handling of snapshot definition
object
virDomainSnapshotAssignDef: Clear second argument when it is consumed
virDomainSnapshotRedefinePrep: Don't do partial redefine
src/conf/snapshot_conf.c | 120 +++++++++++++++-------------
src/conf/snapshot_conf.h | 13 +--
src/conf/virdomainmomentobjlist.c | 9 +--
src/conf/virdomainsnapshotobjlist.c | 29 ++++++-
src/conf/virdomainsnapshotobjlist.h | 5 +-
src/libvirt_private.syms | 1 +
src/qemu/qemu_driver.c | 18 ++---
src/qemu/qemu_snapshot.c | 35 ++++----
src/test/test_driver.c | 89 ++++++++++++---------
src/vz/vz_sdk.c | 3 +-
10 files changed, 180 insertions(+), 142 deletions(-)
--
2.31.1
2 years, 11 months
[PATCH 00/11] Misc cleanups
by Michal Privoznik
Couple of cleanups I've done whilst looking around our code base.
Michal Prívozník (11):
storage_file: Declare virStorageSourceParseRBDColonString only in one
header
virconf: Report an error in when virConfSetValue() fails
xen_xl: Check for virConfSetValue() retval
src: Declare and use g_autoptr(virConfValue)
virconf: Make virConfSetValue() clear consumed pointer
libxl: Don't use a static buffer in xenParseXLVnuma()
libxl: Allocate @libxldisk in xenParseXLDisk() on stack
xen_xl.c: Use g_autofree more
xen_xl.c: Use g_autoptr() for virCPUDef
libxl: Remove needless labels
virsh: Remove needless labels
src/libxl/xen_common.c | 62 ++---
src/libxl/xen_xl.c | 259 ++++++------------
src/libxl/xen_xm.c | 18 +-
src/storage_file/storage_source.h | 5 -
.../storage_source_backingstore.h | 3 +-
src/util/virconf.c | 19 +-
src/util/virconf.h | 3 +-
tools/virsh-host.c | 20 +-
tools/vsh.c | 11 +-
9 files changed, 135 insertions(+), 265 deletions(-)
--
2.34.1
2 years, 11 months