[libvirt] [PATCH perl 0/2] Fix missing methods in Perl binding

Daniel P. Berrangé (2): Add missing define_nwfilter and define_secret APIs Fix docs for Sys::Virt::NWFilter undefine method Changes | 3 ++- lib/Sys/Virt.pm | 32 ++++++++++++++++++++++++++++++++ lib/Sys/Virt/NWFilter.pm | 6 ++---- 3 files changed, 36 insertions(+), 5 deletions(-) -- 2.14.3

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- Changes | 2 +- lib/Sys/Virt.pm | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index f560864..d2d9a94 100644 --- a/Changes +++ b/Changes @@ -2,7 +2,7 @@ Revision history for perl module Sys::Virt 4.2.0 2018-00-00 - - XXX + - Add missing define_nwfilter and define_secret APIs in Sys::Virt 4.1.0 2018-03-05 diff --git a/lib/Sys/Virt.pm b/lib/Sys/Virt.pm index 035cdb6..f93d122 100644 --- a/lib/Sys/Virt.pm +++ b/lib/Sys/Virt.pm @@ -315,6 +315,38 @@ sub define_network { return Sys::Virt::Network->_new(connection => $self, xml => $xml, nocreate => 1); } +=item my $dom = $vmm->define_nwfilter($xml); + +Defines a new network filter based on the XML description +passed into the C<$xml> parameter. The returned object is an instance +of the L<Sys::Virt::NWFilter> class. This method is not available with +unprivileged connections to the VMM. + +=cut + +sub define_nwfilter { + my $self = shift; + my $xml = shift; + + return Sys::Virt::NWFilter->_new(connection => $self, xml => $xml, nocreate => 1); +} + +=item my $dom = $vmm->define_secret($xml); + +Defines a new secret based on the XML description +passed into the C<$xml> parameter. The returned object is an instance +of the L<Sys::Virt::Secret> class. This method is not available with +unprivileged connections to the VMM. + +=cut + +sub define_secret { + my $self = shift; + my $xml = shift; + + return Sys::Virt::Secret->_new(connection => $self, xml => $xml, nocreate => 1); +} + =item my $dom = $vmm->create_storage_pool($xml); Create a new storage pool based on the XML description passed into the C<$xml> -- 2.14.3

On 03/06/2018 07:44 AM, Daniel P. Berrangé wrote:
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- Changes | 2 +- lib/Sys/Virt.pm | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/Changes b/Changes index f560864..d2d9a94 100644 --- a/Changes +++ b/Changes @@ -2,7 +2,7 @@ Revision history for perl module Sys::Virt
4.2.0 2018-00-00
- - XXX + - Add missing define_nwfilter and define_secret APIs in Sys::Virt
4.1.0 2018-03-05
diff --git a/lib/Sys/Virt.pm b/lib/Sys/Virt.pm index 035cdb6..f93d122 100644 --- a/lib/Sys/Virt.pm +++ b/lib/Sys/Virt.pm @@ -315,6 +315,38 @@ sub define_network { return Sys::Virt::Network->_new(connection => $self, xml => $xml, nocreate => 1); }
+=item my $dom = $vmm->define_nwfilter($xml);
I noticed this about the documentation in a lot of places - it uses "$vmm" when I would have thought that "$conn" would be more plausible (i.e. a better implication of what kind of object it was supposed to be), and "$dom" when $[something else] would be better, e.g. $net, $nwfilter, etc. But since these are just repeating the existing pattern (and since I built and installed an updated Sys::Virt package, and successfully tested define_nwfilter()): Reviewed-by: Laine Stump <laine@laine.org>
+ +Defines a new network filter based on the XML description +passed into the C<$xml> parameter. The returned object is an instance +of the L<Sys::Virt::NWFilter> class. This method is not available with +unprivileged connections to the VMM. + +=cut + +sub define_nwfilter { + my $self = shift; + my $xml = shift; + + return Sys::Virt::NWFilter->_new(connection => $self, xml => $xml, nocreate => 1); +} + +=item my $dom = $vmm->define_secret($xml); + +Defines a new secret based on the XML description +passed into the C<$xml> parameter. The returned object is an instance +of the L<Sys::Virt::Secret> class. This method is not available with +unprivileged connections to the VMM. + +=cut + +sub define_secret { + my $self = shift; + my $xml = shift; + + return Sys::Virt::Secret->_new(connection => $self, xml => $xml, nocreate => 1); +} + =item my $dom = $vmm->create_storage_pool($xml);
Create a new storage pool based on the XML description passed into the C<$xml>

On Tue, Mar 06, 2018 at 09:43:15AM -0500, Laine Stump wrote:
On 03/06/2018 07:44 AM, Daniel P. Berrangé wrote:
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- Changes | 2 +- lib/Sys/Virt.pm | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/Changes b/Changes index f560864..d2d9a94 100644 --- a/Changes +++ b/Changes @@ -2,7 +2,7 @@ Revision history for perl module Sys::Virt
4.2.0 2018-00-00
- - XXX + - Add missing define_nwfilter and define_secret APIs in Sys::Virt
4.1.0 2018-03-05
diff --git a/lib/Sys/Virt.pm b/lib/Sys/Virt.pm index 035cdb6..f93d122 100644 --- a/lib/Sys/Virt.pm +++ b/lib/Sys/Virt.pm @@ -315,6 +315,38 @@ sub define_network { return Sys::Virt::Network->_new(connection => $self, xml => $xml, nocreate => 1); }
+=item my $dom = $vmm->define_nwfilter($xml);
I noticed this about the documentation in a lot of places - it uses "$vmm" when I would have thought that "$conn" would be more plausible (i.e. a better implication of what kind of object it was supposed to be), and "$dom" when $[something else] would be better, e.g. $net, $nwfilter, etc.
Yeah, I don't really recall why i called this "vmm" anymore - so long ago now. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- Changes | 1 + lib/Sys/Virt/NWFilter.pm | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index d2d9a94..016fcf2 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,7 @@ Revision history for perl module Sys::Virt 4.2.0 2018-00-00 - Add missing define_nwfilter and define_secret APIs in Sys::Virt + - Misc docs fixes 4.1.0 2018-03-05 diff --git a/lib/Sys/Virt/NWFilter.pm b/lib/Sys/Virt/NWFilter.pm index 8ede8a0..980532d 100644 --- a/lib/Sys/Virt/NWFilter.pm +++ b/lib/Sys/Virt/NWFilter.pm @@ -91,10 +91,8 @@ the network's configuration =item $filter->undefine() -Remove the configuration associated with a network previously defined -with the C<define_network> method in L<Sys::Virt>. If the network is -running, you probably want to use the C<shutdown> or C<destroy> -methods instead. +Remove the configuration associated with a network filter previously defined +with the C<define_nwfilter> method in L<Sys::Virt>. =cut -- 2.14.3

On 03/06/2018 07:44 AM, Daniel P. Berrangé wrote:
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
--- Changes | 1 + lib/Sys/Virt/NWFilter.pm | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/Changes b/Changes index d2d9a94..016fcf2 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,7 @@ Revision history for perl module Sys::Virt 4.2.0 2018-00-00
- Add missing define_nwfilter and define_secret APIs in Sys::Virt + - Misc docs fixes
4.1.0 2018-03-05
diff --git a/lib/Sys/Virt/NWFilter.pm b/lib/Sys/Virt/NWFilter.pm index 8ede8a0..980532d 100644 --- a/lib/Sys/Virt/NWFilter.pm +++ b/lib/Sys/Virt/NWFilter.pm @@ -91,10 +91,8 @@ the network's configuration
=item $filter->undefine()
-Remove the configuration associated with a network previously defined -with the C<define_network> method in L<Sys::Virt>. If the network is -running, you probably want to use the C<shutdown> or C<destroy> -methods instead. +Remove the configuration associated with a network filter previously defined +with the C<define_nwfilter> method in L<Sys::Virt>.
=cut
participants (2)
-
Daniel P. Berrangé
-
Laine Stump