Page MenuHomeFreeBSD

bhyve: supported features reporting PoC
Needs ReviewPublic

Authored by novel on Jun 24 2018, 9:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 2:54 AM
Unknown Object (File)
Dec 17 2023, 4:03 AM
Unknown Object (File)
Dec 16 2023, 5:02 PM
Unknown Object (File)
Dec 14 2023, 11:33 PM
Unknown Object (File)
Nov 20 2023, 1:41 AM
Unknown Object (File)
Oct 30 2023, 3:52 PM
Unknown Object (File)
Sep 28 2023, 3:48 PM
Unknown Object (File)
Aug 16 2023, 8:52 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 Passed
Unit
No Test Coverage
Build Status
Buildable 17585
Build 17398: arc lint + arc unit

Event Timeline

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.