summaryrefslogtreecommitdiffstats
path: root/daemon/find.c
Commit message (Collapse)AuthorAgeFilesLines
* daemon: collect list of called external commandsOlaf Hering2012-08-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | guestfsd calls many different tools. Keeping track of all of them is error prone. This patch introduces a new helper macro to put the command string into its own ELF section: GUESTFSD_EXT_CMD(C_variable, command_name); This syntax makes it still possible to grep for used command names. The actual usage of the collected list could be like this: objcopy -j .guestfsd_ext_cmds -O binary daemon/guestfsd /dev/stdout | tr '\0' '\n' | sort -u The resulting output will be used to tell mkinitrd which programs to copy into the initrd. Signed-off-by: Olaf Hering <olaf@aepfle.de> RWMJ: - Move str_vgchange at request of author. - Fix snprintf call in daemon/debug.c
* guestfs_find: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-171-83/+0
| | | | | This also reimplements the virt-ls -R option to use the replacement guestfs_find API, which is simpler (though actually less efficient).
* Replace 'int' with 'size_t' passim.Richard W.M. Jones2012-03-131-3/+6
| | | | | Analyze all uses of 'int' in the code, and replace with 'size_t' where appropriate.
* daemon: Implement a growable strings buffer type.Richard W.M. Jones2012-03-131-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | Previously a lot of daemon code used three variables (a string list, 'int size' and 'int alloc') to track growable strings buffers. This commit implements a simple struct containing the same variables, but using size_t instead of int: struct stringsbuf { char **argv; size_t size; size_t alloc; }; Use it like this: DECLARE_STRINGSBUF (ret); //... if (add_string (&ret, str) == -1) return NULL; //... if (end_stringsbuf (&ret) == -1) return NULL; return ret.argv;
* Tempus fugit.Richard W.M. Jones2012-01-181-1/+1
| | | | Update all copyright dates to 2012.
* Update FSF address.Matthew Booth2011-11-081-1/+1
|
* daemon: Remove some less useful debugging messages.Richard W.M. Jones2011-05-081-7/+1
| | | | | | | | Remove some debug messages which were basically left over from when the code was being developed. However we leave debug messages where it is printing an external command that is about to be executed, since those are useful.
* daemon: Don't use ../src path to include generator_protocol.hRichard W.M. Jones2010-11-031-1/+1
| | | | | This file is already hard-linked into the current directory, so the relative path is not required.
* daemon: Don't need to prefix error messages with the command name.Richard Jones2010-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | The RPC stubs already prefix the command name to error messages. The daemon doesn't have to do this. As a (small) benefit this also makes the daemon slightly smaller. Code in the daemon such as: if (argv[0] == NULL) { reply_with_error ("passed an empty list"); return NULL; } now results in error messages like this: ><fs> command "" libguestfs: error: command: passed an empty list (whereas previously you would have seen ..command: command:..)
* daemon: Missing #includes revealed by cross-compiling.Richard Jones2009-11-201-0/+1
|
* 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.
* generator.ml: use new "Pathname" designationJim Meyering2009-08-131-4/+1
| | | | | | | | | | 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.
* update all NEED_ROOT usesJim Meyering2009-08-131-1/+1
| | | | | | run this command: git grep -l -w NEED_ROOT|xargs perl -pi -e \ 's/(NEED_ROOT) \((.*?)\)/$1 (return $2)/'
* update all uses of ABS_PATHJim Meyering2009-08-131-1/+1
| | | | | | run this command: git grep -l -w ABS_PATH|xargs perl -pi -e \ 's/(?:ABS_PATH)( \(.*?,) (.*?)\)/ABS_PATH$1 return $2)/'
* Replace shell_quote function with %Q and %R printf specifiers.Richard Jones2009-07-281-9/+2
| | | | | | | %Q => simple shell quoted string %R => path will be prefixed by /sysroot eg. snprintf (cmd, sizeof cmd, "cat %R", path); system (cmd);
* Make /sysroot path configurable.Richard Jones2009-07-181-2/+10
| | | | | | | | | 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.
* remove trailing blanksJim Meyering2009-07-031-1/+1
|
* All instances of 'pclose' now check for return value != 0.Richard W.M. Jones2009-07-011-1/+1
| | | | | | We are generally interested that the subcommand ran without error, ie. had exit status of 0. 'pclose' returns the exit status, so we now check that pclose (fp) != 0.
* Check return value from pclose.Richard W.M. Jones2009-06-201-1/+5
|
* In the daemon, change all const char * parameters to char *.Richard Jones2009-06-101-1/+1
|
* Added 'find' command.Richard Jones2009-05-191-0/+129