From nobody Sun Feb 8 16:12:04 2026 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=1613740178; cv=none; d=zohomail.com; s=zohoarc; b=XuyRcQuCfNjZdVq+Ayo2yJ1ZqFBzBKgY4m2TnWGHa1+sse+Ik+r+zvfPgBZPIhFflJzxS6NmjW9aTJRvqD0tF6NO0cT9/NCCnR1BsOA7yedOWuj8LejO7qyBNluRESC6hA9dcRC1Xv7FJuIDpIlbyb2Al1HsPHu9SaqKwYoHoC4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613740178; 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=gFfLZNd+wvE/ORoIs0nyjGTlxRJ5DSfnIYgqAS1caww=; b=Kqzk17MtfJT6L5TaNWhpSpfkf3F1VbL3gQT2lGS5pvLvVduwRiko1fHSW/PtlrIEcsCiNwMwGtD4rtp9WP02oY2mZbWut1p78aZa09npwbX1ZKBo8fTmAS6OdtWs0+LyQ4ni5YlNLPQq6M8ACfLxAOb/vITVgK5L+L3zJsJH5zM= 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 1613740178289718.801130399023; Fri, 19 Feb 2021 05:09:38 -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-236-KX3M_V6nNxKxXx-WCMEDzg-1; Fri, 19 Feb 2021 08:09:35 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CDCC9814302; Fri, 19 Feb 2021 13:08:55 +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 E4CB86086F; Fri, 19 Feb 2021 13:08:53 +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 DD7D41809C90; Fri, 19 Feb 2021 13:08:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11JD8UR3017987 for ; Fri, 19 Feb 2021 08:08:30 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3C4FA5D9C2; Fri, 19 Feb 2021 13:08:30 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.194.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 91D095D9C6 for ; Fri, 19 Feb 2021 13:08:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613740177; 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=gFfLZNd+wvE/ORoIs0nyjGTlxRJ5DSfnIYgqAS1caww=; b=bPMPXx89LcbhCdJiRuyWV/qGMdjhzaRjta8oOSVGqnRkpeod7wVLePQIsg1iBV/960+9Pi cEphCYyl5Whz0EtAotlM5Tz40JSFP+Ltbk9F33yreCiyJxgFQ00QkDhy2Skn6SCjTX6wIQ v4gvedDzaYJuMHMJ/rGotZvmK9NqsZY= X-MC-Unique: KX3M_V6nNxKxXx-WCMEDzg-1 From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH] event-test: Properly terminate strings printed from callbacks Date: Fri, 19 Feb 2021 14:07:53 +0100 Message-Id: <20210219130753.15266-1-khanicov@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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.13 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" Stdio was buffering strings in functions: myDomainEventBlockJobCallback, myDomainEventBlockThresholdCallback, myDomainEventMemoryFailureCallback. It caused flushing the printed strings from callbacks at the end of a run, not gradually. The solution is to add \n at the end of each string. Signed-off-by: Kristina Hanicova Reviewed-by: J=C3=A1n Tomko --- examples/c/misc/event-test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/c/misc/event-test.c b/examples/c/misc/event-test.c index f164e825e1..76d4f3f6e8 100644 --- a/examples/c/misc/event-test.c +++ b/examples/c/misc/event-test.c @@ -938,7 +938,7 @@ myDomainEventBlockJobCallback(virConnectPtr conn G_GNUC= _UNUSED, const char *eventName =3D opaque; =20 printf("%s EVENT: Domain %s(%d) block job callback '%s' disk '%s', " - "type '%s' status '%s'", + "type '%s' status '%s'\n", __func__, virDomainGetName(dom), virDomainGetID(dom), eventName, disk, blockJobTypeToStr(type), blockJobStatusToStr(status)); return 0; @@ -956,7 +956,7 @@ myDomainEventBlockThresholdCallback(virConnectPtr conn = G_GNUC_UNUSED, { /* Casts to uint64_t to work around mingw not knowing %lld */ printf("%s EVENT: Domain %s(%d) block threshold callback dev '%s'(%s),= " - "threshold: '%" PRIu64 "', excess: '%" PRIu64 "'", + "threshold: '%" PRIu64 "', excess: '%" PRIu64 "'\n", __func__, virDomainGetName(dom), virDomainGetID(dom), dev, NULLSTR(path), (uint64_t)threshold, (uint64_t)excess); return 0; @@ -972,7 +972,7 @@ myDomainEventMemoryFailureCallback(virConnectPtr conn G= _GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { printf("%s EVENT: Domain %s(%d) memory failure: recipient '%d', " - "aciont '%d', flags '%d'", __func__, virDomainGetName(dom), + "aciont '%d', flags '%d'\n", __func__, virDomainGetName(dom), virDomainGetID(dom), recipient, action, flags); return 0; } --=20 2.29.2