[Libguestfs] question about guestfs_add_drive_opts_blocksize

Richard W.M. Jones rjones at redhat.com
Fri Mar 26 16:19:25 UTC 2021


On Fri, Mar 26, 2021 at 09:57:47AM -0600, Stefan Fiala wrote:
> I want to do some work with 4K blocksize devices (real and virtual). I found
> examples/create_disk.c
> then found it didn't contain the blocksize option. I have Ubuntu 20.04
> guestfish version 1.40.2. I investigated and found a recent checkin 1.45.2 that
> adds this option.

Do you mean this one?

  commit 94843f155aa72d75d693a96f7b11ceb7558837f0
  Author: Nikolay Ivanets
  Date:   Tue Feb 11 16:12:24 2020 +0200

    lib: add support for disks with 4096 bytes sector size

> I then rebuilt libguestfs from scratch using tag V1.45.2.
> I noted the warning not to "make install" it and stopped.
>  
> I don't see how to build create_disk.c against a libguesfs.a version 1.45.2.
> The faq/etc talk about running a self-compiled program using ./run but not how
> to make such a program with a different version.

You can just do something like:

  gcc create_disk.c -L lib/.libs -lguestfs -o create_disk
  ./run ./create_disk

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top




More information about the Libguestfs mailing list