From: Richard W.M. Jones <rjones@redhat.com>
To: THO HUYNH <feeliwood@yahoo.com>
Cc: libguestfs@redhat.com
Sent: Friday, 9 March 2012, 16:52
Subject: Re: mounting using guestfish
On Fri, Mar 09, 2012 at 01:11:23AM -0800, THO HUYNH wrote:
> Do you have any documentation about the
implementation of mounting
> using guestfish. I want to know how it works inside then write the
> script.
Libguestfs live access works slightly differently from ordinary use of
libguestfs, and all the examples only explain the ordinary way.
The main documentation is here:
http://libguestfs.org/guestfs.3.html#api_overviewOnce you've decided what language you want to use, you'll need to
follow one of these pages:
http://libguestfs.org/guestfs-perl.3.htmlhttp://libguestfs.org/guestfs-python.3.htmlhttp://libguestfs.org/guestfs-ocaml.3.htmlhttp://libguestfs.org/guestfs-ruby.3.htmlhttp://libguestfs.org/guestfs-java.3.htmlBecause it's live, you need to add the domain using the 'live' option,
see:
http://libguestfs.org/guestfs.3.html#guestfs_add_domainTo download and upload between handles, you'll need to use two
threads, a pipe between them, and the regular download/upload APIs:
http://libguestfs.org/guestfs.3.html#guestfs_downloadhttp://libguestfs.org/guestfs.3.html#guestfs_uploadhttp://libguestfs.org/guestfs.3.html#guestfs_tar_outhttp://libguestfs.org/guestfs.3.html#guestfs_tar_in(etc)
I suggest writing some code and reading the many programs in the
source of libguestfs, and if you get stuck, posting specific questions
on the mailing list.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjonesNew in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw