Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jun 2018 11:07:08 +0400
From:      Roman Bogorodskiy <novel@freebsd.org>
To:        araujo@freebsd.org
Cc:        freebsd-virtualization@freebsd.org
Subject:   Re: RFC: bhyve supported features reporting
Message-ID:  <20180626070704.GA1886@kloomba>
In-Reply-To: <CAOfEmZh0zZ6ND9hgK=NtBhuoNUhYywstJ=GfKF47RQbb3fuD-Q@mail.gmail.com>
References:  <20180624101301.GB2252@kloomba> <CAOfEmZh0zZ6ND9hgK=NtBhuoNUhYywstJ=GfKF47RQbb3fuD-Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--M9NhX3UHpAaciwkO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

  Marcelo Araujo wrote:

> Hi Roman,
>=20
> 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.

Yeah, it's true, I think it would be good to make it more compact
somehow. I'll play around with macros to see if I can make it easier to
add new items.

> As an example this patch that you made:
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D210111
>=20
> 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 detail=
s,
> 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.

Yeah, this patch makes things easier, but doesn't cover all the cases.
For example, at some point VNC authentication was added [1] through
adding a 'password' keyword, but with an approach like that it's not
possible to know if the given bhyve version supports that or not.

1: https://svnweb.freebsd.org/base?view=3Drevision&revision=3D319487

> I do believe if we remove the complexity or at least makes it easy to be
> extend, IMHO it is a good idea.
>=20
> Best,
>=20
>=20
> 2018-06-24 18:13 GMT+08:00 Roman Bogorodskiy <novel@freebsd.org>:
>=20
> > 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=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=3Dvgaconf,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.c
> >
> > Roman Bogorodskiy
> >
>=20
>=20
>=20
> --=20
>=20
> --=20
> Marcelo Araujo            (__)araujo@FreeBSD.org
> \\\'',)http://www.FreeBSD.org <http://www.freebsd.org/>;   \/  \ ^
> Power To Server.         .\. /_)

Roman Bogorodskiy

--M9NhX3UHpAaciwkO
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJbMeYYAAoJEMltX/4IwiJqyp8H/iRk2CYJE+eVFlIlOoKM9Y0J
eRQlx/Bt3+TA/xFKzdX9lKKo/pTsJH9yxgv7oaEW4dTQ2z9Ry0oDUD4S6+u5S10a
HPP1UthQAx6prHaqDccTwxDaXRJY0CyaYx5eOwNJYvesQ+MQ7ANtsCDetagLj2D6
rHvWsbJhv30K+YYe7sYcQx+xFT3HmI4qp7FjMZgyUatWZ4oUGtOWzWE/wp5d3e2E
/v7ca+oqEPbqRfLlNY2upCg85HTtbI5epTaE2DzmSc9zV7kfEyh+1whnmhHO0FgN
iD+d2DbO34kEjWdpvJ+qAuoFpYh5p5o9AD+SGrzipihLRTVcEqJroDGTv89U42U=
=+LDG
-----END PGP SIGNATURE-----

--M9NhX3UHpAaciwkO--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180626070704.GA1886>