Page MenuHomeFreeBSD

WIP: hyperv/kvp Cleanup KVP logic
Needs ReviewPublic

Authored by on Feb 19 2016, 7:28 AM.
Referenced Files
Unknown Object (File)
Fri, May 5, 5:21 AM
Unknown Object (File)
Mar 6 2023, 4:01 AM
Unknown Object (File)
Feb 18 2023, 7:43 AM
Unknown Object (File)
Feb 14 2023, 1:26 AM
Unknown Object (File)
Jan 13 2023, 10:15 AM
Unknown Object (File)
Dec 21 2022, 1:05 PM
Unknown Object (File)
Dec 15 2022, 11:53 AM
Unknown Object (File)
Apr 8 2017, 1:18 AM
This revision needs review, but there are no reviewers specified.



Use the state machine instead of 8 boolean variables
to track the state change.

Test Plan

Run the following powershell script from host box:

# Filter for parsing XML data
filter Import-CimXml 
   # Create new XML object from input
   $CimXml = [Xml]$_ 
   $CimObj = New-Object -TypeName System.Object 
   # Iterate over the data and pull out just the value name and data for each entry
   foreach ($CimProperty in $CimXml.SelectNodes("/INSTANCE/PROPERTY[@NAME='Name']")) 
         $CimObj | Add-Member -MemberType NoteProperty -Name $CimProperty.NAME -Value $CimProperty.VALUE 
   foreach ($CimProperty in $CimXml.SelectNodes("/INSTANCE/PROPERTY[@NAME='Data']")) 
         $CimObj | Add-Member -MemberType NoteProperty -Name $CimProperty.NAME -Value $CimProperty.VALUE 
   # Display output
# Prompt for the Hyper-V Server to use
$HyperVServer = Read-Host "Specify the Hyper-V Server to use (enter '.' for the local computer)"
# Prompt for the virtual machine to use
$VMName = Read-Host "Specify the name of the virtual machine"
# Get the virtual machine object
$query = "Select * From Msvm_ComputerSystem Where ElementName='" + $VMName + "'"
$Vm = gwmi -namespace root\virtualization\v2 -query $query -computername $HyperVServer
# Get the KVP Object
$query = "Associators of {$Vm} Where AssocClass=Msvm_SystemDevice ResultClass=Msvm_KvpExchangeComponent"
$Kvp = gwmi -namespace root\virtualization\v2 -query $query -computername $HyperVServer
Write-Host "Guest KVP information for" $VMName
# Filter the results
$Kvp.GuestIntrinsicExchangeItems | Import-CimXml

Diff Detail

rS FreeBSD src repository - subversion
Lint Passed
No Test Coverage
Build Status
Buildable 2564
Build 2581: arc lint + arc unit

Event Timeline retitled this revision from to WIP: hyperv/kvp Cleanup KVP logic. updated this object. edited the test plan for this revision. (Show Details)