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
CP-10203: XenAPI: api call for RDP on/off request #2042
Conversation
(Ref.string_of vm) domid (Printexc.to_string e); | ||
false | ||
|
||
let beg_rdp ~__context ~vm ~enabled = |
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.
Here we read and write Xenstore nodes directly from xapi.
Wherever possible we want to do this only through xenopsd, so this function should just call a corresponding new function in xenopsd.
(Sorry I missed this on Friday when I was reviewing your earlier version of the code. In fact I should have mentioned it before you started.)
@@ -64,6 +64,8 @@ let allowed_power_states ~__context ~vmr ~(op:API.vm_operations) = | |||
| `send_trigger | |||
| `snapshot_with_quiesce | |||
| `suspend | |||
| `beg_rdp_on |
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 set of operations is currently in alphabetical order, which is helpful for readability.
It would be nice to preserve this by inserting the new items into the appropriate place (after awaiting_memory_live) instead of putting them at the end.
The code looks good now (except for the trivial cosmetic issue of the ordering of the items in xapi_vm_lifecycle.ml around line 67). Please would you squash the two commits into one? |
Thanks Thomas for the comments. |
@@ -174,6 +174,7 @@ let vm_old_pv_drivers = "VM_OLD_PV_DRIVERS" | |||
let vm_lacks_feature_shutdown = "VM_LACKS_FEATURE_SHUTDOWN" | |||
let vm_lacks_feature_suspend = "VM_LACKS_FEATURE_SUSPEND" | |||
let vm_lacks_feature_vcpu_hotplug = "VM_LACKS_FEATURE_VCPU_HOTPLUG" | |||
let vm_lacks_feature_ts = "VM_LACKS_FEATURE_TS" |
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.
Why _ts
? What does it stand for?
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.
Rob, "ts" is for "terminal services", Windows terminology for RDP.
This corresponds to the xenstore nodes data/ts
, control/feature-ts
and control-ts
used by the guest agent.
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.
Ah, I see, fair enough. However, this error name is part of the high-level XenAPI, and does not necessarily need to use the same terminology as the low-level xenstore interface. In fact, the API calls use "rdp" rather than "ts" already. From a XenAPI user's point of view, it may be clearer to use "rdp" in the error 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.
Looking at the other FEATURE_
s in the context (shutdown, suspend, vcpu_hotplug) they all correspond to operations on the VM "virtual hardware". The XenAPI VM.* is mostly about manipulating and monitoring the "virtual hardware" and mostly not about performing operations within the guest operating system (although the implementation of VM.clean_shutdown
happens to do this as part of its implementation it could have been implemented in terms of an ACPI button push). This means that the VM.* functions don't really care whether you're running Linux, FreeBSD or Windows.
Since this feature seems very Windows-dependent ("terminal services") and is tied to our particular guest agent (and is not part of the standard Xen guest interface which is more minimal), I think we should reflect that in the name. Perhaps we should call the API VM_guest_agent.foo
?
As said on the xenopsd pull request, I'd prefer to use the verb |
I realise I should have made most of my above comments on xapi-project/xapi-project.github.io#12 :/ |
Thanks all the comments and suggestion.
Could you please correct me if I miss or misunderstand anything? Update: Just uploaded the code here to address comments 1 ~ 3. |
a5f0ad0
to
90802dc
Compare
Thanks all for the comments and suggestions. Could you please help review it? |
let call_plugin ~__context ~vm ~plugin ~fn ~args = | ||
if plugin <> "guest-agent-operation" then | ||
raise (Api_errors.Server_error(Api_errors.xenapi_missing_plugin, [ plugin ])); | ||
let _ = |
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.
What is the point of this? Either
- ignore
args
completely, or - raise an exception if
args <> []
(but this only makes sense after checking thatfn
is valid)
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.
Thanks.
I should have added a comment in code that args
might be used in future and here it is just an example.
Would remove this evaluation statement if it's not necessary.
Looking good, but there are a few small changes to make. datamodel.ml is in an odd state: the With those function specifications gone from the public API, it probably also makes sense to remove the datamodel entry for |
Thanks Thomas. |
Signed-off-by: Hui Zhang <hui.zhang@citrix.com>
CP-10203: XenAPI: api call for RDP on/off request
Thanks @thomassa |
Signed-off-by: Hui Zhang hui.zhang@citrix.com