[Libguestfs] simplify debugging of guestfsd
Richard W.M. Jones
rjones at redhat.com
Mon Oct 15 14:54:22 UTC 2012
On Sun, Oct 14, 2012 at 07:02:29PM +0100, Richard W.M. Jones wrote:
> Introduce a new guestfs_create_flags () call which takes a flag
> variable. By default, passing flag == 0 is entirely the same as
> guestfs_create.
>
> g = guestfs_create_flags (0);
> if (!g) error;
>
> However you could also use it like this:
>
> g = guestfs_create_flags (GUESTFS_CREATE_NO_ENVIRONMENT);
> if (!g) error;
>
> where no environment variable processing is done (hence no errors are
> possible except ENOMEM). Callers can do environment variable
> processing later (see guestfs_set_environment above). Or maybe not if
> they don't want to be affected by the environment. Errors can be
> handled properly in those later calls.
>
> In the language backends, we'd have to map this to more flexible
> functions, eg. in Perl:
>
> my $g = Sys::Guestfs->new (environment => 0);
>
> (which is of course backwards compatible with existing code).
That took much longer than I thought it would ...
https://github.com/libguestfs/libguestfs/commit/9466060201600db47016133d80af22eb38091a49
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top
More information about the Libguestfs
mailing list