Hello,

There is a alternative relevant way of representing "handle" (keeping  :

> +[[structs.fields]]
> +name = "handle"
> +description = "IN: Unique identifier for this guest given by the toolstack."
> +typ = { tag = "array", args = [{ tag = "u8" }, 16]  }
> +

We can introduce a "guest_handle" type which is represented either as :
- C: xen_guest_handle_t (basically uint8_t[16])
- Rust: uuid::Uuid (which is uuid::Bytes thus [u8; 16]) [1]
(we would need to add uuid = "1" as a dependency on xen-sys)

The toolstack currently uses and represents this handle as a UUID, so I 
suppose we can keep this representation and being able to manipulate 
those as Uuid as well (and having new_v4 functions and similar).

[1] https://docs.rs/uuid/1.11.0/uuid/struct.Uuid.html#abi

Cheers
Teddy


Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

Reply via email to