From patchwork Mon Oct 7 15:13:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Rosbrook X-Patchwork-Id: 11177823 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7A34513BD for ; Mon, 7 Oct 2019 15:16:40 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5407A2053B for ; Mon, 7 Oct 2019 15:16:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="t2iuLvbx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5407A2053B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iHUjA-0007yl-MC; Mon, 07 Oct 2019 15:15:12 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iHUj9-0007xk-QP for xen-devel@lists.xenproject.org; Mon, 07 Oct 2019 15:15:11 +0000 X-Inumbo-ID: 0d3821aa-e915-11e9-9bee-bc764e2007e4 Received: from mail-qt1-x841.google.com (unknown [2607:f8b0:4864:20::841]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0d3821aa-e915-11e9-9bee-bc764e2007e4; Mon, 07 Oct 2019 15:13:43 +0000 (UTC) Received: by mail-qt1-x841.google.com with SMTP id u22so19592653qtq.13 for ; Mon, 07 Oct 2019 08:13:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3jlbshyhsnKwUe+1UF5DET0VROjnqCsc7bkrYu/FoCc=; b=t2iuLvbxglpe4k2o8NK6Ts3SwCZ7HElL+Lu7fht5a/F7+WT3Zon3xU08IHA3KzxJSi X7S5rOoo9ilmDotU4h7eZskBmdwKYo8gL1TD7R+Vo+BgNIRnmPjmCibpFMBJkQ1lLTta 3cEOziHjA0SIZfv7oqbweIKQLW6+Lnng3ldnNkZWjUV3iHiGt4/iXbWqygRotyoH4RJp sH32fg4U1MqD7xe6oGe+Jt9VlMvf7ErhEfe0ymLR/wpkvRKUT1xte64PThfpU2hHb7uC hvT1MQ9iRdNZh7VIjmrAlVSjS0JfClKp3nT+0H3AVbUgWK5wSQne/3cKKSQNsO1v9i9q u1PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3jlbshyhsnKwUe+1UF5DET0VROjnqCsc7bkrYu/FoCc=; b=gYobAsRts0EF4sHaGzo1D/euSR2IO58WxMvcjoTv3dDhex2Xs4dpubbKpmrEH6/qWO j5Tpd9GGZqN+Y/M0VUVrlrSRrL3DH5iVIa9Gow5l/+jJMDbmqbqyHnTpUQOguLYv16x6 Ys7zQydk7ZEUD7ScaUxd+MWpVRLWv4H3bnAvvLyOMrUElpcgPf+rWVuLqAeyZHw0Hr+a oLMvJ8Tzs5+rF3z0yA/WvlRkBw/vibtwDsEwN/I5RED+uVh1oIT5E6n577goXvk0Mm/P sBVLcX4lSgx14ws2asbZS5L3hGJwiSHUyjwsRWa8iobvoIPwgOmhapRd7uLHg3dGafwb vnKw== X-Gm-Message-State: APjAAAURiUXcYlXrdwrkWqtOv8j3Jx7Tiw99Y5zH3dwnjWiaKgmjsPEH UsSQVaODW8p0QzyIJf8LsYV3Ux8V X-Google-Smtp-Source: APXvYqyWpxIb1FPExH6TAxXj0lVj8Z7Bp8zOrwWRbdiA7PEs+1b/Q2YSuidVKfR8Rs7FzbiWolJsCQ== X-Received: by 2002:aed:2ae6:: with SMTP id t93mr30231192qtd.384.1570461223079; Mon, 07 Oct 2019 08:13:43 -0700 (PDT) Received: from five.crux.rad.ainfosec.com (209-217-208-226.northland.net. [209.217.208.226]) by smtp.googlemail.com with ESMTPSA id c185sm8354313qkg.74.2019.10.07.08.13.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2019 08:13:42 -0700 (PDT) From: Nick Rosbrook To: xen-devel@lists.xenproject.org Date: Mon, 7 Oct 2019 11:13:10 -0400 Message-Id: <96e1b2bbb921981be2d05232e5cc1f38a97d7809.1570456846.git.rosbrookn@ainfosec.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 23/24] golang/xenlight: add error return type to Context.Cpupoolinfo X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Nick Rosbrook , Ian Jackson , kerriganb@ainfosec.com, George Dunlap , Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Nick Rosbrook A previous commit that removed Context.CheckOpen revealed an ineffectual assignent to err in Context.Cpupoolinfo, as there is no error return type. Since it appears that the intent is to return an error here, add an error return value to the function signature. Signed-off-by: Nick Rosbrook --- Cc: George Dunlap Cc: Ian Jackson Cc: Wei Liu tools/golang/xenlight/xenlight.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/golang/xenlight/xenlight.go b/tools/golang/xenlight/xenlight.go index e540b5413d..0a4f476451 100644 --- a/tools/golang/xenlight/xenlight.go +++ b/tools/golang/xenlight/xenlight.go @@ -530,17 +530,17 @@ func (Ctx *Context) ListCpupool() (list []Cpupoolinfo) { } // int libxl_cpupool_info(libxl_ctx *ctx, libxl_cpupoolinfo *info, uint32_t poolid); -func (Ctx *Context) CpupoolInfo(Poolid uint32) (pool Cpupoolinfo) { +func (Ctx *Context) CpupoolInfo(Poolid uint32) (pool Cpupoolinfo, err error) { var c_cpupool C.libxl_cpupoolinfo ret := C.libxl_cpupool_info(Ctx.ctx, &c_cpupool, C.uint32_t(Poolid)) if ret != 0 { - //err = Error(-ret) + err = Error(-ret) return } defer C.libxl_cpupoolinfo_dispose(&c_cpupool) - _ = pool.fromC(&c_cpupool) + err = pool.fromC(&c_cpupool) return }