Matthew Booth
04ea1375c5
Update FSF address.
2011-11-08 14:43:07 +00:00
Richard W.M. Jones
a0e3b21837
RHEL 5: Use mke4fs on RHEL 5 as replacement for mke2fs.
2011-03-25 14:42:40 +00:00
Nikita A Menkovich
4ffa2d6798
New API: resize2fs-M to resize ext2/3/4 to minimum size.
2011-01-14 13:40:17 +00:00
Richard W.M. Jones
9ff9941836
daemon: Don't use ../src path to include generator_protocol.h
...
This file is already hard-linked into the current directory, so
the relative path is not required.
2010-11-03 13:15:19 +00:00
Richard Jones
52f9cd4882
daemon: Limit label lengths (RHBZ#597118).
2010-06-02 13:38:00 +01:00
Richard Jones
da4812ab6b
Fix and deprecate get_e2label and get_e2uuid (RHBZ#597112).
...
Fix these calls (see description in RHBZ#597112), but also
deprecate them since the new calls vfs_label and vfs_uuid can
work on any filesystem type.
This also adds a regression test for the original bug reported
in RHBZ#597112.
2010-06-01 15:30:13 +01:00
Richard Jones
71b02d6654
New API: resize2fs-size to allow shrinking ext2 filesystems (RHBZ#585221).
2010-05-21 14:51:54 +01:00
Richard Jones
9e0b31a2af
appliance: Set $PATH instead of hard-coding paths to binaries everywhere.
...
Change the appliance so PATH includes common directories. Thus
we don't need to hard-code paths to binaries (eg. "/sbin/fdisk")
everywhere.
2010-03-26 13:36:30 +00:00
Richard Jones
00a9ae7365
Fix lvresize test on RHEL 5, by fixing guestfs_e2fsck_l.
...
The problem is that mkfs was making an ext2 filesystem,
which later we were checking with e4fsck. e4fsck corrects
an "error" on the filesystem:
/dev/VG/LV: Adding dirhash hint to filesystem.
e4fsck returns 1 (errors corrected) which we were interpreting
as an error return.
2010-03-24 23:28:14 +00:00
Richard Jones
c4e8aa245a
Use ext4 dev tools on RHEL 5 (RHBZ#576688).
2010-03-24 22:02:34 +00:00
Richard Jones
e9c3711310
daemon: Don't need to prefix error messages with the command name.
...
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:..)
2010-02-12 16:49:00 +00:00
Richard Jones
688bdc1a06
daemon: Missing #includes revealed by cross-compiling.
2009-11-20 10:36:21 +00:00
Jim Meyering
9a8889e4d0
use STREQ, not strcmp: part 1
...
git grep -l 'strcmp *([^=]*== *0'|xargs \
perl -pi -e 's/\bstrcmp( *\(.*?\)) *== *0/STREQ$1/g'
2009-11-09 22:34:16 +01:00
Jim Meyering
3e70b34eed
change strncmp() == 0 to STREQLEN()
...
git grep -l 'strncmp *([^=]*== *0'|xargs \
perl -pi -e 's/\bstrncmp( *\(.*?\)) *== *0\b/STREQLEN$1/g'
2009-11-09 22:34:16 +01:00
Jim Meyering
6a14f1c250
avoid use of all ctype macros
...
* 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.
2009-09-24 11:00:44 +02:00
Richard W.M. Jones
2b891ceef3
mke2fs: Use e4fsprogs programs if available.
...
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.
2009-08-19 15:13:43 +01:00
Jim Meyering
9b41eeb917
indent with spaces, not TABs
2009-08-17 11:56:10 +02:00
Richard W.M. Jones
a61bccecfb
New commands: mkfs-b, mke2journal*, mke2fs-J*
...
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.
2009-08-15 18:05:07 +01:00
Jim Meyering
84fc760439
generator.ml: use new "Pathname" designation
...
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.
2009-08-13 14:45:34 +02:00
Jim Meyering
0c07f0d236
* src/generator.ml: Change all String "device"' to Device "device"'.
...
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.
2009-08-13 14:45:34 +02:00
Jim Meyering
1997858e90
change almost all uses: s/IS_DEVICE/RESOLVE_DEVICE/
...
Use this command:
git grep -l -w IS_DEVICE|xargs perl -pi -e \
's/\b(?:IS_DEVICE)\b( \(.*?,) (.*?)\)/RESOLVE_DEVICE$1 return $2)/'
2009-08-13 14:45:33 +02:00
Jim Meyering
2f1a50d816
Convert all TABs-as-indentation to spaces.
...
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 : $_'
2009-08-03 17:17:57 +02:00
Jim Meyering
a7b73d4a1e
remove trailing blanks
2009-07-03 17:04:21 +02:00
Richard Jones
56bef498f4
In the daemon, change all const char * parameters to char *.
2009-06-10 14:16:47 +01:00
Richard Jones
2df2f2854e
Add IS_DEVICE checks for all calls which take a device parameter.
2009-06-10 11:11:14 +01:00
Richard Jones
0f81d0941a
Add e2fsck_f command, and modify lvresize test to use it (RHBZ 502018).
2009-05-21 16:17:38 +01:00
Richard Jones
0695593702
Add: lvresize, resize2fs commands.
2009-05-18 20:22:36 +01:00
Richard Jones
668d27b568
Rename tune2fs.c -> ext2.c
2009-04-30 13:02:29 +01:00