From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44912 invoked by alias); 14 Jun 2018 14:44:28 -0000 Mailing-List: contact springfield-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: springfield-owner@sourceware.org Received: (qmail 44827 invoked by uid 89); 14 Jun 2018 14:44:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.4 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=UD:M, images X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mx1.redhat.com Date: Mon, 01 Jan 2018 00:00:00 -0000 From: "Richard W.M. Jones" To: =?utf-8?Q?Vojt=C4=9Bch_Trefn=C3=BD?= , libguestfs@redhat.com Cc: springfield@sourceware.org Subject: Re: Could libguestfs use springfield? Message-ID: <20180614144353.GC14740@redhat.com> References: <20180614111545.GB14740@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 14 Jun 2018 14:44:25 +0000 (UTC) X-SW-Source: 2018-06/txt/msg00002.txt.bz2 [Adding libguestfs mailing list] On Thu, Jun 14, 2018 at 04:15:57PM +0200, Vojtěch Trefný wrote: > > > On 06/14/2018 01:15 PM, Richard W.M. Jones wrote: > > > >libguestfs provides a C library and large set of tools for > >manipulating disk images. http://libguestfs.org/ > > > >As part of this we provide APIs to open VM disks and do things like > >enumerate partitions or resize logical volumes. The actual way this > >works currently is we run the external commands (eg. parted, lvresize) > >inside a small virtual machine and pass the right command line options > >or parse the output. In some cases we're also parsing stuff out of > >kernel /sys/block. > > > >We've accumulated a large amount of code to do this (I counted 60619 > >lines of code in the current version). Here are a few examples so you > >can see in concrete terms what I'm talking about: > > > >https://github.com/libguestfs/libguestfs/blob/afd1c70601c51043684a0245ce2f63d71a9cc07a/daemon/parted.c#L344 > > > >https://github.com/libguestfs/libguestfs/blob/afd1c70601c51043684a0245ce2f63d71a9cc07a/daemon/lvm.c#L271 > > > >Steven W pointed me to "Project Springfield" and it sort of looks like > >it's in the same area. Could libguestfs replace the parsing code > >above with this? > > > >What might be problems: We have no python or dbus in the appliance. > >So anything that depends on those is a non-starter. > > > >TBH the project webpage left me more confused than enlightened. There > >seem to be lots of projects (subprojects?) doing stuff with odd names > >and no unifying philosophy, and I'm not sure if Project Springfield is > >a thing or more of an intention. > > > >Rich. > > > > Hi, project springfield is a collection of existing projects, > libblockdev is probably the "subproject" you are looking for. It is > a plugin based C library -- we have plugins for working with btrfs, > filesystems (ext, xfs, vfat and ntfs), lvm, mdraid, partitions etc. > It mostly also uses the command line tools and in some cases also > other existing libraries (libcryptsetup, libmount, libparted...). > > Libblockdev Github repo: https://github.com/storaged-project/libblockdev > and API documentation: http://storaged.org/libblockdev/ > > From the code you sent it looks like libblockdev covers most of the > functionality libguestfs needs. Some functionality is missing (e.g. > we don't support changing of uuid for lvs) but we can add these > missing bits. > > -- > Vojtech Trefny -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html