From patchwork Thu Apr 18 01:52:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "dpsmith.dev" X-Patchwork-Id: 10906433 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 245EF161F for ; Thu, 18 Apr 2019 01:54:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01BCC28797 for ; Thu, 18 Apr 2019 01:54:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E979628BD7; Thu, 18 Apr 2019 01:54:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3B5D828797 for ; Thu, 18 Apr 2019 01:54:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hGwDn-0001tF-0t; Thu, 18 Apr 2019 01:52:15 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hGwDm-0001tA-3b for xen-devel@lists.xenproject.org; Thu, 18 Apr 2019 01:52:14 +0000 X-Inumbo-ID: 95723b1e-617c-11e9-92d7-bc764e045a96 Received: from mail-qt1-x843.google.com (unknown [2607:f8b0:4864:20::843]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 95723b1e-617c-11e9-92d7-bc764e045a96; Thu, 18 Apr 2019 01:52:12 +0000 (UTC) Received: by mail-qt1-x843.google.com with SMTP id f13so192132qto.6 for ; Wed, 17 Apr 2019 18:52:12 -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; bh=ivI26akOyzNjxb/QZJE9El9S7eMR9ZQApKzypjYBa4Y=; b=Psn37fPswbl51YS7/4HLVAg/EzduT3uwpp/vrBcGa2RciSuyhorIhFgqKvmJuL2m1u u2vuWJzhP5xsXBXIvn10CfvEdVDJj5qzPMzl8GRIoILt/mRFILmEDK7e8P5euPZe3whD ahVxbfQZuUp6b6K4G2/potIO43rHN7IYyyG4KOPBHpkWfECI4vMpt1evixZQHp7wEz/T lTCCbq8ey2npLAjlPNWhXV+cc+Lgq3C9cN7q9y/ijiIBv1oQfDNE88ZHYiraLMyZ4WJx FdK5MJhK+DG0LmeAT7UTyUK6efQ7gVfmacCPEQtdiqg+8FT14BK0sQdTO0XsSyDn4h7e Zoig== 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; bh=ivI26akOyzNjxb/QZJE9El9S7eMR9ZQApKzypjYBa4Y=; b=bTyv0GM2xFn/klyqQnCOvYn0Dzy2Fkzewbmxz40rJNQPlWD+ofuLEIc0HTryDsT2gX tg9DBv5iWnEvizE+muAsx/1BXlHxIGJ7SVTQv+D/GakjE7qWE0sZ7MQVeUHj8o58dS3H ekr9x7Al6tjEdOq1LKGZW+qGOcvK78+pxUB8th/d2407zU74+2QslV7+2bWys6A+WF7n vunqzIWU+hALie9DBGc12rWP5H3srisroZBrD5NWbcXdXnID16oPUEBas4gKzMQo6sJS mOKgCRpkd7za4rUgNen3yhPeecNcV89q/rHwXHFPBlUpRFPcr3um10w0PaKr/4fOc7ZE rWXg== X-Gm-Message-State: APjAAAW7Q6eGwmC9Sn6OUfrkTT4z4b3Yecode4ZrXjEg2pk1lWMIA+Kd gn9DsryIMdP1YrY3RX4ge10cm4a+ X-Google-Smtp-Source: APXvYqzJtssLQ/w/NWyYAO397w71b+NcVMpFJGDy5L8da8OxgEGn94ZV4j5c0mdUg1wiyDrw6O5zaQ== X-Received: by 2002:a0c:b107:: with SMTP id q7mr76029715qvc.77.1555552331778; Wed, 17 Apr 2019 18:52:11 -0700 (PDT) Received: from localhost.localdomain (c-73-129-199-244.hsd1.md.comcast.net. [73.129.199.244]) by smtp.gmail.com with ESMTPSA id j93sm323892qtd.82.2019.04.17.18.52.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 18:52:11 -0700 (PDT) From: "Daniel P. Smith" X-Google-Original-From: "Daniel P. Smith" To: xen-devel@lists.xenproject.org Date: Wed, 17 Apr 2019 21:52:03 -0400 Message-Id: <20190418015203.1636-1-dpsmith@apertussolutions.com> X-Mailer: git-send-email 2.11.0 Subject: [Xen-devel] [PATCH] golang/xenlight: Fixing compilation for go 1.11 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: George Dunlap MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This deals with two casting issues for compiling under go 1.11: - explicitly cast to *C.xentoollog_logger for Ctx.logger pointer - add cast to unsafe.Pointer for the C string cpath Signed-off-by: Daniel P. Smith Reviewed-by: George Dunlap --- 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/xenlight.go index 9c37e59ec0..47bb27a0f9 100644 --- a/tools/golang/xenlight/xenlight.go +++ b/tools/golang/xenlight/xenlight.go @@ -854,7 +854,7 @@ func (Ctx *Context) Open() (err error) { } ret := C.libxl_ctx_alloc(&Ctx.ctx, C.LIBXL_VERSION, - 0, unsafe.Pointer(Ctx.logger)) + 0, (*C.xentoollog_logger)(unsafe.Pointer(Ctx.logger))) if ret != 0 { err = Error(-ret) @@ -869,7 +869,7 @@ func (Ctx *Context) Close() (err error) { if ret != 0 { err = Error(-ret) } - C.xtl_logger_destroy(unsafe.Pointer(Ctx.logger)) + C.xtl_logger_destroy((*C.xentoollog_logger)(unsafe.Pointer(Ctx.logger))) return } @@ -1170,7 +1170,7 @@ func (Ctx *Context) ConsoleGetTty(id Domid, consNum int, conType ConsoleType) (p err = Error(-ret) return } - defer C.free(cpath) + defer C.free(unsafe.Pointer(cpath)) path = C.GoString(cpath) return @@ -1190,7 +1190,7 @@ func (Ctx *Context) PrimaryConsoleGetTty(domid uint32) (path string, err error) err = Error(-ret) return } - defer C.free(cpath) + defer C.free(unsafe.Pointer(cpath)) path = C.GoString(cpath) return