none
HyperCall Implementation Problem RRS feed

  • Question

  • I am trying to achieve parent and child partition communication i.e I want to pass file related attributes (metadata about a specific file) from the child partition to parent partition.

    Let's just talk about a simple hypercall function HvGetPartitionId (it returns the partition Id of the caller). I made some simple changes to the passThrough driver and added the following code in the PtInstanceSetup function:

    HV_STATUS status;

    HV_PARTITION_ID pi;

    status=HvGetPartitionId(&pi);

    In the documentation it is mentioned to include the Hvgdk.h header file for the function. But when I include the mentioned headerfile and try to build the driver it gives me a compile time error saying function is undefined. HV_STATUS and HV_PARTITION_ID were well defined in the headerfile but there was no mention of the above function(or any hypercall functions for that matter).

    Wednesday, January 29, 2014 6:52 PM

Answers

  • Before you get too far down that path, ask yourself a few questions:

    1. What should happen if the VM is saved and restored in the middle of your operation?  (Partition ID will change during that sequence.)
    2. What should happen if the VM is migrated from one host to another in the middle of your operation?
    3. What should happen if the VM is migrated from a host with your hypothetical component installed to one without it installed?
    4. What does it mean to talk about a file in a file system that only one VM (the child partition) has access to?
    5. What's your security model?  I.e. how do you know your communications channel is talking to the entity that you think it is?

    Coming up with satisfactory answers to these questions is pretty difficult, and it's one reason why Microsoft doesn't support Hyper-V as an extensible platform for development.  You might be able to work something out, but there's no documentation on what you're going to need and no tools that are going to help you.

    With that said, if you're going to press on anyhow, you'll have to do it by reading the Hypervisor Top Level Design Specification, which is the first hit in this search:

    http://www.bing.com/search?q=hyper-v+hypervisor+top+level+design+specification+3.0a&qs=n&form=QBRE&pq=hyper-v+hypervisor+top+level+design+specification+3.0a&sc=0-0&sp=-1&sk=&cvid=7ca59ba7af0740638bf4c51448cef6a1

    You'll have to roll your own headers to make the appropriate hypercalls.  In the end, any system based on the interfaces described in that document will break the moment the VM goes through some sort of state change, like a pause, migration, save/restore, backup/restore, etc.  The interfaces that can survive those state changes isn't published.

    -- Jake Oshins

    Hyper-V Team

    Microsoft

    Wednesday, January 29, 2014 9:49 PM