[Libguestfs] golang binding help

Richard W.M. Jones rjones at redhat.com
Fri Jul 11 20:33:45 UTC 2014


On Fri, Jul 11, 2014 at 06:18:12PM +0400, Vasiliy Tolstov wrote:
> Hello. I'm very happy with libguestfs, but now i'm try to write packer
> plugin to strip images:

Packer is: http://www.packer.io/intro ?

> 1) resize filesystem to minimum
> 2) resize partitions to minimum
> 3) create/resize file with needed size
> 
> But golang binding have not docs. Is that possible to generate
> something suitable to godoc.org to determine api methods and
> input,output variables for functions?

So a few different things here:

(a) Yes, we should add golang docs.  However I don't know how to do
that.  If you can point me to some documentation about writing
documentation for golang modules then I'll be glad to add it.

(b) In the meantime you can read the C API documentation (in English,
not Russian -- sorry!)

http://libguestfs.org/guestfs.3.html

and the golang examples:

http://libguestfs.org/guestfs-golang.3.html

and the golang tests:

https://github.com/libguestfs/libguestfs/tree/master/golang/src/libguestfs.org/guestfs

(c) In the API you can resize filesystems using calls like
guestfs_resize2fs / g.Resize2fs and others.  However note that there
is no single API for doing a virt-resize -like operation.  You have to
actually call virt-resize if you want to resize a whole OS disk.

Hope that helps, let me know if you have more questions.

Rich.

-- 
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




More information about the Libguestfs mailing list