From nobody Sun Feb 8 17:03:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1522041435636268.8852566536656; Sun, 25 Mar 2018 22:17:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EE4A73DE42; Mon, 26 Mar 2018 05:17:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 352535C890; Mon, 26 Mar 2018 05:17:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A81ED4CA9A; Mon, 26 Mar 2018 05:17:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2Q5H8NP027617 for ; Mon, 26 Mar 2018 01:17:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5D8B5200BC7C; Mon, 26 Mar 2018 05:17:08 +0000 (UTC) Received: from localhost.localdomain (ovpn-204-33.brq.redhat.com [10.40.204.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id E50CA2026E04 for ; Mon, 26 Mar 2018 05:17:07 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 26 Mar 2018 07:16:42 +0200 Message-Id: <5efab8fb32e7e0e68ea0f9cf46c414d795392ee7.1522041162.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/5] virlog: Don't log devmapper X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 26 Mar 2018 05:17:14 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Unless overridden, libdevmapper logs all messages to stderr. Therefore if something goes wrong in storage_backend_mpath.c or parthelper.c we don't honour user set logging targets. Signed-off-by: Michal Privoznik --- src/util/virlog.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/util/virlog.c b/src/util/virlog.c index dd927f0ba7..51f2d341db 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -40,6 +40,9 @@ #if HAVE_SYS_UN_H # include #endif +#if WITH_DEVMAPPER +# include +#endif =20 #include "virerror.h" #include "virlog.h" @@ -258,6 +261,20 @@ virLogPriorityString(virLogPriority lvl) } =20 =20 +#ifdef WITH_DEVMAPPER +static void +virLogDM(int level ATTRIBUTE_UNUSED, + const char *file ATTRIBUTE_UNUSED, + int line ATTRIBUTE_UNUSED, + int dm_errno ATTRIBUTE_UNUSED, + const char *fmt ATTRIBUTE_UNUSED, + ...) +{ + return; +} +#endif + + static int virLogOnceInit(void) { @@ -289,6 +306,12 @@ virLogOnceInit(void) NUL_TERMINATE(virLogHostname); } =20 +#ifdef WITH_DEVMAPPER + /* Ideally, we would not need this. But libdevmapper prints + * error messages to stderr by default. Sad but true. */ + dm_log_with_errno_init(virLogDM); +#endif + virLogUnlock(); return 0; } --=20 2.16.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list