summaryrefslogtreecommitdiffstats
path: root/daemon
Commit message (Collapse)AuthorAgeFilesLines
...
* propagate semantic changes to NEED_ROOT, NEED_ROOT_OR_IS_DEVICEJim Meyering2009-08-131-8/+8
| | | | | | changing IS_DEVICE semantics leads to changing semantics of NEED_ROOT_OR_IS_DEVICE and NEED_ROOT, too. * daemon/daemon.h: Update definitions.
* convert the last few, manuallyJim Meyering2009-08-132-2/+2
|
* change almost all uses: s/IS_DEVICE/RESOLVE_DEVICE/Jim Meyering2009-08-1315-32/+32
| | | | | | Use this command: git grep -l -w IS_DEVICE|xargs perl -pi -e \ 's/\b(?:IS_DEVICE)\b( \(.*?,) (.*?)\)/RESOLVE_DEVICE$1 return $2)/'
* * daemon/daemon.h (RESOLVE_DEVICE): Rename from IS_DEVICE.Jim Meyering2009-08-131-3/+3
| | | | | Change parameter from "errcode" (which would be returned) to "fail_stmt" so that a caller can specify e.g., "goto done" upon failure.
* Add 'setcon', 'getcon' commands to set and get the SELinux context.Richard Jones2009-08-133-0/+93
|
* Return error if allocations fail.Richard Jones2009-08-121-0/+12
|
* If using SELinux, mount /selinux in the appliance.Richard Jones2009-08-121-2/+8
| | | | | | If selinux=1 on the Linux kernel command line, then we mount /selinux in the appliance. We will also bind-mount this directory into guests when we run commands.
* daemon/ls: make do_ll require root, like all the restJim Meyering2009-08-111-7/+10
| | | | | * ls.c (do_ll): Do invoke "NEED_ROOT" here, and add a FIXME to provide a "debug ll" command with the semantics we're removing.
* build: enable automake's silent rules optionJim Meyering2009-08-101-0/+3
| | | | | | | * configure.ac: Use AM_SILENT_RULES([yes]). Those who want verbose build output may configure with --disable-silent-rules or use "make V=1". * daemon/configure.ac: Likewise.
* build: daemon/do_debug: parameters aren't always unusedJim Meyering2009-08-101-1/+7
| | | | | | | | | * daemon/debug.c (MAYBE_UNUSED): Define. (do_debug): Mark parameters as unused only when they really are unused. Spotted by Richard Jones. SCALAR(0xdd8370) prefer sizeof *VAR sizeof TYPE (no semantic change)
* build: avoid warnings in daemon/inotify.cJim Meyering2009-08-101-3/+4
| | | | | | | | Avoid "comparison between signed and unsigned integer expressions" warnings. If it's at all hard or risky to avoid this type of warning, then it's not worthwhile. Here, it's easy and safe. * daemon/inotify.c (inotify_posn): Declare local to be of unsigned type. (do_inotify_read, do_inotify_files): Likewise.
* build: avoid warnings in daemon/guestfsd.cJim Meyering2009-08-101-2/+2
| | | | | * daemon/guestfsd.c (print_arginfo, print_shell_quote): Mark each "info" parameter as unused.
* build: avoid warnings in daemon/debug.cJim Meyering2009-08-101-1/+1
| | | | * daemon/debug.c (do_debug): Mark parameters as unused.
* define ATTRIBUTE_UNUSEDJim Meyering2009-08-101-0/+10
| | | | * daemon/daemon.h (__attribute__, ATTRIBUTE_UNUSED): Define.
* daemon/file.c: remove duplicate absolute-path checkJim Meyering2009-08-101-1/+0
| | | | | | * daemon/file.c (do_file): Remove redundant use of ABS_PATH. It's redundant because the preceding line invokes NEED_ROOT_OR_IS_DEVICE, which also invokes ABS_PATH.
* Always pass mkswap -f parameter.Richard Jones2009-08-061-2/+2
| | | | | Otherwise mkswap will give a silly error if you ask it to swap on a whole device.
* RHEL 5: inotify_init1 call did not exist on RHEL 5.Richard Jones2009-08-062-1/+23
|
* Fix errno check in readdir in devsparts.cMatthew Booth2009-08-061-3/+5
|
* daemon: use gnulibJim Meyering2009-08-064-1/+73
| | | | | | | | | | | | | | | | | * daemon/Makefile.am (SUBDIRS): Define. (AM_CPPFLAGS): Define, to include from gnulib's lib/ (LDADD): Define, to link with gnulib's libgnu.a. * daemon/configure.ac: Use AC_CONFIG_AUX_DIR([build-aux]), gl_EARLY and gl_INIT. (AC_CONFIG_FILES): Add lib/Makefile and tests/Makefile * daemon/m4/gnulib-cache.m4: New file, generated by running ../.gnulib/gnulib-tool --import --with-tests hash * daemon/.gitignore: Ignore all of the imported files. build: tell bootstrap about daemon/ * bootstrap: Run gnulib-tool --update in daemon/. Remove bootstrap's --gnulib-srcdir option, because it probably didn't work, and even if it did, we've discovered that using a separate git repo like that can lead to subtle mix-ups.
* Recognise cd-rom devices in devsparts.cMatthew Booth2009-08-061-72/+96
| | | | | | Also: * Un-duplicate device detection code by creating a common mapping function. * Add some more comments.
* Convert all TABs-as-indentation to spaces.Jim Meyering2009-08-0316-201/+201
| | | | | | | | | | | Do it by running this command: [exempted files are matched via .x-sc_TAB_in_indentation] git ls-files \ | pcregrep -vf .x-sc_TAB_in_indentation \ | xargs pcregrep -l '^ *\t' \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
* build: reenable "syntax-check" rule: sc_const_long_optionJim Meyering2009-08-031-1/+1
| | | | | | | * cfg.mk (disable_temporarily): Remove sc_const_long_option. * daemon/guestfsd.c (main): Declare long_options to be "const". * fish/fish.c (main): Likewise. * test-tool/test-tool.c (main): Likewise.
* Add interface to Linux 'inotify' API.Richard W.M. Jones2009-07-312-0/+321
|
* New commands: swapon-*, swapoff-*, mkswap-file.Richard W.M. Jones2009-07-311-2/+128
| | | | | | | | | | | | swapon-device swapoff-device swapon-file swapoff-file swapon-label swapoff-label swapon-uuid swapoff-uuid mkswap-file
* New command: 'fallocate' to (pre-)allocate sized files.Richard W.M. Jones2009-07-312-0/+60
|
* New commands: 'ln', 'ln-f', 'ln-s', 'ln-sf' and 'readlink'.Richard W.M. Jones2009-07-312-0/+138
| | | | | These commands can be used to make hard and symbolic links. The readlink command is used to read existing symbolic links.
* Add 'realpath' command.Richard W.M. Jones2009-07-312-0/+48
|
* fix comments; move declarationsJim Meyering2009-07-301-6/+4
| | | | | | * daemon/devsparts.c (do_list_devices, do_list_partitions): Remove stray words in comments. Move declarations down to definition.
* Implement '*grep*' family of commands.Richard Jones2009-07-292-0/+141
|
* Don't show empty CD devices (RHBZ#514505).Richard Jones2009-07-291-0/+27
|
* Pass '-z' parameter to 'file' command so it looks inside compressed files.Richard Jones2009-07-281-1/+1
| | | | Also we deprecate the old 'zfile' command.
* Need to declare asprintf_nowarn as inline to avoid gcc complaining.Richard Jones2009-07-281-1/+1
|
* Replace shell_quote function with %Q and %R printf specifiers.Richard Jones2009-07-288-104/+154
| | | | | | | %Q => simple shell quoted string %R => path will be prefixed by /sysroot eg. snprintf (cmd, sizeof cmd, "cat %R", path); system (cmd);
* Fix typo in error message.Richard Jones2009-07-221-1/+1
|
* Generator: Implement RBufferOut and "read-file" call.Richard W.M. Jones2009-07-211-0/+59
| | | | | | | | | This commit implements the RBufferOut type for returning arbitrary 8 bit data from calls. We also implement the guestfs_read_file call to read a whole file that can contain any 8 bit content, but up to a limit of ~ 2 MB.
* Make /sysroot path configurable.Richard Jones2009-07-1821-121/+127
| | | | | | | | | Currently /sysroot is hard-coded throughout the daemon code. This patch turns the path into a variable so that we can change it in future, for example to allow standalone mode to be implemented. This patch was tested by running all the C API tests successfully.
* New commands: 'mkmountpoint' and 'rmmountpoint'Richard W.M. Jones2009-07-151-0/+51
| | | | | | | | | | | | | | | | | | | | | These specialized commands are used to create additional mountpoints before mounting filesystems. They are only used where you want to mount several unrelated or read-only filesystems together, and need additional care to use correctly. Here is how to use these calls to unpack the "Russian doll" nest of a Fedora 11 live CD: add-ro Fedora-11-i686-Live.iso run mkmountpoint /cd mkmountpoint /squash mkmountpoint /ext3 mount /dev/sda /cd mount-loop /cd/LiveOS/squashfs.img /squash mount-loop /squash/LiveOS/ext3fs.img /ext3 The inner filesystem is now unpacked under the /ext3 mountpoint.
* New command: 'mountpoints' which returns a hash of device -> mountpoint.Richard W.M. Jones2009-07-151-2/+29
|
* RHEL 5: header was called <sys/xattr.h>Richard W.M. Jones2009-07-142-3/+10
|
* Fix: daemon/xattr.c can now compile even when no xattr support.Richard W.M. Jones2009-07-141-3/+3
|
* Support for Linux extended attributes.Richard W.M. Jones2009-07-143-1/+289
| | | | | | | | | | | | | | | | This commit adds six calls to support Linux extended attributes. They are: getxattrs list all extended attributes for a file or directory setxattr add/replace an extended attribute removexattr remove an extended attribute lgetxattrs \ lsetxattr (same as above, but operate on symbolic links) lremovexattr / See attr(5) for more information. This also adds support for the FBuffer field type, which maps to an XDR opaque<> or a C (int, char *) pair.
* Implement new 'zfile' command, to show file type inside compressed files.Richard Jones2009-07-131-0/+60
|
* Generate structs and struct lists generically.Richard Jones2009-07-073-11/+11
| | | | | | | | | | | This modifies the way that struct and struct lists are generated (for return values) so that there is no need to add an explicit new type when adding a new structure. All tests pass, and the C API should be compatible. I have also inspected the changes that are made to the generated code by hand.
* Don't die if reply message is oversized (RHBZ#509597).Richard Jones2009-07-051-2/+7
|
* Make it possible to build in a separate directoryMatthew Booth2009-07-032-3/+3
| | | | | | | | | | | | | | | | | | | | | | This patch allows you to do: mkdir build cd build ../configure ... make This will output all generated files to the build directory. Given that autogen automatically runs configure, you can also do: BUILDDIR=./build ./autogen.sh which will do the right thing. Also: * Fix a dependency bug which means that guestfs_protocol.h isn't automatically rebuilt. * Re-running autogen.sh with no arguments won't blow away your previous configure arguments.
* avoid leak upon failed reallocJim Meyering2009-07-031-8/+12
| | | | | * daemon/guestfsd.c (commandrv): Free original buffer (rather than leaking it) if realloc fails.
* remove trailing blanksJim Meyering2009-07-0344-44/+44
|
* daemon/readdir: avoid a small leakJim Meyering2009-07-031-0/+2
| | | | | * daemon/readdir.c (do_readdir): Free both p and v.name, in case only one of the allocations failed.
* Add 'sfdiskM' command.Richard W.M. Jones2009-07-021-2/+13
| | | | | | | | | | This command is a saner interface to partitioning. All partition sizes are specified in megabytes (not cylinders). You don't need to specify the cyls/heads/secs parameters. All the test code has been updated to use this, so it is now CHS-independent (eg. when CHS changes as between IDE and virtio).
* Add list of function_names to the daemon.Richard W.M. Jones2009-07-023-2/+8
| | | | | Messages which include the proc_nr can now also include the name of the actual function being called.