From nobody Mon Feb 9 08:31:20 2026 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-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=1574694120; cv=none; d=zohomail.com; s=zohoarc; b=JFdwGN5w59SFaAfJ9DcJvaKskKEWI90O3HU2KgTkWajXro7GkvU1nHxSTmsVqr/Nt0oNED1n2gZCbd1r3vmUfKMA7qNxqUdBY12VbM7zjXyNXnOx4BH2L2nOUgLoJT67BYWT7bFeSAF6mbGBbBCRpfDO48tJFAscjv8TxT6xlFk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574694120; 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=UWOcGbbtQXYIvEHow+WIw8wgSEUyaxTa1L1PQ8If/pI=; b=AOfSolK9rwXoru7qrW/+0iarkaRzp8ewME4s9n2yQtxV6B/BHG5doy0wvi/4ABtLjk4PHMZLVzXlwTwjprma6Xwq20DoOY5pHSwZhZvY7TcoiUiXRB9VDrV4Xa/RW6JYptuT5dKsthCZFfxakAw8f/x82O6aInyw73dNLgf9NSs= 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-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1574694120754754.1257026224426; Mon, 25 Nov 2019 07:02:00 -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-8-Yc78s-DFPZC0b178Zn9beg-1; Mon, 25 Nov 2019 10:01:57 -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 B4A6DA6D23; Mon, 25 Nov 2019 15:01:51 +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 815005C1D4; Mon, 25 Nov 2019 15:01:51 +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 2B2B24BB78; Mon, 25 Nov 2019 15:01:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAPF1nMA022037 for ; Mon, 25 Nov 2019 10:01:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2715E5D6AE; Mon, 25 Nov 2019 15:01:49 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id A34B05D6A0 for ; Mon, 25 Nov 2019 15:01:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574694119; 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=UWOcGbbtQXYIvEHow+WIw8wgSEUyaxTa1L1PQ8If/pI=; b=cptM0agvu/Bs+aGxX8lR1xYZcWi+yz/396KZK4mMs/NtTZjZHAvMflPik6jSg2CZ6JCMrq k9O5pF1aXOKw8OVdJFgT31FqawxdV/nyAKvNrEOShR/xW5izOVXswDAPJ4v3V4CgGz/Ven vJj4qfe30R06ABxIltgbuy73/Hol6cQ= From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 25 Nov 2019 16:01:33 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/9] virsh: domjobinfo: Allow printing stats also for failed and other jobs 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 X-MC-Unique: Yc78s-DFPZC0b178Zn9beg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Introduce the --anystats flag which does not skip the printing of the stats if the job was unsuccessful. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tools/virsh-domain.c | 7 ++++++- tools/virsh.pod | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 577dec30c5..81229fa5ca 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -6029,6 +6029,10 @@ static const vshCmdOptDef opts_domjobinfo[] =3D { .type =3D VSH_OT_BOOL, .help =3D N_("don't destroy statistics of a recently completed job wh= en reading") }, + {.name =3D "anystats", + .type =3D VSH_OT_BOOL, + .help =3D N_("print statistics for any kind of job (even failed ones)= ") + }, {.name =3D NULL} }; @@ -6167,7 +6171,8 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd) vshPrint(ctl, "%-17s %-12s\n", _("Operation:"), virshDomainJobOperationToString(op)); - if (info.type !=3D VIR_DOMAIN_JOB_BOUNDED && + if (!vshCommandOptBool(cmd, "anystats") && + info.type !=3D VIR_DOMAIN_JOB_BOUNDED && info.type !=3D VIR_DOMAIN_JOB_UNBOUNDED && (!(flags & VIR_DOMAIN_JOB_STATS_COMPLETED) || info.type !=3D VIR_DOMAIN_JOB_COMPLETED)) { diff --git a/tools/virsh.pod b/tools/virsh.pod index 6c14520780..e5428976a0 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -1381,11 +1381,16 @@ Returns basic information about the domain. Abort the currently running domain job. =3Ditem B I [I<--completed>] [I<--keep-completed>] +[I<--anystats>] Returns information about jobs running on a domain. I<--completed> tells virsh to return information about a recently finished job. Statistics of a completed job are automatically destroyed once read (unless I<--keep-completed> is used) or when libvirtd is restarted. + +Normally only statistics for running and successful completed jobs are pri= nted. +I<--anystats> can be used to display statistics also for failed jobs. + Note that time information returned for completed migrations may be completely irrelevant unless both source and destination hosts have synchronized time (i.e., NTP daemon is running --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list