Re: [RFC 4/6] migration: Deprecate -incoming

2023-06-21 Thread Juan Quintela
Thomas Huth wrote: > On 12/06/2023 21.33, Juan Quintela wrote: >> Only "defer" is recommended. After setting all migation parameters, >> start incoming migration with "migrate-incoming uri" command. >> Signed-off-by: Juan Quintela >> --- >> docs/about/deprecated.rst | 7 +++ >> softmmu/vl

[libvirt PATCH v2] run: add ability to set selinux context

2023-06-21 Thread Jonathon Jongsma
When running libvirt from the build directory with the 'run' script, it will run as unconfined_t. This can result in unexpected behavior when selinux is enforcing due to the fact that the selinux policies are written assuming that libvirt is running with the system_u:system_r:virtd_t context. This

Re: [PATCH 0/3] Enable asynchronous teardown on s390x hosts

2023-06-21 Thread Jonathon Jongsma
On 6/13/23 10:42 AM, Boris Fiuczynski wrote: Update capabilities for QEMU 8.1 on s390x, add a new capability async-teardown and make use of it when running on s390x hosts to improve memory reclaiming. Is this really something that should be enabled unconditionally on all s390x guests, or shoul

Re: [PATCH 2/3] vircommand: Utilize close_range()

2023-06-21 Thread Daniel P . Berrangé
On Wed, Jun 21, 2023 at 04:09:10PM +0200, Michal Privoznik wrote: > As of commit v5.9-rc1~160^2~3 the Linux kernel has close_range() > syscall, which closes not just one FD but whole range. In glibc > this is exposed by automatically generated wrapper of the same > name. In musl, this is not expose

Re: [PATCH 1/3] vircommand: Use closefrom() more often

2023-06-21 Thread Daniel P . Berrangé
On Wed, Jun 21, 2023 at 04:09:09PM +0200, Michal Privoznik wrote: > As of commit v5.9-rc1~160^2~3 the Linux kernel has close_range() > syscall, which closes not just one FD but whole range. Then, in > its commit glibc-2.34~115 glibc introduced closefrom() which is > just a wrapper over close_range(

Re: [PATCH 3/3] virGlobalInit: Make glib init its own global state

2023-06-21 Thread Daniel P . Berrangé
On Wed, Jun 21, 2023 at 04:09:11PM +0200, Michal Privoznik wrote: > This should not be needed, but here's what's happening: > virStrToLong_*() family of functions was switched from strtol*() > to g_ascii_strtol*() in order to handle corner cases on Windows > (most notably parsing hex numbers with b

[PATCH 0/3] Fix recent deadlocks when spawning processes

2023-06-21 Thread Michal Privoznik
This is basically a v2 of: https://listman.redhat.com/archives/libvir-list/2023-June/240320.html But after discussion with Dan and most importantly, once he found the root cause we can do proper fixes instead of papering over the issue. Michal Prívozník (3): vircommand: Use closefrom() more of

[PATCH 3/3] virGlobalInit: Make glib init its own global state

2023-06-21 Thread Michal Privoznik
This should not be needed, but here's what's happening: virStrToLong_*() family of functions was switched from strtol*() to g_ascii_strtol*() in order to handle corner cases on Windows (most notably parsing hex numbers with base=0) - see v9.4.0-61-g2ed41d7cd9. But what we did not realize back then,

[PATCH 1/3] vircommand: Use closefrom() more often

2023-06-21 Thread Michal Privoznik
As of commit v5.9-rc1~160^2~3 the Linux kernel has close_range() syscall, which closes not just one FD but whole range. Then, in its commit glibc-2.34~115 glibc introduced closefrom() which is just a wrapper over close_range(), but it allows us to use FreeBSD-only implementation on Linux too, as bo

[PATCH 2/3] vircommand: Utilize close_range()

2023-06-21 Thread Michal Privoznik
As of commit v5.9-rc1~160^2~3 the Linux kernel has close_range() syscall, which closes not just one FD but whole range. In glibc this is exposed by automatically generated wrapper of the same name. In musl, this is not exposed, yet, but we can call the syscall() directly. In either case, we have to

[libvirt PATCH 7/9] util: relax requirement for logind to be running

2023-06-21 Thread Daniel P . Berrangé
Historically we wanted to check if logind was actually running, not merely activatable, because on systems where systemd is installed, but the OS is booted into non-systemd init, we want to fallback to pm-utils. Requiring logind to be running, however, forces us to serialize libvirtd startup on st

[libvirt PATCH 1/9] src: remove After=local-fs.target from systemd units

2023-06-21 Thread Daniel P . Berrangé
All services are ordered after local-fs.target unless they have set DefaultDependencies=no, which we do not do. https://gitlab.com/libvirt/libvirt/-/issues/489 Signed-off-by: Daniel P. Berrangé --- src/ch/virtchd.service.in | 1 - src/interface/virtinterfaced.service.in | 1 - src/

[libvirt PATCH 9/9] util: add logging about node suspend availability

2023-06-21 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- src/util/virnodesuspend.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/virnodesuspend.c b/src/util/virnodesuspend.c index 01f387d6fa..91a7f10eb9 100644 --- a/src/util/virnodesuspend.c +++ b/src/util/virnodesuspend.c @@ -249,6 +249,7 @@ virN

[libvirt PATCH 8/9] src: remove dep on systemd-logind.service from unit files

2023-06-21 Thread Daniel P . Berrangé
After the previous commit we no longer require that logind is actually running, it merely has to be activatable. https://gitlab.com/libvirt/libvirt/-/issues/489 Signed-off-by: Daniel P. Berrangé --- src/ch/virtchd.service.in | 1 - src/lxc/virtlxcd.service.in| 1 - src/qemu/virtqemud.se

[libvirt PATCH 2/9] src: remote deps on ip[6]tables/firewalld.service from systemd units

2023-06-21 Thread Daniel P . Berrangé
The unit files both have After=network.target, and this in turn implies After=network-pre.target. Both iptables.service & ip6tables.service have Before=network-pre.target since Fedora >= 35 and RHEL >= 8.4. When we first added the deps on ip[6]tables.service in commit 0756415f147dda15a417bd79ee

[libvirt PATCH 5/9] rpc: automatically raise max file limit in all daemons

2023-06-21 Thread Daniel P . Berrangé
None of our daemons use select(), so it is safe to raise the max file limit to its maximum on startup. https://gitlab.com/libvirt/libvirt/-/issues/489 Signed-off-by: Daniel P. Berrangé --- src/rpc/virnetdaemon.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rpc/virnetdaemon.c b/src/

[libvirt PATCH 3/9] util: remove pointless wrappers for setrlimit/getrlimit

2023-06-21 Thread Daniel P . Berrangé
These wrappers added no semantic difference over calling the system function directly. Signed-off-by: Daniel P. Berrangé --- src/util/virprocess.c | 22 ++ 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/util/virprocess.c b/src/util/virprocess.c index 2fd9b

[libvirt PATCH 6/9] src: set max open file limit to match systemd >= 240 defaults

2023-06-21 Thread Daniel P . Berrangé
Since systemd 240, all services get an open file hard limit of 500k, and a soft limit of 1024. This limit means apps are safe to use select() by default which is limited to 1024 FDs. Apps which don't use select() are expected to simply set their soft limit to match the hard limit during startup. W

[libvirt PATCH 0/9] src: some improvements to systemd unit files

2023-06-21 Thread Daniel P . Berrangé
These were suggested by Lennart in https://gitlab.com/libvirt/libvirt/-/issues/489 Daniel P. Berrangé (9): src: remove After=local-fs.target from systemd units src: remote deps on ip[6]tables/firewalld.service from systemd units util: remove pointless wrappers for setrlimit/getrlimit u

[libvirt PATCH 4/9] util: add helper for raising the max files limit

2023-06-21 Thread Daniel P . Berrangé
Historically the max files limit for processes has always been 1024, because going beyond this is incompatible with the select() function. None the less most apps these days will use poll() so should not be limited in this way. Since systemd >= 240, the hard limit will be 500k, while the soft limi

Re: [PATCH 3/3] qemu: enable asynchronous teardown on s390x hosts

2023-06-21 Thread Thomas Huth
On 13/06/2023 17.42, Boris Fiuczynski wrote: Enablement of asynchronous teardown on s390x and add a new test for asynchronous teardown not supported. Signed-off-by: Boris Fiuczynski --- src/qemu/qemu_command.c | 15 + .../balloon-ccw-deflate.s390x-latest.args

Re: [RFC 5/6] migration: Deprecate block migration

2023-06-21 Thread Stefan Hajnoczi
On Mon, Jun 12, 2023 at 09:33:43PM +0200, Juan Quintela wrote: > It is obsolete. It is better to use driver_mirror+NBD instead. > > CC: Kevin Wolf > CC: Eric Blake > CC: Stefan Hajnoczi > CC: Hanna Czenczek > > Signed-off-by: Juan Quintela > > --- > > Can any of you give one example of ho

Re: [RFC 6/6] migration: Deprecated old compression method

2023-06-21 Thread Daniel P . Berrangé
On Mon, Jun 12, 2023 at 09:33:44PM +0200, Juan Quintela wrote: > Signed-off-by: Juan Quintela > --- > docs/about/deprecated.rst | 8 > qapi/migration.json | 92 --- > migration/options.c | 13 ++ > 3 files changed, 79 insertions(+), 34 del

Re: [RFC 6/6] migration: Deprecated old compression method

2023-06-21 Thread Thomas Huth
On 12/06/2023 21.33, Juan Quintela wrote: Signed-off-by: Juan Quintela --- docs/about/deprecated.rst | 8 qapi/migration.json | 92 --- migration/options.c | 13 ++ 3 files changed, 79 insertions(+), 34 deletions(-) diff --git a/doc

Re: [RFC 4/6] migration: Deprecate -incoming

2023-06-21 Thread Thomas Huth
On 12/06/2023 21.33, Juan Quintela wrote: Only "defer" is recommended. After setting all migation parameters, start incoming migration with "migrate-incoming uri" command. Signed-off-by: Juan Quintela --- docs/about/deprecated.rst | 7 +++ softmmu/vl.c | 2 ++ 2 files chan