| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
Some of the generated files anyway.
|
|
|
|
|
| |
This will allow us to easily change the location of this
script in future.
|
| |
|
|
|
|
| |
Set MBR partition type byte accordingly.
|
|
|
|
|
|
|
|
| |
RHBZ#838081."
This reverts commit ad7c4498f66f37c4219242c6df04d28e9ee7877f.
Reverted because we still see core dumps.
|
| |
|
| |
|
|
|
|
|
| |
By using the once_had_no_optargs flag, this change is backwards
compatible for callers.
|
|
|
|
|
| |
By using the once_had_no_optargs flag, this change is backwards
compatible for callers.
|
|
|
|
|
|
| |
By using the once_had_no_optargs flag, this change is backwards
compatible for callers (except Haskell, PHP and GObject as discussed
in earlier commit).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In C, a function called 'func' which has once_had_no_optargs=true will
(because of the previous commit) generate 'func_opts' and a
backwards-compatibility function called 'func'.
This commit changes some of the non-C bindings so that they also
generate 'func_opts' which is merely a wrapper that calls 'func'.
This avoids incompatibility when we rename 'mkfs_opts' etc back to
plain 'mkfs', and it also makes it easier to translate between other
language bindings and C code.
NB: Some bindings do not include aliases:
PHP: There's no way to easily alias methods in PHP < 5.3, and we
can't assume everyone has this minimum version.
GObject: Very complex to add aliases, but we should probably do this
at some point.
Haskell: No support for optargs in these bindings. Unfortunately
this means that we can no longer bind 'Guestfs.add_drive'
(since it will be changed to add optional arguments) making
the Haskell bindings even less useful than they were already.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds a flag (once_had_no_optargs) which can be used to add
optargs to functions that currently don't have any.
The idea is that if 'func' currently has no optargs, we can safely add
optargs provided we are backwards compatible for existing callers.
In C that means we leave 'guestfs_func' alone and provide an extra
function 'guestfs_func_opts' that takes the optargs ('guestfs_func'
becomes a wrapper that calls 'guestfs_func_opts').
In the C generator this means there are two names for each function
(although the two names are normally identical). 'c_name' is the name
that we export publicly (eg. [guestfs_] 'func_opts'). 'name' is the
internal name of the function (eg. 'func') which is used for
everything apart from the public interface, and also to generate the
no-optargs compat function.
In other languages that can add optional arguments safely, we simply
add the arguments to the existing 'func', so for example in Perl:
$g->func (required_args)
$g->func (required_args, optional_args)
can be used.
Note that this commit does not cause any change to the output of the
generator. I verified this by diffing the output before and after.
|
|
|
|
|
| |
This is just code motion. I verified this by comparing the
generator output before and after this commit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For example the existing method:
public void mkfs_opts (String fstype, String device, Map<..> optargs);
is now accompanied by this overloaded method which is a simple wrapper:
public void mkfs_opts (String fstype, String device)
throws LibGuestFSException
{
mkfs_opts (fstype, device, null);
}
|
|
|
|
| |
This updates commit 9286f556c6a9e6967fcac8aacdae3660821c4c7a.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This field, which is generated internally by the generator, is the
name of the C function corresponding to each action.
For actions that have NO optional arguments, it's just "guestfs_<name>".
For actions that have any optional arguments, it is
"guestfs_<name>_argv" (since any binding has to construct the optional
argument struct explicitly).
In a future commit, this mapping may become more complex.
This commit also "fixes" the C# bindings which didn't handle optional
arguments properly at all. In fact, it doesn't fix this, it just
changes it enough that it probably now compiles. We should either
compile and test the bindings routinely with Mono, or drop them, since
they are starting to bit-rot.
In the GObject bindings, I have added a space between the C function
name and the first paren.
Apart from the C# and GObject changes, this is just code motion. It
was verified by diffing the output of the generator before and after.
|
|
|
|
|
|
|
|
| |
Store the camel-case name directly in the struct instead
of generating it on the fly in only the GObject bindings.
This is just code motion. Tested by verifying that the generator
output is identical.
|
|
|
|
|
| |
The internal_* prefix is reserved for internal functions
such as these tests.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each action changes from a tuple like this:
("cat", (RString "content", [Pathname "path"], []), 4,
[ProtocolLimitWarning],
[InitISOFS, Always, TestOutput (
[["cat"; "/known-2"]], "abcdef\n")],
"list the contents of a file",
"[...]");
to a slightly longer but more readable struct:
{ defaults with
name = "cat";
style = RString "content", [Pathname "path"], [];
proc_nr = Some 4;
protocol_limit_warning = true;
tests = [
InitISOFS, Always, TestOutput (
[["cat"; "/known-2"]], "abcdef\n")
];
shortdesc = "list the contents of a file";
longdesc = "[...]" };
["defaults" is a struct which contains the defaults for every field,
allowing us to use the "{ defaults with ... }" syntax to just update
the fields we want to be different from the defaults.]
This is a mechanical change and there is no change to the output of
the generator. I checked the output before and after with diff to
verify this. There are no changes in the output apart from UUIDs
which are expected to change with each run.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This fixes commit f9a5e3ed86ee7bcd13619f13b4d4de6ce46ac8c3.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
See also:
https://bugzilla.redhat.com/show_bug.cgi?id=835466#c9
|
| |
|
|
|
|
|
|
| |
This reverts commit 6e5a85bb9b6557bc337625a339728e23f5f2dd94.
It turns out this is a bug in QEMU after all.
|
| |
|
|
|
|
|
|
|
| |
https://bugs.launchpad.net/qemu/+bug/1021649 is invalid, probably
caused by a Fedora ROM.
This updates commit 52d188e32fb8addb45bf926df07e34ab35898f85.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Earlier versions of qemu contained a bug in the qcow2 code which
causes qemu to segfault when shutting down and flushing its internal
cache, and this can result in data loss.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new API splits orderly close into a two-step process:
if (guestfs_shutdown (g) == -1) {
/* handle the error, eg. qemu error */
}
guestfs_close (g);
Note that the explicit shutdown step is only necessary in the case
where you have made changes to the disk image and want to handle write
errors. Read the documentation for further information.
This change also:
- deprecates guestfs_kill_subprocess
- turns guestfs_kill_subprocess into the same as guestfs_shutdown
- changes guestfish and other tools to call shutdown + close
where necessary (not for read-only tools)
- updates documentation
- updates examples
|
|
|
|
|
| |
Currently guestfs_close has no method to return an error indication,
so this commit simply prints the error on stderr.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The order is now:
- remove the handle from the list of handles
- send close trace message
- sync and shutdown qemu
- run user close callback
- free temporary directory
- free memory
This commit ought to be no functional change.
|
|
|
|
|
|
|
| |
Make the comments consistent.
Also make the Perl example call $g->close explicitly so it is
consistent with the other examples.
|
|
|
|
|
| |
This is now set by default in all supported versions of libguestfs.
It's just confusing if the examples refer to it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Linux, sync(2) does not actually issue a write barrier, thus it
doesn't force a flush of the underlying hardware write cache (or
qemu's disk cache in the virtual case).
This can be a problem, because libguestfs relies on running sync in
the appliance, followed by killing qemu (using SIGTERM).
In most cases, this is fine, because killing qemu with SIGTERM should
cause it to flush out the disk cache before it exits. However we have
found various bugs in qemu which cause qemu to crash while doing the
flush, leaving the data unwritten (see RHBZ#836913).
The solution is to issue fsync(2) to the block devices. This has a
write barrier, so it ensures that qemu writes out its cache long
before we get around to killing qemu.
|