From nobody Wed Jun 23 15:52:21 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 573105D5055 for ; Wed, 23 Jun 2021 15:52:33 +0000 (UTC) (envelope-from ionut.mihalache1506@gmail.com) Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G977j1Rs3z3D4B for ; Wed, 23 Jun 2021 15:52:32 +0000 (UTC) (envelope-from ionut.mihalache1506@gmail.com) Received: by mail-io1-xd2d.google.com with SMTP id r12so4052166ioa.7 for ; Wed, 23 Jun 2021 08:52:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GxrN2R8drkuoZD/Ji7pwuwXuUZqdmdGKVpAEXYG3SKY=; b=JGqa14r4vLqwuE/lSnQglke/ayJrzF3bolRK7DBvJ+WKPe6bpG1F7TYvXRNASkg4HX op5NN7Tl5qzg6Zuzew3JrmzjkYGVFgs9PHex6BWTpoCH+vCq8uU4OgaQMHi/51JFOMac dJ1SkuLrX+NxbrhHo78Gtr5Jam6uLPNmY9r5Zn7IMa2WTKUqTgWxObVBd/HmOO/UdyWB lHFgMvq6OAvhrI3XfM2BEt0Z18iPigLcl3eEb5ZppuN9vFlLs4NfNYQjzc52/R/YVGcT R0qEV9ukCu/NMIQopZ8z1CZAIkTi3jwtlinpXUS2stsTMUSaEpoWDgBCoE62CyNbTj+i 0ISA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GxrN2R8drkuoZD/Ji7pwuwXuUZqdmdGKVpAEXYG3SKY=; b=kqWKf8AW4V4VG9ozkMVHjhUW0AFBFoxgpzBd1F6oHQQKwykOPcCJeJAVmpsK2dSfdH U6NmfIUMy4SQKuTsvJmYSfw5UUZ9Qoy7GT7MWoiz8Q90DLZkA+90cL05YpJTD9j+UM1N D+/6rPIM1z5kyE4RQ5ipqXyD7+cBLDgPHoxlX1JQhjMlb06PLBopARqzHo3tHrnGAEXj MTQSKQn5f0fjUr3Qn+NY7yBncjD1dFKRCq4ZHMnGiMN/E1aLs0x6i5BvApaKDMxLe6xz uTj+IFiVJEePlbqOSTl8exeH9CVNAHGPCPqWwlipvAahO86xnLE5QiRmBbFrL4j1Mx2w Q2vg== X-Gm-Message-State: AOAM5313BhiL/TEVf5GQHRXAGSvgkJrT179oAPwpqQm18GsUM9a5YcWz NUzi8/bkIuZYBf+XZecSW4EvQKTVppE4AIx77MerTvEt X-Google-Smtp-Source: ABdhPJywruMBVDmMXtvK9xG8URMr0e0NH7khGf/uFxmjR3cWK6I23+3xjAdGuBLZ5SbEtGxrlr0kvETBKtxq8AgBJSs= X-Received: by 2002:a02:c808:: with SMTP id p8mr229904jao.109.1624463552306; Wed, 23 Jun 2021 08:52:32 -0700 (PDT) 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 References: In-Reply-To: From: =?UTF-8?Q?Ionu=C8=9B_Mihalache?= Date: Wed, 23 Jun 2021 18:52:21 +0300 Message-ID: Subject: Re: libzfs.h and libnvpair.h To: Chris Cc: freebsd-hackers@freebsd.org Content-Type: multipart/alternative; boundary="000000000000fc631b05c570e4e4" X-Rspamd-Queue-Id: 4G977j1Rs3z3D4B X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: Y --000000000000fc631b05c570e4e4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable When including there is another include for the header which redefines functions from . and don't seem to have problems, includes , I don't have to include it myself. =C3=8En mie., 23 iun. 2021 la 18:19, Chris 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 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--