From nobody Mon Apr 29 01:38:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614698524; cv=none; d=zohomail.com; s=zohoarc; b=CdVBN/iX6zH00PBaWqq5/dSj8ijBbFkjvk+X1xOB+m+UtXx9EPBax0dgWKe1OyGb2zlfNWhig4lk8KnsTGie1/REysrSRwnsFFxFFKOHzqzickhfrgqeFhJYsWyF76XYpkmLmyFtMUlpbmkJJVg2kevOyWA4rK8n5CY/WqoN6fA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614698524; h=Content-Type:Content-Transfer-Encoding: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=FQevDKlQTeEs8v5fdfr6nVBB/KU4PJCalpLJHMUggZY=; b=lm4ODB6JvR6WrWwGdJDOc3gkfezGRj6dwwMbeiaLJfilQNGCWe757UkOhHnpyvgE7bLyssd9aHR/5OkeEIhmYJxoP8+UFd/242OdthA+bX9EgtgVE83rq1YL30ZjnYiPFbKvEnMR6sAbJlZ1mUrGnIIMb+uPaALi8ASwW+VLQbU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1614698524800906.6622022443082; Tue, 2 Mar 2021 07:22:04 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-354-M2TyQqzbMgGmhjRf2WR-Cw-1; Tue, 02 Mar 2021 10:22:00 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CC5CF80197C; Tue, 2 Mar 2021 15:21:54 +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 A7F9E5D9F1; Tue, 2 Mar 2021 15:21:54 +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 6D5844EBC6; Tue, 2 Mar 2021 15:21:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 122FLF9b017521 for ; Tue, 2 Mar 2021 10:21:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3AC70E144; Tue, 2 Mar 2021 15:21:15 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 98E5819C48 for ; Tue, 2 Mar 2021 15:21:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614698523; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=FQevDKlQTeEs8v5fdfr6nVBB/KU4PJCalpLJHMUggZY=; b=LywKJNHI6R9g6IDsOSIp2Xfd7w/mTWC3PMRf8/dXR/mP0JuSv6gBk8esLVwx8knzW5ZUsh 2morHx8X0eFixmwMi5HTpaeYfemUU3MzPlIpg2iRm/Tfuaewm9OmVtsBOdpvAskLELXPV4 egMunKXWvUcul+hIVMAjUJncQ6sqQgM= X-MC-Unique: M2TyQqzbMgGmhjRf2WR-Cw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/6] util: virerror: Don't use stack'd buffers in error report helpers Date: Tue, 2 Mar 2021 16:21:03 +0100 Message-Id: <1f043727fdd7e706ee8ef45b3d4bb76a46c30abe.1614698410.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This was (probably) a relict from times when we cared about OOM conditions and the possibility to report the error. Nowadays it doesn't make sense as virRaiseErrorFull will do an allocated copy of the strings and also concatenate the error message prefix with the detail which doesn't guarantee that the result will be less than 1024 chars. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/util/virerror.c | 47 +++++++++++++++++++-------------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/src/util/virerror.c b/src/util/virerror.c index a503cdefdc..b9a49ec70c 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -28,6 +28,7 @@ #include "virlog.h" #include "virthread.h" #include "virstring.h" +#include "virbuffer.h" #define LIBVIRT_VIRERRORPRIV_H_ALLOW #include "virerrorpriv.h" @@ -1285,23 +1286,23 @@ void virReportErrorHelper(int domcode, const char *fmt, ...) { int save_errno =3D errno; - va_list args; - char errorMessage[VIR_ERROR_MAX_LENGTH]; - const char *virerr; + g_autofree char *detail =3D NULL; + const char *errormsg; if (fmt) { + va_list args; + va_start(args, fmt); - g_vsnprintf(errorMessage, sizeof(errorMessage)-1, fmt, args); + detail =3D g_strdup_vprintf(fmt, args); va_end(args); - } else { - errorMessage[0] =3D '\0'; } - virerr =3D virErrorMsg(errorcode, (errorMessage[0] ? errorMessage : NU= LL)); + errormsg =3D virErrorMsg(errorcode, detail); + virRaiseErrorFull(filename, funcname, linenr, domcode, errorcode, VIR_ERR_ERROR, - virerr, errorMessage, NULL, - -1, -1, virerr, errorMessage); + errormsg, detail, NULL, + -1, -1, errormsg, detail); errno =3D save_errno; } @@ -1325,36 +1326,28 @@ void virReportSystemErrorFull(int domcode, const char *fmt, ...) { int save_errno =3D errno; - char msgDetailBuf[VIR_ERROR_MAX_LENGTH]; - - const char *errnoDetail =3D g_strerror(theerrno); - const char *msg =3D virErrorMsg(VIR_ERR_SYSTEM_ERROR, fmt); - const char *msgDetail =3D NULL; + virBuffer buf =3D VIR_BUFFER_INITIALIZER; + g_autofree char *detail =3D NULL; + const char *errormsg; if (fmt) { va_list args; - size_t len; - int n; va_start(args, fmt); - n =3D g_vsnprintf(msgDetailBuf, sizeof(msgDetailBuf), fmt, args); + virBufferVasprintf(&buf, fmt, args); va_end(args); - len =3D strlen(errnoDetail); - if (0 <=3D n && n + 2 + len < sizeof(msgDetailBuf)) { - strcpy(msgDetailBuf + n, ": "); - n +=3D 2; - strcpy(msgDetailBuf + n, errnoDetail); - msgDetail =3D msgDetailBuf; - } + virBufferAddLit(&buf, ": "); } - if (!msgDetail) - msgDetail =3D errnoDetail; + virBufferAdd(&buf, g_strerror(theerrno), -1); + + detail =3D virBufferContentAndReset(&buf); + errormsg =3D virErrorMsg(VIR_ERR_SYSTEM_ERROR, detail); virRaiseErrorFull(filename, funcname, linenr, domcode, VIR_ERR_SYSTEM_ERROR, VIR_ERR_ERROR, - msg, msgDetail, NULL, theerrno, -1, msg, msgDetail); + errormsg, detail, NULL, theerrno, -1, errormsg, deta= il); errno =3D save_errno; } --=20 2.29.2 From nobody Mon Apr 29 01:38:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614698506; cv=none; d=zohomail.com; s=zohoarc; b=mRaGLQtX1N5MaIfzeB9l7IpRMU755Opk+rgWZ7KeSaQsLH0QOYCZsfSFFlqR+9Xu7oHxS6q+I2mPBVpRLKcAJa+1fEVsNGUTnGOBMZ/EsBADC3ychIW7Q2bEJ8q/WRjfPE44BF9AusYcscnSU+NiF72AJv1Bnntxpid2fqpnf9Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614698506; h=Content-Type:Content-Transfer-Encoding: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=u4zq6m7XXpl2HKbvxIZABGkOU7npVkkLggLKGLF49Q8=; b=fOGgi6WTD+DML3XmAKtqGLR/Rcn8ypVScwa7KD6nGhtBn2ehXEg1a2e72joUeWzIwxJk80k4NNbp+Ut1/OIEMHeNNWreGLdgrj+ZD2mxDCS+vUUZwHCSSXoLnHlxkG+Pif2P3ltwsbf3JffkJ3onO1NCF9k0LxVCP0X8WVhzThY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1614698506636123.89875209229683; Tue, 2 Mar 2021 07:21:46 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-391-J2NbXVfsPB6vfO1nYvhEFA-1; Tue, 02 Mar 2021 10:21:43 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AACD8814307; Tue, 2 Mar 2021 15:21:35 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7F4E41A864; Tue, 2 Mar 2021 15:21:35 +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 47BF11809C8F; Tue, 2 Mar 2021 15:21:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 122FLGaE017534 for ; Tue, 2 Mar 2021 10:21:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 50784E144; Tue, 2 Mar 2021 15:21:16 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id A1DCD19C48 for ; Tue, 2 Mar 2021 15:21:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614698505; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=u4zq6m7XXpl2HKbvxIZABGkOU7npVkkLggLKGLF49Q8=; b=HnWx5Qu3UOmo2OKpRtLLjZLgqEQqZZjK9EZwUVSC1/WnAf/qwnGPfBtu9mkc5HBWpo+w91 dqq+CRgBYYOy8uf7IeavwkdkUV1SvYm8vvlGYh6vsZzhQkQt5Z+xIp9AuXqgpLoUYkvtqU 4K5dRoRvjzXIuy50SaABQchU15KaMD4= X-MC-Unique: J2NbXVfsPB6vfO1nYvhEFA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/6] util: virerror: Avoid a copy of the error messages Date: Tue, 2 Mar 2021 16:21:04 +0100 Message-Id: <6b176060e2a1d259f5893496093f31ffa97c3492.1614698410.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Some error message reporting functions already have allocated buffers which were used to format the error message, so copying the strings is redundant. Extract the internals from 'virRaiseErrorFull' to 'virRaiseErrorInternal' which takes allocated strings as arguments and steals them, so that callers can reuse the buffers. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/util/virerror.c | 159 ++++++++++++++++++++++++++------------------ 1 file changed, 95 insertions(+), 64 deletions(-) diff --git a/src/util/virerror.c b/src/util/virerror.c index b9a49ec70c..220fc362c1 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -755,6 +755,70 @@ void virRaiseErrorLog(const char *filename, meta, "%s", err->message); } + +/** + * virRaiseErrorInternal: + * + * Internal helper to assign and raise error. Note that @msgarg, @str1arg, + * @str2arg and @str3arg if non-NULL must be heap-allocated strings and are + * stolen and freed by this function. + */ +static void +virRaiseErrorInternal(const char *filename, + const char *funcname, + size_t linenr, + int domain, + int code, + virErrorLevel level, + char *msgarg, + char *str1arg, + char *str2arg, + char *str3arg, + int int1, + int int2) +{ + g_autofree char *msg =3D msgarg; + g_autofree char *str1 =3D str1arg; + g_autofree char *str2 =3D str2arg; + g_autofree char *str3 =3D str3arg; + virErrorPtr to; + virLogMetadata meta[] =3D { + { .key =3D "LIBVIRT_DOMAIN", .s =3D NULL, .iv =3D domain }, + { .key =3D "LIBVIRT_CODE", .s =3D NULL, .iv =3D code }, + { .key =3D NULL }, + }; + + /* + * All errors are recorded in thread local storage + * For compatibility, public API calls will copy them + * to the per-connection error object when necessary + */ + if (!(to =3D virLastErrorObject())) + return; + + virResetError(to); + + if (code =3D=3D VIR_ERR_OK) + return; + + if (!msg) + msg =3D g_strdup(_("No error message provided")); + + /* Deliberately not setting conn, dom & net fields sincethey're utterl= y unsafe. */ + to->domain =3D domain; + to->code =3D code; + to->message =3D g_steal_pointer(&msg); + to->level =3D level; + to->str1 =3D g_steal_pointer(&str1); + to->str2 =3D g_steal_pointer(&str2); + to->str3 =3D g_steal_pointer(&str3); + to->int1 =3D int1; + to->int2 =3D int2; + + virRaiseErrorLog(filename, funcname, linenr, to, meta); +} + + /** * virRaiseErrorFull: * @filename: filename where error was raised @@ -789,63 +853,20 @@ virRaiseErrorFull(const char *filename, const char *fmt, ...) { int save_errno =3D errno; - virErrorPtr to; - char *str; - virLogMetadata meta[] =3D { - { .key =3D "LIBVIRT_DOMAIN", .s =3D NULL, .iv =3D domain }, - { .key =3D "LIBVIRT_CODE", .s =3D NULL, .iv =3D code }, - { .key =3D NULL }, - }; - - /* - * All errors are recorded in thread local storage - * For compatibility, public API calls will copy them - * to the per-connection error object when necessary - */ - to =3D virLastErrorObject(); - if (!to) { - errno =3D save_errno; - return; /* Hit OOM allocating thread error object, sod all we can = do now */ - } - - virResetError(to); + char *msg =3D NULL; - if (code =3D=3D VIR_ERR_OK) { - errno =3D save_errno; - return; - } - - /* - * formats the message; drop message on OOM situations - */ - if (fmt =3D=3D NULL) { - str =3D g_strdup(_("No error message provided")); - } else { + if (fmt) { va_list ap; + va_start(ap, fmt); - str =3D g_strdup_vprintf(fmt, ap); + msg =3D g_strdup_vprintf(fmt, ap); va_end(ap); } - /* - * Save the information about the error - */ - /* - * Deliberately not setting conn, dom & net fields since - * they're utterly unsafe - */ - to->domain =3D domain; - to->code =3D code; - to->message =3D str; - to->level =3D level; - to->str1 =3D g_strdup(str1); - to->str2 =3D g_strdup(str2); - to->str3 =3D g_strdup(str3); - to->int1 =3D int1; - to->int2 =3D int2; - - virRaiseErrorLog(filename, funcname, linenr, - to, meta); + virRaiseErrorInternal(filename, funcname, linenr, + domain, code, level, + msg, g_strdup(str1), g_strdup(str2), g_strdup(st= r3), + int1, int2); errno =3D save_errno; } @@ -1286,8 +1307,9 @@ void virReportErrorHelper(int domcode, const char *fmt, ...) { int save_errno =3D errno; - g_autofree char *detail =3D NULL; - const char *errormsg; + char *detail =3D NULL; + char *errormsg =3D NULL; + char *fullmsg =3D NULL; if (fmt) { va_list args; @@ -1297,12 +1319,19 @@ void virReportErrorHelper(int domcode, va_end(args); } - errormsg =3D virErrorMsg(errorcode, detail); + errormsg =3D g_strdup(virErrorMsg(errorcode, detail)); + + if (errormsg) { + if (detail) + fullmsg =3D g_strdup_printf(errormsg, detail); + else + fullmsg =3D g_strdup(errormsg); + } + + virRaiseErrorInternal(filename, funcname, linenr, + domcode, errorcode, VIR_ERR_ERROR, + fullmsg, errormsg, detail, NULL, -1, -1); - virRaiseErrorFull(filename, funcname, linenr, - domcode, errorcode, VIR_ERR_ERROR, - errormsg, detail, NULL, - -1, -1, errormsg, detail); errno =3D save_errno; } @@ -1327,8 +1356,9 @@ void virReportSystemErrorFull(int domcode, { int save_errno =3D errno; virBuffer buf =3D VIR_BUFFER_INITIALIZER; - g_autofree char *detail =3D NULL; - const char *errormsg; + char *detail =3D NULL; + char *errormsg =3D NULL; + char *fullmsg =3D NULL; if (fmt) { va_list args; @@ -1343,11 +1373,12 @@ void virReportSystemErrorFull(int domcode, virBufferAdd(&buf, g_strerror(theerrno), -1); detail =3D virBufferContentAndReset(&buf); - errormsg =3D virErrorMsg(VIR_ERR_SYSTEM_ERROR, detail); + errormsg =3D g_strdup(virErrorMsg(VIR_ERR_SYSTEM_ERROR, detail)); + fullmsg =3D g_strdup_printf(errormsg, detail); - virRaiseErrorFull(filename, funcname, linenr, - domcode, VIR_ERR_SYSTEM_ERROR, VIR_ERR_ERROR, - errormsg, detail, NULL, theerrno, -1, errormsg, deta= il); + virRaiseErrorInternal(filename, funcname, linenr, + domcode, VIR_ERR_SYSTEM_ERROR, VIR_ERR_ERROR, + fullmsg, errormsg, detail, NULL, theerrno, -1); errno =3D save_errno; } --=20 2.29.2 From nobody Mon Apr 29 01:38:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614698496; cv=none; d=zohomail.com; s=zohoarc; b=QcfxVAOya1pbqigDg2GCv+YcveZRyij6GiKPiXjqybRtYjbCrjsrGEQxk/4GCgl3JBws5HH/zzgE8xFUOuH6eB/TQlb1LngM1AaqT/Enomg6n41fFCKPXXdHKxbGieE5p+lL/xkqQ8v2StywlGcTzvb+8sesz17k6azl/g+/5vk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614698496; h=Content-Type:Content-Transfer-Encoding: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=yf7smPdyyBn+SquYvTEVCHrXl0tmZwLYJqdrCJ3w9EE=; b=dlzmVeNadWyulreWFxD7VuNKlrYfoScKmxUJqwKqkkLe/NY6v5QHEQDCFh4tnOaq8jRpX68AS/rnPBk4iC1x6DzoyWWodfs979IJIktVTY3Is5Jv2iO6ur5db9SYmx0+GNrWVZUj8YoK6z3RQL26dsRVU2ZFX5gVWgDFETfTaqk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1614698496336824.0066272791535; Tue, 2 Mar 2021 07:21:36 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-150-D4lTaE5KODWrDctFMFtamQ-1; Tue, 02 Mar 2021 10:21:32 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 01EBF1936B68; Tue, 2 Mar 2021 15:21:27 +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 CB1D960C05; Tue, 2 Mar 2021 15:21:26 +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 754AD57DFC; Tue, 2 Mar 2021 15:21:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 122FLHcV017541 for ; Tue, 2 Mar 2021 10:21:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id 576F31A7D9; Tue, 2 Mar 2021 15:21:17 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id B64ED19C48 for ; Tue, 2 Mar 2021 15:21:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614698495; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=yf7smPdyyBn+SquYvTEVCHrXl0tmZwLYJqdrCJ3w9EE=; b=i6hALz9zFaUdIiC3HjuN1DdchjU5o/4TY5u/jT/zNlUotVSqAVfizhyQZvhThFfDLxksfr rTLzQAE7dp2LqgHNhy0a9tCokKPoF56I8f+AT54rQ0P/bLAUK6cc5NuWW0Vus6Zv5DHJ5D NdmbAIymv58c5FAQXgOYqJ5LViV6rA8= X-MC-Unique: D4lTaE5KODWrDctFMFtamQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/6] util: virprocess: Use local maximum error message size Date: Tue, 2 Mar 2021 16:21:05 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use of VIR_ERROR_MAX_LENGTH is actually misleading to the readers because it implies that the strings in virError are 1024 bytes at most. That isn't true at least for the 'message' field as it's constructed from concatenating the detail string which (was) max 1024 bytes with the string variant of the error code without limiting to 1024. Use a local copy for declaring the struct for error transport with a comment so that's obvious that it's a local decision to use 1k buffers. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/util/virprocess.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/util/virprocess.c b/src/util/virprocess.c index 69d64e9466..5a4e3c3e43 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -1137,14 +1137,16 @@ virProcessRunInMountNamespace(pid_t pid G_GNUC_UNUS= ED, #ifndef WIN32 +/* We assume that error messages will fit into 1024 chars */ +# define VIR_PROCESS_ERROR_MAX_LENGTH 1024 typedef struct { int code; int domain; - char message[VIR_ERROR_MAX_LENGTH]; + char message[VIR_PROCESS_ERROR_MAX_LENGTH]; virErrorLevel level; - char str1[VIR_ERROR_MAX_LENGTH]; - char str2[VIR_ERROR_MAX_LENGTH]; - char str3[VIR_ERROR_MAX_LENGTH]; + char str1[VIR_PROCESS_ERROR_MAX_LENGTH]; + char str2[VIR_PROCESS_ERROR_MAX_LENGTH]; + char str3[VIR_PROCESS_ERROR_MAX_LENGTH]; int int1; int int2; } errorData; --=20 2.29.2 From nobody Mon Apr 29 01:38:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614698510; cv=none; d=zohomail.com; s=zohoarc; b=cYnpq/Er3JwQ7rdPEGg8EM3Kl9gUPVd4sVvWa3vYtylNi7yQEThlGqkMDi+ar1AxoZILJUzVr3V2y5Myh/1svFYemv4+yuL9B/j3wnTzslxNsjBNhhb9wfN4Vntkm0lycjz5i9R7Hmo3PXDRs4qWSJrcT5Vsp95y/owd1vvkA/c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614698510; h=Content-Type:Content-Transfer-Encoding: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=OlEtWJJ5CCj+tX/vUkYgSGlS2e9DSd+YBaeFpPFKZN0=; b=IhSHtJ0WPIjuXRcEYCsXLgmfzyMGiBxRMqpLyJ4TywlgxsPq/42BuXc3wCo8ccUeGcu78NVTd0TZ9mDH7dM9aBszvztLoheV2eTZVy8mP3NwMsY4AUjg1iqt/S0chdFbgqse/vbNovdMWn66Ec/qEJqp714Wdp7IvwrdYrCD064= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1614698510895577.60007664535; Tue, 2 Mar 2021 07:21:50 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-399-lvrMDjP2P9-URc5NbXuEtg-1; Tue, 02 Mar 2021 10:21:46 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D1B40E5769; Tue, 2 Mar 2021 15:21:38 +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 A36F419C48; Tue, 2 Mar 2021 15:21:38 +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 650304E58D; Tue, 2 Mar 2021 15:21:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 122FLI66017550 for ; Tue, 2 Mar 2021 10:21:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6357C19C46; Tue, 2 Mar 2021 15:21:18 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id B8BFFE144 for ; Tue, 2 Mar 2021 15:21:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614698509; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=OlEtWJJ5CCj+tX/vUkYgSGlS2e9DSd+YBaeFpPFKZN0=; b=d4UnCZ16jEK47YnWByZKBBr4a+ZE0laHvLPQdWCwocnii2fZNs0Kfl03dy/PRj5xqB6lo2 RsPetw+E2UF3g1TzYQRZJ+VGZ9mGu0Z9WmQ61qJ850PtLDue4Ck3cxXoUjRiX7YiSOzlM/ 86h2Zo5vcLUfHTYG8vrPN2IKGKdYgrM= X-MC-Unique: lvrMDjP2P9-URc5NbXuEtg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/6] qemuProcessReportLogError: Remove unnecessary math for max error message Date: Tue, 2 Mar 2021 16:21:06 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Now that error message formatting doesn't use fixed size buffers we can drop the math for calculating the maximum chunk of log to report in the error message and use a round number. This also makes it obvious that the chosen number is arbitrary. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 398f63282e..55649286ae 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2140,14 +2140,9 @@ qemuProcessReportLogError(qemuDomainLogContextPtr lo= gCtxt, const char *msgprefix) { g_autofree char *logmsg =3D NULL; - size_t max; - max =3D VIR_ERROR_MAX_LENGTH - 1; - max -=3D strlen(msgprefix); - /* The length of the formatting string minus two '%s' */ - max -=3D strlen(_("%s: %s")) - 4; - - if (qemuProcessReadLog(logCtxt, &logmsg, max) < 0) + /* assume that 1024 chars of qemu log is the right balance */ + if (qemuProcessReadLog(logCtxt, &logmsg, 1024) < 0) return -1; virResetLastError(); --=20 2.29.2 From nobody Mon Apr 29 01:38:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614698505; cv=none; d=zohomail.com; s=zohoarc; b=MlvDSqsYRqMKlooWcBBtlfD2acxibMvH6O+yv9hkpH+9JMfURiY+dxVvd/pYmhPgIiBPfBTXXS3UQ9os0yERYFoeqjK/Lqo9m0xcSDgpwWFcyUxbdgl81zHG1jKGoCJVDmjwje+2ZVNIAHr0TO3wpwlWai5KsQ5eo4pF/WLXcXw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614698505; h=Content-Type:Content-Transfer-Encoding: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=/bSVJjmzymGkBusiOo6odIYwEiSU/c6k7l6tUM0ZCf0=; b=ecGPD5fmG6zQi8Zq+R+Y0+ntVHpOScExpDiF5QCtEBHOCRc1HGKX7rvbWbRSq5mL/HD1+RyrCr3NeSFSW5e2wm8IOMer5tAnUIXnt6xOPvufJmwHWNhL/HabxUaSMLnKSjmu7YfKaE+erP/Hs9gSH13wSmhpb8kVr6tElG5SLJw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1614698505716991.6305607302428; Tue, 2 Mar 2021 07:21:45 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-142-WK2ocjxHNDq5xjKn6L_Wag-1; Tue, 02 Mar 2021 10:21:40 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7BDC9100A61D; Tue, 2 Mar 2021 15:21:34 +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 5199B177D7; Tue, 2 Mar 2021 15:21:34 +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 1F23457DFD; Tue, 2 Mar 2021 15:21:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 122FLJWF017567 for ; Tue, 2 Mar 2021 10:21:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7EE40E144; Tue, 2 Mar 2021 15:21:19 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE05819C46 for ; Tue, 2 Mar 2021 15:21:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614698504; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=/bSVJjmzymGkBusiOo6odIYwEiSU/c6k7l6tUM0ZCf0=; b=F+pnOMyy7+rl62K6bp3t5BGap2ZxNuDLijPxwbXENrLgzeRrw3StpNzraakRVRS6TiGuSn NqKHh8hKi2vaZZFiytH09gDM9c5C2iZ77j3RSFuyGBa4MhPuTVro46cRxhs60ZMqM8Xh+W h+MQF7gszoQmtrovcsD3xmMrdqqsZGI= X-MC-Unique: WK2ocjxHNDq5xjKn6L_Wag-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/6] qemuProcessReportLogError: Don't mark "%s: %s" as translatable Date: Tue, 2 Mar 2021 16:21:07 +0100 Message-Id: <59c7fcb698bc3cc57172510966bca122933513b6.1614698410.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The function is constructing an error message from a prefix and the contents of the qemu log file. Marking just two string modifiers as translatable is pointless and will certainly confuse translators. Remove the marking and add a comment which bypasses the sc_libvirt_unmarked_diagnostics check. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 55649286ae..aa547686c1 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2149,7 +2149,8 @@ qemuProcessReportLogError(qemuDomainLogContextPtr log= Ctxt, if (virStringIsEmpty(logmsg)) virReportError(VIR_ERR_INTERNAL_ERROR, "%s", msgprefix); else - virReportError(VIR_ERR_INTERNAL_ERROR, _("%s: %s"), msgprefix, log= msg); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s: %s", /* _( silence sc_= libvirt_unmarked_diagnostics */ + msgprefix, logmsg); return 0; } --=20 2.29.2 From nobody Mon Apr 29 01:38:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614698530; cv=none; d=zohomail.com; s=zohoarc; b=IRJ3ajnJqFyBIUnNmh3Jt+QBsJUXmDdy2t3TJmIcL/eXUclhAjKWGJ3GgCgNBcByKAmlU8BE5yFwSQ2o2pqWpFqu1K5mz+Avr80lyrmwgJp3Z5vNaI1Kw4AbPzIFblEC2gDuWLZ0OFWPztTY4qGIXZHWM5t2K7kwRSSnekDy8IE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614698530; h=Content-Type:Content-Transfer-Encoding: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=gv/NPaAl4DNW39GWsqKkjSvcR67rJ0A4sABdkewGXUo=; b=n7icA6w6uR6ioBvUVFV8W33svylnZqiANEIRndQPN+onMmrI/xjaupqvPnbQxSPQ/VEe1tl9w7rqVGuzCcvQwZgljzCtQnypFvMW0KSk64tT5JdnkhrJWWMrie7ylft74tk3L7G4evsGo1ZjE17uzx0i0UMomOsh35yFIS4aghw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1614698530965700.2358395763677; Tue, 2 Mar 2021 07:22:10 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-497-6AjD-JdVPqeGWqZP3T22LQ-1; Tue, 02 Mar 2021 10:21:47 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C0CB8107ACED; Tue, 2 Mar 2021 15:21:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C68C19C48; Tue, 2 Mar 2021 15:21:37 +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 4C5241809C90; Tue, 2 Mar 2021 15:21:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 122FLK3F017577 for ; Tue, 2 Mar 2021 10:21:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id 94CE5E144; Tue, 2 Mar 2021 15:21:20 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id E409A1A7D9 for ; Tue, 2 Mar 2021 15:21:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614698529; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=gv/NPaAl4DNW39GWsqKkjSvcR67rJ0A4sABdkewGXUo=; b=gY5TNmgjpAuj4EQezvs9pnG7aGY8Sw/tJ98I8+b2DGjFEYH2v0LbiTDQCDKt8rEt6jp5X9 3/HYCXpS7+ZwvE8Yben7TcCfQBAcIjqqscHX1Fohc4IRur9YvmPXwMNbCx5u94QFPlNkX7 Oytbw0xvez9Hfl6YAQuV9PLa9UZ3KmI= X-MC-Unique: 6AjD-JdVPqeGWqZP3T22LQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 6/6] util: virerror: Remove VIR_ERROR_MAX_LENGTH macro Date: Tue, 2 Mar 2021 16:21:08 +0100 Message-Id: <2a88eea213e72066aad9fc9ebd8baf35996d37ff.1614698410.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/util/virerror.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/util/virerror.h b/src/util/virerror.h index da7d7c0afe..bec3863c3f 100644 --- a/src/util/virerror.h +++ b/src/util/virerror.h @@ -23,8 +23,6 @@ #include "internal.h" -#define VIR_ERROR_MAX_LENGTH 1024 - extern virErrorFunc virErrorHandler; extern void *virUserData; --=20 2.29.2