From nobody Wed Jun 23 15:19:03 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1F75F5D1771 for ; Wed, 23 Jun 2021 15:19:04 +0000 (UTC) (envelope-from bsd-lists@bsdforge.com) Received: from udns.ultimatedns.net (static-24-113-41-81.wavecable.com [24.113.41.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "ultimatedns.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G96P36MnDz4sJs for ; Wed, 23 Jun 2021 15:19:03 +0000 (UTC) (envelope-from bsd-lists@bsdforge.com) Received: from ultimatedns.net (localhost [127.0.0.1]) by udns.ultimatedns.net (8.16.1/8.16.1) with ESMTP id 15NFJ36A063011; Wed, 23 Jun 2021 08:19:09 -0700 (PDT) (envelope-from bsd-lists@bsdforge.com) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Date: Wed, 23 Jun 2021 08:19:03 -0700 From: Chris To: =?UTF-8?Q?Ionu=C8=9B_Mihalache?= Cc: freebsd-hackers@freebsd.org Subject: Re: libzfs.h and libnvpair.h In-Reply-To: References: User-Agent: UDNSMS/17.0 Message-ID: X-Sender: bsd-lists@bsdforge.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4G96P36MnDz4sJs X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_RCPT(0.00)[]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 2021-06-23 06:24, IonuČ› 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 tried > 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 there > 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 as > 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 for example. The same could be performed against libzfs.h. If including libzfs.h didn't work, and including first libzfs.h along with 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.