-
Notifications
You must be signed in to change notification settings - Fork 284
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
Multi-Version Drivers #6163
base: master
Are you sure you want to change the base?
Multi-Version Drivers #6163
Conversation
lindig
commented
Dec 6, 2024
6d992d8
to
f0db7d8
Compare
I understand this is a draft version. But would be easier to split it into smaller commits for review, or is that not very feasible? |
I worked from the original work by @last-genius but ended up having so many changes that the commit history was not meaningful. In addition, re-basing made a mess of them. In the end, this is difficult to split up - it's almost impossible to split this up such that each commit still compiles because it references each other. I could split it by module or something like it - but that is not entirely logical either. |
I have additional code to make the database update incremental on |
@@ -581,17 +602,6 @@ let gc_PVS_cache_storage ~__context = | |||
(fun x -> valid_ref __context x.pVS_cache_storage_host) | |||
Db.PVS_cache_storage.destroy | |||
|
|||
(* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove these?
|
||
(** destroy driver and recursively its variants, too *) | ||
let destroy ~__context ~self = | ||
D.debug "Destroying driver %s" (Ref.string_of self) ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The %s __FUNCTION__
can be added here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very long single commit... I would normally split out at least the datamodel definition, internal logic, tests and mock tool into separate commits.
"Unique versions of this driver variant" | ||
; field ~lifecycle:[] ~qualifier:DynamicRO ~ty:Bool "hardware_present" | ||
"True if the hardware for this variant is present on the host" | ||
; field ~lifecycle:[] ~qualifier:DynamicRO ~ty:Float "priority" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not mentioned in the markdown doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True; the role of priority is not clear at the moment; we are not actively using it except to order presentation. The value is reported by the lower level.
ocaml/xapi/xapi_host_driver.ml
Outdated
D.debug "%s selecting driver %s variant %s" __FUNCTION__ drv var ; | ||
let d = Db.Host_driver.get_record ~__context ~self in | ||
let v = Db.Driver_variant.get_record ~__context ~self:variant in | ||
let stdout = | ||
drivertool ["select"; d.API.host_driver_name; v.API.driver_variant_name] | ||
in | ||
info "%s: %s" __FUNCTION__ stdout ; | ||
Db.Host_driver.set_selected_variant ~__context ~self ~value:variant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a copy of Variant.select
, except you have the driver ref already. But I'm not sure we actually need Driver_variant.select
in the API at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One uses the name of the variant, the other the ref. Both may be the most convenient for an API client; I would make the decision to remove this later as the feature progresses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So both for select
and rescan
have redundant versions in the datamodel now. I prefer to keep the API simple and have just one way of doing something, and keep just one of each kind. But fine if you want to decide later which one is best.
f0db7d8
to
2a1a1d1
Compare
|
||
The format of the description is vendor specific and is used for | ||
a null-terminated string holding the version. The name is fixed to | ||
"XenServer". The exact format is described in [ELF notes]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this configurable? The spec says the identifier is vendor-specific, so can another vendor provide .note.$VENDOR
instead and tell XAPI that it's where it should look for the extra driver information?
Alternatively, if not configurable, would Xapi
be a better fit as an identifier for such a feature of the XAPI Project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of this is quite far out and we are trying to get this off the ground. It's too early to encode this kind of flexibility where we are far away from any end-to-end testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand regarding the configurability. However I tried to suggest changing the hardcoded names to Xapi
(paths, ELF notes...), which seemed a good and neutral identifier for downstreams, in the previous draft iteration of this PR, but without an answer at the time, that's why I'm asking again now. This would likely avert the need for configurable paths and identifiers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll bring it up in a discussion. I understand the desire to keep XenServer
out of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! I see the merge is near. Did you discuss this topic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole feature is quite far away and the lower-level code that dictates this is not yet ready. We will change this later. I am trying to merge this to avoid a long-running feature branch.
The diff for |
fa3b4ae
to
0e02275
Compare
0e02275
to
26eb2b0
Compare
Two things left before we can merge:
|
Provide an API/CLI for multi-version drivers. Two new classes represent them: Host_driver and Driver_variant. See * doc/content/toolstack/features/MVD/index.md for technical background and feature overview. The current implementation mocks the missing drivertool that manipulates the file system and observes driver state. We expect to integrate this at a later point. Consequently, the current implementation is incomplete and exists to faciliate development of API and XE clients. On Xapi start and restart driver information is purged from the database and re-built from scrach. This could be improved in the future to be incremental. Signed-off-by: Christian Lindig <[email protected]>
When scanning a host for drivers, don't remove and re-create them but instead update an entry if it already exists. Signed-off-by: Christian Lindig <[email protected]>
When scanning a host for drivers, don't remove and re-create them but instead update an entry if it already exists. Signed-off-by: Christian Lindig <[email protected]>
Address review comments; fix typos and parameter names. Signed-off-by: Christian Lindig <[email protected]>
Signed-off-by: Christian Lindig <[email protected]>
Signed-off-by: Christian Lindig <[email protected]>
This fixes a typo in list of fields we show in the CLI. Signed-off-by: Christian Lindig <[email protected]>
Re-generate datamodel_lifecycle.ml to reflect correctly the current version of the API. Signed-off-by: Christian Lindig <[email protected]>
d719098
to
02c00d2
Compare
@robhoes I've addressed the typo and lifecycle code; this is also on top of master again. |
availability (HA) and workload balancing (WLB)" | ||
|
||
* `select (self, version)`; select `version` of driver `self`. Selecting | ||
the version (a string) of an existing driver. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THe parameter for this function is not a version string in the datamodel, but a variant reference. (I do prefer the variant reference of the string versiong)
; (* timeout_alerts; *) | ||
(* CA-29253: wake up all blocked clients *) | ||
("Heartbeat", Xapi_event.heartbeat) | ||
; ("VTPMs", gc_vtpms) (* CA-29253: wake up all blocked clients *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment got attached to the wrong element.
Co-authored-by: Pau Ruiz Safont <[email protected]> Signed-off-by: Christian Lindig <[email protected]>
Co-authored-by: Pau Ruiz Safont <[email protected]> Signed-off-by: Christian Lindig <[email protected]>
Co-authored-by: Pau Ruiz Safont <[email protected]> Signed-off-by: Christian Lindig <[email protected]>
Fix documentation for select() method. Signed-off-by: Christian Lindig <[email protected]>
Use more existing functions to format records. Signed-off-by: Christian Lindig <[email protected]>