summaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-03-12 16:20:31 +0000
committerRichard Jones <rjones@redhat.com>2010-03-12 16:21:58 +0000
commitcb9613b993792c1c4b14fa0d9b5001ff644ac2f4 (patch)
treef1a91e4082b11a89c79897d52774c4effa7bd0dc /m4
parent891aac7a0c35eb25f853c3960eadf8f1f22ca60b (diff)
downloadlibguestfs-cb9613b993792c1c4b14fa0d9b5001ff644ac2f4.tar.gz
libguestfs-cb9613b993792c1c4b14fa0d9b5001ff644ac2f4.tar.xz
libguestfs-cb9613b993792c1c4b14fa0d9b5001ff644ac2f4.zip
Rewrite libguestfs-supermin-helper in C.
libguestfs-supermin-helper was previously a shell script. Although we had steadily optimized it, there were a number of intractable hot spots: (1) cpio still reads input files in 512 byte chunks; this is *very* pessimal behaviour, particularly when SELinux is enabled. (2) the hostfiles globbing was done very inefficiently by the shell, with the shell rereading the same directory over and over again. This is a rewrite of this shell script in C. It is approximately 3 times faster without SELinux, and has an even greater speed difference with SELinux. The main features are: (a) It never frees memory, making it simpler. The program is designed to run and exit in sub-second times, so this is acceptable. (b) It caches directory reads, making the globbing of host files much faster (measured this as ~ 4 x speed up). (c) It doesn't use external cpio, but instead contains code to write newc format cpio files, which is all that the kernel can read. Unlike cpio, this code uses large buffers for reads and writes. (d) Ignores missing or unreadable hostfiles, whereas cpio gave a warning. (e) Checks all return values from system calls. (f) With --verbose flag, it will print messages timing itself. This passes all tests. Updated with feedback from Jim Meyering.
Diffstat (limited to 'm4')
-rw-r--r--m4/.gitignore24
1 files changed, 24 insertions, 0 deletions
diff --git a/m4/.gitignore b/m4/.gitignore
index 3f1a5a43..0880f753 100644
--- a/m4/.gitignore
+++ b/m4/.gitignore
@@ -144,3 +144,27 @@ xsize.m4
/strtoul.m4
/strtoull.m4
/xstrtol.m4
+/cloexec.m4
+/cycle-check.m4
+/d-type.m4
+/dirent-safer.m4
+/fcntl.m4
+/fdopendir.m4
+/fts.m4
+/getdtablesize.m4
+/getgroups.m4
+/getugroups.m4
+/i-ring.m4
+/mgetgroups.m4
+/mkdir.m4
+/priv-set.m4
+/realloc.m4
+/rmdir.m4
+/sleep.m4
+/stat-time.m4
+/strdup.m4
+/unlink.m4
+/unlinkdir.m4
+/usleep.m4
+/stdarg.m4
+/xvasprintf.m4