From patchwork Mon Dec 23 15:17:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Rosbrook X-Patchwork-Id: 11308451 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 E3A5213B6 for ; Mon, 23 Dec 2019 15:19:19 +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 C030C206CB for ; Mon, 23 Dec 2019 15:19:19 +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="pHMlx/8L" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C030C206CB 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 1ijPTN-0006Rs-Re; Mon, 23 Dec 2019 15:18:17 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ijPTM-0006RE-He for xen-devel@lists.xenproject.org; Mon, 23 Dec 2019 15:18:16 +0000 X-Inumbo-ID: 6488a966-2597-11ea-88e7-bc764e2007e4 Received: from mail-qv1-xf44.google.com (unknown [2607:f8b0:4864:20::f44]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 6488a966-2597-11ea-88e7-bc764e2007e4; Mon, 23 Dec 2019 15:17:54 +0000 (UTC) Received: by mail-qv1-xf44.google.com with SMTP id f16so6465194qvi.4 for ; Mon, 23 Dec 2019 07:17:54 -0800 (PST) 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 :in-reply-to:references; bh=F/xV9O13I7GQ/UCRCjsUvyaympRarisj/rLEyIKgRFk=; b=pHMlx/8LE4XvEKQdtXEU5JugHWGVSHtPu5CB0TuFY+vwS7ud3dp6GCiMKqPWuoIc0J KeMrfC+AfndLLXMxb1XFU/WAgqW23rF/kZbi4q/eNA1VSv0W0FBUhK5irNio9wnHZdYU K3v0/jm5/q0IWBg9cQHMYRrLYeSJwgj9bRzWfefPjD30Z3TLNe/xvDCdGICKMnlGu3N8 q2O1oJD/RVEeOfQx55nRP9qKxuQeEyDWWCXT+sejzxosO1bMJ8bvxuhoSwa32D0vcCcK 0pJPq2e3lI13cUd2GrcPciO97d8HvvxxqafyfIqdYluGT1qPX0TB9Qn71dty/eCZJCzX uZyw== 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:in-reply-to:references; bh=F/xV9O13I7GQ/UCRCjsUvyaympRarisj/rLEyIKgRFk=; b=KMmxKm1iD+ddxhpK42nDdmfhnyUq1LgM+o3NSsZZpIxmCSYZDXnZldO6xAbggenAV1 wAaOUXxtcvG1r1C7ZslVKyQDlwtcFhEt4BhmvJAWrzSIVJ2pfoEGky6EsVNBldJa2Otd OWfgOQI57aT2dVfQgSzA19dnadxIvOiQJ3xd9kMLFaAAMfNt6p30tzIGtAhof9yULQ/u uzlgubvFAX35aSkGaOXzQf/1LqIYt5zVOC9VmPw13GulyPfUakEqLgDDpNjLw18bKOpO Rp/giE7FKjjfOQ+9gonis23ziVGg7I+q35vLrQY3b9I1Lfwz6bBvZqZ3uanGAK6+ho13 axpQ== X-Gm-Message-State: APjAAAUampyArhidBPb109Nj90sOZnjW9hQgzp4qRWblybT32SYXHWRg CfNqNom667Hfw7keVGDkn34j5YAo X-Google-Smtp-Source: APXvYqwZ8k+GIdIvG464d7bb9g5hI8ovmp+u+tGC7954ukk610VnYppuqyyat1ONvNOLglX4BesNEQ== X-Received: by 2002:a0c:c389:: with SMTP id o9mr25177144qvi.232.1577114273901; Mon, 23 Dec 2019 07:17:53 -0800 (PST) Received: from four.lan (cpe-67-241-56-252.twcny.res.rr.com. [67.241.56.252]) by smtp.gmail.com with ESMTPSA id u15sm5823907qku.67.2019.12.23.07.17.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Dec 2019 07:17:53 -0800 (PST) From: Nick Rosbrook X-Google-Original-From: Nick Rosbrook To: xen-devel@lists.xenproject.org Date: Mon, 23 Dec 2019 10:17:07 -0500 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Subject: [Xen-devel] [PATCH v4 6/6] 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 MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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 Reviewed-by: George Dunlap --- 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 5f14cab6ce..237f26bce9 100644 --- a/tools/golang/xenlight/xenlight.go +++ b/tools/golang/xenlight/xenlight.go @@ -504,17 +504,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 }