Page MenuHomeFreeBSD

WIP: hyperv/kvp Cleanup KVP logic
Needs ReviewPublic

Authored by howard0su_gmail.com on Feb 19 2016, 7:28 AM.
Tags
None
Referenced Files
F82019232: D5343.diff
Wed, Apr 24, 3:31 PM
Unknown Object (File)
Thu, Apr 11, 12:25 PM
Unknown Object (File)
Mar 22 2024, 12:14 AM
Unknown Object (File)
Feb 22 2024, 1:26 PM
Unknown Object (File)
Jan 24 2024, 7:04 AM
Unknown Object (File)
Dec 20 2023, 1:33 AM
Unknown Object (File)
Dec 8 2023, 3:28 PM
Unknown Object (File)
Nov 22 2023, 12:06 PM
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

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
   $CimObj 
} 
 
# 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
Write-Host "Guest KVP information for" $VMName
 
# Filter the results
$Kvp.GuestIntrinsicExchangeItems | Import-CimXml

Diff Detail

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

Event Timeline

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