Re: [PATCH 5/8] network: Clean up after inactive objects during start

2024-09-16 Thread Laine Stump
Aha! Here's the message that I couldn't find! I accidentally sent it from my personal email address, and it showed up only in my personal inbox (and not in the libvirt folder). Anyway, as I said in the reply to 0/8 - completely disregard what I said here. Again, I have *no idea* what I thought

Re: [PATCH 0/8] Do more cleaning up after network objects upon start

2024-09-16 Thread Laine Stump
On 9/3/24 10:36 AM, Martin Kletzander wrote: This was initially inspired by https://issues.redhat.com/browse/RHEL-50968 which does things behind our back. However, I have found some other things when digging into the aforemention bug. I rebased, changed, rebased, refactored, and rebased again t

Re: [PATCH 6/8] network: Try to read dnsmasq PIDs for inactive networks too

2024-09-16 Thread Laine Stump
On 9/3/24 10:36 AM, Martin Kletzander wrote: Just in case one needs a clean up. Resolves: https://issues.redhat.com/browse/RHEL-50968 Signed-off-by: Martin Kletzander Reviewed-by: Laine Stump --- src/network/bridge_driver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) dif

Re: [PATCH 7/8] network: Separate cleanup from networkRemoveInactive

2024-09-16 Thread Laine Stump
On 9/3/24 10:36 AM, Martin Kletzander wrote: The new function (networkCleanupInactive) can be called from an iterator over the list of networks without the risk of deadlock. Signed-off-by: Martin Kletzander Reviewed-by: Laine Stump --- src/network/bridge_driver.c | 18 +++---

Re: [PATCH] tests: Fix typo in README.rst of qemucapabilitiesdata

2024-09-16 Thread Andrea Bolognani
On Mon, Sep 16, 2024 at 04:57:04PM GMT, Boris Fiuczynski wrote: > Signed-off-by: Boris Fiuczynski > --- > tests/qemucapabilitiesdata/README.rst | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Andrea Bolognani and pushed. -- Andrea Bolognani / Red Hat / Virtualization

Re: [PATCH 5/8] network: Clean up after inactive objects during start

2024-09-16 Thread Laine Stump
On 9/3/24 10:36 AM, Martin Kletzander wrote: Once networkUpdateState() identifies a dead network it should clean up after it as well. Resolves: https://issues.redhat.com/browse/RHEL-50968 Signed-off-by: Martin Kletzander --- src/network/bridge_driver.c | 6 ++ 1 file changed, 6 insertion

Re: [PATCH] apparmor: Don't check for existence of templates upfront

2024-09-16 Thread Daniel P . Berrangé
On Tue, Sep 17, 2024 at 12:32:46AM +0900, Andrea Bolognani wrote: > On Mon, Sep 16, 2024 at 04:15:58PM GMT, Daniel P. Berrangé wrote: > > A difference is that this Probe check will presumably report the error > > during daemon startup, while the virt-aa-helper check will delay the > > report until

Re: [PATCH 4/8] network: Don't check if network is active in networkShutdownNetwork

2024-09-16 Thread Laine Stump
On 9/3/24 10:36 AM, Martin Kletzander wrote: It skips the cleanup from networkStartNetwork and the only other path> already checks if the network is active or not. Signed-off-by: Martin Kletzander Reviewed-by: Laine Stump --- src/network/bridge_driver.c | 3 --- 1 file changed, 3 delet

Re: [PATCH] apparmor: Don't check for existence of templates upfront

2024-09-16 Thread Andrea Bolognani
On Mon, Sep 16, 2024 at 04:15:58PM GMT, Daniel P. Berrangé wrote: > A difference is that this Probe check will presumably report the error > during daemon startup, while the virt-aa-helper check will delay the > report until a VM is started. A failure to start the daemon is arguably > more likely t

Re: [PATCH] apparmor: Don't check for existence of templates upfront

2024-09-16 Thread Andrea Bolognani
On Mon, Sep 16, 2024 at 04:13:03PM GMT, Daniel P. Berrangé wrote: > On Tue, Sep 17, 2024 at 12:12:05AM +0900, Andrea Bolognani wrote: > > On Mon, Sep 16, 2024 at 04:04:40PM GMT, Daniel P. Berrangé wrote: > > > On Mon, Sep 16, 2024 at 04:55:55PM +0200, Andrea Bolognani wrote: > > > > static virSecu

Re: [PATCH] apparmor: Don't check for existence of templates upfront

2024-09-16 Thread Daniel P . Berrangé
On Mon, Sep 16, 2024 at 04:13:03PM +0100, Daniel P. Berrangé wrote: > On Tue, Sep 17, 2024 at 12:12:05AM +0900, Andrea Bolognani wrote: > > On Mon, Sep 16, 2024 at 04:04:40PM GMT, Daniel P. Berrangé wrote: > > > On Mon, Sep 16, 2024 at 04:55:55PM +0200, Andrea Bolognani wrote: > > > > static virSe

Re: [PATCH] apparmor: Don't check for existence of templates upfront

2024-09-16 Thread Daniel P . Berrangé
On Tue, Sep 17, 2024 at 12:12:05AM +0900, Andrea Bolognani wrote: > On Mon, Sep 16, 2024 at 04:04:40PM GMT, Daniel P. Berrangé wrote: > > On Mon, Sep 16, 2024 at 04:55:55PM +0200, Andrea Bolognani wrote: > > > static virSecurityDriverStatus > > > AppArmorSecurityManagerProbe(const char *virtDrive

Re: [PATCH] apparmor: Don't check for existence of templates upfront

2024-09-16 Thread Andrea Bolognani
On Mon, Sep 16, 2024 at 04:04:40PM GMT, Daniel P. Berrangé wrote: > On Mon, Sep 16, 2024 at 04:55:55PM +0200, Andrea Bolognani wrote: > > static virSecurityDriverStatus > > AppArmorSecurityManagerProbe(const char *virtDriver G_GNUC_UNUSED) > > We're passing the virt driver name ("QEMU" or "LXC")

Re: [PATCH 3/8] network: Move port deletion into the shutdown function

2024-09-16 Thread Laine Stump
On 9/3/24 10:36 AM, Martin Kletzander wrote: It will be more useful in there when calling from new places. (and also the extra call to virNetworkObjDeleteAllPorts() that this creates in the error cleanup of networkStartNetwork() is harmless) Signed-off-by: Martin Kletzander Reviewed-by: L

Re: [PATCH] apparmor: Don't check for existence of templates upfront

2024-09-16 Thread Daniel P . Berrangé
On Mon, Sep 16, 2024 at 04:55:55PM +0200, Andrea Bolognani wrote: > Currently, if either template is missing AppArmor support is > completely disabled. This means that uninstalling the LXC > driver from a system results in QEMU domains being started > without AppArmor confinement, which obviously d

Re: [PATCH 2/8] network: Do not call virNetworkObjUnsetDefTransient on start cleanup

2024-09-16 Thread Laine Stump
On 9/3/24 10:36 AM, Martin Kletzander wrote: The function networkShutdownNetwork already does that. (Harmless, but redundant)(or am I missing something?) Signed-off-by: Martin Kletzander Reviewed-by: Laine Stump --- src/network/bridge_driver.c | 1 - 1 file changed, 1 deletion(-) di

[PATCH] tests: Fix typo in README.rst of qemucapabilitiesdata

2024-09-16 Thread Boris Fiuczynski
Signed-off-by: Boris Fiuczynski --- tests/qemucapabilitiesdata/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemucapabilitiesdata/README.rst b/tests/qemucapabilitiesdata/README.rst index 727695c6b0..f65f07cfca 100644 --- a/tests/qemucapabilitiesdata/README.

[PATCH] apparmor: Don't check for existence of templates upfront

2024-09-16 Thread Andrea Bolognani
Currently, if either template is missing AppArmor support is completely disabled. This means that uninstalling the LXC driver from a system results in QEMU domains being started without AppArmor confinement, which obviously doesn't make any sense. The problematic scenario was impossible to hit in

Re: [PATCH 1/8] network: Do not update network ports for inactive networks

2024-09-16 Thread Laine Stump
On 9/3/24 10:36 AM, Martin Kletzander wrote: The semantic does not change since inside networkUpdatePort() (well, networkNotifyPort, for which the former is a wrapper) exits for inactive networks, but with an error we can easily avoid with this patch. (which normally wouldn't happen, *except*

Re: [PATCH 5/5] network: *un*set the firewalld zone while shutting down a network

2024-09-16 Thread Laine Stump
On 9/16/24 4:06 AM, Martin Kletzander wrote: Having said that it would still be beneficial to do some extra clean up to remove the zone if, for example, the bridge disappeared while virtnetworkd was not running (shameless plug of [1] O:-) ) Martin [1] https://lists.libvirt.org/archives/list/dev

Re: [PATCH v2 12/18] tests/tcg: ensure s390x-softmmu output redirected

2024-09-16 Thread Ilya Leoshkevich
On Mon, 2024-09-16 at 09:53 +0100, Alex Bennée wrote: > The multiarch system tests output serial data which should be > redirected to the "output" chardev rather than echoed to the console. > > Comment the use of EXTFLAGS variable while we are at it. > > Signed-off-by: Alex Bennée Acked-by: Ily

Re: [PATCH v2 1/1] qemu: Add support for RAPL MSRs feature

2024-09-16 Thread Anthony Harivel
Hi, Anthony Harivel, Sep 05, 2024 at 13:01: > > Hi, > > Anthony Harivel, Sep 03, 2024 at 14:41: > > Daniel P. Berrangé, Sep 03, 2024 at 14:24: > > > On Tue, Sep 03, 2024 at 02:16:58PM +0200, Peter Krempa wrote: > > > > On Tue, Sep 03, 2024 at 13:29:28 +0200, Anthony Harivel wrote: > > > > > Daniel

Re: -chardev with a JSON argument (was: [PATCH] chardev: introduce 'reconnect-ms' and deprecate 'reconnect')

2024-09-16 Thread Kevin Wolf
Am 14.09.2024 um 10:42 hat Markus Armbruster geschrieben: > Peter Krempa writes: > > > This is a little off-topic: > > > > So I wanted to make libvirt use the new parameter to stay ahead > > deprecation. I've applied this patch to qemu, dumped capabilities and > > pretty much expected a bunch of

Re: [PATCH] Revert "vircommand: Parse /dev/fd on *BSD-like systems when looking for opened FDs"

2024-09-16 Thread Martin Kletzander
On Mon, Sep 16, 2024 at 11:00:04AM +0200, Michal Privoznik wrote: Unfortunately, devfs on FreeBSD (accessible via /dev/fd) exposes only those FDs which can be represented as a file. To cite manpage [1]: The files /dev/fd/0 through /dev/fd/# refer to file descriptors which can be accessed throu

Re: [PATCH] resctrl: Do not rewrite default MB values for new allocations

2024-09-16 Thread Michal Prívozník
On 9/16/24 10:33, Martin Kletzander wrote: > The code did it "just in case" the allocation was not reset for new > subdirectories. That might've happened in the past with CAT settings, > but checking it now it is properly reset to its maximum values for each > new CLOSID (Class of Service ID). >

[PATCH v2 17/18] plugins: add option to dump write argument to syscall plugin

2024-09-16 Thread Alex Bennée
From: Rowan Hart Signed-off-by: Rowan Hart Reviewed-by: Pierrick Bouvier Tested-by: Pierrick Bouvier Message-Id: <20240827215329.248434-3-rowanbh...@gmail.com> [AJB: tweak fmt string for vaddr] Signed-off-by: Alex Bennée --- vAJB - tweak fmt string for PRIu64 v2 - add static to arch_sysc

[PATCH v2 15/18] contrib/plugins: Add a plugin to generate basic block vectors

2024-09-16 Thread Alex Bennée
From: Akihiko Odaki SimPoint is a widely used tool to find the ideal microarchitecture simulation points so Valgrind[2] and Pin[3] support generating basic block vectors for use with them. Let's add a corresponding plugin to QEMU too. Note that this plugin has a different goal with tests/plugin/

[PATCH v2 16/18] plugins: add plugin API to read guest memory

2024-09-16 Thread Alex Bennée
From: Rowan Hart Signed-off-by: Rowan Hart Reviewed-by: Pierrick Bouvier Message-Id: <20240827215329.248434-2-rowanbh...@gmail.com> [AJB: tweaked cpu_memory_rw_debug call] Signed-off-by: Alex Bennée --- vAJB: - explicit bool for cpu_memory_rw_debug v2 - fix alignment --- include/qemu/qem

[PATCH] Revert "vircommand: Parse /dev/fd on *BSD-like systems when looking for opened FDs"

2024-09-16 Thread Michal Privoznik
Unfortunately, devfs on FreeBSD (accessible via /dev/fd) exposes only those FDs which can be represented as a file. To cite manpage [1]: The files /dev/fd/0 through /dev/fd/# refer to file descriptors which can be accessed through the file system. This means FDs representing pipes and/or unna

[PATCH v2 18/18] contrib/plugins: avoid hanging program

2024-09-16 Thread Alex Bennée
Although we asks for instructions per second we work in quanta and that cannot be 0. Fail to load the plugin instead and report the minimum IPS we can handle. Signed-off-by: Alex Bennée Reported-by: Elisha Hollander Reviewed-by: Richard Henderson --- contrib/plugins/ips.c | 5 + 1 file cha

[PATCH v2 14/18] util/timer: avoid deadlock when shutting down

2024-09-16 Thread Alex Bennée
When we shut down a guest we disable the timers. However this can cause deadlock if the guest has queued some async work that is trying to advance system time and spins forever trying to wind time forward. Pay attention to the return code and bail early if we can't wind time forward. Signed-off-by

[PATCH v2 13/18] tests/tcg: add a system test to check memory instrumentation

2024-09-16 Thread Alex Bennée
At first I thought I could compile the user-mode test for system mode however we already have a fairly comprehensive test case for system mode in "memory" so lets use that. As tracking every access will quickly build up with "print-access" we add a new mode to track groups of reads and writes to r

[PATCH v2 12/18] tests/tcg: ensure s390x-softmmu output redirected

2024-09-16 Thread Alex Bennée
The multiarch system tests output serial data which should be redirected to the "output" chardev rather than echoed to the console. Comment the use of EXTFLAGS variable while we are at it. Signed-off-by: Alex Bennée --- v2 - don't remove EXTFLAGS, add comment --- tests/tcg/s390x/Makefile.sof

[PATCH v2 10/18] tests/tcg: clean up output of memory system test

2024-09-16 Thread Alex Bennée
This is useful information when debugging memory issues so lets improve by: - include the ptr address for u8 fills (like the others) - indicate the number of operations for reads and writes - explicitly note when we are flushing - move the fill printf to after the reset Message-Id: <20240

[PATCH v2 11/18] tests/tcg: only read/write 64 bit words on 64 bit systems

2024-09-16 Thread Alex Bennée
While the compilers will generally happily synthesise a 64 bit value for you on 32 bit systems it doesn't exercise anything on QEMU. It also makes it hard to accurately compare the accesses to test_data when instrumenting. Message-Id: <20240910140733.4007719-21-alex.ben...@linaro.org> Reviewed-by:

[PATCH v2 09/18] tests/tcg/multiarch: add test for plugin memory access

2024-09-16 Thread Alex Bennée
From: Pierrick Bouvier Add an explicit test to check expected memory values are read/written. 8,16,32 load/store are tested for all arch. 64,128 load/store are tested for aarch64/x64. atomic operations (8,16,32,64) are tested for x64 only. By default, atomic accesses are non atomic if a single c

[PATCH v2 08/18] tests/tcg/plugins/mem: add option to print memory accesses

2024-09-16 Thread Alex Bennée
From: Pierrick Bouvier By using "print-accesses=true" option, mem plugin will now print every value accessed, with associated size, type (store vs load), symbol, instruction address and phys/virt address accessed. Reviewed-by: Richard Henderson Reviewed-by: Xingtao Yao Signed-off-by: Pierrick

[PATCH v2 07/18] tests/tcg: allow to check output of plugins

2024-09-16 Thread Alex Bennée
From: Pierrick Bouvier A specific plugin test can now read and check a plugin output, to ensure it contains expected values. Tested-by: Xingtao Yao Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20240724194708.1843704-5-pierrick.bouv...@linaro.org> Signed-off-by:

[PATCH v2 06/18] tests/tcg: add mechanism to run specific tests with plugins

2024-09-16 Thread Alex Bennée
From: Pierrick Bouvier Only multiarch tests are run with plugins, and we want to be able to run per-arch test with plugins too. Tested-by: Xingtao Yao Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20240724194708.1843704-4-pierrick.bouv...@linaro.org> Signed-off-b

[PATCH v2 05/18] plugins: extend API to get latest memory value accessed

2024-09-16 Thread Alex Bennée
From: Pierrick Bouvier This value can be accessed only during a memory callback, using new qemu_plugin_mem_get_value function. Returned value can be extended when QEMU will support accesses wider than 128 bits. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1719 Resolves: https://gitla

[PATCH v2 04/18] plugins: save value during memory accesses

2024-09-16 Thread Alex Bennée
From: Pierrick Bouvier Different code paths handle memory accesses: - tcg generated code - load/store helpers - atomic helpers This value is saved in cpu->neg.plugin_mem_value_{high,low}. Values are written only for accessed word size (upper bits are not set). Atomic operations are doing read/w

[PATCH v2 02/18] deprecation: don't enable TCG plugins by default with TCI

2024-09-16 Thread Alex Bennée
The softmmu memory instrumentation test sees so many more accesses than a normal translated host and its really not worth fixing up. Lets deprecate this odd configuration and save on the CI cycles. Message-Id: <20240910140733.4007719-13-alex.ben...@linaro.org> Reviewed-by: Pierrick Bouvier Signed

[PATCH v2 03/18] contrib/plugins: control flow plugin

2024-09-16 Thread Alex Bennée
This is a simple control flow tracking plugin that uses the latest inline and conditional operations to detect and track control flow changes. It is currently an exercise at seeing how useful the changes are. Reviewed-by: Pierrick Bouvier Message-Id: <20240910140733.4007719-14-alex.ben...@linaro.

[PATCH v2 01/18] deprecation: don't enable TCG plugins by default on 32 bit hosts

2024-09-16 Thread Alex Bennée
The existing plugins already liberally use host pointer stuffing for passing user data which will fail when doing 64 bit guests on 32 bit hosts. We should discourage this by officially deprecating support and adding another nail to the 32 bit host coffin. Message-Id: <20240910140733.4007719-12-ale

[PATCH v2 00/18] tcg plugins pre-PR (deprecations, mem apis, contrib plugins)

2024-09-16 Thread Alex Bennée
I think all these are ready to go having been mostly reviewed in previous series. The following still need review: util/timer: avoid deadlock when shutting down tests/tcg: add a system test to check memory instrumentation tests/tcg: ensure s390x-softmmu output redirected tests/tcg/multiarc

Re: [PATCH 11/17] tests/tcg: only read/write 64 bit words on 64 bit systems

2024-09-16 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > On 13/9/24 19:26, Alex Bennée wrote: >> While the compilers will generally happily synthesise a 64 bit value >> for you on 32 bit systems it doesn't exercise anything on QEMU. It >> also makes it hard to accurately compare the accesses to test_data >> when instrum

Re: [PATCH 12/17] tests/tcg: ensure s390x-softmmu output redirected

2024-09-16 Thread Alex Bennée
Thomas Huth writes: > On 13/09/2024 19.26, Alex Bennée wrote: >> The multiarch system tests output serial data which should be >> redirected to the "output" chardev rather than echoed to the console. >> Remove the unused EXTFLAGS variable while we are at it. >> Signed-off-by: Alex Bennée >> ---

[PATCH] resctrl: Do not rewrite default MB values for new allocations

2024-09-16 Thread Martin Kletzander
The code did it "just in case" the allocation was not reset for new subdirectories. That might've happened in the past with CAT settings, but checking it now it is properly reset to its maximum values for each new CLOSID (Class of Service ID). The advantage of this is that we do not rewrite the v

Re: [PATCH 5/5] network: *un*set the firewalld zone while shutting down a network

2024-09-16 Thread Martin Kletzander
On Mon, Sep 16, 2024 at 09:49:44AM +0200, Martin Kletzander wrote: On Thu, Sep 05, 2024 at 01:07:59PM -0400, Laine Stump wrote: When a bridge device for a virtual network had been placed in a firewalld zone while starting the network, then even after the network is shut down and the bridge devic

Re: [PATCH 5/5] network: *un*set the firewalld zone while shutting down a network

2024-09-16 Thread Martin Kletzander
On Thu, Sep 05, 2024 at 01:07:59PM -0400, Laine Stump wrote: When a bridge device for a virtual network had been placed in a firewalld zone while starting the network, then even after the network is shut down and the bridge device is deleted, its name will show up in the list of interfaces for wh

Re: [PATCH 4/5] network: remove firewalld version check from networkSetBridgeZone()

2024-09-16 Thread Martin Kletzander
On Thu, Sep 05, 2024 at 01:07:58PM -0400, Laine Stump wrote: At the time the version check in this function was written, there were still several supported versions of some distros that were using a version of firewalld too old to support the "rich rule priorities" used by the 'libvirt' zone that

Re: [PATCH 3/5] network: support setting firewalld zone for bridge device of open networks

2024-09-16 Thread Martin Kletzander
On Thu, Sep 05, 2024 at 01:07:57PM -0400, Laine Stump wrote: The bit of code that sets the firewalld zone was previously a part of the function networkAddFirewallRules(), which is not called for networks with . Setting the 'libvirt' zone for the bridge device of virtual networks that also add fi

Re: [PATCH 2/5] network: belatedly update an error message

2024-09-16 Thread Martin Kletzander
On Thu, Sep 05, 2024 at 01:07:56PM -0400, Laine Stump wrote: The 'open' forward type probably hadn't yet been added when this message was written. Signed-off-by: Laine Stump Reviewed-by: Martin Kletzander --- src/conf/network_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) dif

Re: [PATCH 1/5] network: permit when a network has no IP address

2024-09-16 Thread Martin Kletzander
On Thu, Sep 05, 2024 at 01:07:55PM -0400, Laine Stump wrote: The whole point of is to supress libvirt from adding any firewall rules for a network, and someone might want to create a network with no IP address (i.e. they don't want the guests to have connectivity to the host via this interface)