Move hypervisor-specific code into a case statement

Change-Id: Id799506f180ac81d493f49de140cc079338430aa
Merge "Move hypervisor-specific code into a case statement"