X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=perl%2Flib%2FSys%2FGuestfs.pm;h=7331053e23eee39b9f8e29d925b86fac21bc8df5;hp=1798e7b86446b575c2421a818567f97309382ef1;hb=f47dafd23186938a22d41739d9bc695c7760b912;hpb=94050e0344685b6916e21581e618ad3e85795008 diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm index 1798e7b..7331053 100644 --- a/perl/lib/Sys/Guestfs.pm +++ b/perl/lib/Sys/Guestfs.pm @@ -91,13 +91,13 @@ sub new { return $self; } -=item $h->add_cdrom (filename); +=item $h->add_cdrom ($filename); This function adds a virtual CD-ROM disk image to the guest. This is equivalent to the qemu parameter C<-cdrom filename>. -=item $h->add_drive (filename); +=item $h->add_drive ($filename); This function adds a virtual machine disk image C to the guest. The first time you call this function, the disk appears as IDE @@ -112,20 +112,316 @@ image). This is equivalent to the qemu parameter C<-drive file=filename>. -=item $content = $h->cat (path); +=item $h->aug_close (); + +Close the current Augeas handle and free up any resources +used by it. After calling this, you have to call +C<$h-Eaug_init> again before you can use any other +Augeas functions. + +=item ($nrnodes, $created) = $h->aug_defnode ($name, $expr, $val); + +Defines a variable C whose value is the result of +evaluating C. + +If C evaluates to an empty nodeset, a node is created, +equivalent to calling C<$h-Eaug_set> C, C. +C will be the nodeset containing that single node. + +On success this returns a pair containing the +number of nodes in the nodeset, and a boolean flag +if a node was created. + +=item $nrnodes = $h->aug_defvar ($name, $expr); + +Defines an Augeas variable C whose value is the result +of evaluating C. If C is NULL, then C is +undefined. + +On success this returns the number of nodes in C, or +C<0> if C evaluates to something which is not a nodeset. + +=item $val = $h->aug_get ($path); + +Look up the value associated with C. If C +matches exactly one node, the C is returned. + +=item $h->aug_init ($root, $flags); + +Create a new Augeas handle for editing configuration files. +If there was any previous Augeas handle associated with this +guestfs session, then it is closed. + +You must call this before using any other C<$h-Eaug_*> +commands. + +C is the filesystem root. C must not be NULL, +use C instead. + +The flags are the same as the flags defined in +Eaugeas.hE, the logical I of the following +integers: + +=over 4 + +=item C = 1 + +Keep the original file with a C<.augsave> extension. + +=item C = 2 + +Save changes into a file with extension C<.augnew>, and +do not overwrite original. Overrides C. + +=item C = 4 + +Typecheck lenses (can be expensive). + +=item C = 8 + +Do not use standard load path for modules. + +=item C = 16 + +Make save a no-op, just record what would have been changed. + +=item C = 32 + +Do not load the tree in C<$h-Eaug_init>. + +=back + +To close the handle, you can call C<$h-Eaug_close>. + +To find out more about Augeas, see L. + +=item $h->aug_insert ($path, $label, $before); + +Create a new sibling C