Re: [PATCH] remote: set VIR_TYPED_PARAM_STRING_OKAY on migration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 02/08/2016 02:18 PM, Erik Skultety wrote:
> On 05/02/16 20:24, Joao Martins wrote:
>> Commit 8cd1d54 ("util: Export remoteSerializeTypedParameters
>> internally via util") consolidates both daemon and remote
>> driver typed param serialization functions. Though as is
>> no flags are passed which lets virTypedParamsSerialize to
>> ignore all strings (to be sent), thus leading to fail
>> migration on drivers on Prepare phase, as already reported
>> by the Xen test CI[0] with:
>>
>> error: internal error: no domain XML passed
>>
> 
> Sigh, I wish the reality was "easy to refactor, hard to break" rather
> than vice versa... :(
> 
>> This patch proposes setting VIR_TYPED_PARAM_STRING_OKAY
>> to avoid leading such failures.
>>
>> [0]
>> http://lists.xenproject.org/archives/html/xen-devel/2016-02/msg01012.html
>>
>> Signed-off-by: Joao Martins <joao.m.martins@xxxxxxxxxx>
>> ---
>>  src/remote/remote_driver.c | 18 ++++++++++++------
>>  1 file changed, 12 insertions(+), 6 deletions(-)
>>
>> diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
>> index 58787cd..7cf61cf 100644
>> --- a/src/remote/remote_driver.c
>> +++ b/src/remote/remote_driver.c
>> @@ -6886,7 +6886,8 @@ remoteDomainMigrateBegin3Params(virDomainPtr domain,
>>  
>>      if (virTypedParamsSerialize(params, nparams,
>>                                  (virTypedParameterRemotePtr *) &args.params.params_val,
>> -                                &args.params.params_len, 0) < 0) {
>> +                                &args.params.params_len,
>> +                                VIR_TYPED_PARAM_STRING_OKAY) < 0) {
>>          xdr_free((xdrproc_t) xdr_remote_domain_migrate_begin3_params_args,
>>                   (char *) &args);
>>          goto cleanup;
>> @@ -6953,7 +6954,8 @@ remoteDomainMigratePrepare3Params(virConnectPtr dconn,
>>  
>>      if (virTypedParamsSerialize(params, nparams,
>>                                  (virTypedParameterRemotePtr *) &args.params.params_val,
>> -                                &args.params.params_len, 0) < 0) {
>> +                                &args.params.params_len,
>> +                                VIR_TYPED_PARAM_STRING_OKAY) < 0) {
>>          xdr_free((xdrproc_t) xdr_remote_domain_migrate_prepare3_params_args,
>>                   (char *) &args);
>>          goto cleanup;
>> @@ -7040,7 +7042,8 @@ remoteDomainMigratePrepareTunnel3Params(virConnectPtr dconn,
>>  
>>      if (virTypedParamsSerialize(params, nparams,
>>                                  (virTypedParameterRemotePtr *) &args.params.params_val,
>> -                                &args.params.params_len, 0) < 0) {
>> +                                &args.params.params_len,
>> +                                VIR_TYPED_PARAM_STRING_OKAY) < 0) {
>>          xdr_free((xdrproc_t) xdr_remote_domain_migrate_prepare_tunnel3_params_args,
>>                   (char *) &args);
>>          goto cleanup;
>> @@ -7129,7 +7132,8 @@ remoteDomainMigratePerform3Params(virDomainPtr dom,
>>  
>>      if (virTypedParamsSerialize(params, nparams,
>>                                  (virTypedParameterRemotePtr *) &args.params.params_val,
>> -                                &args.params.params_len, 0) < 0) {
>> +                                &args.params.params_len,
>> +                                VIR_TYPED_PARAM_STRING_OKAY) < 0) {
>>          xdr_free((xdrproc_t) xdr_remote_domain_migrate_perform3_params_args,
>>                   (char *) &args);
>>          goto cleanup;
>> @@ -7201,7 +7205,8 @@ remoteDomainMigrateFinish3Params(virConnectPtr dconn,
>>  
>>      if (virTypedParamsSerialize(params, nparams,
>>                                  (virTypedParameterRemotePtr *) &args.params.params_val,
>> -                                &args.params.params_len, 0) < 0) {
>> +                                &args.params.params_len,
>> +                                VIR_TYPED_PARAM_STRING_OKAY) < 0) {
>>          xdr_free((xdrproc_t) xdr_remote_domain_migrate_finish3_params_args,
>>                   (char *) &args);
>>          goto cleanup;
>> @@ -7275,7 +7280,8 @@ remoteDomainMigrateConfirm3Params(virDomainPtr domain,
>>  
>>      if (virTypedParamsSerialize(params, nparams,
>>                                  (virTypedParameterRemotePtr *) &args.params.params_val,
>> -                                &args.params.params_len, 0) < 0) {
>> +                                &args.params.params_len,
>> +                                VIR_TYPED_PARAM_STRING_OKAY) < 0) {
>>          xdr_free((xdrproc_t) xdr_remote_domain_migrate_confirm3_params_args,
>>                   (char *) &args);
>>          goto cleanup;
>>
> The patch itself is fine, but it only covers migration. The commit you
> mentioned in the commit message also broke blkiotune and numatune APIs
> which have their client bodies generated by gendispatch.pl. So I
> adjusted the gendispatch accordingly, squashed into your patch and
> pushed. Hopefully, there won't be any other use cases I missed.
Great, Thank you!

Joao

> 
> Erik
> 

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]