From nobody Mon Feb 9 14:29:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=fRnkgcTDtSonVOagLOXBDzlR6goeNarFsa2hJPB4tLdI/Zb9+IKks+pF4q4DCTNlUd5+GVVA8S2cc4B2JOAbhcnl64ELTGvj1Xk9+oDGxuW8vlAJXYGAuAt4NvFACq4GT9oJJScjCSSGirAKixhd4PsOIwmzrBI9CYoGhrmdu0U= 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=h3l+rL+QJuDqxigp3CmmkAm+tQqc5t5wIkdtRGFx/xw=; b=CPGSh6m0CPxrpSfNaZVYE1nxjxtUKTDNEL++6E32H77Pe4WOlZ7UxWJY9mxfstVnapXEMLgPf7rJX1DMneYybcAubfOMvt+aG2qo4p1eSnfepcrT9Xl7dSmVpWvCpN3suyHb16r8z0IhKEAwcexfiADEV6oWF9YTnUiZGOTVNDE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1574694120589202.5020492576075; 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-381-QoUCec1xMZSYLGsPF3O4XA-1; Mon, 25 Nov 2019 10:01:57 -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 1808A107B7F5; Mon, 25 Nov 2019 15:01:48 +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 D4C1760C18; Mon, 25 Nov 2019 15:01:47 +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 7D94A182B011; Mon, 25 Nov 2019 15:01:47 +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 xAPF1kNB022009 for ; Mon, 25 Nov 2019 10:01:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id B2E2C5D6AE; Mon, 25 Nov 2019 15:01:46 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B5FB5D6A0 for ; Mon, 25 Nov 2019 15:01:46 +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=h3l+rL+QJuDqxigp3CmmkAm+tQqc5t5wIkdtRGFx/xw=; b=BJOc1a293jEN4IQOp28z3xkenvR0K+RJKo8Yu5zmf2WFEbL7T1Ql8xHkUnqSV/BbORX3Vw dr7gltcm0UlovWCbMtZnUOuLD05OhkwIVx4iQPIj8SXHfpYc0UZCRwvnCBnrlV2SH//w8g U1U9+TMm0ZW+UqgIFlcAvVZUnThg7/U= From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 25 Nov 2019 16:01:30 +0100 Message-Id: <86854222cf11b705978f32eb001f058f223d0394.1574693958.git.pkrempa@redhat.com> 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 3/9] virsh: Implement VIR_DOMAIN_JOB_STATS_COMPLETED_KEEP for 'domjobinfo' 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 X-MC-Unique: QoUCec1xMZSYLGsPF3O4XA-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" Signed-off-by: Peter Krempa --- tools/virsh-domain.c | 9 +++++++++ tools/virsh.pod | 7 ++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 99194c2f81..6e3814f1fd 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -6025,6 +6025,10 @@ static const vshCmdOptDef opts_domjobinfo[] =3D { .type =3D VSH_OT_BOOL, .help =3D N_("return statistics of a recently completed job") }, + {.name =3D "keep-completed", + .type =3D VSH_OT_BOOL, + .help =3D N_("don't destroy statistics of a recently completed job wh= en reading") + }, {.name =3D NULL} }; @@ -6117,12 +6121,17 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd) int op; int rc; + VSH_REQUIRE_OPTION("keep-completed", "completed"); + if (!(dom =3D virshCommandOptDomain(ctl, cmd, NULL))) return false; if (vshCommandOptBool(cmd, "completed")) flags |=3D VIR_DOMAIN_JOB_STATS_COMPLETED; + if (vshCommandOptBool(cmd, "keep-completed")) + flags |=3D VIR_DOMAIN_JOB_STATS_COMPLETED_KEEP; + memset(&info, 0, sizeof(info)); rc =3D virDomainGetJobStats(dom, &info.type, ¶ms, &nparams, flags); diff --git a/tools/virsh.pod b/tools/virsh.pod index 2dce4493cb..6c14520780 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -1380,12 +1380,13 @@ Returns basic information about the domain. Abort the currently running domain job. -=3Ditem B I [I<--completed>] +=3Ditem B I [I<--completed>] [I<--keep-completed>] 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 or when libvirtd -is restarted. Note that time information returned for completed +a completed job are automatically destroyed once read (unless +I<--keep-completed> is used) or when libvirtd is restarted. +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 on both of them). --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list