From patchwork Mon Oct 7 15:12:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Rosbrook X-Patchwork-Id: 11177795 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 4AEBA13BD for ; Mon, 7 Oct 2019 15:15:29 +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 266892070B for ; Mon, 7 Oct 2019 15:15:29 +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="R3ikUzlO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 266892070B 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 1iHUiD-00075A-BT; Mon, 07 Oct 2019 15:14:13 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iHUiB-00074C-Nv for xen-devel@lists.xenproject.org; Mon, 07 Oct 2019 15:14:11 +0000 X-Inumbo-ID: 04896cb2-e915-11e9-9bee-bc764e2007e4 Received: from mail-qt1-x842.google.com (unknown [2607:f8b0:4864:20::842]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 04896cb2-e915-11e9-9bee-bc764e2007e4; Mon, 07 Oct 2019 15:13:29 +0000 (UTC) Received: by mail-qt1-x842.google.com with SMTP id u22so19591325qtq.13 for ; Mon, 07 Oct 2019 08:13:29 -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=cCZaglVTgcfWai9fgB2qXpyY4KTejoKlJVlB2MGtgNA=; b=R3ikUzlOnHnUwpPCc9S6M79b93ZhUErSjhNERWcuOhd2l33GpgIPJjL4bytWYnzrx8 lKOAVLJNqv0vVNW2tWAbbq1lJEKc4hOd5r427eX6GScevroOEFoPPf6Zy3PT+p3MfSQ5 nRiMUjzeqowf3OXXk+27ll4jllXEx0CCHlkcZXHwDDkxhnxSc/rOQwh7N3Byf/x/AVPd aV7htl32Q5xvN56UWvKO6w7wGCfk1WiFmK59qiNIagYKrpirtK3t9O+x5tAFI3IsOBfP +0RdD+oktvlwNuxzPqdJZfYhfE3y472rpKIyjbXj2jV77dRjvYiBgR6K8+IhFnI1DnuR rq6A== 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=cCZaglVTgcfWai9fgB2qXpyY4KTejoKlJVlB2MGtgNA=; b=RGFrfz7ddzSoLXa1SgCgI8bwMeJufvJ6UIJ1XHgcr5gmqxgHiBrnEsRD1muUYc+W/s O3lNunLXPoy9uJZh50dxYsHXoEuX3Zh0loWvV4yybjo79abrtf70fQRN9d26xNLyA+Kg p78RmT4cxxWG2vitjv5jV3CgpU/eDupdb7aZK3u8eTpmEqbO4MOGyrMSYpfwpu1LJ7xC VvduquJOdsMrhgqJ8hxWlOyUg51Fizc0/k22zMs2T4EZe0HJFvp8krCKQ4+V6PnKQYob WT0XYFYKRuwrQm48l7Zf8oVPWO64MAry0M6KElceevlW//HLlRzmAVxT2Q/FVPHeglR/ rctQ== X-Gm-Message-State: APjAAAU/75tY8ja3MC08o4B4MUkv2ot1DkHpkY4CNXIfwnFP1ipphgwP e6QSWHYB/K2nVXVzpPAet7Ci6GGh X-Google-Smtp-Source: APXvYqyNmbmKjZz4gIwyT7oZgrx4nUmjRTEBQh2m4z3pxVyMowjhft6MebAtY/vKVHOTTFHq5mMyPg== X-Received: by 2002:aed:32c6:: with SMTP id z64mr29400427qtd.202.1570461208556; Mon, 07 Oct 2019 08:13:28 -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.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2019 08:13:27 -0700 (PDT) From: Nick Rosbrook To: xen-devel@lists.xenproject.org Date: Mon, 7 Oct 2019 11:12:58 -0400 Message-Id: <5773984ae9308500183adde21cf25837bba39f7f.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 11/24] golang/xenlight: define CpuidPolicyList builtin type 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 Define CpuidPolicyList as a wrapper struct with field val of type *C.libxl_cpuid_policy_list and implement fromC and toC functions. Signed-off-by: Nick Rosbrook --- Cc: George Dunlap Cc: Ian Jackson Cc: Wei Liu tools/golang/xenlight/xenlight.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/golang/xenlight/xenlight.go b/tools/golang/xenlight/xenlight.go index d41de253f3..9c384485e1 100644 --- a/tools/golang/xenlight/xenlight.go +++ b/tools/golang/xenlight/xenlight.go @@ -249,6 +249,26 @@ type EvLink struct{} func (el *EvLink) fromC(cel *C.libxl_ev_link) error { return nil } func (el *EvLink) toC() (cel C.libxl_ev_link, err error) { return } +// CpuidPolicyList represents a libxl_cpuid_policy_list. +type CpuidPolicyList struct { + val *C.libxl_cpuid_policy_list +} + +func (cpl *CpuidPolicyList) fromC(ccpl *C.libxl_cpuid_policy_list) error { + cpl.val = ccpl + return nil +} + +func (cpl *CpuidPolicyList) toC() (C.libxl_cpuid_policy_list, error) { + if cpl.val == nil { + var c C.libxl_cpuid_policy_list + return c, nil + } + ccpl := (*C.libxl_cpuid_policy_list)(unsafe.Pointer(cpl.val)) + + return *ccpl, nil +} + type Context struct { ctx *C.libxl_ctx logger *C.xentoollog_logger_stdiostream