]> git.ipfire.org Git - thirdparty/libvirt.git/commit
rpc: Initialize a worker pool for max_workers=0 as well
authorMarc Hartmayer <mhartmay@linux.ibm.com>
Tue, 7 Aug 2018 11:38:00 +0000 (13:38 +0200)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 14 Aug 2018 16:16:42 +0000 (12:16 -0400)
commit7330d0918e4001328f36d7b7f0a806f0a55faadd
tree1aa68881e78a3683b41093de48abbd998690f65e
parent97f4a1044cc8bc511cc9a8c52dc9284c71349854
rpc: Initialize a worker pool for max_workers=0 as well

Semantically, there is no difference between an uninitialized worker
pool and an initialized worker pool with zero workers. Let's allow the
worker pool to be initialized for max_workers=0 as well then which
makes the API more symmetric and simplifies code. Validity of the
worker pool is delegated to virThreadPoolGetMaxWorkers instead.

This patch fixes segmentation faults in
virNetServerGetThreadPoolParameters and
virNetServerSetThreadPoolParameters for the case when no worker pool
is actually initialized (max_workers=0).

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
src/rpc/virnetserver.c