From patchwork Tue Dec 10 15:47:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Rosbrook X-Patchwork-Id: 11282861 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 A17A314BD for ; Tue, 10 Dec 2019 15:48:51 +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 7D3B02077B for ; Tue, 10 Dec 2019 15:48:51 +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="dYMpIxMB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D3B02077B 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 1iehjr-0002qV-RA; Tue, 10 Dec 2019 15:47: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 1iehjq-0002qP-Rh for xen-devel@lists.xenproject.org; Tue, 10 Dec 2019 15:47:50 +0000 X-Inumbo-ID: 6b6c715a-1b64-11ea-88e7-bc764e2007e4 Received: from mail-qk1-x741.google.com (unknown [2607:f8b0:4864:20::741]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 6b6c715a-1b64-11ea-88e7-bc764e2007e4; Tue, 10 Dec 2019 15:47:50 +0000 (UTC) Received: by mail-qk1-x741.google.com with SMTP id l124so4839042qkf.8 for ; Tue, 10 Dec 2019 07:47:50 -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:mime-version :content-transfer-encoding; bh=pWQY94SlKd279kFoDYFFayqdH1S0YXpkUwx3GmlVcMY=; b=dYMpIxMBngerX3cZYXfelR8NW7pymNSzDWCBvhSJjHNflLAF3EZjjdqocEYnnl140b CRxU0yUb0WOOSI4uOdzrjrVCYbjRZKRg9HXgq9g8PTmfM86Ds1/BtIljQw8HwHvO/9xe zmWIamyOHktxB7TYg2nlFP5SYsOKItI/yz8rKkgA7UaEkuewPzpigGor6hXYvVmlvnfb +ofTs+FYk0Q9nt1Ei+dvK+QhdyFCnL1g2c5iVpVY5HRaeRi9OLS9ElirqDwLZ0I2qytf IGkCWZI2xEElUyWCCLj91vQvbuKh/roF5bQORrIXY3e0mbIa31ljy4UB7TM6+Ee1kGmU 9fqQ== 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:mime-version :content-transfer-encoding; bh=pWQY94SlKd279kFoDYFFayqdH1S0YXpkUwx3GmlVcMY=; b=JOwwWZyDPFnNMwPzwdSSJJZd1zs2ti6MmJu/qpNDj4Q6ORGx5afgzygGyHoO/mwKal KSNxlscczG1NcF3jX2bCHX0fNLaHZEdAeYs5h+QGmDl0VonUIbT3TtezGkoCmfAz/V7U Y42RIi8aeCqc7sq8Gnhtt0sIK0/U0dp4ZaiKn+pfflhESbajn4+qI9nC1Eyv3QqoKDFg Ox0M+WW9I1Bt8Kh84Cp5zo1ijEOuxtZJn5GcOaoekeHSfSyWRn4pEoaujHd/49X8QY71 iUf3skszDPjcleMErTxT1PQIvof41+/j3MW+fQfdrSPiBv5R0vc6/HqCL3JF5kPFKH0j PxaA== X-Gm-Message-State: APjAAAWI457JuUlMds9MWcor8xs25jPIBvyais+teekW/7UzyKClozYW g6egfV3TRzwVqsfOFcYf7fKQobf9 X-Google-Smtp-Source: APXvYqw3i0pjR8GOA5Sh/RN7NFsgklpnE4/80GLeP8f/+vFGHe1pAAg1D3QxjkLSVupGEHjNVbvqQA== X-Received: by 2002:a05:620a:3cf:: with SMTP id r15mr33644612qkm.12.1575992869317; Tue, 10 Dec 2019 07:47:49 -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.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 07:47:48 -0800 (PST) From: Nick Rosbrook To: xen-devel@lists.xenproject.org Date: Tue, 10 Dec 2019 10:47:15 -0500 Message-Id: X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 00/22] generated Go libxl bindings using IDL 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 After Xen summit, we started the discussion in this[1] RFC thread to figure out how to generate Go bindings for libxl. This series implements that Go code generation using the existing IDL, and updates the existing hand-written code in xenlight.go to use the generated code. The goal of this series is to provide a good foundation for continued development of the Go package. The v1 series can be found on my GitHub branch[2]. Changes in v2: - GitHub branch for v2 [3]. - Drop patch 01/24 from v1 since was committed as a bug fix for 4.13. - The Makefile changes in 24/24 from v1 have been moved to the patches where the build changes are introduced. Changes in v3: - GitHub branch for v3 [4]. - Simplify a pattern for iterating over builtin types in their fromC functions. - Try not to duplicate as much code in gengotypes.py, and use consistent style in generated code when calling fromC. [1] https://lists.xenproject.org/archives/html/xen-devel/2019-07/msg02259.html [2] https://github.com/enr0n/xen/tree/golang-patches-v1 [3] https://github.com/enr0n/xen/tree/golang-patches-v2 [4] https://github.com/enr0n/xen/tree/golang-patches-v3 Nick Rosbrook (22): golang/xenlight: generate enum types from IDL golang/xenlight: define Defbool builtin type golang/xenlight: define Devid type as int golang/xenlight: define KeyValueList as empty struct golang/xenlight: re-name Bitmap marshaling functions golang/xenlight: define StringList builtin type golang/xenlight: define Mac builtin type golang/xenlight: define MsVmGenid builtin type golang/xenlight: define EvLink builtin as empty struct golang/xenlight: define CpuidPolicyList builtin type golang/xenlight: re-factor Uuid type implementation golang/xenlight: re-factor Hwcap type implementation golang/xenlight: generate structs from the IDL golang/xenlight: remove no-longer used type MemKB golang/xenlight: begin C to Go type marshaling golang/xenlight: implement keyed union C to Go marshaling golang/xenlight: implement array C to Go marshaling golang/xenlight: begin Go to C type marshaling golang/xenlight: implement keyed union Go to C marshaling golang/xenlight: implement array Go to C marshaling golang/xenlight: revise use of Context type golang/xenlight: add error return type to Context.Cpupoolinfo tools/golang/xenlight/Makefile | 20 +- tools/golang/xenlight/gengotypes.py | 677 ++++++ tools/golang/xenlight/helpers.gen.go | 3246 ++++++++++++++++++++++++++ tools/golang/xenlight/types.gen.go | 1224 ++++++++++ tools/golang/xenlight/xenlight.go | 901 +++---- 5 files changed, 5531 insertions(+), 537 deletions(-) create mode 100644 tools/golang/xenlight/gengotypes.py create mode 100644 tools/golang/xenlight/helpers.gen.go create mode 100644 tools/golang/xenlight/types.gen.go