[Libguestfs] GObject bindings

Matthew Booth mbooth at redhat.com
Tue Jan 17 15:48:41 UTC 2012


This is the first iteration of the GObject bindings. I have 'kicked the tyres'
on these, meaning I have ensured that a bunch of basic manual tests work as
expected. I'm in the process of adding more comprehensive tests.

Here's an example simple javascript program which uses these bindings:

===
const Guestfs = imports.gi.Guestfs;

print('Starting');
var g = new Guestfs.Session();

var o = new Guestfs.AddDriveOpts({format: 'raw', iface: 'virtio'});
g.add_drive_opts('tests/guests/fedora.img', null);
g.launch();

r = g.inspect_os();
m = g.inspect_get_mountpoints(r[0]);
print(m['/boot']);

print('Finished');
===

Run this file as ./run gjs gobject-test.js




More information about the Libguestfs mailing list