From nobody Tue Feb 10 00:58:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1595499565; cv=none; d=zohomail.com; s=zohoarc; b=lj0H1GavNi0y5ayqnGQIfokUL1io9Axv3NI9lExlY5/z1Jo4yfcqBAZLTB1x4ZJdgnwO4LDw3RRykJXGd/o4QSoefIqu1RJzryl/E74XxWJK80yQuPVJ/d1Kl8ez9NRRbKQ0WJ+dWmrPFup9tNOiN5L2Lls6nK7RjWikJHa2Flg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595499565; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=m7yj8SmcSHYdSj0OGk7g9shDeidSHUzVLb4pwPyFsH8=; b=nL0D69BMNjNHmgdyBqmVshU0oUYgnYYanyNJ+6OZmZwksZ1SicqFasdc6aRItoenbD0jaUifZr8UMCXbI8vdauYwYrPAnpvbRxn3P4Bh6awetfbtxnwnIOlZcQxCZk2Nc98Pmc/6T/joS6cul3ITzgNXfTLHoeZpdzF1YCUjFNY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1595499565864953.6957301447658; Thu, 23 Jul 2020 03:19:25 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-145-oBxpBVmnP2mbQqbyIloVZA-1; Thu, 23 Jul 2020 06:19:22 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 53DB0100CCC3; Thu, 23 Jul 2020 10:19:17 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2DFFA1009978; Thu, 23 Jul 2020 10:19:16 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BB6B61809557; Thu, 23 Jul 2020 10:19:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06NAFrGD008459 for ; Thu, 23 Jul 2020 06:15:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 308F72156A3A; Thu, 23 Jul 2020 10:15:53 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2C0CD2157F26 for ; Thu, 23 Jul 2020 10:15:50 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2DAE1800658 for ; Thu, 23 Jul 2020 10:15:50 +0000 (UTC) Received: from relay3.sw.ru (relay.sw.ru [185.231.240.75]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-177-iJwIvonvMGizVDNTyU35HA-1; Thu, 23 Jul 2020 06:15:47 -0400 Received: from [172.16.50.220] (helo=vz7.localdomain) by relay3.sw.ru with esmtp (Exim 4.93) (envelope-from ) id 1jyYGM-0007ZV-VL for libvir-list@redhat.com; Thu, 23 Jul 2020 13:15:42 +0300 X-MC-Unique: oBxpBVmnP2mbQqbyIloVZA-1 X-MC-Unique: iJwIvonvMGizVDNTyU35HA-1 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Subject: [PATCH v2 06/13] rpc: add shutdown facilities to netserver Date: Thu, 23 Jul 2020 13:14:06 +0300 Message-Id: <1595499253-584162-7-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1595499253-584162-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1595499253-584162-1-git-send-email-nshirokovskiy@virtuozzo.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable virNetServerClose and virNetServerShutdownWait are used to start net server threads shutdown and wait net server threads to actually finish respectively during net daemon shutdown procedure. Signed-off-by: Nikolay Shirokovskiy Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Daniel Henrique Barboza --- src/rpc/virnetserver.c | 8 ++++++++ src/rpc/virnetserver.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index e0a2386..79ea9f6 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -942,9 +942,17 @@ void virNetServerClose(virNetServerPtr srv) for (i =3D 0; i < srv->nclients; i++) virNetServerClientClose(srv->clients[i]); =20 + virThreadPoolStop(srv->workers); + virObjectUnlock(srv); } =20 +void +virNetServerShutdownWait(virNetServerPtr srv) +{ + virThreadPoolDrain(srv->workers); +} + static inline size_t virNetServerTrackPendingAuthLocked(virNetServerPtr srv) { diff --git a/src/rpc/virnetserver.h b/src/rpc/virnetserver.h index 1c6a2ef..112a51d 100644 --- a/src/rpc/virnetserver.h +++ b/src/rpc/virnetserver.h @@ -56,6 +56,7 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONVal= uePtr object, ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6); =20 void virNetServerClose(virNetServerPtr srv); +void virNetServerShutdownWait(virNetServerPtr srv); =20 virJSONValuePtr virNetServerPreExecRestart(virNetServerPtr srv); =20 --=20 1.8.3.1