import perl-Sys-Virt-4.5.0-4.module+el8+2529+a9686a4d

This commit is contained in:
CentOS Sources 2019-05-07 08:15:33 -04:00 committed by Andrew Lukoshko
commit fe12cc2f6c
8 changed files with 1001 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
SOURCES/Sys-Virt-v4.5.0.tar.gz

1
.perl-Sys-Virt.metadata Normal file
View File

@ -0,0 +1 @@
8e69ddc32a5f61ad5730859cf312808a3daab5a0 SOURCES/Sys-Virt-v4.5.0.tar.gz

View File

@ -0,0 +1,126 @@
From d5ae3d1db19b52676489c2312efd21ab5e86aee4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Tue, 14 Aug 2018 11:46:08 +0100
Subject: [PATCH] Add NWFilterBinding.pm module missed in dist
---
lib/Sys/Virt/NWFilterBinding.pm | 107 ++++++++++++++++++++++++++++++++
1 file changed, 107 insertions(+)
create mode 100644 lib/Sys/Virt/NWFilterBinding.pm
diff --git a/lib/Sys/Virt/NWFilterBinding.pm b/lib/Sys/Virt/NWFilterBinding.pm
new file mode 100644
index 0000000..2c56b3f
--- /dev/null
+++ b/lib/Sys/Virt/NWFilterBinding.pm
@@ -0,0 +1,107 @@
+# -*- perl -*-
+#
+# Copyright (C) 2018 Red Hat
+#
+# This program is free software; You can redistribute it and/or modify
+# it under either:
+#
+# a) the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any
+# later version,
+#
+# or
+#
+# b) the "Artistic License"
+#
+# The file "LICENSE" distributed along with this file provides full
+# details of the terms and conditions of the two licenses.
+
+=pod
+
+=head1 NAME
+
+Sys::Virt::NWFilterBinding - Represent & manage a network filter binding
+
+=head1 DESCRIPTION
+
+The C<Sys::Virt::NWFilterBinding> module represents a binding between a
+network filter and a network port device.
+
+=head1 METHODS
+
+=over 4
+
+=cut
+
+package Sys::Virt::NWFilterBinding;
+
+use strict;
+use warnings;
+
+
+sub _new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my %params = @_;
+
+ my $con = exists $params{connection} ? $params{connection} : die "connection parameter is required";
+ my $self;
+ if (exists $params{portdev}) {
+ $self = Sys::Virt::NWFilterBinding::_lookup_by_port_dev($con, $params{portdev});
+ } elsif (exists $params{xml}) {
+ $self = Sys::Virt::NWFilterBinding::_create_xml($con, $params{xml});
+ } else {
+ die "portdev or xml parameters are required";
+ }
+
+ bless $self, $class;
+
+ return $self;
+}
+
+
+=item my $name = $binding->get_port_dev()
+
+Returns a string with the name of the network port device that is bound to
+
+=item my $name = $binding->get_filter_name()
+
+Returns a string with the name of the network filter that is bound to
+
+=item my $xml = $binding->get_xml_description()
+
+Returns an XML document containing a complete description of
+the network's configuration
+
+=item $binding->delete()
+
+Unbind the network port device from the filter
+
+=cut
+
+
+1;
+
+=back
+
+=head1 AUTHORS
+
+Daniel P. Berrange <berrange@redhat.com>
+
+=head1 COPYRIGHT
+
+Copyright (C) 2018 Red Hat
+
+=head1 LICENSE
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of either the GNU General Public License as published
+by the Free Software Foundation (either version 2 of the License, or at
+your option any later version), or, the Artistic License, as specified
+in the Perl README file.
+
+=head1 SEE ALSO
+
+L<Sys::Virt>, L<Sys::Virt::Error>, C<http://libvirt.org>
+
+=cut
--
2.17.1

View File

@ -0,0 +1,26 @@
From 9ae7dd0dd0c15dc88ea7e5caf9d29e6fa0630d4c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Thu, 26 Jul 2018 10:30:01 +0100
Subject: [PATCH] Add missing import of NWFilterBinding
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit fb72cb23fe654d28e7c4027985552cd3b7ca53a0)
---
lib/Sys/Virt.pm | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/Sys/Virt.pm b/lib/Sys/Virt.pm
index e0b0d77..302a748 100644
--- a/lib/Sys/Virt.pm
+++ b/lib/Sys/Virt.pm
@@ -75,6 +75,7 @@ use Sys::Virt::NodeDevice;
use Sys::Virt::Interface;
use Sys::Virt::Secret;
use Sys::Virt::NWFilter;
+use Sys::Virt::NWFilterBinding;
use Sys::Virt::DomainSnapshot;
use Sys::Virt::Stream;

View File

@ -0,0 +1,67 @@
From 1dea4a6a88ede59814c672a907dd24d0a683c2a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Mon, 6 Aug 2018 16:57:47 +0100
Subject: [PATCH] Add missing initialization of virTypedParameters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
For any API call where the API impl allocates the virTypedParameters
array must be passed a NULL-initialized pointer.
Several APIs missed initialization which caused memory corruption.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 62edc0530fe04b4fc81473a5f5d750ae4d54ba3d)
---
lib/Sys/Virt.xs | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/lib/Sys/Virt.xs b/lib/Sys/Virt.xs
index 40134d3..a013915 100644
--- a/lib/Sys/Virt.xs
+++ b/lib/Sys/Virt.xs
@@ -2403,8 +2403,8 @@ get_node_sev_info(conn, flags=0)
virConnectPtr conn;
unsigned int flags;
PREINIT:
- virTypedParameterPtr params;
- int nparams;
+ virTypedParameterPtr params = NULL;
+ int nparams = 0;
CODE:
if (virNodeGetSEVInfo(conn, &params, &nparams, flags) < 0) {
_croak_error();
@@ -4554,8 +4554,8 @@ get_job_stats(dom, flags=0)
unsigned int flags;
PREINIT:
int type;
- virTypedParameterPtr params;
- int nparams;
+ virTypedParameterPtr params = NULL;
+ int nparams = 0;
HV *paramsHv;
SV *typeSv;
PPCODE:
@@ -4986,8 +4986,8 @@ get_launch_security_info(dom, flags=0)
virDomainPtr dom;
unsigned int flags;
PREINIT:
- virTypedParameterPtr params;
- int nparams;
+ virTypedParameterPtr params = NULL;
+ int nparams = 0;
CODE:
if (virDomainGetLaunchSecurityInfo(dom, &params, &nparams, flags) < 0) {
_croak_error();
@@ -5103,8 +5103,8 @@ get_guest_vcpus(dom, flags=0)
virDomainPtr dom;
unsigned int flags;
PREINIT:
- virTypedParameterPtr params;
- unsigned int nparams;
+ virTypedParameterPtr params = NULL;
+ unsigned int nparams = 0;
CODE:
if (virDomainGetGuestVcpus(dom, &params, &nparams, flags) < 0) {
_croak_error();

View File

@ -0,0 +1,122 @@
From 1b025f7c670eeafb835858558db356917e150a36 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Mon, 6 Aug 2018 16:59:37 +0100
Subject: [PATCH] Add missing free'ing of virTypedParameters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Safefree() must be used to free any virTypedParameter arrays previously
allocated with Newx().
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 440fde1cb81595c9f5eab7b03c240ca88e998961)
---
lib/Sys/Virt.xs | 36 +++++++++++++++++++++++++++---------
1 file changed, 27 insertions(+), 9 deletions(-)
diff --git a/lib/Sys/Virt.xs b/lib/Sys/Virt.xs
index a013915..3d8eb9b 100644
--- a/lib/Sys/Virt.xs
+++ b/lib/Sys/Virt.xs
@@ -2683,8 +2683,10 @@ set_node_memory_parameters(conn, newparams, flags=0)
nparams = vir_typed_param_from_hv(newparams, params, nparams);
- if (virNodeSetMemoryParameters(conn, params, nparams, flags) < 0)
+ if (virNodeSetMemoryParameters(conn, params, nparams, flags) < 0) {
+ Safefree(params);
_croak_error();
+ }
Safefree(params);
@@ -4566,7 +4568,7 @@ get_job_stats(dom, flags=0)
typeSv = newSViv(type);
paramsHv = vir_typed_param_to_hv(params, nparams);
- Safefree(params);
+ free(params);
EXTEND(SP, 2);
PUSHs(newRV_noinc((SV*)typeSv));
@@ -4775,11 +4777,15 @@ set_scheduler_parameters(dom, newparams, flags=0)
}
nparams = vir_typed_param_from_hv(newparams, params, nparams);
if (flags) {
- if (virDomainSetSchedulerParametersFlags(dom, params, nparams, flags) < 0)
+ if (virDomainSetSchedulerParametersFlags(dom, params, nparams, flags) < 0) {
+ Safefree(params);
_croak_error();
+ }
} else {
- if (virDomainSetSchedulerParameters(dom, params, nparams) < 0)
+ if (virDomainSetSchedulerParameters(dom, params, nparams) < 0) {
+ Safefree(params);
_croak_error();
+ }
}
Safefree(params);
@@ -4831,8 +4837,10 @@ set_memory_parameters(dom, newparams, flags=0)
nparams = vir_typed_param_from_hv(newparams, params, nparams);
- if (virDomainSetMemoryParameters(dom, params, nparams, flags) < 0)
+ if (virDomainSetMemoryParameters(dom, params, nparams, flags) < 0) {
+ Safefree(params);
_croak_error();
+ }
Safefree(params);
@@ -4883,8 +4891,10 @@ set_numa_parameters(dom, newparams, flags=0)
nparams = vir_typed_param_from_hv(newparams, params, nparams);
- if (virDomainSetNumaParameters(dom, params, nparams, flags) < 0)
+ if (virDomainSetNumaParameters(dom, params, nparams, flags) < 0) {
+ Safefree(params);
_croak_error();
+ }
Safefree(params);
@@ -4936,8 +4946,10 @@ set_blkio_parameters(dom, newparams, flags=0)
nparams = vir_typed_param_from_hv(newparams, params, nparams);
if (virDomainSetBlkioParameters(dom, params, nparams,
- flags) < 0)
+ flags) < 0) {
+ Safefree(params);
_croak_error();
+ }
Safefree(params);
@@ -5658,8 +5670,11 @@ set_block_iotune(dom, disk, newparams, flags=0)
}
nparams = vir_typed_param_from_hv(newparams, params, nparams);
- if (virDomainSetBlockIoTune(dom, disk, params, nparams, flags) < 0)
+ if (virDomainSetBlockIoTune(dom, disk, params, nparams, flags) < 0) {
+ Safefree(params);
_croak_error();
+ }
+ Safefree(params);
HV *
@@ -5709,8 +5724,11 @@ set_interface_parameters(dom, intf, newparams, flags=0)
}
nparams = vir_typed_param_from_hv(newparams, params, nparams);
- if (virDomainSetInterfaceParameters(dom, intf, params, nparams, flags) < 0)
+ if (virDomainSetInterfaceParameters(dom, intf, params, nparams, flags) < 0) {
+ Safefree(params);
_croak_error();
+ }
+ Safefree(params);
HV *

View File

@ -0,0 +1,472 @@
From 88cf0236e1b98b00bcaa5762f9207b99fb98e084 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Mon, 6 Aug 2018 17:11:57 +0100
Subject: [PATCH] Clear typed parameter elements as well as array
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Some typed parameter elements may contain strings that need to be
freed.
We must ensure that the parameter array has dup'd the strings
rather than borrowing a pointer.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 54f0d2c64021e6e143f40185f0181cf5d5a51f53)
---
lib/Sys/Virt.xs | 124 ++++++++++++++++++++++++++----------------------
1 file changed, 66 insertions(+), 58 deletions(-)
diff --git a/lib/Sys/Virt.xs b/lib/Sys/Virt.xs
index 3d8eb9b..6c2bf48 100644
--- a/lib/Sys/Virt.xs
+++ b/lib/Sys/Virt.xs
@@ -86,7 +86,6 @@ virt_newSVull(unsigned long long val) {
}
-
static void
ignoreVirErrorFunc(void * userData, virErrorPtr error) {
/* Do nothing */
@@ -263,7 +262,8 @@ vir_typed_param_from_hv(HV *newparams, virTypedParameterPtr params, int nparams)
case VIR_TYPED_PARAM_STRING:
ptr = SvPV(*val, len);
- params[i].value.s = (char *)ptr;
+ if (!(params[i].value.s = strdup((char *)ptr)))
+ abort();
break;
}
}
@@ -300,7 +300,8 @@ vir_typed_param_add_string_list_from_hv(HV *newparams,
localparams[*nparams + i].field[VIR_TYPED_PARAM_FIELD_LENGTH - 1] = '\0';
localparams[*nparams + i].type = VIR_TYPED_PARAM_STRING;
- localparams[*nparams + i].value.s = ptr;
+ if (!(localparams[*nparams + i].value.s = strdup(ptr)))
+ abort();
}
*params = localparams;
@@ -308,6 +309,14 @@ vir_typed_param_add_string_list_from_hv(HV *newparams,
}
+static void
+vir_typed_param_safe_free(virTypedParameterPtr params, int nparams)
+{
+ virTypedParamsClear(params, nparams);
+ Safefree(params);
+}
+
+
static int
_domain_event_lifecycle_callback(virConnectPtr con,
virDomainPtr dom,
@@ -2411,7 +2420,7 @@ get_node_sev_info(conn, flags=0)
}
RETVAL = vir_typed_param_to_hv(params, nparams);
- free(params);
+ virTypedParamsFree(params, nparams);
OUTPUT:
RETVAL
@@ -2651,12 +2660,12 @@ get_node_memory_parameters(conn, flags=0)
Newx(params, nparams, virTypedParameter);
if (virNodeGetMemoryParameters(conn, params, &nparams, flags) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
RETVAL = vir_typed_param_to_hv(params, nparams);
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
OUTPUT:
RETVAL
@@ -2677,17 +2686,17 @@ set_node_memory_parameters(conn, newparams, flags=0)
Newx(params, nparams, virTypedParameter);
if (virNodeGetMemoryParameters(conn, params, &nparams, 0) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
nparams = vir_typed_param_from_hv(newparams, params, nparams);
if (virNodeSetMemoryParameters(conn, params, nparams, flags) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
@@ -4562,13 +4571,12 @@ get_job_stats(dom, flags=0)
SV *typeSv;
PPCODE:
if (virDomainGetJobStats(dom, &type, &params, &nparams, flags) < 0) {
- Safefree(params);
_croak_error();
}
typeSv = newSViv(type);
paramsHv = vir_typed_param_to_hv(params, nparams);
- free(params);
+ virTypedParamsFree(params, nparams);
EXTEND(SP, 2);
PUSHs(newRV_noinc((SV*)typeSv));
@@ -4676,11 +4684,11 @@ block_copy(dom, path, destxml, newparams, flags=0)
nparams = vir_typed_param_from_hv(newparams, params, nparams);
if (virDomainBlockCopy(dom, path, destxml, params, nparams, flags) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
void
@@ -4741,17 +4749,17 @@ get_scheduler_parameters(dom, flags=0)
Newx(params, nparams, virTypedParameter);
if (flags) {
if (virDomainGetSchedulerParametersFlags(dom, params, &nparams, flags) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
} else {
if (virDomainGetSchedulerParameters(dom, params, &nparams) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
}
RETVAL = vir_typed_param_to_hv(params, nparams);
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
OUTPUT:
RETVAL
@@ -4772,22 +4780,22 @@ set_scheduler_parameters(dom, newparams, flags=0)
free(type);
Newx(params, nparams, virTypedParameter);
if (virDomainGetSchedulerParameters(dom, params, &nparams) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
nparams = vir_typed_param_from_hv(newparams, params, nparams);
if (flags) {
if (virDomainSetSchedulerParametersFlags(dom, params, nparams, flags) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
} else {
if (virDomainSetSchedulerParameters(dom, params, nparams) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
}
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
HV *
@@ -4805,12 +4813,12 @@ get_memory_parameters(dom, flags=0)
Newx(params, nparams, virTypedParameter);
if (virDomainGetMemoryParameters(dom, params, &nparams, flags) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
RETVAL = vir_typed_param_to_hv(params, nparams);
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
OUTPUT:
RETVAL
@@ -4831,17 +4839,17 @@ set_memory_parameters(dom, newparams, flags=0)
Newx(params, nparams, virTypedParameter);
if (virDomainGetMemoryParameters(dom, params, &nparams, 0) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
nparams = vir_typed_param_from_hv(newparams, params, nparams);
if (virDomainSetMemoryParameters(dom, params, nparams, flags) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
HV *
@@ -4859,12 +4867,12 @@ get_numa_parameters(dom, flags=0)
Newx(params, nparams, virTypedParameter);
if (virDomainGetNumaParameters(dom, params, &nparams, flags) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
RETVAL = vir_typed_param_to_hv(params, nparams);
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
OUTPUT:
RETVAL
@@ -4885,17 +4893,17 @@ set_numa_parameters(dom, newparams, flags=0)
Newx(params, nparams, virTypedParameter);
if (virDomainGetNumaParameters(dom, params, &nparams, 0) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
nparams = vir_typed_param_from_hv(newparams, params, nparams);
if (virDomainSetNumaParameters(dom, params, nparams, flags) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
HV *
@@ -4913,12 +4921,12 @@ get_blkio_parameters(dom, flags=0)
Newx(params, nparams, virBlkioParameter);
if (virDomainGetBlkioParameters(dom, params, &nparams, flags) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
RETVAL = vir_typed_param_to_hv(params, nparams);
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
OUTPUT:
RETVAL
@@ -4939,7 +4947,7 @@ set_blkio_parameters(dom, newparams, flags=0)
Newx(params, nparams, virBlkioParameter);
if (virDomainGetBlkioParameters(dom, params, &nparams, 0) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
@@ -4947,10 +4955,10 @@ set_blkio_parameters(dom, newparams, flags=0)
if (virDomainSetBlkioParameters(dom, params, nparams,
flags) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
HV *
@@ -4962,12 +4970,12 @@ get_perf_events(dom, flags=0)
int nparams = 0;
CODE:
if (virDomainGetPerfEvents(dom, &params, &nparams, flags) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
RETVAL = vir_typed_param_to_hv(params, nparams);
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
OUTPUT:
RETVAL
@@ -4982,7 +4990,7 @@ set_perf_events(dom, newparams, flags=0)
int nparams = 0;
PPCODE:
if (virDomainGetPerfEvents(dom, &params, &nparams, 0) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
@@ -4990,7 +4998,7 @@ set_perf_events(dom, newparams, flags=0)
if (virDomainSetPerfEvents(dom, params, nparams, flags) < 0)
_croak_error();
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
HV *
@@ -5005,7 +5013,7 @@ get_launch_security_info(dom, flags=0)
_croak_error();
}
RETVAL = vir_typed_param_to_hv(params, nparams);
- free(params);
+ virTypedParamsFree(params, nparams);
OUTPUT:
RETVAL
@@ -5386,10 +5394,10 @@ _migrate(dom, destcon, newparams, flags=0)
* if it is possible todo so
*/
if ((RETVAL = virDomainMigrate3(dom, destcon, params, nparams, flags)) == NULL) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
OUTPUT:
RETVAL
@@ -5477,10 +5485,10 @@ _migrate_to_uri(dom, desturi, newparams, flags=0)
* if it is possible todo so
*/
if (virDomainMigrateToURI3(dom, desturi, params, nparams, flags) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
void
@@ -5639,12 +5647,12 @@ get_block_iotune(dom, disk, flags=0)
Newx(params, nparams, virTypedParameter);
if (virDomainGetBlockIoTune(dom, disk, params, &nparams, flags) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
RETVAL = vir_typed_param_to_hv(params, nparams);
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
OUTPUT:
RETVAL
@@ -5665,16 +5673,16 @@ set_block_iotune(dom, disk, newparams, flags=0)
Newx(params, nparams, virTypedParameter);
if (virDomainGetBlockIoTune(dom, disk, params, &nparams, 0) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
nparams = vir_typed_param_from_hv(newparams, params, nparams);
if (virDomainSetBlockIoTune(dom, disk, params, nparams, flags) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
HV *
@@ -5693,12 +5701,12 @@ get_interface_parameters(dom, intf, flags=0)
Newx(params, nparams, virTypedParameter);
if (virDomainGetInterfaceParameters(dom, intf, params, &nparams, flags) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
RETVAL = vir_typed_param_to_hv(params, nparams);
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
OUTPUT:
RETVAL
@@ -5719,16 +5727,16 @@ set_interface_parameters(dom, intf, newparams, flags=0)
Newx(params, nparams, virTypedParameter);
if (virDomainGetInterfaceParameters(dom, intf, params, &nparams, 0) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
nparams = vir_typed_param_from_hv(newparams, params, nparams);
if (virDomainSetInterfaceParameters(dom, intf, params, nparams, flags) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
HV *
@@ -5764,7 +5772,7 @@ block_stats(dom, path, flags=0)
Newx(params, nparams, virTypedParameter);
if (virDomainBlockStatsFlags(dom, path, params, &nparams, flags) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
@@ -5784,7 +5792,7 @@ block_stats(dom, path, flags=0)
(void)hv_store(RETVAL, field, strlen(field), val, 0);
}
}
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
}
OUTPUT:
RETVAL
@@ -6018,7 +6026,7 @@ get_cpu_stats(dom, start_cpu, ncpus, flags=0)
Newx(params, ncpus * nparams, virTypedParameter);
if ((ret = virDomainGetCPUStats(dom, params, nparams, start_cpu, ncpus, flags)) < 0) {
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
_croak_error();
}
@@ -6028,7 +6036,7 @@ get_cpu_stats(dom, start_cpu, ncpus, flags=0)
PUSHs(newRV_noinc((SV *)rec));
}
- Safefree(params);
+ vir_typed_param_safe_free(params, nparams);
void

186
SPECS/perl-Sys-Virt.spec Normal file
View File

@ -0,0 +1,186 @@
# Automatically generated by perl-Sys-Virt.spec.PL
Name: perl-Sys-Virt
Version: 4.5.0
Release: 4%{?dist}
Summary: Represent and manage a libvirt hypervisor connection
License: GPLv2+ or Artistic
URL: https://metacpan.org/release/Sys-Virt
Source0: https://cpan.metacpan.org/authors/id/D/DA/DANBERR/Sys-Virt-v%{version}.tar.gz
Patch0: 0000-Add-NWFilterBinding.pm-module-missed-in-dist.patch
Patch1: 0001-Add-missing-import-of-NWFilterBinding.patch
Patch2: 0002-Add-missing-initialization-of-virTypedParameters.patch
Patch3: 0003-Add-missing-free-ing-of-virTypedParameters.patch
Patch4: 0004-Clear-typed-parameter-elements-as-well-as-array.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# Build
BuildRequires: coreutils
BuildRequires: findutils
BuildRequires: gcc
BuildRequires: git
BuildRequires: libvirt-devel >= %{version}
BuildRequires: make
BuildRequires: perl-interpreter
BuildRequires: perl-devel
BuildRequires: perl-generators
BuildRequires: perl(ExtUtils::CBuilder)
BuildRequires: perl(Module::Build)
BuildRequires: sed
# Runtime
BuildRequires: perl(overload)
BuildRequires: perl(strict)
BuildRequires: perl(warnings)
BuildRequires: perl(XSLoader)
# Tests only
BuildRequires: perl(base)
BuildRequires: perl(Sys::Hostname)
BuildRequires: perl(Test::More)
BuildRequires: perl(Time::HiRes)
BuildRequires: perl(XML::XPath)
BuildRequires: perl(XML::XPath::XMLParser)
# Optional tests only
BuildRequires: perl(Test::CPAN::Changes)
BuildRequires: perl(Test::Pod) >= 1.00
BuildRequires: perl(Test::Pod::Coverage) >= 1.00
Requires: perl(:MODULE_COMPAT_%(eval "$(perl -V:version)"; echo $version))
%description
The Sys::Virt module provides a Perl XS binding to the libvirt virtual
machine management APIs. This allows machines running within arbitrary
virtualization containers to be managed with a consistent API.
%prep
%autosetup -S git -n Sys-Virt-v%{version}
%build
%{__perl} Build.PL installdirs=vendor
./Build
%install
./Build install destdir=$RPM_BUILD_ROOT create_packlist=0
%{_fixperms} $RPM_BUILD_ROOT/*
%check
./Build test
%files
%license LICENSE
%doc AUTHORS Changes README examples/
%{perl_vendorarch}/auto/*
%{perl_vendorarch}/Sys*
%{_mandir}/man3/*
%changelog
* Wed Aug 29 2018 Daniel P. Berrangé <berrange@redhat.com> - 4.5.0-4
- Fix typed parameter memory handling (rhbz #1602346)
- Fix missing NWFilterBinding module (rhbz #1615841)
* Tue Aug 7 2018 Danilo de Paula <ddepaula@redhat.com> - 4.5.0-3
- Included BuildRequire: git to fix a building issue
* Tue Aug 7 2018 Daniel P. Berrangé <berrange@redhat.com> - 4.5.0-2
- Fix typed parameter memory handling (rhbz#1602346)
* Tue Jul 3 2018 Daniel P. Berrangé <berrange@redhat.com> - 4.5.0-1
- Update to 4.5.0 release
* Fri Jun 29 2018 Jitka Plesnikova <jplesnik@redhat.com> - 4.4.0-2
- Perl 5.28 rebuild
* Tue Apr 3 2018 Daniel P. Berrangé <berrange@redhat.com> - 4.2.0-1
- Update to 4.2.0 release
* Mon Mar 5 2018 Daniel P. Berrange <berrange@redhat.com> - 4.1.0-1
- Update to 4.1.0 release
* Mon Feb 19 2018 Jitka Plesnikova <jplesnik@redhat.com> - 4.0.0-3
- Add build-require gcc
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Tue Jan 23 2018 Daniel P. Berrange <berrange@redhat.com> - 4.0.0-1
- Update to 4.0.0 release
* Tue Dec 5 2017 Daniel P. Berrange <berrange@redhat.com> - 3.9.1-1
- Update to 3.9.1 release
* Fri Nov 3 2017 Daniel P. Berrange <berrange@redhat.com> - 3.9.0-1
- Update to 3.9.0 release
* Wed Oct 4 2017 Daniel P. Berrange <berrange@redhat.com> - 3.8.0-1
- Update to 3.8.0 release
* Mon Sep 4 2017 Daniel P. Berrange <berrange@redhat.com> - 3.7.0-1
- Update to 3.7.0 release
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.5.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Thu Jul 6 2017 Daniel P. Berrange <berrange@redhat.com> - 3.5.0-1
- Update to 3.5.0 release
* Tue Jun 06 2017 Jitka Plesnikova <jplesnik@redhat.com> - 3.4.0-2
- Perl 5.26 rebuild
* Mon Jun 5 2017 Daniel P. Berrange <berrange@redhat.com> - 3.4.0-1
- Update to 3.4.0 release
* Mon May 8 2017 Daniel P. Berrange <berrange@redhat.com> - 3.3.0-1
- Update to 3.3.0 release
* Mon Apr 3 2017 Daniel P. Berrange <berrange@redhat.com> - 3.2.0-1
- Update to 3.2.0 release
* Fri Mar 3 2017 Daniel P. Berrange <berrange@redhat.com> - 3.1.0-1
- Update to 3.1.0 release
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Thu Jan 19 2017 Daniel P. Berrange <berrange@redhat.com> - 3.0.0-1
- Update to 3.0.0 release
* Mon Dec 5 2016 Daniel P. Berrange <berrange@redhat.com> - 2.5.0-1
- Update to 2.5.0 release
* Wed Nov 2 2016 Daniel P. Berrange <berrange@redhat.com> - 2.4.0-1
- Update to 2.4.0 release
* Thu Oct 6 2016 Daniel P. Berrange <berrange@redhat.com> - 2.3.0-1
- Update to 2.3.0 release
* Mon Sep 5 2016 Daniel P. Berrange <berrange@redhat.com> - 2.2.0-1
- Update to 2.2.0 release
* Tue Aug 2 2016 Daniel P. Berrange <berrange@redhat.com> - 2.1.0-1
- Update to 2.1.0 release
* Fri Jul 1 2016 Daniel P. Berrange <berrange@redhat.com> - 2.0.0-1
- Update to 2.0.0 release
* Tue Jun 7 2016 Daniel P. Berrange <berrange@redhat.com> - 1.3.5-1
- Update to 1.3.5 release
* Mon May 16 2016 Jitka Plesnikova <jplesnik@redhat.com> - 1.3.4-2
- Perl 5.24 rebuild
* Wed May 4 2016 Daniel P. Berrange <berrange@redhat.com> - 1.3.4-1
- Update to 1.3.4 release
* Thu Apr 7 2016 Daniel P. Berrange <berrange@redhat.com> - 1.3.3-1
- Update to 1.3.3 release
* Tue Mar 1 2016 Daniel P. Berrange <berrange@redhat.com> - 1.3.2-1
- Update to 1.3.2 release
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Jan 20 2016 Daniel P. Berrange <berrange@redhat.com> - 1.3.1-1
- Update to 1.3.1 release