| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Note this is not a "chkdsk" equivalent tool.
|
|
|
|
|
|
|
| |
Add a flag "ConfigOnly" to make sure that some non-daemon functions
should be called only at CONFIG state (RHBZ#796520).
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For stubs of functions that had arguments, code did this:
static void
mount_stub (XDR *xdr_in)
{
int r;
struct guestfs_mount_args args;
if (optargs_bitmask != 0) {
//...
goto done;
}
// possibly other tests here
memset (&args, 0, sizeof args);
[...]
done:
xdr_free ((xdrproc_t) xdr_guestfs_mount_args, (char *) &args);
return;
}
This caused xdr_free to be called on uninitialized 'args' struct,
causing a segfault.
The fix is to add another label, so the code looks like:
static void
mount_stub (XDR *xdr_in)
{
int r;
struct guestfs_mount_args args;
if (optargs_bitmask != 0) {
//...
goto done_no_free;
}
// possibly other tests here
memset (&args, 0, sizeof args);
[...]
done:
xdr_free ((xdrproc_t) xdr_guestfs_mount_args, (char *) &args);
done_no_free:
return;
}
This fixes commit 330fbea5b2d6bd7db84f7ea7afe87cf1bcd438e0
and commit 0344248af55802bbbd816b349ec1ba9305996f6e.
|
|
|
|
| |
This fixes commit a2b3e0900ee14e5a49d526c24e22edefc3030f99.
|
|
|
|
|
|
|
| |
Add the new api wipefs to erase the filesystem signatures
on a device but now erase any data.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Callers are supposed to use the availability API to check for
functions that may not be available in particular builds of
libguestfs. If they don't do this, currently they tend to get obscure
error messages, eg:
libguestfs: error: zerofree: /dev/vda1: zerofree: No such file or directory
This commit changes the error message to explain what callers ought to
be doing instead:
libguestfs: error: zerofree: feature 'zerofree' is not available in this
build of libguestfs. Read 'AVAILABILITY' in the guestfs(3) man page for
how to check for the availability of features.
This patch makes the stubs check for availability. The stub code
changes to:
static void
zerofree_stub (XDR *xdr_in)
{
[...]
/* The caller should have checked before calling this. */
if (! optgroup_zerofree_available ()) {
reply_with_error ("feature '%s' is not available in this\n"
"build of libguestfs. Read 'AVAILABILITY' in the guestfs(3) man page for\n"
"how to check for the availability of features.",
"zerofree");
goto done;
}
[...]
|
| |
|
|
|
|
|
| |
This change binds guestfs_close(). It consequently results in RConstOptString
being able to throw an error.
|
|
|
|
|
|
|
|
|
|
|
| |
RConstOptString cannot return an error in the C api. This makes it a special
case for the GObject api, as all other return types have a corresponding GError
**err argument to return an error. This change removes this special case, and
includes the possibility of an error return in the API. An error is indicated by
setting *err to a non-NULL value.
This change is in preparation for adding a close api. An attempt to call any
api, even RConstOptString, on a closed handle must return an error.
|
|
|
|
|
|
| |
function_entry was left over from PHP 3.
See: http://news.php.net/php.pecl.dev/7123
|
|
|
|
|
|
|
|
| |
Note that this change disables compiling and running the haskell bindtests. The
haskell bindings do not implement optargs, and adding optargs to test0 causes
that method not to be bound in the haskell bindings. This prevents the haskell
bindtests from compiling. These should be re-enabled when optargs are
implemented.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We can make a good guess at camel case names for most APIs. For example,
add_drive_opts can be automatically transformed to AddDriveOpts. However, other
apis don't produce a satisfactory name when transformed automatically. For
example, we would want md_create to produce MDCreate rather than MdCreate.
This change adds a CamelName flag which allows a camel case name to be specified
explicitly when the automatic transformation isn't satisfactory.
|
|
|
|
|
|
| |
We were passing the name of the last argument directly to va_start. However, if
the last argument is a BufferIn it expands to 2 arguments, the latter of which
is <name>_size.
|
|
|
|
| |
Fixup the existing test, and add an entry in actions so it's actually generated.
|
| |
|
| |
|
|
|
|
| |
This reverts commit 83c20f02dc0e97b098e9de837839a3f4a4416129.
|
|
|
|
| |
Update all copyright dates to 2012.
|
|
|
|
| |
http://gcc.gnu.org/wiki/Visibility
|
|
|
|
|
|
| |
However since the OCaml bindings use guestfs_safe_strdup and
guestfs_safe_memdup we need to export those two (in the private
functions section) from <guestfs.h>.
|
|
|
|
|
|
| |
Previously, passing NULL optargs to an _argv call resulted in a segfault. This
change causes NULL optargs to be interpreted as no optargs, and to be correctly
handled accordingly.
|
| |
|
|
|
|
|
|
|
|
|
| |
Currently any api which takes a FileIn or FileOut parameter is implicitly
cancellable. This change make cancellable an explicit flag in anticipation of it
being added to other apis.
Note that a Cancellable function must be able to return an error, which means it
can't return RConstOptString.
|
|
|
|
|
|
|
|
|
|
| |
We can make a good guess at camel case names for most APIs. For example,
add_drive_opts can be automatically transformed to AddDriveOpts. However, other
apis don't produce a satisfactory name when transformed automatically. For
example, we would want md_create to produce MDCreate rather than MdCreate.
This change adds a CamelName flag which allows a camel case name to be specified
explicitly when the automatic transformation isn't satisfactory.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
m: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Add a new api e2fsck with two options:
correct: same as '-p' option of e2fsck
forceall: same as '-y' option of e2fsck
Thanks for Rich's idea.
v1->v2: use optargs_bitmask
v2->v3: change the optargs_bitmask check
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
|
|
|
|
|
| |
Remove generated .depend files from source control, and don't barf when they
don't exist while bootstrapping.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, optional arguments had the same type as regular arguments, but were
constrained by various runtime tests to be only Bool, Int, Int64 or String. This
change makes the type of optional arguments stronger by giving them their own
type.
A convenience function, optargs_to_args is defined to convert optargs in the few
places where they are genuinely treated identically to mandatory arguments.
It also allows for future changes to optional arguments which do not affect
mandatory arguments.
RWMJ:
- removed redundant parens
- readded the check for > 64 optargs, but changed it to > 63
- changed the new function to args_of_optargs
|
|
|
|
|
| |
This map was originally included just for the java bindings, but is generally
useful to any binding which uses camel case by requirement or convention.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Add 'event', 'list-events' and 'delete-event' commands so that event
handlers can be registered, listed and deleted in guestfish. The
event handler is a shell script snippet or host command.
Cc: Pádraig Brady <P@draigBrady.com>
|
|
|
|
|
|
|
|
|
|
| |
This also adds comprehensive tests for utimens on regular files,
directories (RHBZ#761451), named pipes (RHBZ#761460), symbolic links,
block and char devices.
Note that there is a small change in the (previously undefined)
semantics of this call: It now sets the time on a symbolic link
itself, not on what the symbolic link points to.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
A NEW API blkid.
It can print the device attributes.
Use it after list-devices, we can list ower devices and the attributes
of each device.
Use it like:
blkid <device>
It's should be a usefull function.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
|
| |
|
| |
|
|
|
|
|
|
|
| |
RBufferOut binding didn't free the buffer after copying it onto
the OCaml heap.
Found by valgrind.
|
| |
|
|
|
|
| |
This cleans up commit cbd1c45d95c530c8d94103dcc2c521bf5501ef59.
|
|
|
|
|
|
|
|
| |
This API is used to stop a md device.
When we want to move a device to another md array, we should
stop the md device which contained this device first.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
|
|
|
|
|
|
|
|
|
| |
This change renames the following 2 apis:
* mdadm_create -> md_create
* mdadm_detail -> md_detail
This is more consistent with list_md_devices, and removes a reference to an
implementation detail from the api.
|
| |
|
|
|
|
|
|
|
|
|
| |
eg:
static void
run_foo ()
{
}
|
| |
|
|
|
|
|
|
|
| |
Return a list of Linux MD devices detected in the guest.
This API complements list_devices, list_partitions, list_lvs and
list_dm_devices.
|
| |
|