From nobody Fri Apr 19 06:02:16 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.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; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1561623041; cv=none; d=zoho.com; s=zohoarc; b=IzXdd5OvCABNZOMImYbGZpkp2ANTCC61UAOtnvz+hiXZnr43keQxLrTOfeSv5uwPk6U/lZMZHdnqVYx/4J0aI7dOUXrSm1LT+oej57nNK7nq6MEHVKySI1kbYRB3x83MEJhdx0oQV3XJypjUmXBo3Cze2kzNncYscpKbgZFioRw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561623041; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=zuTgk9vRbQn1fPUoX7TuY+mxmerSxXzr6Fkt//TXKiE=; b=E78FYv0KtjZ+Nno0wXlr1Qw0fmOqfRo4NdRqwXjE3Mj7e3XcPtE4AVq/VSja4VJSlZReVcxkoCx9sbuFKFoh0RVG0qpMFl7dmhGi0SMWBfq8JsW6sx+ScAtM57+LgYaqjblNP1GKF3fRG5jaXaQ3rrkCYJh34adJkgHLgE82uFM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1561623041235104.21601697692063; Thu, 27 Jun 2019 01:10:41 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hgPTG-00023V-P3; Thu, 27 Jun 2019 08:09:30 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hgPTF-00022l-FP for xen-devel@lists.xenproject.org; Thu, 27 Jun 2019 08:09:29 +0000 Received: from gandi.net (unknown [2001:4b98:dc4:5:ae1f:6bff:fe2d:9fdc]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id e1cd6527-98b2-11e9-8980-bc764e045a96; Thu, 27 Jun 2019 08:09:27 +0000 (UTC) Received: from diconico07.dev (unknown [IPv6:2001:4b98:beef:a:e7c:1fb4:ff55:f4a9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by gandi.net (Postfix) with ESMTPSA id A57331602F2; Thu, 27 Jun 2019 08:09:26 +0000 (UTC) X-Inumbo-ID: e1cd6527-98b2-11e9-8980-bc764e045a96 From: Nicolas Belouin To: xen-devel@lists.xenproject.org Date: Thu, 27 Jun 2019 09:58:35 +0200 Message-Id: <20190627075834.14469-1-nicolas.belouin@gandi.net> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] golang/xenlight: Fix type issues with recent Go version 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: Ian Jackson , Nicolas Belouin , 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" Go is doing more type check (even when using CGo), so these incorrect use of `unsafe.Pointer` as well as the lack of `unsafe.Pointer` for these calls no longer compile with recent Go versions. This does *not* break compatibility with older Go version. --- tools/golang/xenlight/xenlight.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/golang/xenlight/xenlight.go b/tools/golang/xenlight/xenl= ight.go index 53534d047e..e281328d43 100644 --- a/tools/golang/xenlight/xenlight.go +++ b/tools/golang/xenlight/xenlight.go @@ -854,7 +854,7 @@ func (Ctx *Context) Open() (err error) { } =20 ret :=3D C.libxl_ctx_alloc(&Ctx.ctx, C.LIBXL_VERSION, - 0, unsafe.Pointer(Ctx.logger)) + 0, (*C.struct_xentoollog_logger)(unsafe.Pointer(Ctx.logger))) =20 if ret !=3D 0 { err =3D Error(-ret) @@ -869,7 +869,7 @@ func (Ctx *Context) Close() (err error) { if ret !=3D 0 { err =3D Error(-ret) } - C.xtl_logger_destroy(unsafe.Pointer(Ctx.logger)) + C.xtl_logger_destroy((*C.struct_xentoollog_logger)(unsafe.Pointer(Ctx.log= ger))) return } =20 @@ -1170,7 +1170,7 @@ func (Ctx *Context) ConsoleGetTty(id Domid, consNum i= nt, conType ConsoleType) (p err =3D Error(-ret) return } - defer C.free(cpath) + defer C.free(unsafe.Pointer(cpath)) =20 path =3D C.GoString(cpath) return @@ -1190,7 +1190,7 @@ func (Ctx *Context) PrimaryConsoleGetTty(domid uint32= ) (path string, err error) err =3D Error(-ret) return } - defer C.free(cpath) + defer C.free(unsafe.Pointer(cpath)) =20 path =3D C.GoString(cpath) return --=20 2.22.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel