Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate_send API call accepted withoutvgpu_map argument and warns only when all is over #3911

Closed
stormi opened this issue Jul 22, 2019 · 3 comments

Comments

@stormi
Copy link
Contributor

stormi commented Jul 22, 2019

From the API docs:

VM ref migrate_send (session ref, VM ref, (string → string) map, bool, (VDI ref → SR ref) map, (VIF ref → network ref) map, (string → string) map, (VGPU ref → GPU_group ref) map) 
(VGPU ref → GPU_group ref) map vgpu_map | Map of source vGPU to destination GPU group

When the vgpu_map parameter is missing, the migrate_send call is still processed and completes well if there's no vgpu. However a warning appears in the logs ("cannot marshall arguments"):

/var/log/xensource.log.1:35182:Jul 15 15:06:55 <host> xapi: [ warn|<host>|178440 |Async.VM.migrate_send R:3793418e587b|rbac_audit] cannot marshall arguments for the action VM.migrate_send: name and value list lengths don't match. str_names=[session_id,vm,dest,live,vdi_map,vif_map,options,vgpu_map,], xml_values=[S(OpaqueRef:934aaee6-cf8e-436f-8396-ae93d8745db6),S(OpaqueRef:06934e5f-04ca-4ff9-96a8-fe8a244d4fce),{SM:S(http://<ip>/services/SM?session_id=OpaqueRef:2b31dd59-acf2-473c-8c04-c3040b8a1301);host:S(OpaqueRef:076a9aca-5df0-47dc-a050-21fbb96abfda);xenops:S(http://<ip>/services/xenops?session_id=OpaqueRef:2b31dd59-acf2-473c-8c04-c3040b8a1301);session_id:S(OpaqueRef:2b31dd59-acf2-473c-8c04-c3040b8a1301);master:S(http://<ip>/)},B(true),{OpaqueRef:b622ba46-ea56-4a27-80a4-fce6e5e6d7d3:S(OpaqueRef:b9c12444-c03d-4808-980c-d64c220465c4)},{},{force:S(true)},]

From what I understand, either the argument is mandatory and then the API call should fail without it, or it is optional and then an empty map should be added to avoid the error.

@robhoes
Copy link
Member

robhoes commented Jul 22, 2019

I have noticed this too, and I am not sure why it happens. I think it is just the audit logging though; the argument is treated as optional.

@edwintorok
Copy link
Contributor

edwintorok commented Jul 22, 2019

The problem seems to be here: https://github.com/xapi-project/xen-api/blob/v1.184.0/ocaml/xapi/rbac_audit.ml#L360-L394
The code uses a fold_right2 which requires matching list lengths, and if there are any optional arguments then it gives up, warns and returns the empty list. It is not specific to this API call, should happen on any API call with optional arguments.

@psafont
Copy link
Member

psafont commented Jan 27, 2023

This was fixed by #4829

@psafont psafont closed this as completed Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants