summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* avoid build failure due to Haskell keyword clashJim Meyering2009-08-191-3/+32
| | | | | | | | * src/generator.ml: Fix this particular problem by renaming the "module" parameter to "modulename". Avoid the general problem by ensuring that no parameter name is in the set of nearly all Haskell, OCaml and C reserved words. (zfile): Adjust one more offender: s/method/meth/.
* guestfs_launch: Correct checks for dup failure.Richard Jones2009-08-191-7/+7
|
* build: Comment out some unused macros.Richard Jones2009-08-192-6/+6
| | | | | GCC 4.4.1 warns about some unused macros. Comment these out while they are not used.
* build: new configure-time option: --enable-gcc-warningsJim Meyering2009-08-181-1/+3
| | | | | * configure.ac: Define/configure it. * src/Makefile.am: Use new variables.
* suppress warnings from -Wmissing-noreturnJim Meyering2009-08-181-0/+2
| | | | | | | Even though these functions are marked as "not implemented yet", and they will surely return a value once implemented, ... * src/guestfs.c (select_add_timeout): Declare with noreturn attribute. (select_remove_timeout): Likewise.
* suppress a warning from -Wswitch-defaultJim Meyering2009-08-181-0/+2
| | | | * src/guestfs.c (guestfs_end_busy): Add a "default:" label.
* suppress signed/unsigned-comparison warningsJim Meyering2009-08-181-2/+2
| | | | | * src/guestfs.c [struct guestfs_h] (msg_in_size, msg_in_allocated): (msg_out_size, msg_out_allocated): Change type from int to unsigned int.
* build: don't perform arithmetic on void* pointersJim Meyering2009-08-181-3/+5
| | | | * src/guestfs.c (receive_file_data_sync, xread, xwrite): Use char*.
* generator.ml: suppress signed/unsigned-compare warningsJim Meyering2009-08-181-1/+1
| | | | | * src/generator.ml (check_reply_header): Emit parameter declarations that are unsigned, so as to avoid signed/unsigned-compare warnings.
* build: suppress an ignored-dup-return-value warningJim Meyering2009-08-181-2/+9
| | | | * src/guestfs.c (guestfs_launch): Handle dup failure.
* build: suppress an ignored-write-return-value warningJim Meyering2009-08-182-2/+5
| | | | | | | | | * bootstrap (modules): Add ignore-value. * src/guestfs.c: Include "ignore-value.h". (stdout_event): Ignore failure to write to stderr. Also, prefer STDERR_FILENO over the literal "2". * src/Makefile.am (libguestfs_la_CPPFLAGS): Include gnulib's .h files. (libprotocol_la_CFLAGS): Remove -Wall -Wno-unused.
* New 'modprobe' command.Matthew Booth2009-08-182-1/+10
| | | | Allow kernel modules to be loaded into the appliance.
* generator: Small code rearrangement.Richard Jones2009-08-181-3/+5
| | | | Move code which updates pod2text memo file into a separate function.
* generator.ml: do not emit unused print_* functionsJim Meyering2009-08-181-5/+12
| | | | | * src/generator.ml: Do not emit functions like print_xattr, print_lvm_vg, print_inotify_event, that are not used.
* generator.ml: do not emit unused print_*_list functionsJim Meyering2009-08-181-12/+24
| | | | | * src/generator.ml (emit_print_list_function): New function. Emit a function definition only if it will be used.
* generator.ml: avoid warnings in generated tests.cJim Meyering2009-08-181-4/+4
| | | | | | | | | * src/generator.ml: Avoid warnings in generated tests.c, regarding print_strings, and in exercising any function that takes a StringList or DeviceList parameter. (print_strings): Change param type to "char *const *s". Declare fully-const initializer for each list-taking function use. Cast *List argument to "(char **)".
* avoid compiler warnings about unused vars in generated codeJim Meyering2009-08-181-2/+12
| | | | | * src/Makefile.am: Compile protocol.c into a convenience library, so it can have its own CFLAGS, and link that with the destination one.
* generator.ml: Use TABs, not spaces for indentation.Jim Meyering2009-08-171-3/+3
|
* java: Small fix to Java bindings.Richard W.M. Jones2009-08-171-1/+4
| | | | Missing declaration of local variable 'i'.
* indent with spaces, not TABsJim Meyering2009-08-171-10/+10
|
* generator.ml: emit slightly prettier codeJim Meyering2009-08-171-3/+3
| | | | * src/generator.ml: Emit a few omitted newlines.
* python: avoid "_POSIX_C_SOURCE" redefinition warningJim Meyering2009-08-171-2/+2
| | | | | * src/generator.ml: Include <Python.h> *before* <stdio.h> to avoid redefinition warning about "_POSIX_C_SOURCE".
* adjust const "**" pointers to avoid warningsJim Meyering2009-08-171-47/+60
| | | | | | Also, ... * src/generator.ml: Add DeviceList type, and propagate that change out to all calling/interface code.
* New commands: mkfs-b, mke2journal*, mke2fs-J*Richard W.M. Jones2009-08-152-1/+85
| | | | | | | | | | mkfs-b: Pass the -b (blocksize) parameter to mkfs. mke2journal and friends: Lets you create external ext2 journals on devices. mke2fs-J and friends: Lets you create ext2/3/4 filesystems with external journals.
* generator: Generate the UUIDs for tests randomly.Richard W.M. Jones2009-08-151-18/+34
| | | | | Adds a uuidgen function which gets the random UUID from the uuid program. Uses this for tests.
* generator.ml: don't emit unused functionsJim Meyering2009-08-141-1/+9
| | | | | * src/generator.ml: Use "rstructs_used" to emit definitions only for put_TYPE_list functions that are used.
* generator.ml: factor out a functionJim Meyering2009-08-141-12/+16
| | | | * src/generator.ml (emit_put_list_function): New function.
* Work out which RStruct/RStructList structs are really used, and how.Richard W.M. Jones2009-08-141-0/+58
|
* Misc parameters which are String but should be Pathname.Richard Jones2009-08-131-9/+9
|
* cp/cp-a/mv parameters marked as Pathname.Richard Jones2009-08-131-3/+3
|
* generator.ml: convert leading TABs to spacesJim Meyering2009-08-131-4/+4
|
* generator.ml: factor out "pr_args n" functionJim Meyering2009-08-131-4/+7
|
* generator.ml: finish adding Dev_or_Path supportJim Meyering2009-08-131-31/+35
| | | | | | | | | | * src/generator.ml: Update all rules to handle Dev_or_Path. (the above changes to generator.ml are mostly mechanical) Emit a use of REQUIRE_ROOT_OR_RESOLVE_DEVICE. * daemon/upload.c (do_download): Remove use of REQUIRE_ROOT_OR_RESOLVE_DEVICE, now that it's automatically done in calling code. * daemon/file.c (do_file): Likewise.
* generator.ml: add type: Dev_or_PathJim Meyering2009-08-131-2/+3
| | | | * src/generator.ml (file, download): Use it.
* generator.ml: constify do_mkdtempJim Meyering2009-08-131-4/+2
| | | | | * daemon/dir.c (do_mkdtemp): Rewrite for a "const" parameter. * src/generator.ml (mkdtemp): Declare parameter to be of type Pathname.
* generator.ml: move String/Device decls "down" to definitionJim Meyering2009-08-131-5/+5
|
* generator.ml: use new "Pathname" designationJim Meyering2009-08-131-14/+31
| | | | | | | | | | Nearly every file-related function in daemons/*.c is affected: Remove this pair of statements from each affected do_* function: - NEED_ROOT (return -1); - ABS_PATH (dir, return -1); and change the type of the corresponding parameter to "const char *". * src/generator.ml: Emit NEED_ROOT just once, even when there are two or more Pathname args.
* generator.ml: new type, "Pathname"Jim Meyering2009-08-131-93/+111
| | | | | | | | | | * src/generator.ml: Emit NEED_ROOT and ABS_PATH into generated stubs.c, rather than requiring they be added manually at the start of each and every do_* function that operates on a "path" parameter. Update grammar: Pathname is just a String, with the above exception. Do not update augeas "path" parameters, since they are not file names, but rather ":"-separated search paths. Except aug_init, for which "path" *is* a file name.
* generator.ml: emit "const char *" for Device and String paramsJim Meyering2009-08-131-7/+5
| | | | | | * src/generator.ml: Emit "const char *", not "char *" for Device and String params, now that the non-const code is hoisted into the calling code in stubs.c.
* * src/generator.ml: Change all `String "device"' to `Device "device"'.Jim Meyering2009-08-131-43/+43
| | | | | | | | | | | | | | | | | | | | | Then update each affected function, removing each uses of RESOLVE_DEVICE, now that it's generated in caller from stub.c. * daemon/blockdev.c (call_blockdev): Remove use of RESOLVE_DEVICE. * daemon/devsparts.c (do_mkfs): Likewise. * daemon/ext2.c (do_e2fsck_f, do_get_e2label, do_get_e2uuid): Likewise. (do_resize2fs, do_set_e2label, do_set_e2uuid, do_tune2fs_l): Likewise. * daemon/fsck.c (do_fsck): Likewise. * daemon/grub.c (do_grub_install): Likewise. * daemon/lvm.c (do_lvremove, do_pvcreate, do_pvremove): Likewise. (do_pvresize): Likewise. * daemon/mount.c (do_mount_vfs): Likewise. * daemon/ntfs.c (do_ntfs_3g_probe): Likewise. * daemon/scrub.c (do_scrub_device): Likewise. * daemon/sfdisk.c (sfdisk, sfdisk_flag): Likewise. * daemon/swap.c (do_mkswap, do_mkswap_L, do_mkswap_U): Likewise. (do_swapoff_device, do_swapon_device): Likewise. * daemon/zero.c (do_zero): Likewise. * daemon/zerofree.c (do_zerofree): Likewise.
* update generator to emit each RESOLVE_DEVICE callJim Meyering2009-08-131-7/+7
| | | | | * src/generator.ml: Emit RESOLVE_DEVICE (device, goto done); just before each Device-enabled do_$FUNCTION.
* generator.ml: define new String-like type: "Device"Jim Meyering2009-08-131-23/+44
|
* add_drive: Don't use cache=off if not supported by underlying filesystem.Richard W.M. Jones2009-08-132-6/+25
| | | | | | | | | | | | | | | | | | If you use the guestfs_add_drive function, then currently it generates a qemu command line element like: -drive ...,cache=off,... This causes qemu to try to open the device with O_DIRECT. Unfortunately some filesystems don't support this flag, notably tmpfs, which means you can't use libguestfs in conjunction with tmpfs. On some systems /tmp is a tmpfs filesystem. This patch fixes this so that if the filesystem doesn't support O_DIRECT, then we omit the cache=off parameter. This seems reasonable from a reliability point of view, because if you're using tmpfs then you probably didn't expect reliability in the case where your system suddenly powers off.
* Add 'setcon', 'getcon' commands to set and get the SELinux context.Richard Jones2009-08-132-1/+19
|
* Spelling fix: labelled -> labeled.Richard Jones2009-08-121-4/+4
|
* Allow selinux=? kernel flag to be controlled.Richard Jones2009-08-122-5/+49
| | | | Adds new API calls to set and get this flags.
* Tidy up generation of java/Makefile.inc.Richard Jones2009-08-071-6/+11
| | | | | (Just whitespace and comment changes, and small restructuring of the code).
* Debug: Improve the way the qemu command line is printed.Richard Jones2009-08-071-7/+31
| | | | | | | | | | | | | | | | Change the way the qemu command is displayed to look like this: /usr/bin/qemu-kvm \ -drive file=/tmp/test.img,cache=off,if=virtio \ -m 500 \ -no-reboot \ -kernel /tmp/libguestfsHBJHRh/kernel \ -initrd /tmp/libguestfsHBJHRh/initrd \ [...] This allows the command line to be copied and pasted directly into the shell, and also makes it simpler to read.
* Allow network interface to be configured.Richard Jones2009-08-071-1/+1
| | | | | | | | Add ./configure --with-net-if=(virtio|ne2k_pci) option. This lets you workaround the following virtio_net bug: https://bugzilla.redhat.com/show_bug.cgi?id=516022
* Tests: swapon_device test mkswap /dev/sda1 instead of /dev/sdb.Richard Jones2009-08-071-4/+17
| | | | | | | | On RHEL 5, mkswap /dev/sdb fails, even with the '-f' option (contradictory to what the manual page says). This commit adds a new 'InitPartition' initialization which just creates /dev/sda1, and then does the swap test on that.