From nobody Fri May 3 14:06:35 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15508495819721022.1135242124341; Fri, 22 Feb 2019 07:33:01 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 2F8FA5D5EF; Fri, 22 Feb 2019 15:33:00 +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 04A6960BF4; Fri, 22 Feb 2019 15:33:00 +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 B739F181A00D; Fri, 22 Feb 2019 15:32:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1MFWdhb009232 for ; Fri, 22 Feb 2019 10:32:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id 820195D9E2; Fri, 22 Feb 2019 15:32:39 +0000 (UTC) Received: from beluga.usersys.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id D1E265D9D5; Fri, 22 Feb 2019 15:32:38 +0000 (UTC) From: Erik Skultety To: libvir-list@redhat.com Date: Fri, 22 Feb 2019 16:32:28 +0100 Message-Id: <36ef867d031eb44352a65b3f22baf7708f33038a.1550849325.git.eskultet@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Erik Skultety Subject: [libvirt] [libvirt-go PATCH 1/3] Introduce DomainSnapshotXMLFlags constant 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: , 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 22 Feb 2019 15:33:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Erik Skultety Reviewed-by: Daniel P. Berrang=C3=A9 --- domain_compat.h | 4 ++++ domain_snapshot.go | 6 ++++++ domain_snapshot_wrapper.h | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/domain_compat.h b/domain_compat.h index 9a30e8f..d5a3f78 100644 --- a/domain_compat.h +++ b/domain_compat.h @@ -948,4 +948,8 @@ struct _virDomainInterface { #define VIR_DOMAIN_MIGRATE_MAX_SPEED_POSTCOPY (1 << 0) #endif =20 +#ifndef VIR_DOMAIN_SNAPSHOT_XML_SECURE +#define VIR_DOMAIN_SNAPSHOT_XML_SECURE (1 << 0) +#endif + #endif /* LIBVIRT_GO_DOMAIN_COMPAT_H__ */ diff --git a/domain_snapshot.go b/domain_snapshot.go index 65fbbb5..86c7c51 100644 --- a/domain_snapshot.go +++ b/domain_snapshot.go @@ -84,6 +84,12 @@ const ( DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY =3D DomainSnapshotDeleteFlags(C.VIR_= DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY) ) =20 +type DomainSnapshotXMLFlags int + +const ( + DOMAIN_SNAPSHOT_XML_SECURE =3D DomainSnapshotXMLFlags(C.VIR_DOMAIN_S= NAPSHOT_XML_SECURE) +) + type DomainSnapshot struct { ptr C.virDomainSnapshotPtr } diff --git a/domain_snapshot_wrapper.h b/domain_snapshot_wrapper.h index fcf8036..b2e5cc5 100644 --- a/domain_snapshot_wrapper.h +++ b/domain_snapshot_wrapper.h @@ -28,7 +28,7 @@ =20 #include #include - +#include "domain_compat.h" =20 int virDomainRevertToSnapshotWrapper(virDomainSnapshotPtr snapshot, --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 14:06:35 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1550849567434884.5127401887619; Fri, 22 Feb 2019 07:32:47 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 80FCC3024EA2; Fri, 22 Feb 2019 15:32:44 +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 3029F601A1; Fri, 22 Feb 2019 15:32: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 5E03741F3E; Fri, 22 Feb 2019 15:32:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1MFWeVK009237 for ; Fri, 22 Feb 2019 10:32:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id 83A035D9E1; Fri, 22 Feb 2019 15:32:40 +0000 (UTC) Received: from beluga.usersys.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id D45875D9D5; Fri, 22 Feb 2019 15:32:39 +0000 (UTC) From: Erik Skultety To: libvir-list@redhat.com Date: Fri, 22 Feb 2019 16:32:29 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Erik Skultety Subject: [libvirt] [libvirt-go PATCH 2/3] Introduce DomainSaveImageXMLFlags constant 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: , 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 22 Feb 2019 15:32:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Erik Skultety Reviewed-by: Daniel P. Berrang=C3=A9 --- domain.go | 8 +++++++- domain_compat.h | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/domain.go b/domain.go index 91b8399..9211b6e 100644 --- a/domain.go +++ b/domain.go @@ -817,6 +817,12 @@ const ( MIGRATE_MAX_SPEED_POSTCOPY =3D DomainMigrateMaxSpeedFlags(C.VIR_DOMAIN_MI= GRATE_MAX_SPEED_POSTCOPY) ) =20 +type DomainSaveImageXMLFlags int + +const ( + VIR_DOMAIN_SAVE_IMAGE_XML_SECURE =3D DomainSaveImageXMLFlags(C.VIR_DOMAIN= _SAVE_IMAGE_XML_SECURE) +) + type VcpuState int =20 const ( @@ -4677,7 +4683,7 @@ func (d *Domain) ManagedSaveDefineXML(xml string, fla= gs uint32) error { } =20 // See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomain= ManagedSaveGetXMLDesc -func (d *Domain) ManagedSaveGetXMLDesc(flags uint32) (string, error) { +func (d *Domain) ManagedSaveGetXMLDesc(flags DomainSaveImageXMLFlags) (str= ing, error) { if C.LIBVIR_VERSION_NUMBER < 3007000 { return "", makeNotImplementedError("virDomainManagedSaveGetXMLDesc") } diff --git a/domain_compat.h b/domain_compat.h index d5a3f78..be6f1c4 100644 --- a/domain_compat.h +++ b/domain_compat.h @@ -952,4 +952,8 @@ struct _virDomainInterface { #define VIR_DOMAIN_SNAPSHOT_XML_SECURE (1 << 0) #endif =20 +#ifndef VIR_DOMAIN_SAVE_IMAGE_XML_SECURE +#define VIR_DOMAIN_SAVE_IMAGE_XML_SECURE (1 << 0) +#endif + #endif /* LIBVIRT_GO_DOMAIN_COMPAT_H__ */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 14:06:35 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1550849581316699.367848821058; Fri, 22 Feb 2019 07:33:01 -0800 (PST) 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 5AFD6300207F; Fri, 22 Feb 2019 15:32:59 +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 335975D71D; Fri, 22 Feb 2019 15:32:59 +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 DCD5B181A00B; Fri, 22 Feb 2019 15:32:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1MFWfux009247 for ; Fri, 22 Feb 2019 10:32:41 -0500 Received: by smtp.corp.redhat.com (Postfix) id 869A55D9E2; Fri, 22 Feb 2019 15:32:41 +0000 (UTC) Received: from beluga.usersys.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id D3EE05D9D5; Fri, 22 Feb 2019 15:32:40 +0000 (UTC) From: Erik Skultety To: libvir-list@redhat.com Date: Fri, 22 Feb 2019 16:32:30 +0100 Message-Id: <42a3a3ea147f1790f498d6230b4a1bf624131aa5.1550849325.git.eskultet@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Erik Skultety Subject: [libvirt] [libvirt-go PATCH 3/3] Enforce new flags types in DomainSaveImageGetXMLDesc and GetXMLDesc 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: , 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.42]); Fri, 22 Feb 2019 15:33:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This breaks API compatibility! Recently libvirt introduced 2 new separate flag enums in order to stop recycling the old virDomainXMLFlags since 2/3 flags were discouraged to use. While it's fine for libvirt to introduce such a change since it uses plain 'int' for flags, not so much for the Go bindings which already enforced the now deprecated DomainXMLFlags type. Signed-off-by: Erik Skultety Reviewed-by: Daniel P. Berrang=C3=A9 --- connect.go | 2 +- domain_snapshot.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/connect.go b/connect.go index f77d10d..0d5118c 100644 --- a/connect.go +++ b/connect.go @@ -2038,7 +2038,7 @@ func (c *Connect) DomainSaveImageDefineXML(file strin= g, xml string, flags Domain } =20 // See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomain= SaveImageGetXMLDesc -func (c *Connect) DomainSaveImageGetXMLDesc(file string, flags DomainXMLFl= ags) (string, error) { +func (c *Connect) DomainSaveImageGetXMLDesc(file string, flags DomainSaveI= mageXMLFlags) (string, error) { cfile :=3D C.CString(file) defer C.free(unsafe.Pointer(cfile)) =20 diff --git a/domain_snapshot.go b/domain_snapshot.go index 86c7c51..282217f 100644 --- a/domain_snapshot.go +++ b/domain_snapshot.go @@ -161,7 +161,7 @@ func (s *DomainSnapshot) HasMetadata(flags uint32) (boo= l, error) { } =20 // See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#= virDomainSnapshotGetXMLDesc -func (s *DomainSnapshot) GetXMLDesc(flags DomainXMLFlags) (string, error) { +func (s *DomainSnapshot) GetXMLDesc(flags DomainSnapshotXMLFlags) (string,= error) { var err C.virError result :=3D C.virDomainSnapshotGetXMLDescWrapper(s.ptr, C.uint(flags), &e= rr) if result =3D=3D nil { --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list