Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jun 2021 18:52:21 +0300
From:      =?UTF-8?Q?Ionu=C8=9B_Mihalache?= <ionut.mihalache1506@gmail.com>
To:        Chris <bsd-lists@bsdforge.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: libzfs.h and libnvpair.h
Message-ID:  <CAOxbktZTDzF0%2BBt%2BKcF27C9KuRYQfRQKqJvtVKTsBoknxXOfOQ@mail.gmail.com>
In-Reply-To: <dccb45464e129ef6f021c5cca1cf44d8@bsdforge.com>
References:  <CAOxbktYPLg-Y11FMv6mMS3bVi6zFxNHYrwnBBNGSPAifqeh-uQ@mail.gmail.com> <dccb45464e129ef6f021c5cca1cf44d8@bsdforge.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000fc631b05c570e4e4
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

When including <libnvpair.h> there is another include for the header
<nvpair.h> which redefines functions from <nv.h>. <libzfs.h> and
<libnvpair.h> don't seem to have problems, <libzfs.h> includes
<libnvpair.h>, I don't have to include it myself.

=C3=8En mie., 23 iun. 2021 la 18:19, Chris <bsd-lists@bsdforge.com> a scris=
:

> On 2021-06-23 06:24, Ionu=C8=9B Mihalache wrote:
> > Hello,
> >
> > I am working into bringing the checkpoint functionality for bhyve and I
> > think I could use the zfs functionalities for the implementation. I tri=
ed
> > to build the world with -DWITH_ZFS and -DWITH_CDDL(I don't exactly know
> > what macro or macros should be defined or if there are any, these two I
> > tried based on the analysis of the Makefiles) but this doesn't seem to
> > work. When I include libzfs.h in order to use the functions from there,=
 I
> > get a compilation error saying that libnvpair.h is not found. After
> > investigating the problem I saw that in /usr/include libnvpair.h is not
> > present. I copied the files from /usr/local/include but after this ther=
e
> > was a problem with the redefinition of some functions. Is it a way to
> > use(or 'activate') the zfs functionalities directly in the code without
> > using syscalls like system or exec(I would like to avoid them as much a=
s
> > possible).
> I regret I haven't got the time to investigate this for you. But on a
> 13/amd64
> system, a cd /usr/src followed by a grep -r -F libnvpair.h .
> returned some results that may be of interest to you in sorting this out.
> ./lib/libbe/be.h:#include <libnvpair.h> for example. The same could be
> performed
> against libzfs.h.
> If including libzfs.h didn't work, and including first libzfs.h along wit=
h
> libnvpair.h errored with duplicates. It may be the case that you need to
> only include libnvpair.h, which may pull in libzfs.h. IDK but thought I'd
> mention it. Sorry, that's all I've got.
>
> HTH
>
> --Chris
>
>
> >
> > Thank you.
>

--000000000000fc631b05c570e4e4--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOxbktZTDzF0%2BBt%2BKcF27C9KuRYQfRQKqJvtVKTsBoknxXOfOQ>