From nobody Mon Apr 29 09:46:45 2024 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 1503958609001806.5124546824172; Mon, 28 Aug 2017 15:16:49 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 4F861C047B81; Mon, 28 Aug 2017 22:16:45 +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 394EC68882; Mon, 28 Aug 2017 22:16:44 +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 7ADC21806101; Mon, 28 Aug 2017 22:16:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v7SMGcaT000938 for ; Mon, 28 Aug 2017 18:16:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4404E68886; Mon, 28 Aug 2017 22:16:38 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.phx2.redhat.com [10.3.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id F2E9968883 for ; Mon, 28 Aug 2017 22:16:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4F861C047B81 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: John Ferlan To: libvir-list@redhat.com Date: Mon, 28 Aug 2017 18:16:33 -0400 Message-Id: <20170828221633.32573-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [libvirt-go PATCH] Add MigrateGetMaxDowntime API 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 28 Aug 2017 22:16:47 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: John Ferlan --- This is a "best guess" effort - basically copied some previous examples from recent comments, built, and ran the same test that the CI build test runs. domain.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/domain.go b/domain.go index cc786dd..f83aa31 100644 --- a/domain.go +++ b/domain.go @@ -2319,6 +2319,21 @@ func (d *Domain) MigrateSetMaxSpeed(speed uint64, fl= ags uint32) error { return nil } =20 +func (d *Domain) MigrateGetMaxDowntime(flags uint32) (uint64, error) { + var downtime C.ulonglong + + if C.LIBVIR_VERSION_NUMBER < 3007000 { + return 0, GetNotImplementedError("virDomainMigrateGetMaxDowntime") + } + + ret :=3D C.virDomainMigrateGetMaxDowntime(d.ptr, &downtime, C.uint(flags)) + if ret =3D=3D -1 { + return 0, GetLastError() + } + + return uint64(downtime), nil +} + func (d *Domain) MigrateSetMaxDowntime(downtime uint64, flags uint32) erro= r { ret :=3D C.virDomainMigrateSetMaxDowntime(d.ptr, C.ulonglong(downtime), C= .uint(flags)) if ret =3D=3D -1 { --=20 2.9.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list