Re: PING 2 [PATCH 0/2] fix use-after-free in network IO

2023-07-24 Thread Oleg Vasilev
Please look at. On 13/07/2023 12:49, Oleg Vasilev wrote: On 04/07/2023 13:10, Oleg Vasilev wrote: Found by repeatedly created and destroyed channels with guest agent. More details in the patch. Oleg Vasilev (2):    net: add debug logs    remote: fix stream use-after-free   src/remote

PING [PATCH 0/2] fix use-after-free in network IO

2023-07-13 Thread Oleg Vasilev
On 04/07/2023 13:10, Oleg Vasilev wrote: Found by repeatedly created and destroyed channels with guest agent. More details in the patch. Oleg Vasilev (2): net: add debug logs remote: fix stream use-after-free src/remote/remote_daemon_stream.c | 13 +++-- src/rpc

[PATCH 2/2] remote: fix stream use-after-free

2023-07-04 Thread Oleg Vasilev
Inside daemonStreamHandleWrite on stream completion (status=OK) we reuse msg object to send confirmation. Only after that, msg is poped from the queue and checked for continue. By that time, msg might've already been processed for the confirmation and freed. Signed-off-by: Oleg Vasilev ---

[PATCH 1/2] net: add debug logs

2023-07-04 Thread Oleg Vasilev
Helped to debug next patch use-after-free. Signed-off-by: Oleg Vasilev --- src/remote/remote_daemon_stream.c | 4 ++-- src/rpc/virnetmessage.c | 5 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/remote/remote_daemon_stream.c b/src/remote

[PATCH 0/2] fix use-after-free in network IO

2023-07-04 Thread Oleg Vasilev
Found by repeatedly created and destroyed channels with guest agent. More details in the patch. Oleg Vasilev (2): net: add debug logs remote: fix stream use-after-free src/remote/remote_daemon_stream.c | 13 +++-- src/rpc/virnetmessage.c | 5 + 2 files changed, 12

[PATCH] util: don't validate empty params

2023-06-23 Thread Oleg Vasilev
If there are no parameters, there is nothing to validate. If params == NULL, memcpy below results in memcpy(sorted, NULL, 0), which is UB. Found by UBSAN. Example of this codepath: virDomainBlockCopy() (where nparams == 0 is valid) -> qemuDomainBlockCopy() Signed-off-by: Oleg Vasilev ---

[PATCH] qemu: add unmap stats to all domain stats

2023-06-01 Thread Oleg Vasilev
From: Nikolay Shirokovskiy Unmap stats are useful for debugging how efficient qemu is in freeing host disk space. Signed-off-by: Oleg Vasilev --- src/qemu/qemu_driver.c | 3 +++ src/qemu/qemu_monitor.h | 3 +++ src/qemu/qemu_monitor_json.c | 3 +++ 3 files changed, 9 insertions

[PATCH 2/3] qemu: migration: implement zstd compression

2023-04-18 Thread Oleg Vasilev
QEMU now supports multifd-compression=zstd for migration with enabled multifd. Bring the support to libvirt as well. Signed-off-by: Oleg Vasilev --- include/libvirt/libvirt-domain.h | 10 ++ src/qemu/qemu_migration.h| 1 + src/qemu/qemu_migration_params.c | 32

[PATCH 0/3] qemu: migration: implement zstd compression

2023-04-18 Thread Oleg Vasilev
QEMU now supports multifd-compression=zstd for migration with enabled multifd. Bring the support to libvirt as well. Claudio Fontana (1): qemu: migration: expose qemuMigrationParamsSetString Oleg Vasilev (2): qemu: migration: implement zstd compression tests: qemumigparams: test for zstd

[PATCH 1/3] qemu: migration: expose qemuMigrationParamsSetString

2023-04-18 Thread Oleg Vasilev
From: Claudio Fontana change from static to external linkage, and move the function close to the other similar ones, near qemuMigrationParamsSetULL. Signed-off-by: Claudio Fontana Signed-off-by: Oleg Vasilev --- src/qemu/qemu_migration_params.c | 47 +++- src/qemu

[PATCH 3/3] tests: qemumigparams: test for zstd compression

2023-04-18 Thread Oleg Vasilev
Here we add one more way to test migration parameters, namely: from vir params. This allows to test the logic of (libvirt) compression->(qemu) multifd-compression Signed-off-by: Oleg Vasilev --- tests/qemumigparamsdata/zstd.json | 4 ++ tests/qemumigparamsdata/zstd.reply | 7 +++ te

Re: [PATCH v3 4/5] logging: add log cleanup for obsolete domains

2023-02-05 Thread Oleg Vasilev
On 03.02.2023 19:45, Martin Kletzander wrote: On Mon, Jan 30, 2023 at 09:00:01PM +0600, Oleg Vasilev wrote: Before, logs from deleted machines have been piling up, since there were no garbage collection mechanism. Now, virtlogd can be configured to periodically scan the log folder for orphan

Re: [PATCH v2 4/5] logging: add log cleanup for obsolete domains

2023-01-30 Thread Oleg Vasilev
On 25.01.2023 19:49, Martin Kletzander wrote: On Fri, Jan 20, 2023 at 04:50:51PM +0600, Oleg Vasilev wrote: On 09.01.2023 18:31, Martin Kletzander wrote: On Thu, Dec 15, 2022 at 01:25:49AM +0600, Oleg Vasilev wrote: Before, logs from deleted machines have been piling up, since there were

[PATCH v3 2/5] logging: move virLogHandler to header

2023-01-30 Thread Oleg Vasilev
Signed-off-by: Oleg Vasilev --- src/logging/log_handler.c | 26 -- src/logging/log_handler.h | 31 --- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c index 7342404b00

[PATCH v3 4/5] logging: add log cleanup for obsolete domains

2023-01-30 Thread Oleg Vasilev
single transaction. Signed-off-by: Oleg Vasilev --- po/POTFILES | 1 + src/logging/log_cleaner.c | 268 ++ src/logging/log_cleaner.h | 29 + src/logging/log_handler.h | 2 + src/logging/meson.build | 1 + 5 files changed, 301 insertions

[PATCH v3 3/5] logging: add configuration for future log cleaner

2023-01-30 Thread Oleg Vasilev
We want to specify the folder to clean and how much time can a log chain live. Signed-off-by: Oleg Vasilev --- src/logging/log_daemon_config.c | 9 + src/logging/log_daemon_config.h | 3 +++ src/logging/test_virtlogd.aug.in | 2 ++ src/logging/virtlogd.aug | 2 ++ src

[PATCH v3 5/5] logging: use the log cleaner

2023-01-30 Thread Oleg Vasilev
Actually use the log cleaner introduced by previous commit. Signed-off-by: Oleg Vasilev --- src/logging/log_handler.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c index 8fc7e9b2a8..a739211c7c 100644 --- a/src/logging

[PATCH v3 0/5] logging: add log cleanup for obsolete domains

2023-01-30 Thread Oleg Vasilev
https://listman.redhat.com/archives/libvir-list/2022-February/228149.html [2]: https://listman.redhat.com/archives/libvir-list/2022-February/msg00865.html CC: Martin Kletzander Oleg Vasilev (5): logging: refactor to store config inside log handler logging: move virLogHandler to header logging

[PATCH v3 1/5] logging: refactor to store config inside log handler

2023-01-30 Thread Oleg Vasilev
Signed-off-by: Oleg Vasilev --- src/logging/log_daemon.c | 6 ++ src/logging/log_handler.c | 29 - src/logging/log_handler.h | 17 - 3 files changed, 22 insertions(+), 30 deletions(-) diff --git a/src/logging/log_daemon.c b/src/logging

Re: [PATCH v2 4/5] logging: add log cleanup for obsolete domains

2023-01-20 Thread Oleg Vasilev
On 09.01.2023 18:31, Martin Kletzander wrote: On Thu, Dec 15, 2022 at 01:25:49AM +0600, Oleg Vasilev wrote: Before, logs from deleted machines have been piling up, since there were no garbage collection mechanism. Now, virtlogd can be configured to periodically scan the log folder for orphan

Re: [PATCH v2] qemu: add append mode config for serial file

2023-01-10 Thread Oleg Vasilev
On 10.01.2023 16:35, Daniel P. Berrangé wrote: On Tue, Jan 10, 2023 at 04:20:59PM +0600, Oleg Vasilev wrote: On 10.01.2023 15:09, Martin Kletzander wrote: On Tue, Jan 10, 2023 at 09:03:40AM +, Daniel P. Berrangé wrote: On Tue, Jan 10, 2023 at 02:42:34PM +0600, Oleg Vasilev wrote

Re: [PATCH v2] qemu: add append mode config for serial file

2023-01-10 Thread Oleg Vasilev
On 10.01.2023 15:09, Martin Kletzander wrote: On Tue, Jan 10, 2023 at 09:03:40AM +, Daniel P. Berrangé wrote: On Tue, Jan 10, 2023 at 02:42:34PM +0600, Oleg Vasilev wrote: Serial log file contains lots of useful information for debugging configuration problems. It makes sense to

Re: [PATCH 1/2] qemu: add append mode config for serial file

2023-01-10 Thread Oleg Vasilev
On 05.01.2023 19:19, Martin Kletzander wrote: On Tue, Nov 29, 2022 at 09:54:51PM +0600, Oleg Vasilev wrote: Serial log file contains lots of useful information for debugging configuration problems. It makes sense to preserve the log in between restarts, so that one can later figure out what

[PATCH v2] qemu: add append mode config for serial file

2023-01-10 Thread Oleg Vasilev
. Signed-off-by: Oleg Vasilev --- src/qemu/libvirtd_qemu.aug| 3 ++ src/qemu/qemu.conf.in | 9 src/qemu/qemu_conf.c | 4 ++ src/qemu/qemu_conf.h | 2 + src/qemu/qemu_domain.c

PING [PATCH v2 0/5] logging: add log cleanup for obsolete domains

2023-01-04 Thread Oleg Vasilev
Ping On 15.12.2022 01:25, Oleg Vasilev wrote: Presently, logs from deleted domains remain forever. Particular motivation comes from the case when libguestfs has repeatedly created transient VMs, which in turn created plenty of logs. This takes up space and lots of files troubles filesystem

Re: [PATCH 0/2] qemu: add append mode config for serial file

2022-12-27 Thread Oleg Vasilev
Ping On 29.11.2022 21:54, Oleg Vasilev wrote: Serial log file contains lots of useful information for debugging configuration problems. It makes sense to preserve the log in between restarts, so that one can later figure out what was going on. Oleg Vasilev (2): qemu: add append mode config

[PATCH v2 0/5] logging: add log cleanup for obsolete domains

2022-12-14 Thread Oleg Vasilev
ibvir-list/2022-February/msg00865.html CC: Martin Kletzander Oleg Vasilev (5): logging: refactor to store config inside log handler logging: move virLogHandler to header logging: add configuration for future log cleaner logging: add log cleanup for obsolete domains logging: use the log cl

[PATCH v2 5/5] logging: use the log cleaner

2022-12-14 Thread Oleg Vasilev
Actually use the log cleaner introduced by previous commit. Signed-off-by: Oleg Vasilev --- src/logging/log_handler.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c index 8fc7e9b2a8..a739211c7c 100644 --- a/src/logging

[PATCH v2 3/5] logging: add configuration for future log cleaner

2022-12-14 Thread Oleg Vasilev
We want to specify the folder to clean and how much time can a log chain live. Signed-off-by: Oleg Vasilev --- src/logging/log_daemon_config.c | 9 + src/logging/log_daemon_config.h | 3 +++ src/logging/test_virtlogd.aug.in | 2 ++ src/logging/virtlogd.aug | 2 ++ src

[PATCH v2 2/5] logging: move virLogHandler to header

2022-12-14 Thread Oleg Vasilev
Signed-off-by: Oleg Vasilev --- src/logging/log_handler.c | 26 -- src/logging/log_handler.h | 31 --- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c index 7342404b00

[PATCH v2 4/5] logging: add log cleanup for obsolete domains

2022-12-14 Thread Oleg Vasilev
single transaction. Signed-off-by: Oleg Vasilev --- po/POTFILES | 1 + src/logging/log_cleaner.c | 276 ++ src/logging/log_cleaner.h | 29 src/logging/log_handler.h | 2 + src/logging/meson.build | 1 + 5 files changed, 309 insertions

[PATCH v2 1/5] logging: refactor to store config inside log handler

2022-12-14 Thread Oleg Vasilev
Signed-off-by: Oleg Vasilev --- src/logging/log_daemon.c | 6 ++ src/logging/log_handler.c | 29 - src/logging/log_handler.h | 17 - 3 files changed, 22 insertions(+), 30 deletions(-) diff --git a/src/logging/log_daemon.c b/src/logging

Re: [PATCH 2/2] logging: add log cleanup for obsolete domains

2022-11-30 Thread Oleg Vasilev
On 30.11.2022 16:49, Martin Kletzander wrote: On Mon, Nov 21, 2022 at 03:29:57PM +0600, Oleg Vasilev wrote: Before, logs from deleted machines have been piling up, since there were no garbadge collection mechanism. Now virtlogd can be configured to periodically scan log folder for orphan logs

Re: [PATCH 0/2] logging: add log cleanup for obsolete domains

2022-11-29 Thread Oleg Vasilev
Kindly ping. The previous attempt didn't get any attention, and I am not sure what else to do. On 21.11.2022 15:29, Oleg Vasilev wrote: Motivation comes from the case when libguestfs has repeatedly created transient VMs, which in turn created lots of logs without any mechanism to dele

[PATCH 2/2] qemuxml2xmltest: add serial append=on test

2022-11-29 Thread Oleg Vasilev
Previous commit has introduced the config option to enable append=on for serial files. Here we test it. Signed-off-by: Oleg Vasilev --- tests/qemuxml2argvdata/serial-append.xml | 56 +++ .../serial-append.x86_64-latest.xml | 56 +++ tests

[PATCH 1/2] qemu: add append mode config for serial file

2022-11-29 Thread Oleg Vasilev
Serial log file contains lots of useful information for debugging configuration problems. It makes sense to preserve the log in between restarts, so that one can later figure out what was going on. Signed-off-by: Oleg Vasilev --- src/qemu/libvirtd_qemu.aug | 3 +++ src/qemu

[PATCH 0/2] qemu: add append mode config for serial file

2022-11-29 Thread Oleg Vasilev
Serial log file contains lots of useful information for debugging configuration problems. It makes sense to preserve the log in between restarts, so that one can later figure out what was going on. Oleg Vasilev (2): qemu: add append mode config for serial file qemuxml2xmltest: add serial

Re: [PATCH 1/2] conf: Make VIR_DOMAIN_NET_TYPE_ETHERNET not share 'host view'

2022-11-28 Thread Oleg Vasilev
'host view', meaning the TX/RX values must be swapped. But that's not true. An easy reproducer is to start a domain with two -s: one type of network, the other of type ethernet and configure the same for both. Reversed setting can then be observed (e.g. via tc). Reported-by: Oleg

Re: TX/RX statistics need to be swapped

2022-11-24 Thread Oleg Vasilev
On 24.11.2022 14:53, Michal Prívozník wrote: On 11/23/22 15:12, Oleg Vasilev wrote: Hi, virDomainNetTypeSharesHostView[1] contains the logic where for some interface types it swaps TX and RX values, because what TX from the inside is RX on the outside and vice versa. We observe a

TX/RX statistics need to be swapped

2022-11-23 Thread Oleg Vasilev
Hi, virDomainNetTypeSharesHostView[1] contains the logic where for some interface types it swaps TX and RX values, because what TX from the inside is RX on the outside and vice versa. We observe a configuration where shows swapped values in statistics, because, apparently, the values are s

[PATCH 2/2] logging: add log cleanup for obsolete domains

2022-11-21 Thread Oleg Vasilev
Before, logs from deleted machines have been piling up, since there were no garbadge collection mechanism. Now virtlogd can be configured to periodically scan log folder for orphan logs with no recent modfications and delete it. Signed-off-by: Oleg Vasilev --- src/logging/log_daemon_config.c

[PATCH 0/2] logging: add log cleanup for obsolete domains

2022-11-21 Thread Oleg Vasilev
.html [2]: https://listman.redhat.com/archives/libvir-list/2022-February/msg00865.html Oleg Vasilev (2): logging: refactor to store config inside log handler logging: add log cleanup for obsolete domains src/logging/log_daemon.c | 6 +- src/logging/log_daemon_config.c | 9 ++ src

[PATCH 1/2] logging: refactor to store config inside log handler

2022-11-21 Thread Oleg Vasilev
Signed-off-by: Oleg Vasilev --- src/logging/log_daemon.c | 6 ++ src/logging/log_handler.c | 29 - src/logging/log_handler.h | 17 - 3 files changed, 22 insertions(+), 30 deletions(-) diff --git a/src/logging/log_daemon.c b/src/logging

Re: [PATCH] qemu: add pcie-to-pci-bridge for q35 machines

2022-11-04 Thread Oleg Vasilev
On 04.11.2022 20:19, Andrea Bolognani wrote: On Fri, Nov 04, 2022 at 01:03:52PM +0100, Peter Krempa wrote: On Fri, Nov 04, 2022 at 16:43:00 +0600, Oleg Vasilev wrote: Hotplugging PCI devices on pc-i440fx machines is supported without additional configuration. On q35, pcie-to-pci-bridge

[PATCH] qemu: add pcie-to-pci-bridge for q35 machines

2022-11-04 Thread Oleg Vasilev
to make it configurable in the future. Previously there was a pci-bridge present by default, but was removed in d5fb8f4564 (qemu: don't add pci-bridge to Q35/arm domains unless it's needed, 2016-04-22) [1]: https://libvirt.org/pci-hotplug.html Signed-off-by: Oleg Vasilev ---