| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Don't pollute the public header file with these macros.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
*/
|
|
|
|
| |
This updates commit a59dcdbd1b0a28c960e3792165a13f2daf4f6c35.
|
|
|
|
|
|
|
| |
List applications with epoch, release and arch data.
If epoch is 0, don't store this as an empty string, but as
undefined, and don't output empty <epoch/> element in the XML.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Tested in only limited situations, with Mono on Linux.
|
| |
|
|
|
|
|
|
|
|
| |
These manual pages have for a very long time 'lived' in the top
source directory.
Clean up this situation by moving those manual pages (plus associated
generated files) into the src/ and fish/ subdirectories respectively.
|
| |
|
|
|
|
| |
This makes the code simpler, shorter and less error-prone.
|
|
|
|
|
| |
The licenses are "any later version", so reflect this in the
naming of the parameter to generate_header.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This commit combines the previously separate "inspector_generator.ml"
program which generated bindings for virt-inspector.
Having two separate programs caused no end of troubles for developers,
so we now combine them into a single program.
NOTE: OCaml xml-light is now *required* in order to rebuild the
generated code.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The libbfd library has a constantly changing, non-standard and
very long name, eg:
/usr/lib64/libbfd-2.20.51.0.2-7.fc13.so
Just add a special case to deal with this. This fixes the guestfs_strings
command, which relies on the external strings binary which uses this
library.
|
| |
|
|
|
|
| |
This fixes commit cada248a53858341c91f70392e8f5b6e47d9b4fe.
|
|
|
|
|
| |
The first 'ls' command was failing, so the second 'ls' command
would never run at all.
|
|
|
|
|
| |
* cfg.mk (_submodule_hash): Also filter out "+".
* autogen.sh: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit uses the Gnulib 'lock' module to implement a mutex on
the global list of handles which is stored by the library.
Note that Gnulib nicely avoids explicitly linking with -lpthread
unless the application program itself links to -lpthread. Locks
are only enabled in multithreaded applications.
$ ldd src/.libs/libguestfs.so.0.217.0
linux-vdso.so.1 => (0x00007fffcb7ff000)
libc.so.6 => /lib64/libc.so.6 (0x00007f96a4e6c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f96a544d000)
Please enter the commit message for your changes. Lines starting
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows you to save the errno from a previous call and
pass it to reply_with_perror.
For example, original code:
r = some_system_call ();
err = errno;
do_cleanup ();
errno = err;
if (r == -1) {
reply_with_perror ("failed");
return -1;
}
can in future be changed to:
r = some_system_call ();
err = errno;
do_cleanup ();
if (r == -1) {
reply_with_perror_errno (err, "failed");
return -1;
}
|
| |
|
|
|
|
|
|
| |
This just ensures that we accurately report errors, even if our
error path code doesn't set errno. We won't end up with a bogus
errno left over from a previous call.
|
| |
|
| |
|