X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=perl%2Flib%2FSys%2FGuestfs.pm;h=083a0172cc341b1ef0484340208e4b50008a8d44;hp=9fefb9a59ab4df1321f65212ced92139a37cc8c8;hb=0884d8bbae6d76a603ec1385ada2938f88981c5c;hpb=233595cc4e3c3422a5f5d8aec3314029da3f0ec7 diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm index 9fefb9a..083a017 100644 --- a/perl/lib/Sys/Guestfs.pm +++ b/perl/lib/Sys/Guestfs.pm @@ -91,13 +91,18 @@ 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); +Note that this call checks for the existence of C. This +stops you from specifying other types of drive which are supported +by qemu such as C and C URLs. To specify those, use +the general C<$h-Econfig> call instead. + +=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 @@ -110,7 +115,31 @@ for whatever operations you want to perform (ie. read access if you just want to read the image or write access if you want to modify the image). -This is equivalent to the qemu parameter C<-drive file=filename>. +This is equivalent to the qemu parameter C<-drive file=filename,cache=off>. + +Note that this call checks for the existence of C. This +stops you from specifying other types of drive which are supported +by qemu such as C and C URLs. To specify those, use +the general C<$h-Econfig> call instead. + +=item $h->add_drive_ro ($filename); + +This adds a drive in snapshot mode, making it effectively +read-only. + +Note that writes to the device are allowed, and will be seen for +the duration of the guestfs handle, but they are written +to a temporary file which is discarded as soon as the guestfs +handle is closed. We don't currently have any method to enable +changes to be committed, although qemu can support this. + +This is equivalent to the qemu parameter +C<-drive file=filename,snapshot=on>. + +Note that this call checks for the existence of C. This +stops you from specifying other types of drive which are supported +by qemu such as C and C URLs. To specify those, use +the general C<$h-Econfig> call instead. =item $h->aug_close (); @@ -119,7 +148,7 @@ 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); +=item ($nrnodes, $created) = $h->aug_defnode ($name, $expr, $val); Defines a variable C whose value is the result of evaluating C. @@ -132,7 +161,7 @@ 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); +=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 @@ -141,12 +170,12 @@ 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); +=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); +=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 @@ -195,7 +224,7 @@ 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); +=item $h->aug_insert ($path, $label, $before); Create a new sibling C