Repository navigation
Conversation
A helper program is to report how an NVIDIA card is partitioned (MIG mode, GPU instances, the profile catalogue, the vGPUs placed on them) as one JSON reply, and through --version which commands and format versions it serves. xapi runs it and reads both replies. Both sides need one description of these replies, and xen-api has none. Add the replies' types, with their JSON readers and writers, to the gpumon interface, which gpumon and xapi already link, in sub-modules named after what they describe. A later minor version may add members and values, and these types must still read its replies. gpumon's existing calls and their JSON are unchanged; nothing reads the new types until xapi's readers of the replies are added. Each record has the reply's member names. An enumeration value that this reader does not know is kept as Unknown, and only the exact lower-case spelling reads as Known, since rpclib's variant reader ignores case. A member that is always present but may be null has its own typ. A member the reader can do without is kept as an Error when it is absent or cannot be read, and an integer must be a JSON integer in range. A profile's signature is the resource counts, memory size and capabilities that the driver reports for it. It tells profiles apart beyond their names and numbers, and can show when a driver renumbers them. A member kept as an Error is lenient, so that a fault in it costs only that member, not the whole reply. The gpumon interface test builds sample replies as OCaml values, writes each one and reads it back. Further cases edit a written reply, to drop or break a member or add what a newer helper may send, and check that the reader refuses the reply or loses only that member. Single values check the enumerations' spelling and the one renamed member. Signed-off-by: Marcus Granado <marcus.granado@citrix.com>
mg12
force-pushed
the
CP-314178-gpu-partition-helper-reply-types
branch
from
November 6, 2026 20:52
9a3fe34 to
aeaed17
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A helper program will report how an NVIDIA card is partitioned (MIG mode, GPU instances, the profile catalogue, the vGPUs placed on them) as one JSON reply, and through --version which commands and format versions it serves. xapi runs it and reads both replies. Both sides need one description of these replies, and xen-api has none.
Add the replies' types, with their JSON readers and writers, to the gpumon interface, which gpumon and xapi already link, in sub-modules named after what they describe. A later minor version may add members and values, and these types must still read its replies. gpumon's existing calls and their JSON are unchanged; nothing reads the new types until xapi's readers of the replies are added.
Each record has the reply's member names. An enumeration value that this reader does not know is kept as Unknown, and only the exact lower-case spelling reads as Known, since rpclib's variant reader ignores case. A member that is always present but may be null has its own typ. A member the reader can do without is kept as an Error when it is absent or cannot be read, and an integer must be a JSON integer in range.
A profile's signature is the resource counts, memory size and capabilities that the driver reports for it. It tells profiles apart beyond their names and numbers, and can show when a driver renumbers them. A member kept as an Error is lenient, so that a fault in it costs only that member, not the whole reply.
The gpumon interface test builds sample replies as OCaml values, writes each one and reads it back. Further cases edit a written reply, to drop or break a member or add what a newer helper may send, and check that the reader refuses the reply or loses only that member. Single values check the enumerations' spelling and the one renamed member.
All 22 pass, with the rest of xapi-idl's 268 tests.