| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Previously we used newSVpv (str, len), but if len == 0 then
this means Perl tries to calculate the string length using
strlen(3). This is not desirable when we know the length, in
which case we should use newSVpvn instead.
|
|
|
|
|
|
|
| |
This is similar to 'guestfs_dd', but it copies just a fixed
number of bytes from the source to the destination. It's an
error if the source is too short or if the destination is too
small.
|
| |
|
|
|
|
|
|
|
|
| |
This allows programs to work if they just
#include <guestfs.h>
and no other headers. It's not useful in the general
case, but fixes some configure-time tests, particularly
the one for Ruby on OS X.
|
|
|
|
|
|
|
|
|
| |
As far as I can tell, Darwin has no way to check the peer euid
of a _loopback_ TCP socket. This is required for the "null vmchannel"
implementation to work securely.
Therefore disable this - Darwin will use one of the other supported
vmchannel implementations instead.
|
| |
|
|
|
|
|
| |
OS X has an older version of readline with some differences
in the names of functions.
|
|
|
|
|
|
| |
In PortableXDR this is not included automatically so we
have to include it explicitly to get definitions for the
XDR types.
|
|
|
|
| |
This is required because guestfs-actions.c uses 'memset'.
|
| |
|
|
|
|
|
| |
Really this should be turned into a configure-time test.
Perhaps one exists already?
|
| |
|
| |
|
|
|
|
|
| |
GODI has an odd package layout, so the generator was unable to
find xml-light. Add the GODI directory to the search path.
|
|
|
|
|
| |
On Mac OS X this prevents a short "flash" as qemu opens a
toplevel window.
|
|
|
|
|
|
|
|
|
| |
These calls allow you to query the relationship between
LVM objects, for example, which PVs contain a VG, or which
LVs are contained in a VG.
See the example / test program 'regressions/test-lvm-mapping.pl'
for an example of how to do this from Perl.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the add_drive_ro call so it adds the readonly=on option
if qemu supports that.
This just means that qemu will not try to open the drive with
O_RDWR, and should not otherwise change the behaviour of qemu or
libguestfs. (In particular, writes to the read-only drive are
still permitted, and are just discarded when the handle is closed).
However it should alleviate RHBZ#571714 where udev was deciding
to incorrectly relabel a device because we had opened the device
for writing (even though we didn't actually write to it).
|
|
|
|
|
|
|
| |
Reimplement qemu_supports() internal function. Allow it to run
before launch so we can test qemu features. Document that you
should run guestfs_set_qemu as early as possible to make sure
these tests are reliable.
|
| |
|
|
|
|
|
|
| |
Functions like guestfs__send were never exported through the public
API (libguestfs.syms prevented that). However they appeared in the
public header. Move them to the internal header.
|
|
|
|
| |
There should be no substantive change.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Change guestfish so it uses xstrtoll to parse Int (31 bit)
parameters. This fixes two bugs on 32 bit platforms which
failed when long = 32 bits. long long = 64 bits on both.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit makes the semi-independent hivex library into a
separate upstream project. The git repo for hivex is now:
http://git.annexia.org/?p=hivex.git;a=summary
Downloads of hivex are available here:
http://libguestfs.org/download/
All questions, patches, bugs etc should be sent to the libguestfs
mailing list and bug tracker.
|
| |
|
| |
|
|
|
|
|
|
|
| |
We originally intended to implement an FTP server (and before
than, an NFS server). But we didn't implement either. We
did however implement a FUSE service (guestmount) which takes
the place of both.
|
|
|
|
|
|
| |
Since we have to compile with -Wno-unused-variables, we don't
spot unused variables in code. I found these by compiling the
code in Ubuntu.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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:..)
|
|
|
|
|
|
|
| |
The command name is already being added by the RPC stubs, so
adding it again in Perl and C# just results in doubled error messages
like:
foo: foo: the error
|
|
|
|
|
|
|
|
|
|
|
| |
The default if=... comes from configure time (currently it
defaults to if=virtio).
This change allows you to set the QEMU block emulation.
We don't think this will be used very often, but virt-v2v
requires it in order to work around a subtle problem with
running 'mkinitrd' in an appliance attached to a guest.
|
| |
|
|
|
|
| |
See also RHBZ#563450 (NB: This commit does not fix the bug).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
guestfs_mount adds -o sync implicitly. This causes a very large
performance problem for write-intensive programs (eg. virt-v2v).
Document this as a "gotcha".
Change the tests, guestfish, Sys::Guestfs::Lib, guestmount to use
mount-options instead.
(Note that this gotcha does not affect mount-ro).
The source of the performance problem was first identified by
Matthew Booth.
|
|
|
|
|
|
|
|
| |
If the version of qemu being used supports -enable-kvm option,
then check if /dev/kvm is openable and add this option.
I have found this option makes no difference, although it is
*supposed* to enable KVM (hardware virtualization) support.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On some combination of installing, upgrading and removing the base
libguestfs package on x86_64, multilib can corrupt libguestfs by
leaving a copy of /usr/bin/libguestfs-supermin-helper around which
references the wrong architecture (usually, contains links to the
i386-based appliance, when the x86_64 appliance should be constructed).
This commit changes libguestfs-supermin-helper so that the script is
the same on all architectures. Instead, the library passes the
differences to the script (eg. $host_cpu). Because the i386 and
x86_64 libraries should be at different locations (/usr/lib vs
/usr/lib64) this should prevent multilib from screwing things up.
Related links:
https://bugzilla.redhat.com/show_bug.cgi?id=558593
http://rwmj.wordpress.com/2009/11/16/please-someone-shoot-multilib/#content
https://bugzilla.redhat.com/show_bug.cgi?id=235752
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Current code uses atoi to parse the generator Int type and
atoll to parse the generator Int64 type. The problem with the
ato* functions is that they don't cope with errors very well,
and they cannot parse numbers that begin with 0.. or 0x..
for octal and hexadecimal respectively.
This replaces the atoi call with a call to Gnulib xstrtol
and the atoll call with a call to Gnulib xstrtoll.
The generated code looks like this for all Int arguments:
{
strtol_error xerr;
long r;
xerr = xstrtol (argv[0], NULL, 0, &r, "");
if (xerr != LONGINT_OK) {
fprintf (stderr,
_("%s: %s: invalid integer parameter (%s returned %d)\n"),
cmd, "memsize", "xstrtol", xerr);
return -1;
}
/* The Int type in the generator is a signed 31 bit int. */
if (r < (-(2LL<<30)) || r > ((2LL<<30)-1)) {
fprintf (stderr, _("%s: %s: integer out of range\n"), cmd, "memsize");
return -1;
}
/* The check above should ensure this assignment does not overflow. */
memsize = r;
}
and like this for all Int64 arguments (note we don't need the
range check for these):
{
strtol_error xerr;
long long r;
xerr = xstrtoll (argv[1], NULL, 0, &r, "");
if (xerr != LONGINT_OK) {
fprintf (stderr,
_("%s: %s: invalid integer parameter (%s returned %d)\n"),
cmd, "size", "xstrtoll", xerr);
return -1;
}
size = r;
}
Note this also fixes an unrelated bug in guestfish handling of
RBufferOut. We were using 'fwrite' without checking the return
value, and this could have caused silent failures, eg. in the case
where there was not enough disk space to store the resulting file,
or even if the program was interrupted (but continued) during the
write.
Replace this with Gnulib 'full-write', and check the return value
and report errors.
|
|
|
|
|
| |
Returns the size of a file. You can already do this with 'stat',
but this call is good for scripting.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Best explained by the comment in the code:
/* Newer versions of qemu (from around 2009/12) changed the
* behaviour of monitors so that an implicit '-monitor stdio' is
* assumed if we are in -nographic mode and there is no other
* -monitor option. Only a single stdio device is allowed, so
* this broke the '-serial stdio' option. There is a new flag
* called -nodefaults which gets rid of all this default crud, so
* let's use that to avoid this and any future surprises.
*/
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Tested in only limited situations, with Mono on Linux.
|