From patchwork Tue Dec 10 15:47:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Rosbrook X-Patchwork-Id: 11282897 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 D1964138C for ; Tue, 10 Dec 2019 15:50:30 +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 ADC28206D5 for ; Tue, 10 Dec 2019 15:50:30 +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="m1hrrmKs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ADC28206D5 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 1iehlZ-00044k-8A; Tue, 10 Dec 2019 15:49:37 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iehlX-00043f-Tf for xen-devel@lists.xenproject.org; Tue, 10 Dec 2019 15:49:35 +0000 X-Inumbo-ID: 7c2addc4-1b64-11ea-88e7-bc764e2007e4 Received: from mail-qk1-x742.google.com (unknown [2607:f8b0:4864:20::742]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 7c2addc4-1b64-11ea-88e7-bc764e2007e4; Tue, 10 Dec 2019 15:48:18 +0000 (UTC) Received: by mail-qk1-x742.google.com with SMTP id z76so103901qka.2 for ; Tue, 10 Dec 2019 07:48:18 -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=XNEElzRpeVV8r6SPzsaAXc9nyqLVWFu8pvvM7YDquJg=; b=m1hrrmKsiKv4O+TgfBj+0k7gVh9QIChmmugiqe5D+WaIV4HfLGHFH3nMBgBu0ZGelJ J1+Y3NO/M3XBQmfzwtFndSoTlOhY9putvzKi+SGyQ0kYSXbabuv8zPlFkGXzHZqLWKUH 8fEjWnYLfYgbPh2oHv0tpn/VCf107c85wnga2t9S+Uo39xWGZHv1VY0n+RKf6+q24l8B fpdolIoxTaWP8s/lLYjROT5adGXd09x+opBFd4qHUgIbWk4l1ywAkiMAi/KB/bkNVIu3 Qn3FDrI2/MRxNw4WSTILxpD5yHL1anx/kpLHi1z9LmxkPBIoS+jXuO4y0oa9tB542Pax XX0A== 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=XNEElzRpeVV8r6SPzsaAXc9nyqLVWFu8pvvM7YDquJg=; b=nTDZv5C92jea+P01WIw3J77UTpz6/CoACnjFlW3OrOzTnxokUWXlzPMeiY39HF+VKn JFRPXmLgTBwyz6jt9VkRFw80u0D32ld0k+5wsbo0SLZ87KqFaDh1SRqhA/oOxjO5istw huSIi8pkBxZuzp4SMa+4ehXZ6o95z44BKtOtk0k3BAm5WLVicrWcct2JbctWR8eQ0P8R O9SWdTcBlLgPseN7N6wC0qxrpBbt8EpF5sh2wuMx/jTwHvKTIMr9tDGI3Z+UDy5lHtu+ tHLf6s9ViCF+P+AhAH2IPR11JDFxli3pJcpEkfcfhz7+rEkzUwciUxsr0/lylUN/utq7 KLRg== X-Gm-Message-State: APjAAAWXXG0OYyHjpsN2kqDvmuoqUcu4fsHgjnShzo3qiFZ5SHT3ifq9 eBkxz3/aJppYenXIPj/8PCfkwNVb X-Google-Smtp-Source: APXvYqxiS7dCAB6NEhn5uTnTXit2i8vxnXt/KvWgoPOgYYam790706whPWKci6c6gcO1gF+ItY2p3w== X-Received: by 2002:a37:8b85:: with SMTP id n127mr33692858qkd.353.1575992897563; Tue, 10 Dec 2019 07:48:17 -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 m29sm1247848qtf.1.2019.12.10.07.48.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 07:48:16 -0800 (PST) From: Nick Rosbrook To: xen-devel@lists.xenproject.org Date: Tue, 10 Dec 2019 10:47:37 -0500 Message-Id: <76e35746cd42c7aba992cc767f7afe3b1041c6f8.1575990937.git.rosbrookn@ainfosec.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 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 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 1c431fa4e5..38d2ba8aa8 100644 --- a/tools/golang/xenlight/xenlight.go +++ b/tools/golang/xenlight/xenlight.go @@ -503,17 +503,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 }