[libvirt] [perl PATCH 0/6] Misc fixes to perl APIs and new migrate constant

Daniel P. Berrangé (6): Fix typo breaking some migrate parameter handling Add handling for VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS Add support for VIR_MIGRATE_PARAM_TLS_DESTINATION constant Add missing create_checkpoint method Remove docs for has_metadata method which doesn't exist Fix data type for VIR_CONNECT_IDENTITY_SASL_USER_NAME Changes | 9 +++++++++ lib/Sys/Virt.xs | 25 +++++++++++++++++++++---- lib/Sys/Virt/Domain.pm | 26 ++++++++++++++++++++++++++ lib/Sys/Virt/DomainCheckpoint.pm | 5 ----- 4 files changed, 56 insertions(+), 9 deletions(-) -- 2.23.0

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- Changes | 2 ++ lib/Sys/Virt.xs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 37529ac..2ba87bb 100644 --- a/Changes +++ b/Changes @@ -4,6 +4,8 @@ Revision history for perl module Sys::Virt - Add VIR_DOMAIN_JOB_SUCCESS and VIR_DOMAIN_JOB_STATS_KEEP_COMPLETED constants + - Fix typo breaking migration postcopy bandwidth and + autoconvert increment parameter handling 5.10.0 2019-12-03 diff --git a/lib/Sys/Virt.xs b/lib/Sys/Virt.xs index 98a12d7..08fd084 100644 --- a/lib/Sys/Virt.xs +++ b/lib/Sys/Virt.xs @@ -5571,7 +5571,7 @@ _migrate_to_uri(dom, desturi, newparams, flags=0) VIR_TYPED_PARAM_FIELD_LENGTH); params[14].type = VIR_TYPED_PARAM_INT; - strncpy(params[14].field, VIR_MIGRATE_PARAM_BANDWIDTH_POSTCOPY, + strncpy(params[15].field, VIR_MIGRATE_PARAM_BANDWIDTH_POSTCOPY, VIR_TYPED_PARAM_FIELD_LENGTH); params[15].type = VIR_TYPED_PARAM_ULLONG; -- 2.23.0

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- Changes | 2 ++ lib/Sys/Virt.xs | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 2ba87bb..ba33d40 100644 --- a/Changes +++ b/Changes @@ -6,6 +6,8 @@ Revision history for perl module Sys::Virt constants - Fix typo breaking migration postcopy bandwidth and autoconvert increment parameter handling + - Add handling for VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS + constant when invoking migrate 5.10.0 2019-12-03 diff --git a/lib/Sys/Virt.xs b/lib/Sys/Virt.xs index 08fd084..b52ae7d 100644 --- a/lib/Sys/Virt.xs +++ b/lib/Sys/Virt.xs @@ -5413,7 +5413,7 @@ _migrate(dom, destcon, newparams, flags=0) virTypedParameterPtr params; int nparams; CODE: - nparams = 16; + nparams = 17; Newx(params, nparams, virTypedParameter); strncpy(params[0].field, VIR_MIGRATE_PARAM_URI, @@ -5480,6 +5480,10 @@ _migrate(dom, destcon, newparams, flags=0) VIR_TYPED_PARAM_FIELD_LENGTH); params[15].type = VIR_TYPED_PARAM_ULLONG; + strncpy(params[16].field, VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS, + VIR_TYPED_PARAM_FIELD_LENGTH); + params[16].type = VIR_TYPED_PARAM_INT; + nparams = vir_typed_param_from_hv(newparams, params, nparams); vir_typed_param_add_string_list_from_hv(newparams, ¶ms, &nparams, @@ -5508,7 +5512,7 @@ _migrate_to_uri(dom, desturi, newparams, flags=0) virTypedParameterPtr params; int nparams; PPCODE: - nparams = 16; + nparams = 17; Newx(params, nparams, virTypedParameter); strncpy(params[0].field, VIR_MIGRATE_PARAM_URI, @@ -5575,6 +5579,10 @@ _migrate_to_uri(dom, desturi, newparams, flags=0) VIR_TYPED_PARAM_FIELD_LENGTH); params[15].type = VIR_TYPED_PARAM_ULLONG; + strncpy(params[16].field, VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS, + VIR_TYPED_PARAM_FIELD_LENGTH); + params[16].type = VIR_TYPED_PARAM_INT; + nparams = vir_typed_param_from_hv(newparams, params, nparams); vir_typed_param_add_string_list_from_hv(newparams, ¶ms, &nparams, -- 2.23.0

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- Changes | 1 + lib/Sys/Virt.xs | 13 +++++++++++-- lib/Sys/Virt/Domain.pm | 9 +++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index ba33d40..09d1dca 100644 --- a/Changes +++ b/Changes @@ -8,6 +8,7 @@ Revision history for perl module Sys::Virt autoconvert increment parameter handling - Add handling for VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS constant when invoking migrate + - Add VIR_MIGRATE_PARAM_TLS_DESTINATION constant 5.10.0 2019-12-03 diff --git a/lib/Sys/Virt.xs b/lib/Sys/Virt.xs index b52ae7d..3245adf 100644 --- a/lib/Sys/Virt.xs +++ b/lib/Sys/Virt.xs @@ -5413,7 +5413,7 @@ _migrate(dom, destcon, newparams, flags=0) virTypedParameterPtr params; int nparams; CODE: - nparams = 17; + nparams = 18; Newx(params, nparams, virTypedParameter); strncpy(params[0].field, VIR_MIGRATE_PARAM_URI, @@ -5484,6 +5484,10 @@ _migrate(dom, destcon, newparams, flags=0) VIR_TYPED_PARAM_FIELD_LENGTH); params[16].type = VIR_TYPED_PARAM_INT; + strncpy(params[17].field, VIR_MIGRATE_PARAM_TLS_DESTINATION, + VIR_TYPED_PARAM_FIELD_LENGTH); + params[17].type = VIR_TYPED_PARAM_STRING; + nparams = vir_typed_param_from_hv(newparams, params, nparams); vir_typed_param_add_string_list_from_hv(newparams, ¶ms, &nparams, @@ -5512,7 +5516,7 @@ _migrate_to_uri(dom, desturi, newparams, flags=0) virTypedParameterPtr params; int nparams; PPCODE: - nparams = 17; + nparams = 18; Newx(params, nparams, virTypedParameter); strncpy(params[0].field, VIR_MIGRATE_PARAM_URI, @@ -5583,6 +5587,10 @@ _migrate_to_uri(dom, desturi, newparams, flags=0) VIR_TYPED_PARAM_FIELD_LENGTH); params[16].type = VIR_TYPED_PARAM_INT; + strncpy(params[17].field, VIR_MIGRATE_PARAM_TLS_DESTINATION, + VIR_TYPED_PARAM_FIELD_LENGTH); + params[17].type = VIR_TYPED_PARAM_STRING; + nparams = vir_typed_param_from_hv(newparams, params, nparams); vir_typed_param_add_string_list_from_hv(newparams, ¶ms, &nparams, @@ -9254,6 +9262,7 @@ BOOT: REGISTER_CONSTANT_STR(VIR_MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT, MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT); REGISTER_CONSTANT_STR(VIR_MIGRATE_PARAM_BANDWIDTH_POSTCOPY, MIGRATE_PARAM_BANDWIDTH_POSTCOPY); REGISTER_CONSTANT_STR(VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS, MIGRATE_PARAM_PARALLEL_CONNECTIONS); + REGISTER_CONSTANT_STR(VIR_MIGRATE_PARAM_TLS_DESTINATION, MIGRATE_PARAM_TLS_DESTINATION); REGISTER_CONSTANT(VIR_DOMAIN_MIGRATE_MAX_SPEED_POSTCOPY, MIGRATE_MAX_SPEED_POSTCOPY); diff --git a/lib/Sys/Virt/Domain.pm b/lib/Sys/Virt/Domain.pm index 2caec51..ae909de 100644 --- a/lib/Sys/Virt/Domain.pm +++ b/lib/Sys/Virt/Domain.pm @@ -1141,6 +1141,15 @@ progress is not made The number of connections used during parallel migration. +=item C<Sys::Virt::Domain::MIGRATE_PARAM_TLS_DESTINATION> + +Override the destination host name used for TLS verification. +Normally the TLS certificate from the destination host must match +the host's name for TLS verification to succeed. When the +certificate does not match the destination hostname and the +expected cetificate's hostname is known, this parameter can be +used to pass this expected hostname when starting the migration. + =back =item $ddom = $dom->migrate(destcon, flags=0, dname=undef, uri=undef, bandwidth=0) -- 2.23.0

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- Changes | 1 + lib/Sys/Virt/Domain.pm | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/Changes b/Changes index 09d1dca..f36d401 100644 --- a/Changes +++ b/Changes @@ -9,6 +9,7 @@ Revision history for perl module Sys::Virt - Add handling for VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS constant when invoking migrate - Add VIR_MIGRATE_PARAM_TLS_DESTINATION constant + - Add missing create_checkpoint method on Sys::Virt::Domain 5.10.0 2019-12-03 diff --git a/lib/Sys/Virt/Domain.pm b/lib/Sys/Virt/Domain.pm index ae909de..d9d64e4 100644 --- a/lib/Sys/Virt/Domain.pm +++ b/lib/Sys/Virt/Domain.pm @@ -1965,6 +1965,23 @@ sub get_checkpoint_by_name { return Sys::Virt::DomainCheckpoint->_new(domain => $self, name => $name); } +=item $checkpoint = $dom->create_checkpoint($xml[, $flags]) + +Create a new checkpoint from the C<$xml>. The C<$flags> parameter accepts +the B<CHECKPOINT CREATION> constants listed in C<Sys::Virt::DomainCheckpoints>. + +=cut + +sub create_checkpoint { + my $self = shift; + my $xml = shift; + my $flags = shift; + + my $checkpoint = Sys::Virt::DomainCheckpoint->_new(domain => $self, xml => $xml, flags => $flags); + + return $checkpoint; +} + 1; =item $dom->fs_trim($mountPoint, $minimum, $flags=0); -- 2.23.0

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- Changes | 1 + lib/Sys/Virt/DomainCheckpoint.pm | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Changes b/Changes index f36d401..9d9a5c8 100644 --- a/Changes +++ b/Changes @@ -10,6 +10,7 @@ Revision history for perl module Sys::Virt constant when invoking migrate - Add VIR_MIGRATE_PARAM_TLS_DESTINATION constant - Add missing create_checkpoint method on Sys::Virt::Domain + - Remove docs for has_metadata method which doesn't exit 5.10.0 2019-12-03 diff --git a/lib/Sys/Virt/DomainCheckpoint.pm b/lib/Sys/Virt/DomainCheckpoint.pm index e8e875d..e1adae4 100644 --- a/lib/Sys/Virt/DomainCheckpoint.pm +++ b/lib/Sys/Virt/DomainCheckpoint.pm @@ -97,11 +97,6 @@ constants. Return the parent of the checkpoint, if any -=item $res = $domchkp->has_metadata() - -Returns a true value if this checkpoint has metadata associated with -it. - =item my @checkpoints = $domchkp->list_all_children($flags) Return a list of all domain checkpoints that are children of this -- 2.23.0

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- Changes | 2 ++ lib/Sys/Virt.xs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 9d9a5c8..e90e736 100644 --- a/Changes +++ b/Changes @@ -11,6 +11,8 @@ Revision history for perl module Sys::Virt - Add VIR_MIGRATE_PARAM_TLS_DESTINATION constant - Add missing create_checkpoint method on Sys::Virt::Domain - Remove docs for has_metadata method which doesn't exit + - Fix data type for VIR_CONNECT_IDENTITY_SASL_USER_NAME + parameter 5.10.0 2019-12-03 diff --git a/lib/Sys/Virt.xs b/lib/Sys/Virt.xs index 3245adf..ab12ef0 100644 --- a/lib/Sys/Virt.xs +++ b/lib/Sys/Virt.xs @@ -2738,7 +2738,7 @@ set_identity(conn, newident, flags=0) strncpy(ident[6].field, VIR_CONNECT_IDENTITY_SASL_USER_NAME, VIR_TYPED_PARAM_FIELD_LENGTH); - ident[6].type = VIR_TYPED_PARAM_INT; + ident[6].type = VIR_TYPED_PARAM_STRING; strncpy(ident[7].field, VIR_CONNECT_IDENTITY_X509_DISTINGUISHED_NAME, VIR_TYPED_PARAM_FIELD_LENGTH); -- 2.23.0

On 12/10/19 2:17 PM, Daniel P. Berrangé wrote:
Daniel P. Berrangé (6): Fix typo breaking some migrate parameter handling Add handling for VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS Add support for VIR_MIGRATE_PARAM_TLS_DESTINATION constant Add missing create_checkpoint method Remove docs for has_metadata method which doesn't exist Fix data type for VIR_CONNECT_IDENTITY_SASL_USER_NAME
Changes | 9 +++++++++ lib/Sys/Virt.xs | 25 +++++++++++++++++++++---- lib/Sys/Virt/Domain.pm | 26 ++++++++++++++++++++++++++ lib/Sys/Virt/DomainCheckpoint.pm | 5 ----- 4 files changed, 56 insertions(+), 9 deletions(-)
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Michal
participants (2)
-
Daniel P. Berrangé
-
Michal Privoznik