summaryrefslogtreecommitdiffstats
path: root/daemon
Commit message (Collapse)AuthorAgeFilesLines
* Tab to space fixes, now passes 'make syntax-check'Richard Jones2009-10-201-5/+4
|
* guestfs_find: Fix memory leak of sysrootdir.Richard Jones2009-10-201-0/+1
|
* New API: find0 (unlimited version of find)Richard Jones2009-10-201-0/+99
| | | | | | | | | | | | | This adds a new API call guestfs_find0, which is like guestfs_find but mainly doesn't suffer from the protocol limit of the earlier command. The earlier command is not deprecated because it is still very useful. guestfs_find0 uses a FileOut parameter and writes the results to an external file. The filenames in the output are separated by ASCII NUL characters (so a bit like "find -print0"). There is also the addition of a regression test for this command.
* avoid use of all ctype macrosJim Meyering2009-09-245-12/+13
| | | | | | | | | | | | | | | | | | | | * cfg.mk (disable_temporarily): Don't disable sc_avoid_ctype_macros. * fish/tilde.c: Remove unnecessary inclusion of ctype.h. * bootstrap: Add gnulib's c-ctype module to the list. * daemon/m4/gnulib-cache.m4: Likewise. * daemon/ext2.c: Include "c-ctype.h", not <ctype.h>. Use c_isspace, etc, rather than isspace. * daemon/guestfsd.c: Likewise. * daemon/lvm.c: Likewise. * daemon/proto.c: Likewise. * fish/fish.c: Likewise. * fish/tilde.c: Likewise. * src/generator.ml: Likewise. * src/guestfs.c: Likewise. * examples/to-xml.c: Likewise. * examples/Makefile.am (to_xml_CPPFLAGS): Add -I$(top_srcdir)/gnulib/lib so inclusion of "c-ctype.h" works. (to_xml_CPPFLAGS): Rename from to_xml_CFLAGS.
* Flexible guestfs_vmchannel parameter for future appliances.Richard Jones2009-09-221-34/+137
| | | | | | | | | | | | | | | | | | | | | | This reimplements parts of commit da0a4f8d1f6ddd302ceba028d87c6e009589e503 in a different, but compatible way. We pass guestfs_vmchannel=tcp:<ip>:<port> on the command line. This is intended to be used as follows (now and in future versions): tcp:10.0.2.4:6666 for guestfwd vmchannel tcp:10.0.2.2:<port> for future "no vmchannel" implementation /dev/vcon4 for future virtio-console vmchannel* It also accepts the old-style guestfs=10.0.2.4:6666 parameter which is sent by older libraries, and turns this transparently into the correct format above. If no guestfs_vmchannel is passed, then this defaults to the guestfwd vmchannel which older libraries would expect. * Maybe this last one should be dev:/dev/vcon4 or file:/dev/vcon4, but we don't need to decide that now.
* Rearrange and tidy up code in guestfsd.cRichard Jones2009-09-221-30/+74
| | | | | | | | | | | | | | | This just tidies up the main() function in the daemon. There is no longer a huge fixed-sized buffer used for the kernel command line. Variables are moved closer to where they are used. Some local variables turned out to be unused - these are removed. Finally the part that reads the kernel command line is moved into a separate function. There is only minimal functional change here (it now prints out the kernel command line). Literal '4' replaced with 'sizeof' expression, at Jim Meyering's suggestion during patch review.
* Fix code which looked for leaked FDs between each command.Richard Jones2009-09-172-5/+6
| | | | | | This code was not checking the return value from system() so it failed if uncommented. Add ignore_value() around the call to system. However, leave the code still disabled.
* Remove explicit guestfs=10.0.2.4:6666 kernel command line parameter.Richard Jones2009-09-171-57/+21
| | | | | | | | | | Since we control the appliance tightly, we can just specify that it will always use a particular host and port, and we don't need to pass it on the command line each time. Also the VMCHANNEL_* constants are only relevant to the particular guestfwd vmchannel implementation, so we rename them as GUESTFWD_*.
* Daemon: fix handling of errors from xread and xwrite.Richard Jones2009-09-173-10/+17
| | | | | | If xread or xwrite returns -1, that indicates an error and we should exit. Note that xread/xwrite has already printed the error message.
* Fix verbose packet dumping functions.Richard Jones2009-09-172-3/+11
| | | | | | | | | | Add the configure parameter --enable-packet-dump so that this code can be enabled without editing the source. This code is normally commented out, because it is too verbose unless you happen to be debugging the underlying protocol. Because it is normally commented out, I found it had bit-rotted slightly. This commit also fixes the obvious problems.
* 'len' should be an unsigned 32 bit int.Richard Jones2009-09-171-1/+1
| | | | | This only happened to work by accident before because 'unsigned len' happens to be 32 bit on all platforms we support.
* Add echo_daemon commandMatthew Booth2009-09-142-0/+74
| | | | | echo_daemon is a simple echo which can be used to test connectivity between the client and daemon.
* Ignore some more m4 files.Richard Jones2009-09-091-0/+1
|
* daemon: diagnose socket write failureJim Meyering2009-08-204-9/+19
| | | | | | | | | * daemon/proto.c (send_chunk): Don't ignore socket-write error. * daemon/proto.c (send_file_end): Return "int", not void, so we can propagate send_chunk failure to caller. * daemon/daemon.h (send_file_end): Update prototype. * daemon/tar.c (do_tar_out, do_tgz_out): Update uses of send_file_end. * daemon/upload.c (do_download): Likewise.
* mke2fs: Use e4fsprogs programs if available.Richard W.M. Jones2009-08-191-3/+46
| | | | | | | On RHEL 5, mke2fs is ancient, and there is a non-standard "mke4fs" binary which acts like the more recent mke2fs on Fedora. Since there are several annoyances and actual bugs in the ancient RHEL 5 mke2fs, use mke4fs instead if it's available.
* New 'modprobe' command.Matthew Booth2009-08-182-0/+41
| | | | Allow kernel modules to be loaded into the appliance.
* Implement 'debug ls' and 'debug ll' commands.Richard Jones2009-08-182-3/+64
| | | | These commands can be used to list files in the appliance.
* Ignore manywarnings.m4 / warnings.m4.Richard W.M. Jones2009-08-171-0/+2
|
* Remove redundant macro.Richard W.M. Jones2009-08-171-2/+0
|
* indent with spaces, not TABsJim Meyering2009-08-173-19/+19
|
* daemon: enable -Werror and many gcc warnings when --enable-gcc-warningsJim Meyering2009-08-173-2/+66
| | | | | | | | | | * daemon/m4/gnulib-cache.m4: Add two modules: manywarnings, warnings. * daemon/configure.ac: Implement --enable-gcc-warnings, and selectively disable a few warning options that are either not useful or that provoke too many warnings for now. Define and AC_SUBST WARN_CFLAGS and WERROR_CFLAGS. * daemon/Makefile.am (guestfsd_CFLAGS): Use $(WARN_CFLAGS) and $(WERROR_CFLAGS), rather than just -Wall.
* xattr.c: avoid warning about comparison between signed and unsignedJim Meyering2009-08-171-4/+6
| | | | * daemon/xattr.c (getxattrs): Use an unsigned index.
* guestfsd: don't ignore failed write-to-socketJim Meyering2009-08-171-1/+1
| | | | | * daemon/proto.c (reply): Fix typo that would cause us to ignore failed write-to-socket.
* daemon.h: avoid warning about possible noreturn functionJim Meyering2009-08-171-1/+1
| | | | * daemon/daemon.h (main_loop): Use "noreturn" attribute.
* sfdisk.c, fallocate.c: use a string literal as formatJim Meyering2009-08-172-3/+3
| | | | | * daemon/fallocate.c (do_fallocate): Format was not a string literal. * daemon/sfdisk.c (sfdisk): Likewise.
* wc, blockdev: avoid warnings about discarding "const" qualifiersJim Meyering2009-08-172-2/+2
| | | | | * daemon/wc.c (wc): Make "flag" param const. * daemon/blockdev.c (call_blockdev): Likewise, for "switc".
* daemon/zero: don't ignore write and close errorsJim Meyering2009-08-171-4/+14
| | | | * daemon/zero.c (do_zero): Detect write and close errors.
* guestfsd.c: don't perform arithmetic on void pointersJim Meyering2009-08-171-2/+4
| | | | * daemon/guestfsd.c (xread, xwrite): Use char* pointers instead.
* command.c: avoid shadowing a global functionJim Meyering2009-08-171-4/+4
| | | | * daemon/command.c (do_sh_lines, do_sh): Do not shadow global "command".
* avoid warning about old-style no-param function definitionJim Meyering2009-08-172-3/+3
| | | | | * daemon/df.c (do_df, do_df_h): Add "void". * sync.c (do_sync): Likewise.
* adjust const "**" pointers to avoid warningsJim Meyering2009-08-178-35/+31
| | | | | | 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-154-17/+218
| | | | | | | | | | 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.
* build: avoid "make sytnax-check" failureJim Meyering2009-08-141-1/+1
| | | | * daemon/configure.ac: Change a leading TAB to 8 spaces.
* appliance: Replace LANG=C with LC_ALL=CRichard Jones2009-08-131-1/+1
|
* umount: Enable device name translation for device parameter.Richard Jones2009-08-131-3/+8
|
* mount: Check mountpoints are absolute paths.Richard Jones2009-08-131-0/+2
|
* selinux: Don't fail if libselinux is not found.Richard Jones2009-08-131-7/+3
|
* In rmmountpoint, have to explicitly check for ABS_PATH (*not* NEED_ROOT).Richard Jones2009-08-131-0/+3
|
* inotify-add-watch does not need to explicitly check for ABS_PATH.Richard Jones2009-08-131-1/+0
|
* cp/cp-a/mv parameters marked as Pathname.Richard Jones2009-08-131-4/+0
|
* do_equal does not need to explicitly check for NEED_ROOT/ABS_PATH.Richard Jones2009-08-131-4/+0
|
* sfdisk: guard against buffer overflowJim Meyering2009-08-131-2/+15
| | | | | * daemon/sfdisk.c (sfdisk): Don't let outrageous "extra_flag" or "device" strings overflow a fixed-size buffer.
* do_umount: don't use RESOLVE_DEVICE anymoreJim Meyering2009-08-131-13/+9
| | | | | * daemon/mount.c (do_umount): Don't use RESOLVE_DEVICE here, now that the caller always invokes REQUIRE_ROOT_OR_RESOLVE_DEVICE.
* generator.ml: finish adding Dev_or_Path supportJim Meyering2009-08-132-4/+0
| | | | | | | | | | * 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: constify do_mkdtempJim Meyering2009-08-131-17/+8
| | | | | * daemon/dir.c (do_mkdtemp): Rewrite for a "const" parameter. * src/generator.ml (mkdtemp): Declare parameter to be of type Pathname.
* generator.ml: use new "Pathname" designationJim Meyering2009-08-1342-325/+175
| | | | | | | | | | 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.
* fix daemon.h's use of NEED_ROOT-in-#defineJim Meyering2009-08-131-1/+1
|
* update all NEED_ROOT usesJim Meyering2009-08-1332-57/+57
| | | | | | run this command: git grep -l -w NEED_ROOT|xargs perl -pi -e \ 's/(NEED_ROOT) \((.*?)\)/$1 (return $2)/'
* * src/generator.ml: Change all `String "device"' to `Device "device"'.Jim Meyering2009-08-1313-53/+0
| | | | | | | | | | | | | | | | | | | | | 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.
* s/NEED_ROOT_OR_IS_DEVICE/REQUIRE_ROOT_OR_RESOLVE_DEVICE/Jim Meyering2009-08-133-3/+3
|