From nobody Thu Apr 18 20:44:51 2024 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=1574694185; cv=none; d=zohomail.com; s=zohoarc; b=BVwdVsGs6aQzj0y01UrAbH2C3pwoXyTQhxadvWEl7cbcF2I2rM6ldrr8ehxW+FPSB5S7MREGGX/ciXOMrCJHqXpfPoaigTcUBU4dhuQtshhva+tjR1WCfL2T5mPEmMv2XOZZda3QoIX4cgQnJnlkM/XrTb+Zx5k8dZZ7yryFqMQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574694185; 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=AW1r6GdCcSnpKWPcmQa5EDFgC+2rcJlX3SKOg7BbVww=; b=YjsjMrzqzngw8meimVQ2CCPtY+hf1aXnR/EhmqxL1mWm7cjN8pF3WsIp2BTXCgmfytdH+QidQUIklUI0eJX+HZM1qJdkUFBC1Bn25rmQVKNCj79C2AcQkEsUowBcio3A0oqENfr+90AFlifYMnahToMhcqiUZJ/H5TitSNG1UM0= 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-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 157469418512599.21362846045974; Mon, 25 Nov 2019 07:03:05 -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-150-A-L-oVRcMpCN-s2PswKEKg-1; Mon, 25 Nov 2019 10:02:06 -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 5AF758A2E20; Mon, 25 Nov 2019 15:01:59 +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 F3BA460C18; Mon, 25 Nov 2019 15:01:58 +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 A2ABF41F02; Mon, 25 Nov 2019 15:01:58 +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 xAPF1jVF021994 for ; Mon, 25 Nov 2019 10:01:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1A7BD5D6AE; Mon, 25 Nov 2019 15:01:45 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 930905D6A0 for ; Mon, 25 Nov 2019 15:01:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574694182; 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=AW1r6GdCcSnpKWPcmQa5EDFgC+2rcJlX3SKOg7BbVww=; b=U16xn9ZY6PE2WWlVBlVSriWzMb5fxM7gBPll66AufhN66wEFANjviNVB8r/IQrEhsq7rbn FATaX24IlgN4/yqISce58jnbOb+N1V9VjGletEhJvH+eG5nDnltzrT7z70oGetEu5Bf4c1 jYLnYeycd6HPMTYqMQ96b0zJMon1X9g= From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 25 Nov 2019 16:01:28 +0100 Message-Id: <6a695bd599055a2d7ef9881d5b29b061839a54f6.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 1/9] virsh: domain: Extract the code converting domain job stats to virDomainJobInfo 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: A-L-oVRcMpCN-s2PswKEKg-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" To simplify the stats printer code we convert the new statistics from the typed parameter list into the old stats structure. Extract this code since it takes a lot of space. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tools/virsh-domain.c | 72 +++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 6be9780836..99194c2f81 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -6065,6 +6065,42 @@ virshDomainJobOperationToString(int op) return str ? _(str) : _("unknown"); } + +static int +virshDomainJobStatsToDomainJobInfo(virTypedParameterPtr params, + int nparams, + virDomainJobInfo *info) +{ + if (virTypedParamsGetULLong(params, nparams, VIR_DOMAIN_JOB_TIME_ELAPS= ED, + &info->timeElapsed) < 0 || + virTypedParamsGetULLong(params, nparams, VIR_DOMAIN_JOB_TIME_REMAI= NING, + &info->timeRemaining) < 0 || + virTypedParamsGetULLong(params, nparams, VIR_DOMAIN_JOB_DATA_TOTAL, + &info->dataTotal) < 0 || + virTypedParamsGetULLong(params, nparams, VIR_DOMAIN_JOB_DATA_PROCE= SSED, + &info->dataProcessed) < 0 || + virTypedParamsGetULLong(params, nparams, VIR_DOMAIN_JOB_DATA_REMAI= NING, + &info->dataRemaining) < 0 || + virTypedParamsGetULLong(params, nparams, VIR_DOMAIN_JOB_MEMORY_TOT= AL, + &info->memTotal) < 0 || + virTypedParamsGetULLong(params, nparams, VIR_DOMAIN_JOB_MEMORY_PRO= CESSED, + &info->memProcessed) < 0 || + virTypedParamsGetULLong(params, nparams, VIR_DOMAIN_JOB_MEMORY_REM= AINING, + &info->memRemaining) < 0 || + virTypedParamsGetULLong(params, nparams, VIR_DOMAIN_JOB_DISK_TOTAL, + &info->fileTotal) < 0 || + virTypedParamsGetULLong(params, nparams, VIR_DOMAIN_JOB_DISK_PROCE= SSED, + &info->fileProcessed) < 0 || + virTypedParamsGetULLong(params, nparams, VIR_DOMAIN_JOB_DISK_REMAI= NING, + &info->fileRemaining) < 0) { + vshSaveLibvirtError(); + return -1; + } + + return 0; +} + + static bool cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd) { @@ -6091,40 +6127,8 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd) rc =3D virDomainGetJobStats(dom, &info.type, ¶ms, &nparams, flags); if (rc =3D=3D 0) { - if (virTypedParamsGetULLong(params, nparams, - VIR_DOMAIN_JOB_TIME_ELAPSED, - &info.timeElapsed) < 0 || - virTypedParamsGetULLong(params, nparams, - VIR_DOMAIN_JOB_TIME_REMAINING, - &info.timeRemaining) < 0 || - virTypedParamsGetULLong(params, nparams, - VIR_DOMAIN_JOB_DATA_TOTAL, - &info.dataTotal) < 0 || - virTypedParamsGetULLong(params, nparams, - VIR_DOMAIN_JOB_DATA_PROCESSED, - &info.dataProcessed) < 0 || - virTypedParamsGetULLong(params, nparams, - VIR_DOMAIN_JOB_DATA_REMAINING, - &info.dataRemaining) < 0 || - virTypedParamsGetULLong(params, nparams, - VIR_DOMAIN_JOB_MEMORY_TOTAL, - &info.memTotal) < 0 || - virTypedParamsGetULLong(params, nparams, - VIR_DOMAIN_JOB_MEMORY_PROCESSED, - &info.memProcessed) < 0 || - virTypedParamsGetULLong(params, nparams, - VIR_DOMAIN_JOB_MEMORY_REMAINING, - &info.memRemaining) < 0 || - virTypedParamsGetULLong(params, nparams, - VIR_DOMAIN_JOB_DISK_TOTAL, - &info.fileTotal) < 0 || - virTypedParamsGetULLong(params, nparams, - VIR_DOMAIN_JOB_DISK_PROCESSED, - &info.fileProcessed) < 0 || - virTypedParamsGetULLong(params, nparams, - VIR_DOMAIN_JOB_DISK_REMAINING, - &info.fileRemaining) < 0) - goto save_error; + if (virshDomainJobStatsToDomainJobInfo(params, nparams, &info) < 0) + goto cleanup; } else if (last_error->code =3D=3D VIR_ERR_NO_SUPPORT) { if (flags) { vshError(ctl, "%s", _("Optional flags are not supported by the= " --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 18 20:44:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; 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.120 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=1574694132; cv=none; d=zohomail.com; s=zohoarc; b=dVy1f8iYYUSfBP4eN9n4NAcoinNJv4G1GUrRsgR5PqLSpb/WiCrCXNa1fJRooy9jmqJOnm+b4+UDDSkvcQRb5VtNObvrFs8uiv+9p70RTVBxzUpLvWKg0cUA85zqolCMsxRVSzyEYGx0aEl5HYzVPSHFctCMZ5AtkH2iTrA/O3c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574694132; 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=iQ0ES71WvTrwu/ES3isM6tj9vFrQcbo9Cse71lMbVvo=; b=FDP6rfYKafa04Mj9o34o0j8he8NP7dJNfL2EO+NO4nnsJzc/+NPUfqruLkDs5bYgQSEm+ZL4E4ptWfXRc6tGBCSLrdJDhlx6A+xlH2OCWgzKz2Dss6yHirdEYLqhNDo4owjpda2wc1QSKAN2U8UD8qXlmKGkDlpd7PfBGxfVADY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1574694132241964.8027540849347; Mon, 25 Nov 2019 07:02:12 -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-96-T5vYlRR9PkeeDP_Rkwfx6A-1; Mon, 25 Nov 2019 10:02:09 -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 046EA1856A65; Mon, 25 Nov 2019 15:02: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 C8BCE5C241; Mon, 25 Nov 2019 15:02:03 +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 46F2E182B014; Mon, 25 Nov 2019 15:02:03 +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 xAPF1jEG022002 for ; Mon, 25 Nov 2019 10:01:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id E26135D6AE; Mon, 25 Nov 2019 15:01:45 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67ECF5D6A0 for ; Mon, 25 Nov 2019 15:01:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574694131; 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=iQ0ES71WvTrwu/ES3isM6tj9vFrQcbo9Cse71lMbVvo=; b=H6NF0EgUnEZkNhnNMe25YliR16jEuy2EMpxZkgqC9214uPmnv556xxP5KhP6/jENZ9Tcdj FV6y4xOP/H3DHX801EjAra+YnmQF2BwO1f9rTdOTgtWk1zDhPo7REldmsQAhh8z+vAoIaZ gvPc64Kp7f4veoaEtq8FPS2TORdvbAc= From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 25 Nov 2019 16:01:29 +0100 Message-Id: <3dbe2587f4740418056d466286c74e8746c5b69f.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 2/9] api: Allow keeping completed domain job stats when reading them 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: T5vYlRR9PkeeDP_Rkwfx6A-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" virDomainGetJobStats destroys the completed statistics on the first read. Give the user possibility to keep them around if they wish so. Add a flag VIR_DOMAIN_JOB_STATS_COMPLETED_KEEP which will read the stats without destroying them. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- include/libvirt/libvirt-domain.h | 2 ++ src/libvirt-domain.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index a2f007568c..84b3cfdff7 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -3246,6 +3246,8 @@ struct _virDomainJobInfo { typedef enum { VIR_DOMAIN_JOB_STATS_COMPLETED =3D 1 << 0, /* return stats of a recent= ly * completed job */ + VIR_DOMAIN_JOB_STATS_COMPLETED_KEEP =3D 1 << 1, /* don't remove comple= ted + stats when reading th= em */ } virDomainGetJobStatsFlags; int virDomainGetJobInfo(virDomainPtr dom, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 51fb79cddd..77169ec4ca 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -8796,7 +8796,8 @@ virDomainGetJobInfo(virDomainPtr domain, virDomainJob= InfoPtr info) * flag may be used to query statistics of a completed incoming pre-copy * migration (statistics for post-copy migration are only available on the * source host). Statistics of a completed job are automatically destroyed - * once read or when libvirtd is restarted. Note that time information + * once read (unless the VIR_DOMAIN_JOB_STATS_COMPLETED_KEEP is used as we= ll) + * or when libvirtd is restarted. Note that time information * returned for completed migrations may be completely irrelevant unless b= oth * source and destination hosts have synchronized time (i.e., NTP daemon is * running on both of them). The statistics of a completed job can also be @@ -8823,6 +8824,9 @@ virDomainGetJobStats(virDomainPtr domain, virCheckNonNullArgGoto(type, error); virCheckNonNullArgGoto(params, error); virCheckNonNullArgGoto(nparams, error); + VIR_REQUIRE_FLAG_GOTO(VIR_DOMAIN_JOB_STATS_COMPLETED_KEEP, + VIR_DOMAIN_JOB_STATS_COMPLETED, + error); conn =3D domain->conn; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 18 20:44:51 2024 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 From nobody Thu Apr 18 20:44:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; 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 207.211.31.120 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=1574694138; cv=none; d=zohomail.com; s=zohoarc; b=llgUZ4IIRoZ6+eICzUtnk7TT9dgyb36gVc1YGL0aqTAOiX36Oj7l4LQrLV2ikf9ALwUlvSmYkoHvzb3XmJzzNSQRaWiXcSz55JDsy427dddvpesf8yA0D4c/6uByP4dMemkqRgNCgimuulXnScrMCpv+vcPWZ8vCYYpn884uds0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574694138; 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=z5syu9mDN+KAY2VRaTtFQnbfN8wexaho54bYrO12Zog=; b=XAxq9rmKNZv7lpgA/n7Cu+o5vh1xDcrfQXnZwVjPCbTRLxEzpDM+Dv+YA8UCXa7GPQQWDRONBl/Ud9wn9chTYBP9ogJaCa0CKTKwfWb2Q3vpe1EOm3j8XWuyraq7x3tKfaz4My7DrwEamnpIWc0q/uDzc2Az9eskjd7A4xAMTjs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1574694138569264.7575221768659; Mon, 25 Nov 2019 07:02:18 -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-419-Da-jMG4OP0uBjCyYnWw2Xw-1; Mon, 25 Nov 2019 10:02:15 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 608DC805A05; Mon, 25 Nov 2019 15:02:09 +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 2EDB2600C6; Mon, 25 Nov 2019 15:02:09 +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 CB44A4BB78; Mon, 25 Nov 2019 15:02:08 +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 xAPF1lrR022017 for ; Mon, 25 Nov 2019 10:01:47 -0500 Received: by smtp.corp.redhat.com (Postfix) id 84E3A5D6AE; Mon, 25 Nov 2019 15:01:47 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C5A35D6A0 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=1574694137; 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=z5syu9mDN+KAY2VRaTtFQnbfN8wexaho54bYrO12Zog=; b=esmuK1bLisweDzrWd00Lfc5y///PFG4pjAQVQf3+fR1Vj7NaRSYXm3SFanVZ+oi4808G9f znqDMuFpLZsBdi793goUgbT+x3YBSAefex4k5ywkX8hlN66YU55pDXY2dyL1Ci69vXZegE eER63d5XcJ82YCdhmipVrCC8F18tLqs= From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 25 Nov 2019 16:01:31 +0100 Message-Id: <4a588f921f730589868900c5eaea21a4fe9455e6.1574693959.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 4/9] qemu: Implement VIR_DOMAIN_JOB_STATS_COMPLETED_KEEP 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.11 X-MC-Unique: Da-jMG4OP0uBjCyYnWw2Xw-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 Reviewed-by: Eric Blake --- src/qemu/qemu_driver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 669c12d6ca..5d6a82bc13 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13958,7 +13958,8 @@ qemuDomainGetJobStats(virDomainPtr dom, bool completed =3D !!(flags & VIR_DOMAIN_JOB_STATS_COMPLETED); int ret =3D -1; - virCheckFlags(VIR_DOMAIN_JOB_STATS_COMPLETED, -1); + virCheckFlags(VIR_DOMAIN_JOB_STATS_COMPLETED | + VIR_DOMAIN_JOB_STATS_COMPLETED_KEEP, -1); if (!(vm =3D qemuDomainObjFromDomain(dom))) goto cleanup; @@ -13980,7 +13981,7 @@ qemuDomainGetJobStats(virDomainPtr dom, ret =3D qemuDomainJobInfoToParams(&jobInfo, type, params, nparams); - if (completed && ret =3D=3D 0) + if (completed && ret =3D=3D 0 && !(flags & VIR_DOMAIN_JOB_STATS_COMPLE= TED_KEEP)) VIR_FREE(priv->job.completed); cleanup: --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 18 20:44:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; 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.120 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=1574694195; cv=none; d=zohomail.com; s=zohoarc; b=RS5zY3240y1rpMCwnzUGlW1CA6kyW/vbtVLv6p6rS2Fyv+q80DEV2hMN8BfrUiiily51SlCiPZ7OLQM75akKutEToQVNxYqfUZ4bn6WKDivZcV85FMXk8YQfzvBwdt8mKP3gzM0Fl328IqFK9mCA6EGOgm+q14N4si49EiUKjeM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574694195; 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=x3U4CeztWXYjNPis3FyTEfwLwXePUgD36BAjGHUVaDQ=; b=Pbu6gUfbJj6sIHiWSqtXej+ilQNzif8HGeV/zKtYWaL5ZSYo4fxEMgB03Zq1qnCujSkIC5hkGMIp8Oic32ClIExdY4kB7IEBrDkkktEc9Pa/grSBFOUo4+GffE8SLjpVB8R5FNl85H92ECtZrZXsEzM5l+Ypqj4nYjcYuHKngqY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1574694195104104.61470360872454; Mon, 25 Nov 2019 07:03:15 -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-209-AEpqh0CIPW6lWycJyqys1Q-1; Mon, 25 Nov 2019 10:02:22 -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 CDD5A8B5E76; Mon, 25 Nov 2019 15:02:13 +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 A01845C290; Mon, 25 Nov 2019 15:02:13 +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 4E148182B00E; Mon, 25 Nov 2019 15:02:13 +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 xAPF1msh022027 for ; Mon, 25 Nov 2019 10:01:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id 555A05D6B7; Mon, 25 Nov 2019 15:01:48 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id D1DFD5D6A0 for ; Mon, 25 Nov 2019 15:01:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574694193; 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=x3U4CeztWXYjNPis3FyTEfwLwXePUgD36BAjGHUVaDQ=; b=VGCitc+GkmaTs0Mncmty2Q2UbvAiHtRMpFZhuyn6FPUs+e50ltJwjEq3VkKdUt3u9aEM4K lOFqZavQc6MkuNey01Bpy0wniKWyhRTA47rquYINJq2VqSrM1ISnjf9PxqScEueGE8izAi jG3BP1MQ96x2G5V9t7bABqxe1bsEs8k= From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 25 Nov 2019 16:01:32 +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 5/9] virsh: domjobinfo: Print also job operation for failed 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: AEpqh0CIPW6lWycJyqys1Q-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" Printing that a job failed is rather unhelpful. Print at least the operation which failed. Achieve this by moving the check whether to print stats later but replace it with a check which will skip printing of the operation if there's no job. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tools/virsh-domain.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 6e3814f1fd..577dec30c5 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -6153,10 +6153,8 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd) vshPrint(ctl, "%-17s %-12s\n", _("Job type:"), virshDomainJobToString(info.type)); - if (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)) { + + if (info.type =3D=3D VIR_DOMAIN_JOB_NONE) { ret =3D true; goto cleanup; } @@ -6169,6 +6167,14 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd) vshPrint(ctl, "%-17s %-12s\n", _("Operation:"), virshDomainJobOperationToString(op)); + if (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)) { + ret =3D true; + goto cleanup; + } + vshPrint(ctl, "%-17s %-12llu ms\n", _("Time elapsed:"), info.timeElaps= ed); if ((rc =3D virTypedParamsGetULLong(params, nparams, VIR_DOMAIN_JOB_TIME_ELAPSED_NET, --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 18 20:44:51 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-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 From nobody Thu Apr 18 20:44:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; 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.120 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=1574694125; cv=none; d=zohomail.com; s=zohoarc; b=DrDl1789k3AA8TC70DRvGT5rmg6VXUksAPGX/ZY3rL0JVBVCAtFHnvTUq1ope4mRPrCQd3TsXx33lYTUuis2QlEOHNFgofKIZmkBCgDsMHnJ9W0cY2/gc1wrlqWmfYlyPssAYzu3nZSZ1KxKx50FIhoJt1AqD5ph5vqZlCjixoc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574694125; 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=7ZRGPC1K4Od2jY8pzjGrGz8YheXKRndQZC+ucvNhn/0=; b=djkYX5S2ycqj2rehtP9pydFeoY4rMtJE8Jx8TZDmN5gkWIrPabqx8QSPouOgEdzXbPO/BTrbZQEnko4yA2KXyi95OJuu/Jdjh5OEGzTIXdLyrxR0goUhJAa9noJPjRyDk/e2g+owPLuTkXSTp4gd4SaqjV+HWABmysY8kAaL0wo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1574694125074579.8250415501855; Mon, 25 Nov 2019 07:02:05 -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-62-5J_smLOdMS6nWBd0ZeX_-A-1; Mon, 25 Nov 2019 10:02:01 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0EA488005A7; Mon, 25 Nov 2019 15:01:54 +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 CE3D119C69; Mon, 25 Nov 2019 15:01: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 79CCB41F03; Mon, 25 Nov 2019 15:01:53 +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 xAPF1ngd022044 for ; Mon, 25 Nov 2019 10:01:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id EC1535D6AE; 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 73E805D6A0 for ; Mon, 25 Nov 2019 15:01:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574694122; 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=7ZRGPC1K4Od2jY8pzjGrGz8YheXKRndQZC+ucvNhn/0=; b=Ir2G/MN3HsYLSMPI0y+HWnt2hR+wudiz7OGqIKE5zQfT6vgK8ToZJAAq7eUit3Ii4C50dE 8uecLTlpvpKCAlnxWxkqfdDG2cRojC9HCpkfzaS9Mc2ARfRSYUFe3TaXozMVr8UakuZaCP ZLJS1bzD0YY4RjTezWcIhubUsbwV9BM= From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 25 Nov 2019 16:01:34 +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 7/9] virsh: domjobinfo: Add switch to print raw fields 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.84 on 10.5.11.23 X-MC-Unique: 5J_smLOdMS6nWBd0ZeX_-A-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 --rawstats which prints all statistics fields from the new API similarly to how the virsh event handler prints them. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tools/virsh-domain.c | 24 +++++++++++++++++++++--- tools/virsh.pod | 6 +++++- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 81229fa5ca..325d748b49 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -6033,6 +6033,10 @@ static const vshCmdOptDef opts_domjobinfo[] =3D { .type =3D VSH_OT_BOOL, .help =3D N_("print statistics for any kind of job (even failed ones)= ") }, + {.name =3D "rawstats", + .type =3D VSH_OT_BOOL, + .help =3D N_("print the raw data returned by libvirt") + }, {.name =3D NULL} }; @@ -6124,6 +6128,8 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd) int ivalue; int op; int rc; + size_t i; + bool rawstats =3D vshCommandOptBool(cmd, "rawstats"); VSH_REQUIRE_OPTION("keep-completed", "completed"); @@ -6143,9 +6149,9 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd) if (virshDomainJobStatsToDomainJobInfo(params, nparams, &info) < 0) goto cleanup; } else if (last_error->code =3D=3D VIR_ERR_NO_SUPPORT) { - if (flags) { - vshError(ctl, "%s", _("Optional flags are not supported by the= " - "daemon")); + if (flags !=3D 0 || rawstats) { + vshError(ctl, "%s", + _("Optional flags or --rawstats are not supported by = the daemon")); goto cleanup; } vshDebug(ctl, VSH_ERR_DEBUG, "detailed statistics not supported\n"= ); @@ -6155,6 +6161,18 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd) if (rc < 0) goto cleanup; + if (rawstats) { + vshPrint(ctl, "Job type: %d\n\n", info.type); + + for (i =3D 0; i < nparams; i++) { + g_autofree char *par =3D virTypedParameterToString(¶ms[i]); + vshPrint(ctl, "%s: %s\n", params[i].field, NULLSTR(par)); + } + + ret =3D true; + goto cleanup; + } + vshPrint(ctl, "%-17s %-12s\n", _("Job type:"), virshDomainJobToString(info.type)); diff --git a/tools/virsh.pod b/tools/virsh.pod index e5428976a0..951cb738a0 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -1381,7 +1381,7 @@ Returns basic information about the domain. Abort the currently running domain job. =3Ditem B I [I<--completed>] [I<--keep-completed>] -[I<--anystats>] +[I<--anystats>] [I<--rawstats>] Returns information about jobs running on a domain. I<--completed> tells virsh to return information about a recently finished job. Statistics of @@ -1391,6 +1391,10 @@ I<--keep-completed> is used) or when libvirtd is res= tarted. Normally only statistics for running and successful completed jobs are pri= nted. I<--anystats> can be used to display statistics also for failed jobs. +In case I<--rawstats> is used, all fields are printed as received from the +server without any attempts to interpred the data. The "Job type:" field is +special, since it's reported by the API and not part of stats. + 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 From nobody Thu Apr 18 20:44:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; 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.120 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=1574694152; cv=none; d=zohomail.com; s=zohoarc; b=CYJsQjN+dsuSZco+RBr+JxHQTiWFkjDo6rkCWbSU1MCt+VGvikstyqRoA2WH6SZjxp+ebabxi1locQgYy7zKEZXeeS3UmRFjcwoSqTc8KLsZ9O/+XDvj4Ivqei0qn5IHn3NkpC7ttyw/+2ufWHtZoGnWEWuuNYCUxLlNhdd+n/o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574694152; 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=6XUeDaImLs68D/BylTYRyEZOWmfGDVwy+nfD9KgESYo=; b=Bx1TDVY/KyF0Sc0TMyndufJ0niz+OgM3ZjYm9xEHY54t/yb+J3vN/udkZjIyCgM2x85YETqCfJNDvvwp8UpPd3wxyQaJDVH6jfgQo1BNBJF8gFYR7js7div3RbRZ9bEXmnzh2bdYzERbV52NQfQe0WPbtVQ7QbvJPmHG9DNlCak= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1574694152929895.3204772887506; Mon, 25 Nov 2019 07:02:32 -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-300-uG2P-m14P8uoZwg-CrYo-Q-1; Mon, 25 Nov 2019 10:02:24 -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 533A71007246; Mon, 25 Nov 2019 15:02:18 +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 1A64C608C8; Mon, 25 Nov 2019 15:02:18 +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 B167141F02; Mon, 25 Nov 2019 15:02:17 +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 xAPF1oVg022049 for ; Mon, 25 Nov 2019 10:01:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id C14AD5D6B7; Mon, 25 Nov 2019 15:01:50 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 460C15D6A0 for ; Mon, 25 Nov 2019 15:01:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574694151; 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=6XUeDaImLs68D/BylTYRyEZOWmfGDVwy+nfD9KgESYo=; b=VjQRWImC+KBkaw6YFVt9sOPg6HwFi+QNOQg2/T9ASEBL1pzKNLdc3kD0z4zxW30ai5D3jM QADXhOTd34W+O440dVz2TCv5OwIEOmKsR9ldwN7bRDUAzBcVhRwZRy9TpyA31wxqnwtwjs HAkhW3GFBktubG0AIdURls7nVgwqnPA= From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 25 Nov 2019 16:01:35 +0100 Message-Id: <680ee5357b4a1bbb5391d3ebced767f1237a038c.1574693959.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 8/9] API: Introduce VIR_DOMAIN_JOB_SUCCESS field for virDomainGetJobStats 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 X-MC-Unique: uG2P-m14P8uoZwg-CrYo-Q-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" The statistics fields are used in two places: 1) virDomainGetJobStats where the job type which ultimately holds whether the job was successful or not is returned via a different argument. 2) The virConnectDomainEventJobCompleted event where we report just the statistics via typed parameters. Since it might be useful to report the event also for jobs which completed unsuccessfully and we don't have the means to transport the state via a different variable with the event let's add a new field which will hold the success state. Since this is meant primarily for completed jobs a plain boolean is sufficient to convey whether the job was successful or not. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- include/libvirt/libvirt-domain.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index 84b3cfdff7..0e490254fd 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -3578,6 +3578,13 @@ typedef enum { */ # define VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE "auto_converge_throttle" +/** + * VIR_DOMAIN_JOB_SUCCESS: + * + * virDomainGetJobStats field: Present only in statistics for a completed = job. + * Successful completion of the job as VIR_TYPED_PARAM_BOOLEAN. + */ +# define VIR_DOMAIN_JOB_SUCCESS "success" /** * virConnectDomainEventGenericCallback: --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 18 20:44:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; 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.120 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=1574694131; cv=none; d=zohomail.com; s=zohoarc; b=lQl+aRrk/dEVcGU8eNKo81BuMW61X8H4GIA9+Menbd3HeNz8ewcnL3b7nBYev2uOTlhuLDpdEoF/a4zeUxfAuTXRvuHZgK/boV/4EzhpaAwbrossa+65l+jcRJm9eF05UWTasMakSZXqhdd/w7e3lcvRL6qIZu4m7mhBAsTy8G0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574694131; 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=BWf5DC9bQnZO1jaf/gwZ377tvAaYsdwdeKR2ymvYqPo=; b=PhEmvT6utvWTLeuVIpmoi1xalzPBI4I+V8FCAhrvYStuFieLMyfyT/vCvA/EpoS5C1LAtwVlvpXkmoYg/BwaGIEzIOddtohmokMtnVLfF52bFX2SQd+exTiBQjNj4ePhNuSC/fQc+TQzqZ/KvD4Yg41cFJGCzYiI0A8BaROz0kU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1574694131440190.86920807302715; Mon, 25 Nov 2019 07:02:11 -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-16-HYq92xvBMrutKMZKOP5Y6A-1; Mon, 25 Nov 2019 10:02:08 -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 C315A100FB94; Mon, 25 Nov 2019 15:01:58 +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 936E960C18; Mon, 25 Nov 2019 15:01:58 +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 06754182B013; Mon, 25 Nov 2019 15:01:58 +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 xAPF1pTD022057 for ; Mon, 25 Nov 2019 10:01:51 -0500 Received: by smtp.corp.redhat.com (Postfix) id 965E55D6AE; Mon, 25 Nov 2019 15:01:51 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1841F5D6A0 for ; Mon, 25 Nov 2019 15:01:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574694130; 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=BWf5DC9bQnZO1jaf/gwZ377tvAaYsdwdeKR2ymvYqPo=; b=NH+4Z4xbWXU08tQGRgNMN19v4o+NdWyGYmXE9fFL0c+9jfDE/agMtYL5hNhKinRMqrWGa0 aBlI+8kO+tpMKRBmYhdqUHzsFxfbXK8cvsdBeXPpkEF+9Z+UYNsSQGW4+Eg5NVJ0cqYGzs 555wxWanONdVutDJ7uw32dtGfy+SdcE= From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 25 Nov 2019 16:01:36 +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 9/9] qemu: Always reset @info in qemuDomainGetJobInfo 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: HYq92xvBMrutKMZKOP5Y6A-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" qemuDomainGetJobInfo didn't always reset the return data in @info. Thankfully this wouldn't be a problem as the RPC layer does it but we should do it anyways. Since we reset the struct we don't have to set the type to VIR_DOMAIN_JOB_NONE is as the value is 0. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5d6a82bc13..112d7a6861 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13920,6 +13920,8 @@ qemuDomainGetJobInfo(virDomainPtr dom, virDomainObjPtr vm; int ret =3D -1; + memset(info, 0, sizeof(*info)); + if (!(vm =3D qemuDomainObjFromDomain(dom))) goto cleanup; @@ -13930,8 +13932,6 @@ qemuDomainGetJobInfo(virDomainPtr dom, goto cleanup; if (jobInfo.status =3D=3D QEMU_DOMAIN_JOB_STATUS_NONE) { - memset(info, 0, sizeof(*info)); - info->type =3D VIR_DOMAIN_JOB_NONE; ret =3D 0; goto cleanup; } --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list