From nobody Wed May 14 21:35:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1516713937022100.65263016760514; Tue, 23 Jan 2018 05:25:37 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 47DF34D4A4; Tue, 23 Jan 2018 13:25:35 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1938D859F4; Tue, 23 Jan 2018 13:25:35 +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 D83173FAEA; Tue, 23 Jan 2018 13:25:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w0NDOc2f027055 for ; Tue, 23 Jan 2018 08:24:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5125E7A31F; Tue, 23 Jan 2018 13:24:38 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.82]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85A3B7BB4D; Tue, 23 Jan 2018 13:24:36 +0000 (UTC) From: "Daniel P. Berrange" To: libvir-list@redhat.com Date: Tue, 23 Jan 2018 13:23:43 +0000 Message-Id: <20180123132347.21944-8-berrange@redhat.com> In-Reply-To: <20180123132347.21944-1-berrange@redhat.com> References: <20180123132347.21944-1-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 07/11] rpc: annotate various parameters as being required to be non-NULL 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 23 Jan 2018 13:25:36 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The server name and client data callbacks need to be non-NULL or the system will crash at various times. This is particularly bad when some of the crashes only occur post-exec restart. Signed-off-by: Daniel P. Berrange --- src/rpc/virnetserver.h | 7 +++++-- src/rpc/virnetserverclient.h | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/rpc/virnetserver.h b/src/rpc/virnetserver.h index 7728a67f5f..a79c39fdb2 100644 --- a/src/rpc/virnetserver.h +++ b/src/rpc/virnetserver.h @@ -47,7 +47,8 @@ virNetServerPtr virNetServerNew(const char *name, virNetServerClientPrivNew clientPrivNew, virNetServerClientPrivPreExecRestart clien= tPrivPreExecRestart, virFreeCallback clientPrivFree, - void *clientPrivOpaque); + void *clientPrivOpaque) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(11) ATTRIBUTE_NONNULL(13); =20 virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object, const char *name, @@ -55,7 +56,9 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONVal= uePtr object, virNetServerClientPrivNewPo= stExecRestart clientPrivNewPostExecRestart, virNetServerClientPrivPreEx= ecRestart clientPrivPreExecRestart, virFreeCallback clientPrivF= ree, - void *clientPrivOpaque); + void *clientPrivOpaque) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) + ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6); =20 void virNetServerClose(virNetServerPtr srv); =20 diff --git a/src/rpc/virnetserverclient.h b/src/rpc/virnetserverclient.h index 3c48759abc..4a0d3cc25e 100644 --- a/src/rpc/virnetserverclient.h +++ b/src/rpc/virnetserverclient.h @@ -72,14 +72,17 @@ virNetServerClientPtr virNetServerClientNew(unsigned lo= ng long id, virNetServerClientPrivNew priv= New, virNetServerClientPrivPreExecR= estart privPreExecRestart, virFreeCallback privFree, - void *privOpaque); + void *privOpaque) + ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(7) ATTRIBUTE_NONNULL(9); =20 virNetServerClientPtr virNetServerClientNewPostExecRestart(virNetServerPtr= srv, virJSONValuePtr= object, virNetServerCli= entPrivNewPostExecRestart privNew, virNetServerCli= entPrivPreExecRestart privPreExecRestart, virFreeCallback= privFree, - void *privOpaqu= e); + void *privOpaqu= e) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) + ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5); =20 virJSONValuePtr virNetServerClientPreExecRestart(virNetServerClientPtr cli= ent); =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list