From nobody Tue Feb 10 02:00:15 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1575992950; cv=none; d=zohomail.com; s=zohoarc; b=G92kl1831f5ALFdfL+Xz9CjdwM54Jxkd1W/BJqnkbYB8AXfdJRG5oEyjdGRwTMZjGGZhoozeX8GiL33oubuayQ9zeXxwbTHo97xdYTt74oxtmTK+uRCd9k/HvfcI3rBZlZIDM5u9xRC9a6VCdCUY+peKO/vlmH5fvlPuekjLqP4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575992950; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8IeViILQA2b04Yt+iHTCFx4kdMEgkQmKRurZfSGluwc=; b=nwxRJdhTHRcd39+UDx+JlUYOJArqgx0Xk/Gfn6UFjvyz9msRSi15HPaQM8mmD2JVd8PEa91Y6UJL5X/OlhhfbsHmkYksSc+0EalBggQn1cZ6SvJqKtAyPiKdDve9onFQ+AdlwP0H+c5O6Se+55aceY8il3cpnT7Ef1c+f+6hrEg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1575992950527598.7034618302425; Tue, 10 Dec 2019 07:49:10 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iehkg-0003GR-Db; Tue, 10 Dec 2019 15:48:42 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iehke-0003FW-SL for xen-devel@lists.xenproject.org; Tue, 10 Dec 2019 15:48:40 +0000 Received: from mail-qk1-x743.google.com (unknown [2607:f8b0:4864:20::743]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 72e21ea8-1b64-11ea-88e7-bc764e2007e4; Tue, 10 Dec 2019 15:48:02 +0000 (UTC) Received: by mail-qk1-x743.google.com with SMTP id d71so8822149qkc.0 for ; Tue, 10 Dec 2019 07:48:02 -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.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 07:48:00 -0800 (PST) X-Inumbo-ID: 72e21ea8-1b64-11ea-88e7-bc764e2007e4 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=Zeqavew/vY6f4t63gmA+rSSNtPJ2y+B2UxfgLhzHhUY=; b=EygbGrdkLsTEk84mPqLcTv0ZRFwnCJfn950cmfQS7JbKzUn/9cHW+fppSCNGF7xek0 Bb9gDYey8ithsZAYGYV55EeJQcipgmee+ugZGBP9jZvd3+6wv98oa7FPdS25EKHhi02e Uyeq0Jvt216T8Lsd3RM2XWf/QnI+14Ehu0lDfTndkG1obPM0SBtHQCGtVEIF8NPT/ary AqSVSQMjp5sl7t2fghySRJV++bgtJxyBYA/m6uBWDVt3Uth7+qQVZrw4RdWQG9AHrFrN 5SRlKp2028GvIrso/6mOqCY8CcTMNfkC16t/ZxE3DMxFv76rS51djEY2aFhN2wNw2VUN mHQw== 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=Zeqavew/vY6f4t63gmA+rSSNtPJ2y+B2UxfgLhzHhUY=; b=SjRndx2HH8hHOSJHoAP/LE+b+fBaLthYVfw6ykFYjJMdgGBOpWhrg5CmA2Pm8ZLD9o SOkf+NjQqCH5qd1tSOqIQEgXD0aLuMki5RmU7m92Cgr7yEclpL42UN0hH9YN/nb+Moyq D0KyR8TwMvCHXzHhg1IWX1jUei7y9Dwh0Q5e+hV93P/xXJy47OwCk0GDcKF3vZU1hrHz VwVqV5HGLGp2+dSEBGCkT6gz7GQgzKDMLZjQgjZwxstc8nZLaypBwrb46EU9Z1LFpUw/ 8XPeRodlkbkc6Rb3xAvluOpTtWzCOLSq3++LueBHu0qjPnuBMayYJ2mtDOQ1+lW6KQtj RBgw== X-Gm-Message-State: APjAAAU/wE2M0xg3NtpkYVnFHtrs/Sce6h2WSCFn6CerHu1ndUau7mje hmKVvO1fFqAqfVnvRlbnXjlnH9d8 X-Google-Smtp-Source: APXvYqwh9aTRRUDRv9wyWdtg/YUET9v/Hyw7FI8XTve/UavWp824/kDuEMYqZ+I6Uj7wSJRabYz+TA== X-Received: by 2002:a05:620a:12ab:: with SMTP id x11mr33769828qki.149.1575992881771; Tue, 10 Dec 2019 07:48:01 -0800 (PST) From: Nick Rosbrook To: xen-devel@lists.xenproject.org Date: Tue, 10 Dec 2019 10:47:25 -0500 Message-Id: <7e9e0c548291406c980e9496a7f09d081682d3c7.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 10/22] 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Nick Rosbrook Define CpuidPolicyList as a string so that libxl_cpuid_parse_config can be used in the toC function. For now, fromC is a no-op since libxl does not support a way to read a policy, modify it,and then give it back to libxl. Signed-off-by: Nick Rosbrook Reviewed-by: George Dunlap --- Changes in v2: - Re-define CpuidPolicyList as string. - Make fromC a no-op. - Use libxl_cpuid_parse_config in toC function. --- tools/golang/xenlight/xenlight.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tools/golang/xenlight/xenlight.go b/tools/golang/xenlight/xenl= ight.go index c1d9fe85fd..6b87bf857d 100644 --- a/tools/golang/xenlight/xenlight.go +++ b/tools/golang/xenlight/xenlight.go @@ -245,6 +245,31 @@ 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 } =20 +// CpuidPolicyList represents a libxl_cpuid_policy_list. +// +// The value of CpuidPolicyList is honored when used as input to libxl. If +// a struct contains a field of type CpuidPolicyList, that field will be l= eft +// empty when it is returned from libxl. +type CpuidPolicyList string + +func (cpl CpuidPolicyList) fromC(ccpl *C.libxl_cpuid_policy_list) error { = return nil } + +func (cpl CpuidPolicyList) toC() (C.libxl_cpuid_policy_list, error) { + var ccpl C.libxl_cpuid_policy_list + + s :=3D C.CString(string(cpl)) + defer C.free(unsafe.Pointer(s)) + + ret :=3D C.libxl_cpuid_parse_config(&ccpl, s) + if ret !=3D 0 { + C.libxl_cpuid_dispose(&ccpl) + + return ccpl, Error(-ret) + } + + return ccpl, nil +} + type Context struct { ctx *C.libxl_ctx logger *C.xentoollog_logger_stdiostream --=20 2.19.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel