From nobody Thu May 15 19:15:51 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1503016614495231.96933750249843; Thu, 17 Aug 2017 17:36:54 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 2D3FC81DE3; Fri, 18 Aug 2017 00:36:52 +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 DEA7D5EDE3; Fri, 18 Aug 2017 00:36: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 CB0811800C89; Fri, 18 Aug 2017 00:36:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v7I0an6Z004306 for ; Thu, 17 Aug 2017 20:36:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 75D3D6061E; Fri, 18 Aug 2017 00:36:49 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6FED2614FE for ; Fri, 18 Aug 2017 00:36:47 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D66954ACA7 for ; Fri, 18 Aug 2017 00:36:45 +0000 (UTC) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v7HMF96p145322 for ; Thu, 17 Aug 2017 18:17:33 -0400 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0b-001b2d01.pphosted.com with ESMTP id 2cdg4qu7p2-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 17 Aug 2017 18:17:32 -0400 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 17 Aug 2017 18:17:31 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 17 Aug 2017 18:17:29 -0400 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v7HMHTr123724118; Thu, 17 Aug 2017 22:17:29 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ED91F12403D; Thu, 17 Aug 2017 18:14:50 -0400 (EDT) Received: from localhost.localdomain.com (unknown [9.40.193.43]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP id B4979124037; Thu, 17 Aug 2017 18:14:50 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2D3FC81DE3 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2D3FC81DE3 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D66954ACA7 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=scottgar@linux.vnet.ibm.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D66954ACA7 From: "Scott Garfinkle" To: libvir-list@redhat.com Date: Thu, 17 Aug 2017 17:17:21 -0500 In-Reply-To: <1503008242-112534-1-git-send-email-scottgar@linux.vnet.ibm.com> References: <1503008242-112534-1-git-send-email-scottgar@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17081722-0036-0000-0000-0000025A7CB6 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007563; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000222; SDB=6.00903809; UDB=6.00452798; IPR=6.00684021; BA=6.00005538; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016745; XFM=3.00000015; UTC=2017-08-17 22:17:30 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17081722-0037-0000-0000-000041794CC8 Message-Id: <1503008242-112534-4-git-send-email-scottgar@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-08-17_13:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1708170360 X-Greylist: Delayed for 02:19:15 by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 18 Aug 2017 00:36:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 18 Aug 2017 00:36:47 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'scottgar@linux.vnet.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.72 (RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Scott Garfinkle Subject: [libvirt] [PATCH v4 3/4] virsh: Add support for virDomainMigrateGetMaxDowntime 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 18 Aug 2017 00:36:53 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Implement a migrate-getmaxdowntime command to complement migrate-setmaxdown= time. Reviewed-by: John Ferlan --- tools/virsh-domain.c | 42 ++++++++++++++++++++++++++++++++++++++++++ tools/virsh.pod | 6 ++++++ 2 files changed, 48 insertions(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 40f1673..012c96e 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -10719,6 +10719,42 @@ cmdMigrateSetMaxDowntime(vshControl *ctl, const vs= hCmd *cmd) return ret; } =20 + /* + * "migrate-getmaxdowntime" command + */ +static const vshCmdInfo info_migrate_getmaxdowntime[] =3D { + {.name =3D "help", + .data =3D N_("get maximum tolerable downtime") + }, + {.name =3D "desc", + .data =3D N_("Get maximum tolerable downtime of a domain which is bei= ng live-migrated to another host.") + }, + {.name =3D NULL} +}; + +static const vshCmdOptDef opts_migrate_getmaxdowntime[] =3D { + VIRSH_COMMON_OPT_DOMAIN_FULL, + {.name =3D NULL} +}; + +static bool +cmdMigrateGetMaxDowntime(vshControl *ctl, const vshCmd *cmd) +{ + virDomainPtr dom; + unsigned long long downtime; + bool ret =3D false; + + if ((dom =3D virshCommandOptDomain(ctl, cmd, NULL)) !=3D NULL) { + if (virDomainMigrateGetMaxDowntime(dom, &downtime, 0) >=3D 0) { + vshPrint(ctl, "%llu\n", downtime); + ret =3D true; + } + virshDomainFree(dom); + } + + return ret; +} + /* * "migrate-compcache" command */ @@ -13875,6 +13911,12 @@ const vshCmdDef domManagementCmds[] =3D { .info =3D info_migrate_setmaxdowntime, .flags =3D 0 }, + {.name =3D "migrate-getmaxdowntime", + .handler =3D cmdMigrateGetMaxDowntime, + .opts =3D opts_migrate_getmaxdowntime, + .info =3D info_migrate_getmaxdowntime, + .flags =3D 0 + }, {.name =3D "migrate-compcache", .handler =3D cmdMigrateCompCache, .opts =3D opts_migrate_compcache, diff --git a/tools/virsh.pod b/tools/virsh.pod index 43d6f0c..15a4143 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -1857,6 +1857,12 @@ Set maximum tolerable downtime for a domain which is= being live-migrated to another host. The I is a number of milliseconds the guest is al= lowed to be down at the end of live migration. =20 +=3Ditem B I + +Get the maximum tolerable downtime for a domain which is being live-migrat= ed to +another host. This is the number of milliseconds the guest is allowed +to be down at the end of live migration. + =3Ditem B I [I<--size> B] =20 Sets and/or gets size of the cache (in bytes) used for compressing repeate= dly --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list