guestfs-gobject - Man Page
How to use libguestfs with the GObject bindings
Synopsis
From Javascript using gjs:
const Guestfs = imports.gi.Guestfs; var g = new Guestfs.Session(); g.add_drive('disk.img', null); g.launch(); g.close();
Description
This manual page documents how to call libguestfs using GObject bindings, especially from Javascript.
Note that the GObject bindings have problems handling 64 bit values. You should not use the GObject bindings if there are native bindings for your language. For example, to use libguestfs from Python you are strongly advised to use the Python native bindings instead (see guestfs-python(3)).
This page just documents the differences from the C API and gives some examples. If you are not familiar with using libguestfs, you also need to read guestfs(3).
Javascript
Using gjs, you can write a .js
file containing:
const Guestfs = imports.gi.Guestfs; var g = new Guestfs.Session(); g.add_drive('disk.img', null); g.launch(); g.close();
and then run it using:
gjs program.js
See Also
guestfs(3), guestfs-examples(3), guestfs-erlang(3), guestfs-golang(3), guestfs-java(3), guestfs-lua(3), guestfs-perl(3), guestfs-python(3), guestfs-recipes(1), guestfs-ruby(3), http://libguestfs.org/.
Authors
Richard W.M. Jones (rjones at redhat dot com
)
Copyright
Copyright (C) 2012-2023 Red Hat Inc.
License
This manual page contains examples which we hope you will use in your programs. The examples may be freely copied, modified and distributed for any purpose without any restrictions.
Bugs
To get a list of bugs against libguestfs, use this link: https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
To report a new bug against libguestfs, use this link: https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
When reporting a bug, please supply:
- The version of libguestfs.
- Where you got libguestfs (eg. which Linux distro, compiled from source, etc)
- Describe the bug accurately and give a way to reproduce it.
- Run libguestfs-test-tool(1) and paste the complete, unedited output into the bug report.
Referenced By
guestfs(3), guestfs-lua(3), guestfs-ocaml(3), guestfs-perl(3), guestfs-python(3), guestfs-recipes(1), guestfs-ruby(3).