From nobody Sun Feb 8 05:47:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1596473909; cv=none; d=zohomail.com; s=zohoarc; b=ZrLa0dbH4FP4wM3LBHwHFFjkGTM77N17ZmIuruw4i4ONnngjB0ZnUOf7Td9UbhpkRDspWE+bTcS4d6cXe93cR840lR4EtsJe7GmWMKMtmkXuYXP78RS8u+JhlH/SXknB0CZJ2WoGFZLqe3uRVa8VGAjTgs4WgefShXodIpagTX0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596473909; 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=uzk+OaO8OeKv5jqZ0vGFIogTkV0BgJIZDFaaSucvNoI=; b=JJJnlgj3IB6g6mGDoaAqpjkcVQy4fpwZoBKk1H+Qu8luphOMVjwIv5hqRgC7mWPxHCs24vdyEUoClHJdDvQbLH/rjZih15aKHEeh12GpK0KU559YI/0Wz7cfTaC3/ZAyPQ551K3M5mBhnw8Ko5ql7hbuGqJOVNf2obQmrdL8iuU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1596473909961949.906011096047; Mon, 3 Aug 2020 09:58:29 -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-429-0fgfPMLZMfqFT0P6AsX0tg-1; Mon, 03 Aug 2020 12:58:26 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 46F08107BEFA; Mon, 3 Aug 2020 16:58:21 +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 28B9771781; Mon, 3 Aug 2020 16:58:21 +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 A0F661809554; Mon, 3 Aug 2020 16:58:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 073Gv62g007649 for ; Mon, 3 Aug 2020 12:57:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6A54971773; Mon, 3 Aug 2020 16:57:06 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.40.208.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id B020571770 for ; Mon, 3 Aug 2020 16:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596473908; 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=uzk+OaO8OeKv5jqZ0vGFIogTkV0BgJIZDFaaSucvNoI=; b=RXXpHgZF/KwKhEzd6nTiuXnpzZPG22WfykwJlk9uhKyAmYcNAb3wZu8qMagpJrMvGuy03v eqB1pcir7A/j0Cs7KGXbAjxIYvSnMh5E3nZa9fOLZNDPz9N/fzoz99uoIN6OAC+ef9VJtq R9djf37iDxDJBeUaULGKMiL2POGb+XY= X-MC-Unique: 0fgfPMLZMfqFT0P6AsX0tg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 03/19] util: virHostMem*Parameters: split out non-Linux stubs Date: Mon, 3 Aug 2020 18:56:40 +0200 Message-Id: <04296864c2687f940c3efbec74fcf1df0f9b7b85.1596473604.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Repeat the whole function header instead of mixing #ifdefs in the code. Signed-off-by: J=C3=A1n Tomko --- src/util/virhostmem.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/util/virhostmem.c b/src/util/virhostmem.c index 7d1871610c..27f192dc24 100644 --- a/src/util/virhostmem.c +++ b/src/util/virhostmem.c @@ -354,16 +354,16 @@ virHostMemParametersAreAllSupported(virTypedParameter= Ptr params, } #endif =20 +#ifdef __linux__ int virHostMemSetParameters(virTypedParameterPtr params G_GNUC_UNUSED, int nparams G_GNUC_UNUSED, unsigned int flags) { - virCheckFlags(0, -1); - -#ifdef __linux__ size_t i; =20 + virCheckFlags(0, -1); + if (virTypedParamsValidate(params, nparams, VIR_NODE_MEMORY_SHARED_PAGES_TO_SCAN, VIR_TYPED_PARAM_UINT, @@ -383,13 +383,21 @@ virHostMemSetParameters(virTypedParameterPtr params G= _GNUC_UNUSED, } =20 return 0; +} #else +int +virHostMemSetParameters(virTypedParameterPtr params G_GNUC_UNUSED, + int nparams G_GNUC_UNUSED, + unsigned int flags) +{ + virCheckFlags(0, -1); + virReportError(VIR_ERR_NO_SUPPORT, "%s", _("node set memory parameters not implemented" " on this platform")); return -1; -#endif } +#endif =20 #ifdef __linux__ static int @@ -434,14 +442,12 @@ virHostMemGetParameterValue(const char *field, #endif =20 #define NODE_MEMORY_PARAMETERS_NUM 8 +#ifdef __linux__ int virHostMemGetParameters(virTypedParameterPtr params G_GNUC_UNUSED, int *nparams G_GNUC_UNUSED, unsigned int flags) { - virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1); - -#ifdef __linux__ unsigned int pages_to_scan; unsigned int sleep_millisecs; unsigned int merge_across_nodes; @@ -453,6 +459,8 @@ virHostMemGetParameters(virTypedParameterPtr params G_G= NUC_UNUSED, size_t i; int ret; =20 + virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1); + if ((*nparams) =3D=3D 0) { *nparams =3D NODE_MEMORY_PARAMETERS_NUM; return 0; @@ -569,13 +577,21 @@ virHostMemGetParameters(virTypedParameterPtr params G= _GNUC_UNUSED, } =20 return 0; +} #else +int +virHostMemGetParameters(virTypedParameterPtr params G_GNUC_UNUSED, + int *nparams G_GNUC_UNUSED, + unsigned int flags) +{ + virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1); + virReportError(VIR_ERR_NO_SUPPORT, "%s", _("node get memory parameters not implemented" " on this platform")); return -1; -#endif } +#endif =20 =20 #ifdef WIN32 --=20 2.26.2