summaryrefslogtreecommitdiffstats
path: root/generator
Commit message (Collapse)AuthorAgeFilesLines
* Add support for hotplugging (removing disks).Richard W.M. Jones2012-10-091-0/+39
| | | | | | | | New API: remove-drive. Note because of a bug in fuser, this only works with psmisc >= 22.20. This also updates the hotplugging tests.
* Add support for hotplugging (adding disks) to the libvirt attach-method.Richard W.M. Jones2012-10-081-3/+21
| | | | | | | | | | | | | When libvirt is used, we can allow disks to be hotplugged. guestfs_add_drive can be called after launch to hot-add a disk. When a disk is hot-added, we first ask libvirt to add the disk to the appliance, then we make an internal call into the appliance to get it to wait for the disk to appear (ie. udev_settle ()). Hot-added disks are tracked in the g->drives array. This also adds a test.
* launch: Add add_drive 'label' option.Richard W.M. Jones2012-10-081-1/+27
| | | | | | | | | | | | | | | | | | | | | New API: list-disk-labels Allow the user to pass an optional disk label when adding a drive. This is passed through to qemu / libvirt using the disk serial field, and from there to the appliance which exposes it through udev, creating a special alias of the device /dev/disk/guestfs/<label>. Partitions are named /dev/disk/guestfs/<label><partnum>. virtio-blk and virtio-scsi limit the serial field to 20 bytes. We further limit the name to maximum 20 ASCII characters in [a-zA-Z]. list-devices and list-partitions are not changed: these calls still return raw block device names. However a new call, list-disk-labels, returns a hash table allowing callers to map between disk labels, and block device and partition names. This commit also includes a test.
* docs: add_drive: Clean up documentation of the 'filename' parameter.Richard W.M. Jones2012-10-061-9/+6
| | | | | Also, remove duplicate documentation of using '/dev/null' as the filename.
* docs: Minor cleanup of documentation for add_drive 'name' parameter.Richard W.M. Jones2012-10-031-2/+3
|
* NEW API:ext:mke2fsWanlong Gao2012-09-241-0/+90
| | | | | | | | | | | New api mke2fs for full configuration of filesystem. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> RWMJ: - Update description. - Run and fix the tests. - Remove bogus filename from po/POTFILES.
* generator: xdr: Re-code procedure table.Richard W.M. Jones2012-09-241-7/+13
| | | | This is just code motion.
* generator: Tidy up comments in guestfs_protocol.x.Richard W.M. Jones2012-09-241-9/+19
|
* generator: Allow an optional emacs-mode at the top of generated files.Richard W.M. Jones2012-09-241-2/+7
|
* generator: The default input files are 'generator/ *.ml' [sic].Richard W.M. Jones2012-09-241-1/+1
| | | | | | | | Since generator source files were renamed, the comment at the top of each generated file was wrong. Unfortunately we cannot allow /* to appear within a comment, so the space is necessary.
* Update SuSE Linux detection.Olaf Hering2012-09-211-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update SuSE Linux detection. Up to now everything with a /etc/SuSE-release file was treated as openSuSE. With this change SLES based distributions such as "SUSE Linux Enterprise Server", "SUSE Linux Enterprise Desktop" and "Novell Linux Desktop" will show up as "sles". The 'opensuse' detection was updated to handle older openSuSE releases as well as the well known SuSE Linux releases, starting from 6.0. Everything else with a /etc/SuSE-release file will show up as "suse-based". Here is a collection of release files: ==> Dist/6.0/etc/SuSE-release <== SuSE Linux 6.0 (i386) VERSION = 6.0 ==> Dist/6.1/etc/SuSE-release <== SuSE Linux 6.1 (i386) VERSION = 6.1 ==> Dist/6.2/etc/SuSE-release <== SuSE Linux 6.2 (i386) VERSION = 6.2 ==> Dist/6.3/etc/SuSE-release <== SuSE Linux 6.3 (i386) VERSION = 6.3 ==> Dist/6.4/etc/SuSE-release <== SuSE Linux 6.4 (i386) VERSION = 6.4 ==> Dist/7.0/etc/SuSE-release <== SuSE Linux 7.0 (i386) VERSION = 7.0 ==> Dist/7.1/etc/SuSE-release <== SuSE Linux 7.1 (i386) VERSION = 7.1 ==> Dist/7.2/etc/SuSE-release <== SuSE Linux 7.2 (i386) VERSION = 7.2 ==> Dist/7.3/etc/SuSE-release <== SuSE Linux 7.3 (i386) VERSION = 7.3 ==> Dist/8.0/etc/SuSE-release <== SuSE Linux 8.0 (i386) VERSION = 8.0 ==> Dist/8.1/etc/SuSE-release <== SuSE Linux 8.1 (i386) VERSION = 8.1 ==> Dist/8.2/etc/SuSE-release <== SuSE Linux 8.2 (x86-64) VERSION = 8.2 ==> Dist/9.0/etc/SuSE-release <== SuSE Linux 9.0 (x86-64) VERSION = 9.0 ==> Dist/9.1/etc/SuSE-release <== SuSE Linux 9.1 (x86-64) VERSION = 9.1 ==> Dist/9.2/etc/SuSE-release <== SuSE Linux 9.2 (x86-64) VERSION = 9.2 ==> Dist/9.3/etc/SuSE-release <== SuSE Linux 9.3 (x86-64) VERSION = 9.3 ==> Dist/10.0/etc/SuSE-release <== SUSE LINUX 10.0 (X86-64) OSS VERSION = 10.0 ==> Dist/10.1-remastered/etc/SuSE-release <== SUSE LINUX 10.1 (X86-64) VERSION = 10.1 ==> Dist/10.1/etc/SuSE-release <== SUSE Linux 10.1 (X86-64) Beta8 VERSION = 10.1 ==> Dist/10.2/etc/SuSE-release <== openSUSE 10.2 (X86-64) VERSION = 10.2 ==> Dist/10.3/etc/SuSE-release <== openSUSE 10.3 (X86-64) VERSION = 10.3 ==> Dist/11.0/etc/SuSE-release <== openSUSE 11.0 (X86-64) VERSION = 11.0 ==> Dist/11.1/etc/SuSE-release <== openSUSE 11.1 (x86_64) VERSION = 11.1 ==> Dist/11.2/etc/SuSE-release <== openSUSE 11.2 (x86_64) VERSION = 11.2 ==> Dist/11.3/etc/SuSE-release <== openSUSE 11.3 (x86_64) VERSION = 11.3 ==> Dist/11.4/etc/SuSE-release <== openSUSE 11.4 (x86_64) VERSION = 11.4 CODENAME = Celadon ==> Dist/12.1/etc/SuSE-release <== openSUSE 12.1 (x86_64) VERSION = 12.1 CODENAME = Asparagus ==> Dist/12.2/etc/SuSE-release <== openSUSE 12.2 (x86_64) VERSION = 12.2 CODENAME = Mantis ==> Dist/sles8/etc/SuSE-release <== SuSE SLES-8 (AMD64) VERSION = 8.1 ==> Dist/sles9/etc/SuSE-release <== SUSE LINUX Enterprise Server 9 (x86_64) VERSION = 9 ==> Dist/sles9sp2/etc/SuSE-release <== SUSE LINUX Enterprise Server 9 (x86_64) VERSION = 9 PATCHLEVEL = 2 ==> Dist/sles9sp3/etc/SuSE-release <== SUSE LINUX Enterprise Server 9 (x86_64) VERSION = 9 PATCHLEVEL = 3 ==> Dist/sles9sp4/etc/SuSE-release <== SUSE LINUX Enterprise Server 9 (x86_64) VERSION = 9 PATCHLEVEL = 4 ==> Dist/sled10/etc/SuSE-release <== SUSE Linux Enterprise Desktop 10 (x86_64) VERSION = 10 ==> Dist/sled10sp1/etc/SuSE-release <== SUSE Linux Enterprise Desktop 10 (x86_64) VERSION = 10 PATCHLEVEL = 1 ==> Dist/sled10sp2/etc/SuSE-release <== SUSE Linux Enterprise Desktop 10 (x86_64) VERSION = 10 PATCHLEVEL = 2 ==> Dist/sled10sp3/etc/SuSE-release <== SUSE Linux Enterprise Desktop 10 (x86_64) VERSION = 10 PATCHLEVEL = 3 ==> Dist/sled10sp4/etc/SuSE-release <== SUSE Linux Enterprise Desktop 10 (x86_64) VERSION = 10 PATCHLEVEL = 4 ==> Dist/sled11/etc/SuSE-release <== SUSE Linux Enterprise Desktop 11 (x86_64) VERSION = 11 PATCHLEVEL = 0 ==> Dist/sled11sp1/etc/SuSE-release <== SUSE Linux Enterprise Desktop 11 (x86_64) VERSION = 11 PATCHLEVEL = 1 ==> Dist/sled11sp2/etc/SuSE-release <== SUSE Linux Enterprise Desktop 11 (x86_64) VERSION = 11 PATCHLEVEL = 2 ==> Dist/sles10/etc/SuSE-release <== SUSE Linux Enterprise Server 10 (x86_64) VERSION = 10 ==> Dist/sles10sp1/etc/SuSE-release <== SUSE Linux Enterprise Server 10 (x86_64) VERSION = 10 PATCHLEVEL = 1 ==> Dist/sles10sp2/etc/SuSE-release <== SUSE Linux Enterprise Server 10 (x86_64) VERSION = 10 PATCHLEVEL = 2 ==> Dist/sles10sp3/etc/SuSE-release <== SUSE Linux Enterprise Server 10 (x86_64) VERSION = 10 PATCHLEVEL = 3 ==> Dist/sles10sp4/etc/SuSE-release <== SUSE Linux Enterprise Server 10 (x86_64) VERSION = 10 PATCHLEVEL = 4 ==> Dist/sles11/etc/SuSE-release <== SUSE Linux Enterprise Server 11 (x86_64) VERSION = 11 PATCHLEVEL = 0 ==> Dist/sles11sp1/etc/SuSE-release <== SUSE Linux Enterprise Server 11 (x86_64) VERSION = 11 PATCHLEVEL = 1 ==> Dist/sles11sp2/etc/SuSE-release <== SUSE Linux Enterprise Server 11 (x86_64) VERSION = 11 PATCHLEVEL = 2 Signed-off-by: Olaf Hering <olaf@aepfle.de>
* python: PyInt_* no longer exists in python3, replace with PyLong_*Hilko Bengen2012-09-201-1/+1
|
* New API: rm-f: remove a file, ignoring errors if it doesn't exist.Richard W.M. Jones2012-09-171-0/+27
|
* daemon: stubs: Move all arg decls to top of function.Richard W.M. Jones2012-09-171-2/+2
| | | | | | | | | | | | For some reason, argument declarations were handled inconsistently for strings and non-string arguments. Non-string arguments were all declared at the top of the function stub, where as string arguments were declared in place. Be consistent. This is just code motion.
* syntax: Remove definitions of O_CLOEXEC, except in examples (thanks Jim ↵Richard W.M. Jones2012-09-171-4/+0
| | | | | | | Meyering). The gnulib <fcntl.h> replacement header will now define this symbol if it's not defined already.
* syntax: Remove trailing whitespace.Richard W.M. Jones2012-09-155-9/+10
| | | | Found by 'make syntax-check'.
* generator: Remove inaccurate comment.Richard W.M. Jones2012-09-151-20/+0
| | | | | The correct way to extend functions is documented in generator/README. This comment was no longer accurate.
* syntax: Use STREQ/STRNEQ in place of strcmp.Richard W.M. Jones2012-09-151-1/+3
| | | | Found by 'make syntax-check'.
* perl: Add <stdio.h> and <stdlib.h> for printf and malloc.Richard W.M. Jones2012-09-151-0/+2
|
* perl: Include <inttypes.h> and assume it always defines PRId64 and PRIu64.Richard W.M. Jones2012-09-151-8/+2
| | | | | | If these are not defined in the header files, it's a problem on the platform which we should fix with gnulib. Our replacement definitions might be wrong here.
* fish: Replace '_' with '-' in deprecation cross-refs (thanks Olaf Hering).Richard W.M. Jones2012-09-132-3/+5
|
* generator: Remove generated and unused files from previous runs of the ↵Richard W.M. Jones2012-09-053-1/+44
| | | | | | | | | | | | generator. If you go back in time in git (eg. git reset, git bisect) then you can end up in a situation where a file that was generated by a later version is left around unused in the earlier version. This isn't a problem for most things, but gobject documentation generation picks up any file in a directory, even unreferenced ones, and breaks. So the correct thing to do is to remove these files.
* generator: gobject: Use a more normal way to output files.Richard W.M. Jones2012-09-052-100/+111
| | | | | The generator output is identical, verified by comparing the output files before and after the change.
* lib: Add tests to the disk-{format,virtual-size,has-backing-file} APIs.Richard W.M. Jones2012-09-041-0/+24
|
* New APIs: disk-virtual-size and disk-has-backing-file.Richard W.M. Jones2012-09-041-0/+22
|
* guestfs(3): Document disk image formats and how to detect them.Richard W.M. Jones2012-09-031-1/+3
|
* New API: guestfs_disk_formatRichard W.M. Jones2012-09-031-0/+12
| | | | Detect the disk image format of a file, in a secure way.
* generator: Test zero args, one optarg; and 63 optargs.Richard W.M. Jones2012-09-032-68/+104
| | | | This just generates the code; it's not called.
* java: Fix >= 32 optargs (thanks Wanlong Gao).Richard W.M. Jones2012-09-031-1/+1
|
* generator: Rename 'generator_*' as '*'.Richard W.M. Jones2012-09-0237-240/+238
| | | | | | | | | This is a simple renaming of the files/modules. Note that in OCaml, module names are derived from filenames by capitalizing the first letter. Thus the old module names had the form "Generator_api_versions". The new modules names have the form "Api_versions".
* tests: Make mkswap and tar tests conditional on linuxfsuuid and xz features.Richard W.M. Jones2012-08-311-3/+3
|
* NEW API:xfs:xfs_repairWanlong Gao2012-08-301-0/+28
| | | | | | | | | | Add a new api xfs_repair for repairing an XFS filesystem. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> RWMJ: - Fix non-error return path so it doesn't send two replies. - Document return code.
* python: Convert OInt64 using PyLong_AsLongLong so 64 bit ints work correctly.Richard W.M. Jones2012-08-291-1/+1
| | | | | | This avoids the following error on 32 bit machines: OverflowError: Python int too large to convert to C long
* New API: guestfs_hivex_value_utf8Richard W.M. Jones2012-08-291-1/+19
| | | | | A convenience function that reads a value from the registry and returns it as UTF-8.
* New APIs: hivex_*Richard W.M. Jones2012-08-292-0/+201
| | | | | | | | | | | Transscribe many hivex(3) APIs into the libguestfs API. There is one hive handle per libguestfs handle, as with Augeas. Note that hivex uses iconv_open for some APIs (eg. hivex_value_string). But since we delete all the i18n files from the appliance, this doesn't work -- iconv_open returns EINVAL. Therefore hivex APIs which require iconv cannot be bound in the daemon.
* perl: bindtests: Fix 64 bit integers on input on 32 bit Perl interpreter.Richard W.M. Jones2012-08-292-4/+27
|
* Mac OS X: Fixed combination of running autogen.sh on Linux and building on ↵Masami HIRATA2012-08-281-0/+1
| | | | | | Mac OS X Signed-off-by: Masami HIRATA <msmhrt@gmail.com>
* Modified API: mkswap now takes optional arguments.Richard W.M. Jones2012-08-281-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add optional label and uuid arguments, and deprecate mkswap-L and mkswap-U. This also adds a call to udev_settle after creating the swap device. This is an attempt to workaround the following problem seen in Koji and Rawhide: libguestfs: trace: mkswap_L "swapit" "/dev/sda1" libguestfs: send_to_daemon: 72 bytes: 00 00 00 44 | 20 00 f5 f5 | 00 00 00 04 | 00 00 00 83 | 00 00 00 00 | ... guestfsd: main_loop: proc 210 (part_disk) took 2.28 seconds guestfsd: main_loop: new request, len 0x44 mkswap -f -L swapit /dev/sda1 libguestfs: recv_from_daemon: 40 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 83 | 00 00 00 01 | 00 12 37 cf | ... libguestfs: trace: mkswap_L = 0 libguestfs: trace: swapon_label "swapit" libguestfs: send_to_daemon: 56 bytes: 00 00 00 34 | 20 00 f5 f5 | 00 00 00 04 | 00 00 00 ae | 00 00 00 00 | ... guestfsd: main_loop: proc 131 (mkswap_L) took 0.77 seconds guestfsd: main_loop: new request, len 0x34 swapon -L swapit swapon: cannot find the device for swapit guestfsd: error: swapit: swapon: cannot find the device for swapit libguestfs: recv_from_daemon: 100 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 ae | 00 00 00 01 | 00 12 37 d0 | ... libguestfs: trace: swapon_label = -1 (error) swapon_label: swapit: swapon: cannot find the device for swapit test_swapon_label_0 FAILED
* python: Fixed syntax errors in python/guestfs-py.cMasami HIRATA2012-08-251-1/+1
| | | | Signed-off-by: Masami HIRATA <msmhrt@gmail.com>
* docs: Document null disks.Richard W.M. Jones2012-08-211-0/+3
| | | | | It's always been possible to use /dev/null as a disk image. Document this formally in the API.
* xfs_growfs: drop the unstructed outputWanlong Gao2012-08-211-1/+1
| | | | | | | Just drop the unstructed output since we can get the structed info from xfs_info instead. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* New API: xfs: xfs_adminWanlong Gao2012-08-211-0/+27
| | | | | | | | | | | Add new api xfs_admin to change parameters of an XFS filesystem. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> RWMJ: - Remove printuuid, printlabel, since they don't change any settings. - Adjusted the documentation. - Fix the tests.
* Replace mount-options with mount where appropriate.Richard W.M. Jones2012-08-183-21/+21
| | | | | | Since our minimum supported version is now 1.16 and mount was fixed in 1.13.16, it is now safe to replace mount-options + empty options with mount wherever it occurs.
* docs: Rewrite section on protocol limits again.Richard W.M. Jones2012-08-171-17/+2
| | | | This updates commit 92e241440d361e9491a9d96d23ad7a378cb2ab6a.
* New API: fill-dir: Fill a directory with files (for testing).Richard W.M. Jones2012-08-171-0/+11
|
* guestfs_readdir: Note that this suffers from protocol limits.Richard W.M. Jones2012-08-171-0/+1
|
* guestfs_ls: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-171-21/+17
|
* New API: ls0 - List files, separated by \0 characters.Richard W.M. Jones2012-08-171-0/+14
| | | | | This API is not especially useful on its own. It will be used to reimplement guestfs_ls to work without protocol limits.
* guestfs_readlinklist: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-171-1/+25
|
* guestfs_lstatlist, guestfs_lxattrlist: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-171-2/+48
| | | | | Note that the code to do this was already in virt-ls, so this is change is mostly just moving the code into the core library.