| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
PortableXDR didn't support xdr_uint32_t. xdr_u_int is the same type.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Convert all uses automatically, via these two commands:
git grep -l '\<exit *(1)' \
| grep -vEf .x-sc_prohibit_magic_number_exit \
| xargs --no-run-if-empty \
perl -pi -e 's/\b(exit ?)\(1\)/$1(EXIT_FAILURE)/'
git grep -l '\<exit *(0)' \
| grep -vEf .x-sc_prohibit_magic_number_exit \
| xargs --no-run-if-empty \
perl -pi -e 's/\b(exit ?)\(0\)/$1(EXIT_SUCCESS)/'
* .x-sc_prohibit_magic_number_exit: New file.
Edit (RWMJ): Don't change Java code.
|
|
|
|
|
| |
This is a partial fix for code in guestfsd.c where many of these
header files are missing on Win32.
|
|
|
|
|
|
|
|
|
| |
On RHEL/CentOS 5.4, udevadm settle command does not work. This didn't
affect us before, but now that we're using parted for partitioning, we
*do* need to wait for udev to settle (because parted isn't waiting for
this, unlike sfdisk).
This commit chooses the correct program to run.
|
|
|
|
|
| |
git grep -l 'strcmp *([^=]*== *0'|xargs \
perl -pi -e 's/\bstrcmp( *\(.*?\)) *== *0/STREQ$1/g'
|
|
|
|
|
| |
git grep -l 'strncmp *([^=]*== *0'|xargs \
perl -pi -e 's/\bstrncmp( *\(.*?\)) *== *0\b/STREQLEN$1/g'
|
|
|
|
|
| |
git grep -l 'strncmp *([^=]*!= *0'|xargs \
perl -pi -e 's/\bstrncmp( *\(.*?\)) *!= *0/STRNEQLEN$1/g'
|
|
|
|
|
|
|
|
|
|
|
| |
* HACKING: Expand indentation TABs.
* configure.ac: Likewise.
* daemon/daemon.h: Likewise.
* daemon/guestfsd.c: Likewise.
* fuse/guestmount.c: Likewise.
* hivex/LICENSE: Likewise.
* src/generator.ml: Likewise.
* tools/virt-win-reg: Likewise.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When debugging (ie. LIBGUESTFS_DEBUG=1 & verbose flag set in daemon)
always reflect any stderr output from commands that we run to
stderr of the daemon, so it is visible.
Previously if stderror == NULL in command*, stderr output was
just eaten and discarded which meant useful error messages could
be lost.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds new variations of the command*() functions which
take a 'flags' argument. Currently the only flag available
is defined as follows:
COMMAND_FLAG_FOLD_STDOUT_ON_STDERR: For broken external commands
that send error messages to stdout (hello, parted) but that don't
have any useful stdout information, use this flag to capture the
error messages in the *stderror buffer. If using this flag,
you should pass stdoutput as NULL because nothing could ever be
captured in that buffer.
This patch also adds some documentation for command*()
function.
|
|
|
|
|
|
|
|
| |
Previously when we ran external commands from the daemon, stdin
(ie. fd 0) was closed. This caused a problem when running the
external hexdump command which seems to break if stdin is closed.
This patch opens stdin on /dev/null.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
* daemon/guestfsd.c (xread, xwrite): Use char* pointers instead.
|
|
|
|
|
|
| |
Also, ...
* src/generator.ml: Add DeviceList type, and propagate that change
out to all calling/interface code.
|
| |
|
| |
|
|
|
|
|
| |
* daemon/guestfsd.c (print_arginfo, print_shell_quote): Mark each
"info" parameter as unused.
|
|
|
|
|
|
|
|
|
|
|
| |
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 : $_'
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
%Q => simple shell quoted string
%R => path will be prefixed by /sysroot
eg. snprintf (cmd, sizeof cmd, "cat %R", path); system (cmd);
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
* daemon/guestfsd.c (commandrv): Free original buffer (rather
than leaking it) if realloc fails.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because udev operates asynchronously, we found errors which were
caused by a previous command (eg. sfdisk or pvremove) creating
or removing a device, and that change not having happened by the
time the next command was run.
This patch adds calls to '/sbin/udevadm settle' after any commands
which can add or remove device nodes.
If udev is not being used or not available, this should have no
effect. The command fails and this is silently ignored.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
virtio_blk is the fast, virt-native block device driver
supported by qemu and KVM. Note that virtio_blk device
names are called /dev/vd*.
Existing scripts should continue working because device name
translation will silently change device names of the form
/dev/sd* to /dev/vd* as required.
See also:
http://libguestfs.org/guestfs.3.html#block_device_naming
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|