RFC: bhyve supported features reporting

Marcelo Araujo araujobsdport at gmail.com
Mon Jun 25 03:41:13 UTC 2018


Hi Roman,

I think it is doable, my only concern is the complexity and
maintainability, as along the way we will add more devices and would be
nice to have something transparent for those additions or at least
something easy to be extended.

As an example this patch that you made:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210111

It has much less complexity, and seemed for me to be much easier to
maintain, however doesn't give us a detailed information like the latest
one you are proposing, I'm not sure if we really need so extensive details,
I didn't see any bhyve device changing its options along the past years,
but that doesn't means it would not in the future.

I do believe if we remove the complexity or at least makes it easy to be
extend, IMHO it is a good idea.

Best,


2018-06-24 18:13 GMT+08:00 Roman Bogorodskiy <novel at freebsd.org>:

> Bhyve evolves over time, and new features get added, such as new
> devices support, new guest configurations and so on. However, it's not
> really straight-forward to figure out what features a given bhyve binary
> supports. This makes it harder to develop tools on top of bhyve,
> specifically error reporting.
>
> For example, libvirt's bhyve driver [1] probes bhyve capabilities [2]
> using:
>
>  * Running 'bhyve -h' and parsing output,
>  * For detecting devices, it runs 'bhyve -s 0,dev' and parses error
>    output to see if the device is supported.
>
> It's not very effective because 'bhyve' binary has to be executed
> multiple times just to check things. Additionally, it's harder to check
> things on a deeper level, e.g. specific device parameters. Also, this is
> error-prone because help output generally is not designed for
> machine-parsing, and this could easily break on slight formatting
> change.
>
> I would like to discuss introducing a general way of reporting features
> bhyve supports. To start a discussion, I've created a simple draft/PoC
> which adds '-f' (as for features) command line switch to bhyve. This
> switch makes bhyve print its supported features. I'll use JSON as
> example, however, as it's done using libxo, XML is also supported.
> Example JSON output with inline comments below:
>
> "bhyve": {
>
>     // 'features' schema version using the common versioning pattern:
>     //    major version increments on incompatible changes,
>     //    minor version increments on compatible changes (extensions).
>     "schema_version": "1.0",
>
>     // there could also go some general properties like max_cpus etc
>
>     // list of specific features, mostly should be self-descriptive
>     "features": {
>         "rtc_utc": {
>             "description": "RTC keeps UTC time",
>             "cmd": {
>                 "switch": "-u"
>             }
>         },
>         "wire_guest_memory": {
>             "description": "Wire guest memory",
>             "cmd": {
>                  "switch": "-S"
>             }
>         },
>         "devices": {
>             "description": "Devices support",
>             "cmd": {
>                   "switch": "-s",
>                   "arguments": [
>
>                       // Probably, it'd be better to make this more
> organized,
>                       // e.g. instead of a string with all arguments and
> arg/value paris,
>                       // use a list of objects which would include
> possible values,
>                       // required/optional, etc
>
>                       {"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"
>                       }
>                    ]
>              }
>         }
>      }
> }
>
> Sample code is here: https://reviews.freebsd.org/D15992. At this point
> it's just an excuse to start a discussion; it needs some macros to make
> items creation easier, and it needs to have all the other
> features/devices populated.
>
> 1: https://libvirt.org/drvbhyve.html
> 2:
> https://github.com/libvirt/libvirt/blob/master/src/bhyve/
> bhyve_capabilities.c
>
> Roman Bogorodskiy
>



-- 

-- 
Marcelo Araujo            (__)araujo at FreeBSD.org
\\\'',)http://www.FreeBSD.org <http://www.freebsd.org/>   \/  \ ^
Power To Server.         .\. /_)


More information about the freebsd-virtualization mailing list