Date: Sun, 24 Jun 2018 14:13:02 +0400 From: Roman Bogorodskiy <novel@freebsd.org> To: freebsd-virtualization@freebsd.org Subject: RFC: bhyve supported features reporting Message-ID: <20180624101301.GB2252@kloomba>
next in thread | raw e-mail | index | archive | help
--xgyAXRrhYN0wYx8y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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": [ =20 // Probably, it'd be better to make this more organized, // e.g. instead of a string with all arguments and ar= g/value paris, // use a list of objects which would include possible= values, // required/optional, etc {"options": "virtio-net,tapN,mac=3Dxx:xx:xx:xx:xx:xx", "description": "Virtio network device" }, {"options": "virtio-blk,path,nocache,direct,ro,sectorsize=3Dlogical= /physical", "description": "Virtio block device" }, {"options": "fbuf,rfb,rfb=3DIP:port,w=3Dwidth,h=3Dheigh,vga=3Dvgaco= nf,wait,password=3Dpassword", "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= =2Ec Roman Bogorodskiy --xgyAXRrhYN0wYx8y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJbL26tAAoJEMltX/4IwiJqFP0H/Ar75ephp349XKXEK3ltpkF+ vsO3KLENOH73EkXHixwLN571rq754fyYzUpeB4NT/a3ao8af8BuinZuIoEVEAqBK +4gi/DUXJd2Rabpxc6yy4OYv2o8eHRkUQfhv0J/LBnlGRGj6mbBoBbBNpnyjEwHg rvDvbyHUiCka60XULNZDf2mUOaOmntmok5Ns7kFZfDenin+GlecVaAGKrUwsUfZ4 mHrdD2xJwaumWQV9tmPdscTUeMEu+7/7HSk7ujH96w/upzGsiYQp60tNrspROmNn tt6ei6CB7PUEvKjzMltz1XGAZ+gW3smWWZerfqeWTufGQ6fVXQNYLREKKRf+Kfk= =OXji -----END PGP SIGNATURE----- --xgyAXRrhYN0wYx8y--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180624101301.GB2252>