From nobody Fri Dec 19 19:14:19 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1601038654; cv=none; d=zohomail.com; s=zohoarc; b=PKU1AGOSIo6CfmDQnZsTC7E0/CbSqm/ifaBPtO/6PUaegyZ+l7fcDTjLq5Gcn9gFPiD9AK9ONmiDMDoFVaL/MIPJgl4k+0sCQUxXKvAWmJ1iC8OOLIdSqBmH3uSjeDnuc3Vk93N9cKveV5FKqBUxeLWbtM4/I9lJthNpKG7GPxo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601038654; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DYHqy58UJZR46wXpvs59hJagcJIqgUuvxLRDNUapKkI=; b=hZVeyi/F1JOCSRT3u37HuknjLff+cZUhuj6xb6nK1hO0eIqXt3po1mo887C2vAsXqbbmrpKyyHDY7NBHXZldOkOEpKmIvXKrTdYmVx3d5iits/5oUkIOoK5szQ6Y2Ak+7AaqSrMVkD+fUD7BGpuss7Oz9vYBn6aZlExGIlJviZA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1601038654512571.5104935616994; Fri, 25 Sep 2020 05:57:34 -0700 (PDT) Received: from localhost ([::1]:53496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLnI5-00070L-5t for importer@patchew.org; Fri, 25 Sep 2020 08:57:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLnCs-0007o4-Cs for qemu-devel@nongnu.org; Fri, 25 Sep 2020 08:52:10 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:39623) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kLnCq-0001Ql-8P for qemu-devel@nongnu.org; Fri, 25 Sep 2020 08:52:10 -0400 Received: by mail-wm1-x343.google.com with SMTP id b79so3165742wmb.4 for ; Fri, 25 Sep 2020 05:52:07 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id m12sm2708543wml.38.2020.09.25.05.51.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 05:52:00 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 173971FF98; Fri, 25 Sep 2020 13:51:49 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DYHqy58UJZR46wXpvs59hJagcJIqgUuvxLRDNUapKkI=; b=PLLxusxhPFqPGcofHMPBU7+IrVX7cQrLqgbuFwawPTVl20xOtV1nU3phv+B+iZ4AHa g6keJCPtstcNtkR9uvaZR6JJFaC+CjknldAUPdPCKsKEqqQdWg7LQ/K64hl5HabyR+I2 XSZC8zZAAoQbmjDZS9YNLV94KZuLi3xRHX0VLG/Fck6PAhVxCTdnu5nWkj+h3JthSgFt /DM5h3kfoW2vgHw+PVqreYUPDkb5qTvo2xXHv7fcmFtCsNdZ/1Wv5+Bqip7AwK31O8Vt TwzJnYZQXcWYdG2MOygKPCTZz2aVxUEYC/IWxxydBRUNyRiC7pnfkoDkJoL/Yb8CwfVz LUDw== 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=DYHqy58UJZR46wXpvs59hJagcJIqgUuvxLRDNUapKkI=; b=qauUn9YTiIZ29QaG9zlffh9DQEymYDQXh5lXJbjJFnEZ25SE5F+2XKDoMFo8rMA9nj xDN5TmbEdmn34c8yJaUK7AsBM53xX2llnqHlkHZK+dN5oRblrprgpBexm+QcWYSd2367 WmYPk7EfKLGqkt69lD2h3lNQKV2aQe/s0HQJ7izseufxSUulVJGItfgjbjlKh/yyV+ra 3ktswvQkZZaC1WZI2limO8TXtCW/fLvVCNIkGe7K67n7giE3rJgPDVK3q8TlwAIsxQQP RZvKGjs2hx1WVVraK758DwyUbLDDqaRcd0bea2AOE6Lzd6EzjIo6/dhSH6+6eko7kqsq jrkw== X-Gm-Message-State: AOAM533VbynN63xu/oKej6wX15RxLYT7HHBqItYw0pRsPHEVxrwZduBg sK83FWepZM5jL+TvZWzI6MeaYw== X-Google-Smtp-Source: ABdhPJzzqmM6H2FagwjjJuJz8oyzXp/4kjhdAn5abuNmGND89rNn/daHMZEIYFS4dnMv23kcecepaA== X-Received: by 2002:a1c:4455:: with SMTP id r82mr2957959wma.60.1601038326726; Fri, 25 Sep 2020 05:52:06 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, maxim.uvarov@linaro.org, joakim.bech@linaro.org, ilias.apalodimas@linaro.org, tomas.winkler@intel.com, yang.huang@intel.com, bing.zhu@intel.com, Matti.Moell@opensynergy.com, hmo@opensynergy.com Subject: [RFC PATCH 09/19] tools/vhost-user-rpmb: add a --verbose/debug flags for logging Date: Fri, 25 Sep 2020 13:51:37 +0100 Message-Id: <20200925125147.26943-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200925125147.26943-1-alex.bennee@linaro.org> References: <20200925125147.26943-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jean-philippe@linaro.org, takahiro.akashi@linaro.org, virtualization@lists.linuxfoundation.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , arnd@linaro.org, stratos-dev@op-lists.linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This gives us two levels of informational output when tracing what the daemon is doing. Signed-off-by: Alex Benn=C3=A9e --- tools/vhost-user-rpmb/main.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/vhost-user-rpmb/main.c b/tools/vhost-user-rpmb/main.c index 269c86cbb633..1be0d4b8a567 100644 --- a/tools/vhost-user-rpmb/main.c +++ b/tools/vhost-user-rpmb/main.c @@ -6,6 +6,9 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ =20 +#define G_LOG_DOMAIN "vhost-user-rpmb" +#define G_LOG_USE_STRUCTURED 1 + #include #include #include @@ -25,12 +28,16 @@ static gchar *socket_path; static gint socket_fd =3D -1; static gboolean print_cap; +static gboolean verbose; +static gboolean debug; =20 static GOptionEntry options[] =3D { { "socket-path", 0, 0, G_OPTION_ARG_FILENAME, &socket_path, "Location = of vhost-user Unix domain socket, incompatible with --fd", "PATH" }, { "fd", 0, 0, G_OPTION_ARG_INT, &socket_fd, "Specify the file-descript= or of the backend, incompatible with --socket-path", "FD" }, { "print-capabilities", 0, 0, G_OPTION_ARG_NONE, &print_cap, "Output t= o stdout the backend capabilities in JSON format and exit", NULL}, + { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be more verbose in = output", NULL}, + { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, "Include debug output", NU= LL}, { NULL } }; =20 @@ -84,6 +91,7 @@ static void vrpmb_panic(VuDev *dev, const char *msg) =20 static uint64_t vrpmb_get_features(VuDev *dev) { + g_info("%s: replying", __func__); return 0; } =20 @@ -209,6 +217,17 @@ int main (int argc, char *argv[]) exit(EXIT_FAILURE); } =20 + if (verbose || debug) { + g_log_set_handler(NULL, G_LOG_LEVEL_MASK, g_log_default_handler, N= ULL); + if (debug) { + g_setenv("G_MESSAGES_DEBUG", "all", true); + } + } else { + g_log_set_handler(NULL, + G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL | G_L= OG_LEVEL_ERROR, + g_log_default_handler, NULL); + } + /* * Now create a vhost-user socket that we will receive messages * on. Once we have our handler set up we can enter the glib main --=20 2.20.1