From nobody Sat May 4 08:28:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1579533137; cv=none; d=zohomail.com; s=zohoarc; b=kx9dLn3B1vHe0vB7Ll8v4BbhX1FzQUyjecFQzUgehjyYJQOBD+kC5DAiyoeAOTn+Cy9N1POZsvva8icBk5PrEOlBQaoRWKFD0/dOJ9CAc7P3oYpky8TTVDiW8TL9EyNe5m+XP/rcXnz+QwrNy/MbsNctIUrgfr33sR8orDPgJhk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579533137; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=1MuEUusM2TLFp9AUepsKWqucpEGgItpUrdbrQZnxyr4=; b=MIdi5loXV0DDHkIK56dAFGUCZM70d+7E6HHovYgE8mITA49P2V3vB2ipFq0zYnr6Whh3mDeB9CFBeInREujSp/ye3gDWgQgCEF5d4Et2R1PFbiggv7d5JmmrEuD4/Bg5ekQURTDA9jNk6Q1bQ/GRrpOfAualJcBuHu7T06CTTm0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 15795331373381013.9299204456149; Mon, 20 Jan 2020 07:12:17 -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-427-xDKgMDp5OGC0RXMrNDX8Bg-1; Mon, 20 Jan 2020 10:12:09 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 54C9E8017CC; Mon, 20 Jan 2020 15:12:01 +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 E8E4F860EF; Mon, 20 Jan 2020 15:11:58 +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 5919C1809567; Mon, 20 Jan 2020 15:11:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00KFBrgw019740 for ; Mon, 20 Jan 2020 10:11:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id E88788BE2E; Mon, 20 Jan 2020 15:11:53 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F4FD8BE2D for ; Mon, 20 Jan 2020 15:11:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579533136; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1MuEUusM2TLFp9AUepsKWqucpEGgItpUrdbrQZnxyr4=; b=MK2TRHWWeHu7sx+vkoVZZXoWtFGxLIOTiizx2xbBjC+k6HWIdi+IxDg+YpxFCj6KETk/jp JgBorgMIL5lnHLXAo5CPokGQuAgb7fR5oa491++U1Ap4Fxhhtu8qga4bciNvfm3MX1v55X +9x4ZvhgtdhRvwtUc8Hs+2s7WhZOi+w= From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] qemu: monitor: Improve error message when QEMU reply is too large Date: Mon, 20 Jan 2020 16:11:49 +0100 Message-Id: <675360ee4a6a17781f253c7ec2897a6e8fc60ade.1579533109.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.15 X-MC-Unique: xDKgMDp5OGC0RXMrNDX8Bg-1 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" Don't use ERANGE as it doesn't make much sense in the error message. Also point out that the reply from qemu was too large which is not obvious from the original error: error: No complete monitor response found in 10485760 bytes: Numerical res= ult out of range The new message will read: error: internal error: QEMU monitor reply exceeds buffer size (10485760 by= tes) Signed-off-by: Peter Krempa Reviewed-by: Jiri Denemark --- src/qemu/qemu_monitor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index ccd20b3740..e3bd000ccb 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -484,9 +484,9 @@ qemuMonitorIORead(qemuMonitorPtr mon) if (avail < 1024) { if (mon->bufferLength >=3D QEMU_MONITOR_MAX_RESPONSE) { - virReportSystemError(ERANGE, - _("No complete monitor response found in = %d bytes"), - QEMU_MONITOR_MAX_RESPONSE); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("QEMU monitor reply exceeds buffer size (%d b= ytes)"), + QEMU_MONITOR_MAX_RESPONSE); return -1; } if (VIR_REALLOC_N(mon->buffer, --=20 2.24.1