From 963136057f657b7b90a12dd61895e97dd09c212b Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Fri, 17 Feb 2023 12:07:46 +0100 Subject: [PATCH] libvirt-9.0.0-6.el9 - rpc: client: Don't check return value of virNetMessageNew (rhbz#2145188) - rpc: Don't warn about "max_client_requests" in single-threaded daemons (rhbz#2145188) Resolves: rhbz#2145188 --- ..._requests-in-single-threaded-daemons.patch | 55 +++++++++++++++++++ ...eck-return-value-of-virNetMessageNew.patch | 45 +++++++++++++++ libvirt.spec | 8 ++- 3 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 libvirt-rpc-Don-t-warn-about-max_client_requests-in-single-threaded-daemons.patch create mode 100644 libvirt-rpc-client-Don-t-check-return-value-of-virNetMessageNew.patch diff --git a/libvirt-rpc-Don-t-warn-about-max_client_requests-in-single-threaded-daemons.patch b/libvirt-rpc-Don-t-warn-about-max_client_requests-in-single-threaded-daemons.patch new file mode 100644 index 0000000..0fe7473 --- /dev/null +++ b/libvirt-rpc-Don-t-warn-about-max_client_requests-in-single-threaded-daemons.patch @@ -0,0 +1,55 @@ +From 64dbfdfe3ed2fc8f252ce138f6213b529edb2407 Mon Sep 17 00:00:00 2001 +Message-Id: <64dbfdfe3ed2fc8f252ce138f6213b529edb2407@dist-git> +From: Peter Krempa +Date: Wed, 15 Feb 2023 10:48:31 +0100 +Subject: [PATCH] rpc: Don't warn about "max_client_requests" in + single-threaded daemons +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The warning about max_client_requests is hit inside virtlogd every time +a VM starts which spams the logs. + +Emit the warning only when the client request limit is not 1 and add a +warning into the daemon config to not configure it too low instead. + +Fixes: 031878c2364 +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2145188 +Signed-off-by: Peter Krempa +Reviewed-by: Daniel P. Berrangé +(cherry picked from commit b3f8e072fe08a6beaf3ec3d27e02efee4358b2ca) +--- + src/remote/libvirtd.conf.in | 1 + + src/rpc/virnetserverclient.c | 3 ++- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/remote/libvirtd.conf.in b/src/remote/libvirtd.conf.in +index 80a98b1529..32a680317a 100644 +--- a/src/remote/libvirtd.conf.in ++++ b/src/remote/libvirtd.conf.in +@@ -374,6 +374,7 @@ + # connection. To avoid one client monopolizing the server + # this should be a small fraction of the global max_workers + # parameter. ++# Setting this too low may cause keepalive timeouts. + #max_client_requests = 5 + + # Same processing controls, but this time for the admin interface. +diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c +index b5c764b1b0..bdb3552c5d 100644 +--- a/src/rpc/virnetserverclient.c ++++ b/src/rpc/virnetserverclient.c +@@ -1261,7 +1261,8 @@ static virNetMessage *virNetServerClientDispatchRead(virNetServerClient *client) + client->rx->bufferLength = VIR_NET_MESSAGE_LEN_MAX; + client->rx->buffer = g_new0(char, client->rx->bufferLength); + client->nrequests++; +- } else if (!client->nrequests_warning) { ++ } else if (!client->nrequests_warning && ++ client->nrequests_max > 1) { + client->nrequests_warning = true; + VIR_WARN("Client hit max requests limit %zd. This may result " + "in keep-alive timeouts. Consider tuning the " +-- +2.39.1 + diff --git a/libvirt-rpc-client-Don-t-check-return-value-of-virNetMessageNew.patch b/libvirt-rpc-client-Don-t-check-return-value-of-virNetMessageNew.patch new file mode 100644 index 0000000..9b62d1e --- /dev/null +++ b/libvirt-rpc-client-Don-t-check-return-value-of-virNetMessageNew.patch @@ -0,0 +1,45 @@ +From c07df2b480134357e6ecb53f61eb1d8295b2b406 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Wed, 15 Feb 2023 10:43:53 +0100 +Subject: [PATCH] rpc: client: Don't check return value of virNetMessageNew +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +virNetServerClientDispatchRead checked the return value but it's not +necessary any more as it can't return NULL nowadays. + +Signed-off-by: Peter Krempa +Reviewed-by: Daniel P. Berrangé +(cherry picked from commit 761cb8a0876d32445951791030c77afa147c0de1) +https://bugzilla.redhat.com/show_bug.cgi?id=2145188 +--- + src/rpc/virnetserverclient.c | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c +index c9a4eb521e..b5c764b1b0 100644 +--- a/src/rpc/virnetserverclient.c ++++ b/src/rpc/virnetserverclient.c +@@ -1257,13 +1257,10 @@ static virNetMessage *virNetServerClientDispatchRead(virNetServerClient *client) + + /* Possibly need to create another receive buffer */ + if (client->nrequests < client->nrequests_max) { +- if (!(client->rx = virNetMessageNew(true))) { +- client->wantClose = true; +- } else { +- client->rx->bufferLength = VIR_NET_MESSAGE_LEN_MAX; +- client->rx->buffer = g_new0(char, client->rx->bufferLength); +- client->nrequests++; +- } ++ client->rx = virNetMessageNew(true); ++ client->rx->bufferLength = VIR_NET_MESSAGE_LEN_MAX; ++ client->rx->buffer = g_new0(char, client->rx->bufferLength); ++ client->nrequests++; + } else if (!client->nrequests_warning) { + client->nrequests_warning = true; + VIR_WARN("Client hit max requests limit %zd. This may result " +-- +2.39.1 + diff --git a/libvirt.spec b/libvirt.spec index 705133d..a0b745c 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -229,7 +229,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 9.0.0 -Release: 5%{?dist}%{?extra_release} +Release: 6%{?dist}%{?extra_release} License: LGPLv2+ URL: https://libvirt.org/ @@ -265,6 +265,8 @@ Patch24: libvirt-qemu_namespace-Deal-with-nested-mounts-when-umount-ing-dev.patc Patch25: libvirt-qemuProcessRefreshDisks-Don-t-skip-filling-of-disk-information-if-tray-state-didn-t-change.patch Patch26: libvirt-qemu_extdevice-Do-cleanup-host-only-for-VIR_DOMAIN_TPM_TYPE_EMULATOR.patch Patch27: libvirt-qemu-blockjob-Handle-pending-blockjob-state-only-when-we-need-it.patch +Patch28: libvirt-rpc-client-Don-t-check-return-value-of-virNetMessageNew.patch +Patch29: libvirt-rpc-Don-t-warn-about-max_client_requests-in-single-threaded-daemons.patch Requires: libvirt-daemon = %{version}-%{release} @@ -2355,6 +2357,10 @@ exit 0 %endif %changelog +* Fri Feb 17 2023 Jiri Denemark - 9.0.0-6 +- rpc: client: Don't check return value of virNetMessageNew (rhbz#2145188) +- rpc: Don't warn about "max_client_requests" in single-threaded daemons (rhbz#2145188) + * Mon Feb 13 2023 Jiri Denemark - 9.0.0-5 - qemu_extdevice: Do cleanup host only for VIR_DOMAIN_TPM_TYPE_EMULATOR (rhbz#2168762) - qemu: blockjob: Handle 'pending' blockjob state only when we need it (rhbz#2168769)