From patchwork Fri Nov 15 19:44: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: 11247015 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 4A6C41393 for ; Fri, 15 Nov 2019 19:46:14 +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 26C582073A for ; Fri, 15 Nov 2019 19:46:14 +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="UrvxpE+p" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26C582073A 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 1iVhWe-0001F4-G6; Fri, 15 Nov 2019 19:45:00 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iVhWd-0001EI-Ep for xen-devel@lists.xenproject.org; Fri, 15 Nov 2019 19:44:59 +0000 X-Inumbo-ID: 68120fac-07e0-11ea-b678-bc764e2007e4 Received: from mail-qt1-x832.google.com (unknown [2607:f8b0:4864:20::832]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 68120fac-07e0-11ea-b678-bc764e2007e4; Fri, 15 Nov 2019 19:44:58 +0000 (UTC) Received: by mail-qt1-x832.google.com with SMTP id o3so12010586qtj.8 for ; Fri, 15 Nov 2019 11:44:58 -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=H0GThlBVCX7zZEsO+PwEo+2sXbUNMNKzCdZVo2LBwSA=; b=UrvxpE+pcppWqFaP4AvXVHJsBz7ZmTpbu1y5Xcl/Pzz2XpHtRnPi5N/lVpqcR3Y8OH dmvkZeVnG6jYhtqoOf9lP59ghMX6xUdgQvt7cjynWYZJEVEjcDTrfUwuchysaFoz0+qI zFMGGvZEEzueHCrBxNokyQbYT8HfrdRAyn1PgPlTxL96o8AeOkfYbNbk4CWkr1cs88Em /iiYmbZHdyZyUdFeSSMBRRRgrcLafpe/m9oascIKj6t9CrThAdEjwYgoJjYkirCb63Ts z8QQqJaDVLw2MokygXxv57UBpj5x/K0PpA6UI9JEY1Lvsf72fNNsfZ4JWwmK4LlEeBcX HA0A== 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=H0GThlBVCX7zZEsO+PwEo+2sXbUNMNKzCdZVo2LBwSA=; b=skdvxZapsIfl2LJyZgE85difrmcx2KBNZj0Nu6Zq1aDQXwi5TnLfliU7I0syVocJyM 33E+jonFr2lovm5ZxWPUWuQf6ns7Rbm8bHUjmoye+dglBTXK4Zh4o7omVOLISXcRmhVQ OdwYEfPdq7nFLTMkUHJKGLLfyKvgz2itQ4q++gVd3SV83XlirhDdeQtlpisjDfpGKg3q nojVoH/SMM/ZwtO8SmSdHGL/rB9m8FLnmnYAsSKn/WgUCEA5q6ZtB8ChM9yO7Fm9zeED l8pjuYRuNDBvbWpzTMfgmTAkIgwJTvz49/UxYLwOrjqW9HaUuPTvRD3Mx4Deg6xCwO+g /iBA== X-Gm-Message-State: APjAAAXGKV/6I3wLzOghCBpXtDD6FIFFEWNdUivdQJDVOsljrg9ILph4 lQsHgAdUgCQQIfq2qhF0xPtTJfia X-Google-Smtp-Source: APXvYqzSHeQJ3ziLCV/+16n6OAYA/1DxNubH9wIu3zrSO5JA2AG90gIXs/k6OtT1U7y/4bIsHq3XFQ== X-Received: by 2002:aed:3f63:: with SMTP id q32mr16177893qtf.340.1573847098033; Fri, 15 Nov 2019 11:44:58 -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.44.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 11:44:57 -0800 (PST) From: Nick Rosbrook To: xen-devel@lists.xenproject.org Date: Fri, 15 Nov 2019 14:44:07 -0500 Message-Id: X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 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. [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 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 | 719 ++++++ tools/golang/xenlight/helpers.gen.go | 3408 ++++++++++++++++++++++++++ tools/golang/xenlight/types.gen.go | 1224 +++++++++ tools/golang/xenlight/xenlight.go | 909 +++---- 5 files changed, 5744 insertions(+), 536 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