From nobody Mon Apr 29 02:56:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1592396718; cv=none; d=zohomail.com; s=zohoarc; b=f/LxT1tjGmEoi8Qog0IT64r5UlwSEmaE47LtTT9444Oa+u20JLBgwV2p/pVYiomWbR/Ukyx8gZfWD1h27x9KwT+3zjuK54WQi6FZY/B25jGcq0AyyJ7DW3c3hPXfCAkRt0WMupmt4c6YnybOSB1qxhiFfFMIl5hYSawJGNG3MCM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592396718; 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=98Rgk4mcX5MOwekGvDSrlxoMKtbWAOzZiAZznQ8GaTk=; b=PquVRUjZqpFsopCs5JsC50lq2IhyRVE1Svg42xU0OCAQWyXpesG94yh9KGRc1Gw4KFwdYxl2cQNAlxBUHs8wt9rVbiw34S0Pt2yRMPxN0ci5a8qlAC6WYoR2kV8ZYLjeucpkTcT7Z5jkNmoIoIispaXq5Vj4+DtxKZ9evOgH6AA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1592396718685928.3348306553889; Wed, 17 Jun 2020 05:25:18 -0700 (PDT) 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-50-sPHjRYU5OPizj8_S6iKBvg-1; Wed, 17 Jun 2020 08:25:13 -0400 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 4557C1092ACC; Wed, 17 Jun 2020 12:25:08 +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 664BF8088B; Wed, 17 Jun 2020 12:25:06 +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 B7100833CB; Wed, 17 Jun 2020 12:25:04 +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 05HCP36H016900 for ; Wed, 17 Jun 2020 08:25:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id CFB9551C4C; Wed, 17 Jun 2020 12:25:03 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4433551C4F for ; Wed, 17 Jun 2020 12:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592396717; 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=98Rgk4mcX5MOwekGvDSrlxoMKtbWAOzZiAZznQ8GaTk=; b=Kf0VZsQ59vVTNUVheXUrW7ExRS9dVxrmVXwjhvtQxxm/GMEC83jsKlzffISCD7sWCFrQxN WhXamC3SAOaZO1pXogE6EpXBW4ZrigMxwh9Z9aRJiMNAODHoGfMJAVrmaMiw1rhG1h5r3p LJG1cpaCZ3t9qAIImFjpzvlTypLV/Rk= X-MC-Unique: sPHjRYU5OPizj8_S6iKBvg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] virsh: cmdBlockcopy: Remove 'error:' prefix for an empty line Date: Wed, 17 Jun 2020 14:24:58 +0200 Message-Id: <1769e7a60440b2d4663a5c8797becae8700a4ca5.1592396698.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.15 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" When a block copy job fails prior to reaching the synchronized phase while we are waiting for the job to finish virsh would print the following: $ virsh blockcopy backup-test vda /tmp/dst.qcow2 --wait --reuse-external -= -transient-job error: Copy failed The above message looks like we've forgot to print the error message itself as the line ends after 'error:'. Unfortunately with the current API design clients have no way of actually getting the error message as the VIR_DOMAIN_EVENT_ID_BLOCK_JOB(_2) event only reports the status but not an error and the job then vanishes. Fix the expectations by using vshPrintExtra instead of vshError: $ virsh blockcopy backup-test vda /tmp/dst.qcow2 --wait --reuse-external -= -transient-job Copy failed Note that the newline is required to avoid printing the 'Copy failed' message on the same line when printing the job progress percentage. Inspired by https://bugzilla.redhat.com/show_bug.cgi?id=3D1847867 Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- tools/virsh-domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 5222949566..3597fb6272 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -2457,7 +2457,7 @@ cmdBlockcopy(vshControl *ctl, const vshCmd *cmd) break; case VIR_DOMAIN_BLOCK_JOB_FAILED: - vshError(ctl, "\n%s", _("Copy failed")); + vshPrintExtra(ctl, "\n%s", _("Copy failed")); goto cleanup; break; --=20 2.26.2