Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 May 2021 09:29:30 -0400
From:      Mark Johnston <markj@freebsd.org>
To:        =?utf-8?B?SW9udcib?= Mihalache <ionut.mihalache1506@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: cap_sysctlbyname for hw.vmm.destroy
Message-ID:  <YI1XujxIQv1fpfpV@nuc>
In-Reply-To: <CAOxbktYgis0tq2yTp-7bwZCH01M0UDXhsgL%2Bf%2BEJtJX8BcxWyA@mail.gmail.com>
References:  <CAOxbktY6GZY2rfyYMoTquyn04rM2GB5S2opAF1gDxh2177frLg@mail.gmail.com> <YIb66AlmFG0DPn%2BG@nuc> <CAOxbktbsOGAEHZHEuHNrzP9ToyJVN0MvhqfRX_M-kxNOChD2Gw@mail.gmail.com> <YIlot3y9aJ5cSB9H@nuc> <CAOxbktYCDEotQE%2BE3SHAkw_FCBui80xoAoWBbau9APb1M5=d6w@mail.gmail.com> <YIl0L5Wrm8YwpXWr@nuc> <CAOxbktazHmPtHjkkD6Hh7=1O5KW5N%2Bcu-5=WfC6GmKPut4K7yQ@mail.gmail.com> <YImCHsL3lVN3HAWo@nuc> <CAOxbktYgis0tq2yTp-7bwZCH01M0UDXhsgL%2Bf%2BEJtJX8BcxWyA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, May 01, 2021 at 12:29:26PM +0300, IonuČ› Mihalache wrote:
> I did a clean buildworld with -DWITH_CASPER and -DHAVE_CASPER and now there
> is a linking problem. Here [1] I have the includes to test the example and
> here [2] I have the code. When trying to link there is a problem with
> cap_sysctl_limit_init,
> cap_sysctl_limit_name, cap_sysctl_limit, cap_sysctlbyname; the symbols are
> not found. If I comment those lines though, cap_service_open fails(this
> happens in bhyverun.c). When using the API here [3] there are no linking
> problems and cap_service_open works, but cap_sysctlbyname returns EPERM(I
> have here [4] the includes that I used).

- You do not need to do a full buildworld.  It is sufficient to rebuild
  bhyve itself with -DWITH_CASPER.  Note that the bhyve Makefile does
  not define WITH_CASPER when snapshot support is enabled.
- You need to add cap_sysctl to the list of libraries linked into bhyve,
  same as it currently links cap_pwd and cap_grp.

> [1] -
> https://github.com/FreeBSD-UPB/freebsd-src/blob/2373ecaa6dea4f0491a3ccc679017c025cbaf243/usr.sbin/bhyve/bhyverun.c#L36
> [2] -
> https://github.com/FreeBSD-UPB/freebsd-src/blob/2373ecaa6dea4f0491a3ccc679017c025cbaf243/usr.sbin/bhyve/bhyverun.c#L1569
> [3] -
> https://github.com/FreeBSD-UPB/freebsd-src/blob/2373ecaa6dea4f0491a3ccc679017c025cbaf243/lib/libvmmapi/vmmapi.c#L141
> [4] -
> https://github.com/FreeBSD-UPB/freebsd-src/blob/2373ecaa6dea4f0491a3ccc679017c025cbaf243/lib/libvmmapi/vmmapi.h#L38



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