From patchwork Wed Apr 13 09:15:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olaf Hering X-Patchwork-Id: 8819861 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B4127C0553 for ; Wed, 13 Apr 2016 09:18:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 959192013A for ; Wed, 13 Apr 2016 09:18:15 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F217320270 for ; Wed, 13 Apr 2016 09:18:13 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqGuR-0006Sv-St; Wed, 13 Apr 2016 09:16:27 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqGuQ-0006SY-Hm for xen-devel@lists.xen.org; Wed, 13 Apr 2016 09:16:26 +0000 Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id 3B/E9-04050-96E0E075; Wed, 13 Apr 2016 09:16:25 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRWlGSWpSXmKPExsUSuHLSIt0MPr5 wg3ezLC2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oxd25YyFxzlr9jUFd7AeIuni5GLg0VgMbPE 7In3WbsYOTkkBHIldi5uYexi5ACyRSSe/E8DqRESOM0k8eEFRI2QQLpEz+4L7CA2m4CSxN6Dx xlBbBEBE4lXPw+CxZkFHCSe9axgApkjLBAocX52JUiYRUBVYuafo2BhXgE7iV8NNRBb5SQuT3 /ABmJzCthLzFz5jwViU5HEhx+HmEFsXgFBiZMzn7BATJeXaN46m3kCo8AsJKlZSFILGJlWMao XpxaVpRbpGuklFWWmZ5TkJmbm6BoaGOvlphYXJ6an5iQmFesl5+duYgSGXz0DA+MOxlPNzocY JTmYlER5p/ziDRfiS8pPqcxILM6ILyrNSS0+xCjDwaEkwevGyxcuJFiUmp5akZaZA4wEmLQEB 4+SCG8YSJq3uCAxtzgzHSJ1ilFRSpzXAiQhAJLIKM2Da4NF3yVGWSlhXkYGBgYhnoLUotzMEl T5V4ziHIxKwrwRIFN4MvNK4Ka/AlrMBLS47B0vyOKSRISUVAOjb/vBogXzRGdMvXlJ2+Fx+3G /lQuvetxk61RSyfJVXW9l8jDw5oSkvIk7OoJcE3d5fYtZyGnaI525RGPXwvYfJ2UyVqpaFL51 2VS7bv/j12/DcvSXZ6ZOdxcoP3dz6o62GfeqPlZ7XDY+NL08yO/Pr9z3z3yCCxyWtFdOkOqfe zdP4u7qMwanlFiKMxINtZiLihMB4B+kmLkCAAA= X-Env-Sender: olaf@aepfle.de X-Msg-Ref: server-13.tower-31.messagelabs.com!1460538984!33967127!1 X-Originating-IP: [81.169.146.162] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: QmFkIElQOiA4MS4xNjkuMTQ2LjE2MiA9PiA1ODg3NDY=\n,sa_preprocessor: QmFkIElQOiA4MS4xNjkuMTQ2LjE2MiA9PiA1ODg3NDY=\n X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10880 invoked from network); 13 Apr 2016 09:16:24 -0000 Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (81.169.146.162) by server-13.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 13 Apr 2016 09:16:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1460538984; l=1925; s=domk; d=aepfle.de; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Date: Subject:Cc:To:From; bh=LFnTKltQEDsPFVhD45GcBWKbN7Z686pW7Sj71dY7eAM=; b=xgJD0D8SVLHbpDHIbl+eA77JZ8dxSPgCTaKa7ONiA7nCSsu8mFYuIRICZw5soYuVoPe ZizqZI588nPDxVhEB/jY9D+ez8QkwDFw7JxZoJEwSwF+ayESqzUmDeqB/xSX8WhQ6hx9H U6mPrZjwKCbRJ4sIPhQDQvPCygI1PhEpQTU= X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+yackYocTD1iAi8x+OWi/zfN1cLnDYUgpTlWBkNW9Bx8xXwfuBtpmvNujsrm6sfmqf16ArQ== X-RZG-CLASS-ID: mo00 Received: from probook ([2001:a62:1211:7eff:9897:cf60:7e77:7275]) by smtp.strato.de (RZmta 37.23 AUTH) with ESMTPSA id z04d95s3D9GD65O (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Wed, 13 Apr 2016 11:16:13 +0200 (CEST) Received: by probook (Postfix, from userid 1000) id CE8D95093F; Wed, 13 Apr 2016 11:16:12 +0200 (CEST) From: Olaf Hering To: libvir-list@redhat.com, xen-devel@lists.xen.org Date: Wed, 13 Apr 2016 09:15:58 +0000 Message-Id: <1460538959-23584-2-git-send-email-olaf@aepfle.de> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1460538959-23584-1-git-send-email-olaf@aepfle.de> References: <1460537820-15398-1-git-send-email-olaf@aepfle.de> <1460538959-23584-1-git-send-email-olaf@aepfle.de> MIME-Version: 1.0 Cc: Olaf Hering , Jim Fehlig Subject: [Xen-devel] [PATCH libvirt v2 1/2] libxl: include a XLU_Config in _libxlDriverConfig X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Upcoming changes for vscsi will use libxlutil.so to prepare the configuration for libxl. The helpers needs a xlu struct for logging. Provide one and reuse the existing output as log target. Signed-off-by: Olaf Hering Cc: Jim Fehlig --- src/libxl/libxl_conf.c | 7 +++++++ src/libxl/libxl_conf.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index d16280d..f5ef50f 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -93,6 +93,7 @@ libxlDriverConfigDispose(void *obj) virObjectUnref(cfg->caps); libxl_ctx_free(cfg->ctx); xtl_logger_destroy(cfg->logger); + xlu_cfg_destroy(cfg->xlu); if (cfg->logger_file) VIR_FORCE_FCLOSE(cfg->logger_file); @@ -1738,6 +1739,12 @@ libxlDriverConfigNew(void) goto error; } + cfg->xlu = xlu_cfg_init(cfg->logger_file, "libvirt"); + if (!cfg->xlu) { + VIR_ERROR(_("cannot create xlu for libxenlight, disabling driver")); + goto error; + } + if (libxl_ctx_alloc(&cfg->ctx, LIBXL_VERSION, 0, cfg->logger)) { VIR_ERROR(_("cannot initialize libxenlight context, probably not " "running in a Xen Dom0, disabling driver")); diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h index 3c0eafb..b069e45 100644 --- a/src/libxl/libxl_conf.h +++ b/src/libxl/libxl_conf.h @@ -27,6 +27,12 @@ # define LIBXL_CONF_H # include +# ifdef HAVE_LIBXLUTIL_H +# include +# else +typedef struct XLU_Config XLU_Config; +XLU_Config *xlu_cfg_init(FILE *report, const char *report_filename); +# endif # include "internal.h" # include "libvirt_internal.h" @@ -96,6 +102,7 @@ struct _libxlDriverConfig { /* log stream for driver-wide libxl ctx */ FILE *logger_file; xentoollog_logger *logger; + XLU_Config *xlu; /* libxl ctx for driver wide ops; getVersion, getNodeInfo, ... */ libxl_ctx *ctx;