From nobody Wed May 8 03:14:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.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=1641229033; cv=none; d=zohomail.com; s=zohoarc; b=jvFvc/5JyuzCIOaS5y/6vsJtWnc0KiMjg4wM4+0oRm9Fss7py3GPAe7T0ZvKzZs+EV0ARrD2Y+yA4RkB10vKZELb8jq3mG9Lm+UN7ZxPj9rGoiTMjiMCdhtvK0OqLJe80chn9wh9GcU45nN9UHtHFMJEycKHe/9oR6yYFhEis+w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641229033; 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=e9UxW9Y8y999ABjuaJfRvCcPeBn88lOCXPI9HTFRnEg=; b=fYbzcBhSklUsZBOZ6vxFGOPGCaTFyzm5L9nUJprKqMIQYBpRwK00NJxJWcVP/f2tyMgop85FK8IJTvf1Rvh1SnEOmdJykYLlfSSeA8/AinekQGRYc+T+u9NIn56W1ECsynEafHqzevpHAnbo6w/1WvXLdIdSPDBrbyoG/sivvxY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1641229033499745.2012709681227; Mon, 3 Jan 2022 08:57:13 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-587-kHC1UkwEPaO9nGXU4Pi_rw-1; Mon, 03 Jan 2022 11:57:11 -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 B9A47344B0; Mon, 3 Jan 2022 16:57:04 +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 739C57FCC6; Mon, 3 Jan 2022 16:57:04 +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 65AC61809CB8; Mon, 3 Jan 2022 16:57:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 203Gv1eq029987 for ; Mon, 3 Jan 2022 11:57:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id C20F07FBA7; Mon, 3 Jan 2022 16:57:01 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 299777FCC6 for ; Mon, 3 Jan 2022 16:56:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641229032; 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=e9UxW9Y8y999ABjuaJfRvCcPeBn88lOCXPI9HTFRnEg=; b=WGKYmCZI1uw+3yu2c6xmGdUaA3MWGNI/ffAgIb53XoBLYo81QHtN3GiPe4AKs5ETBWbi04 UHz/qbS2p7vCtZ5ECBNkQOTUJjp1vVC7osfpHrB8dOzVzkUA13UWnMMqoRIiVVKU4z3a3t vijLwwr133tBSZUOsHgFYsWl4RQYcng= X-MC-Unique: kHC1UkwEPaO9nGXU4Pi_rw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] qemu: monitor: Remove disabled debug infrastructure Date: Mon, 3 Jan 2022 17:56:48 +0100 Message-Id: <00ad3730a3b29a13d982ce0fcb9f21934ba1a84a.1641229007.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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) X-ZM-MESSAGEID: 1641229034357100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: Ani Sinha --- src/qemu/qemu_monitor.c | 44 ----------------------------------------- 1 file changed, 44 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index dda6ae9796..32e4ff1191 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -56,9 +56,6 @@ VIR_LOG_INIT("qemu.qemu_monitor"); -#define DEBUG_IO 0 -#define DEBUG_RAW_IO 0 - /* We read from QEMU until seeing a \r\n pair to indicate a * completed reply or event. To avoid memory denial-of-service * though, we must have a size limit on amount of data we @@ -210,25 +207,6 @@ VIR_ENUM_IMPL(qemuMonitorMemoryFailureAction, "ignore", "inject", "fatal", "reset"); -#if DEBUG_RAW_IO -static char * -qemuMonitorEscapeNonPrintable(const char *text) -{ - size_t i; - g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; - for (i =3D 0; text[i] !=3D '\0'; i++) { - if (g_ascii_isprint(text[i]) || - text[i] =3D=3D '\n' || - (text[i] =3D=3D '\r' && text[i + 1] =3D=3D '\n')) - virBufferAddChar(&buf, text[i]); - else - virBufferAsprintf(&buf, "0x%02x", text[i]); - } - return virBufferContentAndReset(&buf); -} -#endif - - static void qemuMonitorDispose(void *obj) { @@ -329,17 +307,6 @@ qemuMonitorIOProcess(qemuMonitor *mon) if (mon->msg && mon->msg->txOffset =3D=3D mon->msg->txLength) msg =3D mon->msg; -#if DEBUG_IO -# if DEBUG_RAW_IO - char *str1 =3D qemuMonitorEscapeNonPrintable(msg ? msg->txBuffer : ""); - char *str2 =3D qemuMonitorEscapeNonPrintable(mon->buffer); - VIR_ERROR(_("Process %d %p %p [[[[%s]]][[[%s]]]"), (int)mon->bufferOff= set, mon->msg, msg, str1, str2); - VIR_FREE(str1); - VIR_FREE(str2); -# else - VIR_DEBUG("Process %d", (int)mon->bufferOffset); -# endif -#endif PROBE_QUIET(QEMU_MONITOR_IO_PROCESS, "mon=3D%p buf=3D%s len=3D%zu", mon, mon->buffer, mon->bufferOffset); @@ -360,10 +327,6 @@ qemuMonitorIOProcess(qemuMonitor *mon) VIR_FREE(mon->buffer); mon->bufferOffset =3D mon->bufferLength =3D 0; } -#if DEBUG_IO - VIR_DEBUG("Process done %d used %d", (int)mon->bufferOffset, len); -#endif - /* As the monitor mutex was unlocked in qemuMonitorJSONIOProcess() * while dealing with qemu event, mon->msg could be changed which * means the above 'msg' may be invalid, thus we use 'mon->msg' here */ @@ -505,10 +468,6 @@ qemuMonitorIORead(qemuMonitor *mon) mon->buffer[mon->bufferOffset] =3D '\0'; } -#if DEBUG_IO - VIR_DEBUG("Now read %d bytes of data", (int)mon->bufferOffset); -#endif - return ret; } @@ -535,9 +494,6 @@ qemuMonitorIO(GSocket *socket G_GNUC_UNUSED, /* lock access to the monitor and protect fd */ virObjectLock(mon); -#if DEBUG_IO - VIR_DEBUG("Monitor %p I/O on socket %p cond %d", mon, socket, cond); -#endif if (mon->fd =3D=3D -1 || !mon->watch) { virObjectUnlock(mon); virObjectUnref(mon); --=20 2.31.1