summaryrefslogtreecommitdiffstats
path: root/perl
Commit message (Collapse)AuthorAgeFilesLines
* out-of-tree build: fix documentation generationHilko Bengen2011-08-151-3/+3
|
* Fix 'unknown filesystem' warnings in old inspection code (RHBZ#678231 ↵Richard W.M. Jones2011-08-111-14/+20
| | | | | | | | | | RHBZ#666578). This is a comprehensive fix for the warnings from the old (and obsolete) Perl inspection code. For a full description and reproducer, see: https://bugzilla.redhat.com/show_bug.cgi?id=678231#c5
* build: Set TMPDIR for local testing.Richard W.M. Jones2011-08-081-1/+2
| | | | | | This avoids conflicts with the globally installed libguestfs appliance, or lets us build in multiple local directories at the same time without conflicts.
* perl: Fix another place where qw() was used as parentheses.Richard W.M. Jones2011-07-271-4/+4
| | | | | | This is a fix for Perl 5.14. See previous commit 5c3c7e8825341e18c9449976f8a321a04cc78d79.
* perl: Fix CCFLAGS for Perl 5.14.Richard W.M. Jones2011-07-221-2/+3
| | | | | | | | | | | | | | | | | | A change to ExtUtils::CBuilder in Perl 5.14 causes CCFLAGS to completely replace, rather than appending, the C flags. The unfortunate consequence of this is that vital flags such as -D_FILE_OFFSET_BITS=64 are missing. For 32 bit code, this means you get binary-incompatible code that completely fails to load. For further analysis see: http://www.nntp.perl.org/group/perl.perl5.porters/2011/04/msg171535.html This commit changes CCFLAGS so that it appends to the existing $Config{ccflags} instead of replacing it. On earlier versions of Perl this means we get two copies of the flags, which is unfortunate but should be safe.
* java: Add guestfs-java(3) man page.Richard W.M. Jones2011-07-191-0/+1
|
* Revert "Lib.pm: unknown filesystem label SWAP-sda2 (RHBZ#666578)"Richard W.M. Jones2011-06-281-1/+1
| | | | This reverts commit 5cab0d6c807d8a3bf9690375c663d11a10e21656.
* perl: Don't use qw() as parentheses.Richard W.M. Jones2011-06-181-1/+1
| | | | | | In Perl 5.14: Use of qw(...) as parentheses is deprecated at perl/blib/lib/Sys/Guestfs/Lib.pm line 1111.
* Add new guestfs-rescue(1) man page with recipes.Richard W.M. Jones2011-05-181-0/+1
|
* perl: Canonicalize /dev/vd* paths in old inspection code (RHBZ#691724).Richard W.M. Jones2011-03-291-0/+3
|
* perl: Binding and test for guestfs_last_errno (RHBZ#672491).Richard W.M. Jones2011-03-151-0/+76
|
* New event API - Perl bindings (RHBZ#664558).Richard W.M. Jones2011-03-151-0/+72
| | | | | | | | The methods $h->set_progress_callback and $h->clear_progress_callback have been removed, and replaced with a complete mechanism for setting and deleting general-purpose events. This also updates virt-resize to use the new API.
* Detect Red Hat Desktop as 'rhel' distro (RHBZ#682979).Richard W.M. Jones2011-03-081-2/+2
| | | | | | | | | | | | | /etc/redhat-release on Red Hat Desktop contains the following string: Red Hat Desktop release 4 (Nahant Update 8) Previously we matched against the string "Red Hat Enterprise Linux" but since this does not contain that string, this distro wasn't being detected correctly. Note this also changes the obsolete Perl code, for the benefit of virt-v2v.
* guestfs-perl: Fix missing \nRichard W.M. Jones2011-01-311-1/+1
| | | | This updates commit 477eebc83dcd33d00d34398692692dae6af04f22.
* perl: Translate C examples into Perl and include a manual page.Richard W.M. Jones2011-01-305-28/+242
|
* perl: Ignore internal_* functions in POD coverage test.Richard W.M. Jones2011-01-291-1/+2
| | | | This updates commit 1d999540bddd7aea7c2d0fef8b15223d4acc645f.
* Lib.pm: unknown filesystem /dev/hd{x} (cdrom) (RHBZ#666577)Douglas Schilling Landgraf2011-01-021-1/+3
| | | | | | | | | | | | | This a purpose patch to avoid the message "unknown filesystem /dev/hdc". Where /dev/hdc is an entry in fstab for CDROM. Example of fstab: /dev/hdc /media/cdrom auto pamconsole,exec,noauto,managed 0 0 https://bugzilla.redhat.com/show_bug.cgi?id=666577 Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
* Lib.pm: unknown filesystem label SWAP-sda2 (RHBZ#666578)Douglas Schilling Landgraf2011-01-021-1/+1
| | | | | | | | | | | | | | Hi, This is a purpose patch to avoid the message: unknown filesystem label SWAP-sda2. Instead of validate the label with 'eq', use '=~' and /$label/i. https://bugzilla.redhat.com/show_bug.cgi?id=666578 Thanks Douglas
* Lib.pm: avoid message "unknown filesystem /dev/fd0" (RHBZ#666577)Douglas Schilling Landgraf2011-01-021-0/+1
| | | | | | | | | | This patch to avoid the message "unknown filesystem /dev/fd0". https://bugzilla.redhat.com/show_bug.cgi?id=666577 Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Thanks Douglas
* perl: Ignore debug functions in Test::Pod::Coverage.Richard W.M. Jones2010-11-111-1/+4
|
* Sys::Guestfs::Lib: deprecate get_partitions (RHBZ#642933).Richard W.M. Jones2010-10-281-10/+3
| | | | | However the code is left since this function is used by virt-v2v amongst others.
* Sys::Guestfs::Lib: deprecate inspection functions (RHBZ#642930).Richard W.M. Jones2010-10-281-390/+29
| | | | | | | | Deprecate the guest inspection functions in this module, remove documentation, and point users at the core API functions instead. However we will keep the code here since it is used by virt-v2v and virt-inspector.
* tools: Specify format of disks (RHBZ#642934,CVE-2010-3851).Richard W.M. Jones2010-10-221-24/+37
| | | | | | | | | | Sys::Guestfs::Lib is changed in two ways: firstly we take the format string from libvirt and pass it to add_drive_opts. Secondly we allow an extra format => parameter to open_guest which allows the format to be specified for disk images. All the tools are changed to add an extra --format parameter allowing the format to be specified for direct disk images.
* generator: Optional arguments, add-drive-opts (RHBZ#642934,CVE-2010-3851).Richard W.M. Jones2010-10-222-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This large commit changes the generator so that optional arguments can be supported for functions. The model for arguments (known as the "style") is changed from (ret, args) to (ret, args, optargs) where optargs is a more limited list of arguments. One function has been added which takes optional arguments, it is "add-drive-opts", modelled as: (RErr, [String "filename"], #required [Bool "readonly"; String "format"; String "iface"]) #optional Note that this function is processed in the library (does not go over the RPC protocol to the daemon). This has allowed us to simplify the current implementation by omitting changes related to RPC or the daemon, although we plan to add these at some point in the future. From C this function can be called in 3 different ways as in these examples: guestfs_add_drive_opts (g, filename, GUESTFS_ADD_DRIVE_OPTS_READONLY, 1, GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", -1); (the argument(s) between 'filename' and '-1' are the optional ones). guestfs_add_drive_opts_va (g, filename, args); where 'args' is a va_list. This works like the first version. struct guestfs_add_drive_opts_argv optargs = { .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK, .readonly = 1, } guestfs_add_drive_opts_argv (g, filename, &optargs); This last form lets you construct lists of optional arguments, and is used by guestfish and the language bindings. In guestfish optional arguments are used like this: add-drive-opts filename readonly:true In OCaml these are mapped naturally to OCaml optional arguments, eg: g#add_drive_opts ~readonly:true filename; In Perl these are mapped to extra arguments, eg: $g->add_drive_opts ($filename, readonly => 1); In Python these are mapped to optional arguments, eg: g.add_drive_opts ("file", readonly = 1, format = "qcow2") In Ruby these are mapped to a final hash argument, eg: g.add_drive_opts("file", {}) g.add_drive_opts("file", :readonly => 1) g.add_drive_opts("file", :readonly => 1, :iface => "virtio") In PHP these are mapped to extra parameters. This is not quite accurate since you cannot omit arbitrary optional parameters, but there's not much than can be done within the limitations of PHP as a language. Unimplemented in: Haskell, C#, Java.
* Split generator into separate source files.Richard Jones2010-09-111-1/+1
| | | | | | | | | | 'src/generator.ml' is no more. Instead the generator is logically split up over many different source files. Read generator/README for help and tips. We compile the generator down to bytecode, not native code. This means it will run more slowly, but is done for maximum portability.
* New API: file-architectureRichard Jones2010-08-172-214/+3
| | | | | | This change simply converts the existing Perl-only function file_architecture into a core API call. The core API call is written in C and available in all languages and from guestfish.
* perl: Check all images are defined in first param of open_guest.Richard Jones2010-06-111-0/+7
|
* perl: Add explicit close() method (RHBZ#602592).Richard Jones2010-06-102-6/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | This add an optional explicit $g->close method which may be used to force the handle to be closed immediately. Note the provisos about this method in the manual page entry. Callers should *not* normally use this method. The implementation of the handle also changes. Before, the handle was a blessed reference to an integer (the integer being the pointer to the C guestfs_h handle). Now we change this to a hashref containing currently the following field: _g => pointer to C guestfs_h handle (as an integer) If this field is not present, it means that the handle has been explicitly closed. This avoids double-freeing the handle. The user may add their own fields to this hash in order to store per-handle data. However any fields whose names begin with an underscore are reserved for use by the Perl bindings. This commit also adds a regression test. This commit also changes the existing warning when you call a method without a Sys::Guestfs handle as the first parameter, into an error. This is because such cases are always errors.
* Revert "perl: Rerun configure if MAX_PROC_NR changes."Richard Jones2010-06-081-2/+1
| | | | This reverts commit f8ee7869f4836427109959cf20e299a31fa86eaf.
* Rely on new augeas lens for modules.conf and conf.modulesMatthew Booth2010-05-271-7/+0
| | | | | | | | | | | | | | | Latest augeas includes a lens for /etc/modules.conf. If this new lens is present, the code to force the Modprobe lens to try to match /etc/modules.conf as well results in /etc/modules.conf not being parsed at all. This results in modprobe_aliases in virt-inspector output being empty. This change is equivalent to change cfd28d1140393667913689b7b9bcf21c8bfe592c from virt-v2v. An effect of this change is that the Modules_conf augeas lens is now required for correct operation on guests which use /etc/modules.conf. Fixes RHBZ#596776
* perl: Rerun configure if MAX_PROC_NR changes.Richard Jones2010-05-251-1/+2
| | | | | | If MAX_PROC_NR changes (because a new API has been added to the generator) then we need to rerun configure in order to set the Makefile's ${MAX_PROC_NR} variable, in order to rebuild Makefile.PL.
* Improved error if virt-inspector cannot find OSes in image (RHBZ#591142).Richard Jones2010-05-131-2/+8
|
* Add version numbers to Perl modules (RHBZ#521674).Richard Jones2010-05-122-3/+10
| | | | | | | | | | Sys::Guestfs now contains a version number which reflects the ABI that we are compiled against, ie. '0.<MAX_PROC_NR>'. This has the beneficial side effect of causing an error if the user tries to mix versions of the Perl module and the XS code. Sys::Guestfs::Lib now contains a synthetic version number which will reflect future changes in that module.
* inspector: Support filesystem-on-image VMs (RHBZ#590167).Richard Jones2010-05-071-4/+15
| | | | | | $ virt-df /tmp/dbroot.img Filesystem 1K-blocks Used Available Use% /tmp/dbroot.img:/dev/vda 3096336 593628 2345424 20%
* Warn instead of dying if grub refers to non-existent kernelMatthew Booth2010-05-071-2/+8
|
* Don't die during inspection if rpm -qa or dpkg-query failsMatthew Booth2010-04-211-8/+20
| | | | | If a problem in the package database prevented package enumeration from working, inspection would die. This change makes it emit a warning and continue.
* Don't die during inspection if initrd doesn't existMatthew Booth2010-04-211-1/+1
| | | | | This fixes a problem where inspection would die if grub.conf referenced a non-existent initrd. Just return an empty initrd instead.
* Remove warning "No grub default" (RHBZ#580650).Richard Jones2010-04-081-3/+0
|
* Improved version of virt-win-reg, supporting exporting and merging.Richard Jones2010-03-301-2/+4
|
* inspector: Read information about Windows guests from the Registry.Richard Jones2010-03-081-86/+102
| | | | | | | | | | | | | | This commit changes substantially the way that we get information about Windows guests. We now use the Windows Registry to get information such as the version, product name and much else. This uses Win::Hivex (ie. the hivex library). 'reged' is no longer needed or used. As an incidental change, this also tries harder to search for %systemroot%, in the case when we cannot find boot.ini (ie. Windows Vista and more recent). This ensures we can get more detail from those versions of Windows.
* inspector: Add product_name field to output.Richard Jones2010-03-081-0/+10
| | | | | | This is a free text string containing the "product name" of the OS. It's mainly useful for Windows guests, and a forthcoming patch will get this field from the Windows Registry.
* inspector: Sort application names.Richard Jones2010-03-081-0/+2
| | | | This ensures the list of applications is stable.
* List application in Debian based vm imagesGuido Günther2010-02-241-0/+17
| | | | | | | | | | | | | Hi, attached patch adds the code to list applications installed in Debian based vm images. Cheers, -- Guido >From 9427a14725b33415058a0713923c62bd231504ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org> Date: Tue, 23 Feb 2010 21:05:02 +0100 Subject: [PATCH 2/2] Add application listing for Debian
* Debian package formatGuido Günther2010-02-241-2/+2
| | | | | | | | | | | | Hi, Minor nitpick: the Debian folks usually refer to deb as the package format not dpkg. Cheers, -- Guido >From 7a9665d40e0a3109833de10f17831ae06fc8885a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org> Date: Tue, 23 Feb 2010 21:04:37 +0100 Subject: [PATCH 1/2] Debina package format is called 'deb' not 'dpkg'
* check for grub/menu.lst tooGuido Günther2010-02-241-2/+8
| | | | | | | | | | | | | | | | | On Tue, Feb 23, 2010 at 08:07:14PM +0100, Guido Günther wrote: > On Tue, Feb 23, 2010 at 07:52:43PM +0100, Guido Günther wrote: > > Hi, > > attached patch makes virt-inspector find the kernels on Debian systems. > > Since there is no /etc/grub.conf it falls back to > > $grubpartition/grub/menu.lst. > Patch got somehow broken. New version fortchcoming. Sorry for the noise. Attached now. No idea where the 'if' went in the first version ;) -- Guido >From d30b4946f017ff8bde9d4ff62f93c418a707d9e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org> Date: Tue, 23 Feb 2010 19:50:40 +0100 Subject: [PATCH] Check for grub/menu.lst if /etc/grub.conf can't be found
* Sys::Guestfs::Lib::open_guest: Add interface parameter.Richard Jones2010-02-121-2/+15
| | | | This allows you to override the default QEMU block device emulation.
* Sys::Guestfs::Lib::open_guest: Remove freeform parameters.Richard Jones2010-02-121-6/+9
| | | | | | | | | Remove the ability to pass freeform parameters to Sys::Virt->new. We don't use it, it makes the code more complex to modify, and indeed there are no other args that Sys::Virt->new supports so this would never be used. Also change $readwrite to $rw to match parameter name.
* Use mount-options instead of mount to avoid implicit -o sync.Richard Jones2010-02-102-2/+2
| | | | | | | | | | | | | | | guestfs_mount adds -o sync implicitly. This causes a very large performance problem for write-intensive programs (eg. virt-v2v). Document this as a "gotcha". Change the tests, guestfish, Sys::Guestfs::Lib, guestmount to use mount-options instead. (Note that this gotcha does not affect mount-ro). The source of the performance problem was first identified by Matthew Booth.
* inspector: Make RPM application data more specific (RHBZ#552718).Richard Jones2010-01-051-1/+1
| | | | | | | List applications with epoch, release and arch data. If epoch is 0, don't store this as an empty string, but as undefined, and don't output empty <epoch/> element in the XML.
* build: Add missing dependencies in perl directoryMatthew Booth2009-11-211-1/+12
| | | | | | | | make all in the perl directory was missing a check that the library had been built. make check in the perl directory was missing a check that the appliance and test images had been built.