From patchwork Fri Nov 15 19:44:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Rosbrook X-Patchwork-Id: 11247055 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 767961393 for ; Fri, 15 Nov 2019 19:47:59 +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 527302073A for ; Fri, 15 Nov 2019 19:47:59 +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="H4/BTJzh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 527302073A 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 1iVhYR-0002cT-9m; Fri, 15 Nov 2019 19:46:51 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iVhYP-0002ao-J1 for xen-devel@lists.xenproject.org; Fri, 15 Nov 2019 19:46:49 +0000 X-Inumbo-ID: 78fe067c-07e0-11ea-984a-bc764e2007e4 Received: from mail-qv1-xf44.google.com (unknown [2607:f8b0:4864:20::f44]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 78fe067c-07e0-11ea-984a-bc764e2007e4; Fri, 15 Nov 2019 19:45:27 +0000 (UTC) Received: by mail-qv1-xf44.google.com with SMTP id w11so4214811qvu.13 for ; Fri, 15 Nov 2019 11:45:27 -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 :mime-version:content-transfer-encoding; bh=egIM9yCGWbdecCrAFUBjEjOn4j3q9tSDSDea7oC7rr8=; b=H4/BTJzhowbQudbGlUu2y2yu3ohdaDXN4m35scKXn7VM5ZTTcckffHXXFeB1lGeqfJ DljoBg2YxHm3akcFieuKNqF4E/nl+5pxVoBXZdjv8NX+kyeR/4Nte6yOhd7AYczGz6YV skZeUmO5CbL/QPjLf5RtupNah2CwrtYmBr5NmBsKlU0GC0kUOueg6aORDmQTJsSeEKDG dkwycdTBSi/NxiLcJ1PUzkwbHGPwRMMdsiz3sA5Gli+i/UJmqwXNKT0x9O3EkRf3C42m uScj3FAxoKQTHUV3KoUeruxqfgVicMX4mWKh2yR/V6VaHYnwiwVYVYZ7RjI8kmlrQwoZ dovA== 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=egIM9yCGWbdecCrAFUBjEjOn4j3q9tSDSDea7oC7rr8=; b=gKOCbkAGmWCcDZ2k1fgk7s4ysc46n+HbTgxAfz2LY63KWmWSDcO8/G4+0NWEna+A0V H5aIbRcCHG71ev2I0paEvbhbq7wC1GYVv9mS1GEFWCDwXHG3HWbeKONXTVgO1Ujo69em 9z3MAL+IP2fox/3iBvoEv4paQ6IbOg7WtSfeCs0KrPabaW4e3skIOc4Ou57FQSlLSooT +QCCdCZOD5idlQ09WY7sDJdfunH+4wz8JLbPdbbc/lvDBS1OZWuRjot7V+bDpPnvlZlq LdwE6uxWahh7mlxucEucuENqDqs44Wlkx4r59QSdQe3PIgr7SZfmb2tub31F609NxU8B 3w8A== X-Gm-Message-State: APjAAAWIRz79gpJiBDdIkXtZR4uHt4lYymAijvdnJivjHXoFku+gwqM7 Uw8A3aDo6uaWFIPeezT1qQ+yTAvy X-Google-Smtp-Source: APXvYqxeh+EiRrpVmslLrzkou8tKzpPqwcB8kEp9mS+xwPoIPUMchMQsqucQXHEDj6bM7E4zGo5ipg== X-Received: by 2002:ad4:4c4d:: with SMTP id cs13mr15555360qvb.165.1573847126507; Fri, 15 Nov 2019 11:45:26 -0800 (PST) Received: from five.crux.rad.ainfosec.com (209-217-208-226.northland.net. [209.217.208.226]) by smtp.googlemail.com with ESMTPSA id y10sm4649679qkb.55.2019.11.15.11.45.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 11:45:25 -0800 (PST) From: Nick Rosbrook To: xen-devel@lists.xenproject.org Date: Fri, 15 Nov 2019 14:44:29 -0500 Message-Id: X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 22/22] 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 --- 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 4e12cebac1..becd07b0b6 100644 --- a/tools/golang/xenlight/xenlight.go +++ b/tools/golang/xenlight/xenlight.go @@ -513,17 +513,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 }