Add upstream patches to fix error handling.

This commit is contained in:
Richard W.M. Jones 2015-03-17 12:55:45 +00:00
parent 41bd2465b7
commit 8844002b18
3 changed files with 1906 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,32 @@
From 06b24089986523806d386b9e3cfa4fcf5eeb87e6 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 17 Mar 2015 12:53:29 +0000
Subject: [PATCH 2/2] Don't bother checking return from virInitialize.
The Perl bindings don't do this, and it seems that the call can never
fail, or if it does we don't care.
---
libvirt/libvirt_c_oneoffs.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/libvirt/libvirt_c_oneoffs.c b/libvirt/libvirt_c_oneoffs.c
index 32e5a4b..5d82194 100644
--- a/libvirt/libvirt_c_oneoffs.c
+++ b/libvirt/libvirt_c_oneoffs.c
@@ -1229,12 +1229,9 @@ CAMLprim value
ocaml_libvirt_init (value unit)
{
CAMLparam1 (unit);
- CAMLlocal1 (rv);
- int r;
virSetErrorFunc (NULL, ignore_errors);
- r = virInitialize ();
- CHECK_ERROR (r == -1, "virInitialize");
+ virInitialize ();
CAMLreturn (Val_unit);
}
--
2.3.1

View File

@ -2,7 +2,7 @@
Name: ocaml-libvirt
Version: 0.6.1.4
Release: 5%{?dist}
Release: 6%{?dist}
Summary: OCaml binding for libvirt
License: LGPLv2+
@ -15,6 +15,10 @@ Patch1: 0001-Use-C99-standard-int64_t-instead-of-OCaml-defined-an.patch
# Upstream patch to add virDomainCreateXML binding.
Patch2: 0001-Add-a-binding-for-virDomainCreateXML.patch
# Upstream patches to fix error handling.
Patch3: 0001-Suppress-errors-to-stderr-and-use-thread-local-virEr.patch
Patch4: 0002-Don-t-bother-checking-return-from-virInitialize.patch
ExcludeArch: sparc64 s390 s390x
BuildRequires: ocaml >= 3.10.0
@ -45,6 +49,8 @@ developing applications that use %{name}.
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%build
@ -92,6 +98,9 @@ make install-byte
%changelog
* Tue Mar 17 2015 Richard W.M. Jones <rjones@redhat.com> - 0.6.1.4-6
- Add upstream patches to fix error handling.
* Fri Mar 6 2015 Richard W.M. Jones <rjones@redhat.com> - 0.6.1.4-5
- Add binding for virDomainCreateXML.