| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
lua 5.2 changed API, LUA_GLOBALSINDEX is no longer available.
http://www.lua.org/manual/5.2/manual.html#8.3
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
|
|
|
|
|
| |
This adds the following new APIs:
- cap_get_file
- cap_set_file
|
|
|
|
|
|
|
| |
This adds the following new APIs:
- acl_get_file
- acl_set_file
- acl_delete_def_file
|
|
|
|
|
| |
This is just code motion. It just ensures there is no possible
conflict with lua_* symbols.
|
|
|
|
| |
This includes a test.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
See http://article.gmane.org/gmane.comp.lang.lua.general/95065
Note that this is incompatible with existing code. You
have to do:
local G = require "guestfs"
local g = G.create ()
ie. give the module your own name ("G" in that example).
|
| |
|
|
|
|
| |
Thanks Jerome Vuarand.
|
| |
|
|
|
|
|
|
| |
This is faster, but more importantly it avoids the strange error
'lua: attempt to index a string value' which appears with (some)
single element lists.
|
| |
|
| |
|
|
|
|
| |
Use luaL_checkoption which is designed for this purpose.
|
| |
|
|
|
|
|
|
|
|
|
| |
- add support for events (with test)
- test progress messages
- update documentation to describe events
- refactor handle closing code
- refactor error code
- use 'assert' in test code instead of 'if ... then error end'
|
|
|
|
| |
Use %s + strerror as a replacement.
|
|
|
|
|
|
|
|
| |
- Remove default error handler.
- User cancel.
- Add the errno to the object which is thrown on error.
Still no events.
|
|
|
|
|
|
|
|
| |
These are relatively complete, although only lightly tested. Missing:
- events
- last_errno
- user_cancel
|
|
|
|
|
|
|
|
|
|
| |
If you have a function which is in the X optgroup, and also has
IfAvailable X, then two tests for the optgroup are added to the
output.
Check for this case and give an error.
This also fixes existing APIs.
|
|
|
|
| |
No functional change.
|
|
|
|
|
|
| |
Replace the custom error handler with calls to
guestfs_{push,pop}_error_handler only where necessary. This
simplifies the generated code.
|
|
|
|
| |
This is just code motion.
|
|
|
|
| |
Just code cleanup, no functional change.
|
| |
|
|
|
|
| |
This is just whitespace changes in the output.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
guestfs_pop_error_handler.
The addition of these calls makes it much simpler to temporarily
disable or ignore errors:
guestfs_push_error_handler (g, NULL, NULL);
guestfs_mkdir (g, "/foo"); /* We don't care if this fails. */
guestfs_pop_error_handler (g);
Note these calls are used by the C API only. They are not necessary
in other languages, because those map errors to exceptions.
The subsequent commits change existing code to use push/pop instead of
laboriously saving and restoring the error handler.
|
|
|
|
| |
This fixes commit 9466060201600db47016133d80af22eb38091a49.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New APIs: set-tmpdir, get-tmpdir, set-cachedir, get-cachedir.
The current code has evolved over time and has a number of problems:
(a) A single environment variable ($TMPDIR) controls the
location of several directories.
(b) It's hard for the library user to predict which directory
libguestfs will use, unless the user simulates the same internal steps
that libguestfs performs.
This commit fixes these issues.
(a) Now three environment variables control the location of all small
temporary files, and the appliance cache:
For temporary files: $LIBGUESTFS_TMPDIR or $TMPDIR or /tmp.
For the appliance cache: $LIBGUESTFS_CACHEDIR or $TMPDIR or /var/tmp.
The user can also set these directories explicitly through API calls
(guestfs_set_tmpdir and guestfs_set_cachedir).
(b) The user can also retrieve the actual directories that libguestfs
will use, by calling guestfs_get_tmpdir and guestfs_get_cachedir.
These functions are also used internally.
This commit also:
- reworks the internal tmpdir code
- removes the internal (undocumented) guestfs_tmpdir call (replacing
it with calls to the documented guestfs_get_tmpdir API instead)
- changes the ./run script to set LIBGUESTFS_TMPDIR and
LIBGUESTFS_CACHEDIR
- adds a test
- fixes a few places like libguestfs-make-fixed-appliance which
depended on $TMPDIR
|
|
|
|
|
|
|
| |
Previously wipefs (the utility) allowed this, but it's obviously a bad
thing to do and the new wipefs gives an error if you try it:
wipefs: error: /dev/VG/LV: probing initialization failed: Device or resource busy
|
|
|
|
|
|
|
|
| |
Split the functions according to a simple hash across
C.nr_actions_files files (this number can be increased later if
necessary).
This is just code motion.
|
|
|
|
| |
This is just code motion.
|
|
|
|
| |
This is just code motion.
|
| |
|
|
|
|
|
|
| |
RWMJ:
- Fix memory leak in guestfs__inspect_list_applications wrapper.
- Don't document app2_spare* fields.
|
|
|
|
|
|
| |
This just makes it simpler to add extra fields to each struct.
This is code motion.
|
|
|
|
|
|
| |
This is currently done implicitly because of the linker script.
However in order to do symbol versioning, we will have to do
this explicitly at each definition instead.
|
|
|
|
| |
This is just code motion.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Used to create temporary directory or file with an optional suffix.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
RWMJ:
- Split this out into a new file (daemon/mktemp.c).
- I don't see a reason to deprecate the mkdtemp function which
works fine. Instead remove complex dir-making code from the
new function.
- Test and fix the patch (missing close(fd)).
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In languages like Python where we release a global lock around
long-running libguestfs functions, it is also useful to *not* release
this lock for small, non-blocking functions.
Therefore mark all functions with a 'blocking' boolean flag. It
defaults to true, and is true by definition for all daemon functions.
For non-daemon functions, I have classified them manually.
Only when the blocking flag is set do we generate the code to release
and reacquire the lock around libguestfs calls.
|
|
|
|
| |
It's wrong to use it, and in any case it doesn't do anything on Linux.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
guestfs_parse_environment_list.
Add a new function for creating a handle:
guestfs_h *guestfs_create_flags (unsigned flags [, ...]);
This variant lets you supply flags and extra arguments, although extra
arguments are not used at the moment.
Of particular interest is the ability to separate the creation of the
handle from the parsing of environment variables like
LIBGUESTFS_DEBUG. guestfs_create does both together, which prevents
us from propagating errors from parsing environment variables back to
the caller (guestfs_create has always printed any errors on stderr and
then just ignored them).
If you are interested in these errors, you can now write:
g = guestfs_create_flags (GUESTFS_CREATE_NO_ENVIRONMENT);
if (!g)
exit (EXIT_FAILURE);
r = guestfs_parse_environment (g);
if (!r)
exit (EXIT_FAILURE);
Also you can *omit* the call to guestfs_parse_environment, which
creates a handle unaffected by the environment (which was not possible
before).
This commit also includes new (backwards compatible) changes to the
OCaml, Perl, Python, Ruby and Java constructors that let you use the
flags.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit models libvirt authentication events through the API,
adding one new event (GUESTFS_EVENT_LIBVIRT_AUTH) and several new
APIs:
guestfs_set_libvirt_supported_credentials
guestfs_get_libvirt_requested_credentials
guestfs_get_libvirt_requested_credential_prompt
guestfs_get_libvirt_requested_credential_challenge
guestfs_get_libvirt_requested_credential_defresult
guestfs_set_libvirt_requested_credential
See the documentation and example which shows how to use the new API.
This commit also changes existing calls to virConnectOpen* within the
library so that the new API is used.
Also included is an example (but not a test, because it's hard to see
how to automatically test the libvirt API).
|
| |
|
|
|
|
|
| |
For more information on this topic, see:
https://www.redhat.com/archives/libguestfs/2012-October/msg00045.html
|
|
|
|
|
|
|
|
| |
New API: remove-drive.
Note because of a bug in fuser, this only works with psmisc >= 22.20.
This also updates the hotplugging tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When libvirt is used, we can allow disks to be hotplugged.
guestfs_add_drive can be called after launch to hot-add a disk.
When a disk is hot-added, we first ask libvirt to add the disk to the
appliance, then we make an internal call into the appliance to get it
to wait for the disk to appear (ie. udev_settle ()).
Hot-added disks are tracked in the g->drives array.
This also adds a test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New API: list-disk-labels
Allow the user to pass an optional disk label when adding a drive.
This is passed through to qemu / libvirt using the disk serial field,
and from there to the appliance which exposes it through udev,
creating a special alias of the device /dev/disk/guestfs/<label>.
Partitions are named /dev/disk/guestfs/<label><partnum>.
virtio-blk and virtio-scsi limit the serial field to 20 bytes. We
further limit the name to maximum 20 ASCII characters in [a-zA-Z].
list-devices and list-partitions are not changed: these calls still
return raw block device names. However a new call, list-disk-labels,
returns a hash table allowing callers to map between disk labels, and
block device and partition names.
This commit also includes a test.
|
|
|
|
|
| |
Also, remove duplicate documentation of using '/dev/null' as the
filename.
|