Page MenuHomeFreeBSD

bhyve: supported features reporting PoC
Needs ReviewPublic

Authored by novel on Jun 24 2018, 9:54 AM.

Details

Reviewers
rgrimes
Group Reviewers
bhyve
Summary

PoC for https://lists.freebsd.org/pipermail/freebsd-virtualization/2018-June/006536.html

JSON:

bhyve -f --libxo json,pretty                                                    
{                                                                                                                                                                                                                  
  "bhyve": {                                                                                                                                                                                                       
    "schema_version": "1.0",                                                                                                                                                                                       
    "features": {                                                                                                                                                                                                  
      "feature": {                                                                                                                                                                                                 
        "rtc_utc": {                                                                                                                                                                                               
          "description": "RTC keeps UTC time",                                                                                                                                                                     
          "cmd": {                                                                                                                                                                                                 
            "switch": "-u"                                                                                                                                                                                         
          }                                                                                                                                                                                                        
        }                                                                                                                                                                                                          
      },                                                                                                                                                                                                           
      "feature": {                                                                                                                                                                                                 
        "wire_guest_memory": {                                                                                                                                                                                     
          "description": "Wire guest memory",                                                                                                                                                                      
          "cmd": {                                                                                                                                                                                                 
            "switch": "-S"                                                                                                                                                                                         
          }                                                                                                                                                                                                        
        }                                                                                                                                                                                                          
      },                                                                                                                                                                                                           
      "feature": {                                                                                                                                                                                                 
        "devices": {                                                                                                                                                                                               
          "description": "Devices support",                                                                                                                                                                        
          "cmd": {                                                                                                                                                                                                 
            "switch": "-s",                                                                                                                                                                                        
            "arguments": [                                                                                                                                                                                         
              {                                                                                                                                                                                                    
                "options": "virtio-net,tapN,mac=xx:xx:xx:xx:xx:xx",                                                                                                                                                
                "description": "Virtio network device"                                                                                                                                                             
              },                                                                                                                                                                                                   
              {                                                                                                                                                                                                    
                "options": "virtio-blk,path,nocache,direct,ro,sectorsize=logical/physical",                                                                                                                        
                "description": "Virtio block device"                                                                                                                                                               
              },                                                                                                                                                                                                   
              {                                                                                                                                                                                                    
                "options": "fbuf,rfb,rfb=IP:port,w=width,h=heigh,vga=vgaconf,wait,password=password",                                                                                                              
                "description": "Framebuffer device"                                                                                                                                                                
              }                                                                                                                                                                                                    
            ]                                                                                                                                                                                                      
          }                                                                                                                                                                                                        
        }                                                                                                                                                                                                          
      }                                                                                                                                                                                                            
    }                                                                                                                                                                                                              
  }                                                                                                                                                                                                                
}

XML:

<bhyve>
  <schema_version>1.0</schema_version>
  <features>
    <feature>
      <rtc_utc>
        <description>RTC keeps UTC time</description>
        <cmd>
          <switch>-u</switch>
        </cmd>
      </rtc_utc>
    </feature>
    <feature>
      <wire_guest_memory>
        <description>Wire guest memory</description>
        <cmd>
          <switch>-S</switch>
        </cmd>
      </wire_guest_memory>
    </feature>
    <feature>
      <devices>
        <description>Devices support</description>
        <cmd>
          <switch>-s</switch>
          <arguments>
            <options>virtio-net,tapN,mac=xx:xx:xx:xx:xx:xx</options>
            <description>Virtio network device</description>
          </arguments>
          <arguments>
            <options>virtio-blk,path,nocache,direct,ro,sectorsize=logical/physical</options>
            <description>Virtio block device</description>
          </arguments>
          <arguments>
            <options>fbuf,rfb,rfb=IP:port,w=width,h=heigh,vga=vgaconf,wait,password=password</options>
            <description>Framebuffer device</description>
          </arguments>
        </cmd>
      </devices>
    </feature>
  </features>
</bhyve>

Plain text:

Schema version: 1.0

rtc_utc
Description: RTC keeps UTC time
Command line switch: -u

wire_guest_memory
Description: Wire guest memory
Command line switch: -S

devices
Description: Devices support
Command line switch: -s                                                                                                                                                                                            
Arguments: virtio-net,tapN,mac=xx:xx:xx:xx:xx:xx Description: Virtio network device                                                                                                                                
Arguments: virtio-blk,path,nocache,direct,ro,sectorsize=logical/physical Description: Virtio block device                                                                                                          
Arguments: 'fbuf,rfb,rfb=IP:port,w=width,h=heigh,vga=vgaconf,wait,password=password' Description: Framebuffer device

Diff Detail

Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 17585
Build 17398: arc lint + arc unit

Event Timeline

novel created this revision.Jun 24 2018, 9:54 AM
novel updated this revision to Diff 44380.Jun 24 2018, 9:57 AM

Regenerate diff.

novel edited the summary of this revision. (Show Details)Jun 24 2018, 10:38 AM
araujo added a subscriber: araujo.Jun 25 2018, 3:41 AM

It likely should have a way to indicate which parameters are optional

for example, with virtio-blk
A path is required, but the 'nocache' parameter is optional
Maybe sector size should also indicate what the default is?

I am not sure if we want to get more expressive, and provide more documentation for each sub-parameter. I suppose it depends on what your use case is. If some type of UI is using this output to have the user configure a VM, some values might also need to specify the bounds, or units.

araujo removed a subscriber: araujo.Feb 22 2019, 1:22 AM
araujo added a subscriber: araujo.Jul 30 2019, 8:20 AM