| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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_*.
|
|
|
|
|
|
| |
If xread or xwrite returns -1, that indicates an error and we
should exit. Note that xread/xwrite has already printed the
error message.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This only happened to work by accident before because 'unsigned len'
happens to be 32 bit on all platforms we support.
|
|
|
|
|
| |
echo_daemon is a simple echo which can be used to test connectivity between the
client and daemon.
|
| |
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Allow kernel modules to be loaded into the appliance.
|
|
|
|
| |
These commands can be used to list files in the appliance.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* daemon/xattr.c (getxattrs): Use an unsigned index.
|
|
|
|
|
| |
* daemon/proto.c (reply): Fix typo that would cause us to ignore
failed write-to-socket.
|
|
|
|
| |
* daemon/daemon.h (main_loop): Use "noreturn" attribute.
|
|
|
|
|
| |
* daemon/fallocate.c (do_fallocate): Format was not a string literal.
* daemon/sfdisk.c (sfdisk): Likewise.
|
|
|
|
|
| |
* daemon/wc.c (wc): Make "flag" param const.
* daemon/blockdev.c (call_blockdev): Likewise, for "switc".
|
|
|
|
| |
* daemon/zero.c (do_zero): Detect write and close errors.
|
|
|
|
| |
* daemon/guestfsd.c (xread, xwrite): Use char* pointers instead.
|
|
|
|
| |
* daemon/command.c (do_sh_lines, do_sh): Do not shadow global "command".
|
|
|
|
|
| |
* daemon/df.c (do_df, do_df_h): Add "void".
* sync.c (do_sync): Likewise.
|
|
|
|
|
|
| |
Also, ...
* src/generator.ml: Add DeviceList type, and propagate that change
out to all calling/interface code.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
* daemon/configure.ac: Change a leading TAB to 8 spaces.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* daemon/sfdisk.c (sfdisk): Don't let outrageous "extra_flag"
or "device" strings overflow a fixed-size buffer.
|
|
|
|
|
| |
* daemon/mount.c (do_umount): Don't use RESOLVE_DEVICE here,
now that the caller always invokes REQUIRE_ROOT_OR_RESOLVE_DEVICE.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* daemon/dir.c (do_mkdtemp): Rewrite for a "const" parameter.
* src/generator.ml (mkdtemp): Declare parameter to be of type Pathname.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
run this command:
git grep -l -w NEED_ROOT|xargs perl -pi -e \
's/(NEED_ROOT) \((.*?)\)/$1 (return $2)/'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|