From nobody Sun Feb 8 17:42:20 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; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588673471; cv=none; d=zohomail.com; s=zohoarc; b=IdNLnpPRMgGHhvF8BZULWBt+XiEu3d+0ylyM0rEzGWFVNeAocuDOfXFrA2BoQ+nw//RCzVQlqh8ujFJnKPyS1EdilMb9i2aQKsPm09xTn1p4g3IHtgNU81DbNXtbtgdJDCV+dC2u+WU74wiPwca4+ziA/2Rf/wbm3fjXAYFAjWs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588673471; 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=3uhY4JpjkdD4b/x1Tj8FQqVxHqV2quemU+IuLtPPK1U=; b=TPO8Cn1MhLKQHCcj01RkF0wgw9apvjYvku6jvrXvxgAxXpTDx/nvGF61iEkF3HJtSMG6NVAqSEJrsJLlAnzcjdYC7R331HWKRVz2KegCGOvpENd43L3MmdHi29ZTZj5On5rzesgCzcczI7c5jB28D3K3baYQ+cOYAEvb+FpO5t0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass 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 158867347136037.127093619933476; Tue, 5 May 2020 03:11:11 -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-91-WJZXRihROM2RBy83RF3S7A-1; Tue, 05 May 2020 06:11:06 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 343EE100CCF0; Tue, 5 May 2020 10:11:00 +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 F1A4B5D9D3; Tue, 5 May 2020 10:10:59 +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 A43C11809557; Tue, 5 May 2020 10:10:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 045AAJSK001473 for ; Tue, 5 May 2020 06:10:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6C5CE101E58A; Tue, 5 May 2020 10:10:19 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD974101E7F9 for ; Tue, 5 May 2020 10:10:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588673470; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=3uhY4JpjkdD4b/x1Tj8FQqVxHqV2quemU+IuLtPPK1U=; b=PBnBN8rFPWhPcLodLuU3J6uZm8WKrP/N6IMHcyhCKJbLDk87O4S/NvIilc8eq3TVOQvhEG IDg50IiJ5gPXQTo7AUl7vAoHjIEsUlKA5oewxqqUEZsdgBM+FYNVuHncXpT3RF3JAqGMhH zsRzVtPHKeBZxIoV9KIzbRl7fvK5aRU= X-MC-Unique: WJZXRihROM2RBy83RF3S7A-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/4] rpc: Make some functions void Date: Tue, 5 May 2020 12:10:06 +0200 Message-Id: <2b839af8b1e9f5a551db9dddc148e2829c83fa8c.1588672891.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" There are few functions that currently return an integer but in fact they always return the same integer (zero). Make them void. Signed-off-by: Michal Privoznik --- src/rpc/virnetlibsshsession.c | 4 +--- src/rpc/virnetlibsshsession.h | 4 ++-- src/rpc/virnetsocket.c | 6 ++---- src/rpc/virnetsshsession.c | 4 +--- src/rpc/virnetsshsession.h | 4 ++-- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c index 9c20a80b88..0a566eaa54 100644 --- a/src/rpc/virnetlibsshsession.c +++ b/src/rpc/virnetlibsshsession.c @@ -1082,11 +1082,10 @@ virNetLibsshSessionAuthAddKeyboardAuth(virNetLibssh= SessionPtr sess, =20 } =20 -int +void virNetLibsshSessionSetChannelCommand(virNetLibsshSessionPtr sess, const char *command) { - int ret =3D 0; virObjectLock(sess); =20 VIR_FREE(sess->channelCommand); @@ -1094,7 +1093,6 @@ virNetLibsshSessionSetChannelCommand(virNetLibsshSess= ionPtr sess, sess->channelCommand =3D g_strdup(command); =20 virObjectUnlock(sess); - return ret; } =20 int diff --git a/src/rpc/virnetlibsshsession.h b/src/rpc/virnetlibsshsession.h index 231c2591b2..e982bcd2ef 100644 --- a/src/rpc/virnetlibsshsession.h +++ b/src/rpc/virnetlibsshsession.h @@ -35,8 +35,8 @@ typedef enum { VIR_NET_LIBSSH_HOSTKEY_VERIFY_IGNORE } virNetLibsshHostkeyVerify; =20 -int virNetLibsshSessionSetChannelCommand(virNetLibsshSessionPtr sess, - const char *command); +void virNetLibsshSessionSetChannelCommand(virNetLibsshSessionPtr sess, + const char *command); =20 int virNetLibsshSessionAuthSetCallback(virNetLibsshSessionPtr sess, virConnectAuthPtr auth); diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index 6c790cb577..3ea863f625 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -969,8 +969,7 @@ virNetSocketNewConnectLibSSH2(const char *host, VIR_NET_SSH_HOSTKEY_FILE_CR= EATE) !=3D 0) goto error; =20 - if (virNetSSHSessionSetChannelCommand(sess, command) !=3D 0) - goto error; + virNetSSHSessionSetChannelCommand(sess, command); =20 if (!(authMethodList =3D virStringSplit(authMethods, ",", 0))) goto error; @@ -1101,8 +1100,7 @@ virNetSocketNewConnectLibssh(const char *host, verify) !=3D 0) goto error; =20 - if (virNetLibsshSessionSetChannelCommand(sess, command) !=3D 0) - goto error; + virNetLibsshSessionSetChannelCommand(sess, command); =20 if (!(authMethodList =3D virStringSplit(authMethods, ",", 0))) goto error; diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c index fabdc3ef22..b4dea15452 100644 --- a/src/rpc/virnetsshsession.c +++ b/src/rpc/virnetsshsession.c @@ -1132,11 +1132,10 @@ virNetSSHSessionAuthAddKeyboardAuth(virNetSSHSessio= nPtr sess, =20 } =20 -int +void virNetSSHSessionSetChannelCommand(virNetSSHSessionPtr sess, const char *command) { - int ret =3D 0; virObjectLock(sess); =20 VIR_FREE(sess->channelCommand); @@ -1144,7 +1143,6 @@ virNetSSHSessionSetChannelCommand(virNetSSHSessionPtr= sess, sess->channelCommand =3D g_strdup(command); =20 virObjectUnlock(sess); - return ret; } =20 int diff --git a/src/rpc/virnetsshsession.h b/src/rpc/virnetsshsession.h index 0101489302..4d639da453 100644 --- a/src/rpc/virnetsshsession.h +++ b/src/rpc/virnetsshsession.h @@ -40,8 +40,8 @@ typedef enum { VIR_NET_SSH_HOSTKEY_FILE_CREATE =3D 1 << 1, } virNetSSHHostKeyFileFlags; =20 -int virNetSSHSessionSetChannelCommand(virNetSSHSessionPtr sess, - const char *command); +void virNetSSHSessionSetChannelCommand(virNetSSHSessionPtr sess, + const char *command); =20 void virNetSSHSessionAuthReset(virNetSSHSessionPtr sess); =20 --=20 2.26.2