Displaying 20 results from an estimated 126 matches for "guestfs_last_error".
2014 Mar 18
2
[PATCH 1/2] php: make the test suite failures fatal
So far the failure of some test would have not reported a non-zero
return value by run-tests.php. Since now all the PHP tests pass, we can
ask for failures to be fatal, by exporting REPORT_EXIT_STATUS=1 for
run-tests.php.
---
php/run-php-tests.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/php/run-php-tests.sh b/php/run-php-tests.sh
index 6f9ae10..e498987 100755
---
2016 Apr 11
1
[PATCH] RFC: php: support PHP 7
...191,7 +234,11 @@ PHP_FUNCTION (guestfs_create)
guestfs_set_error_handler (g, NULL, NULL);
+#if ZEND_MODULE_API_NO >= 20151012
+ ZVAL_RES(return_value, zend_register_resource(g, res_guestfs_h));
+#else
ZEND_REGISTER_RESOURCE (return_value, g, res_guestfs_h);
+#endif
}
PHP_FUNCTION (guestfs_last_error)
@@ -204,15 +251,15 @@ PHP_FUNCTION (guestfs_last_error)
RETURN_FALSE;
}
- ZEND_FETCH_RESOURCE (g, guestfs_h *, &z_g, -1, PHP_GUESTFS_HANDLE_RES_NAME,
- res_guestfs_h);
+ GUESTFS_ZEND_FETCH_RESOURCE (g, guestfs_h *, z_g,
+ PHP_GUES...
2016 Feb 12
0
[PATCH] php: restructure and expand tests
...unction with optional arguments.
+--FILE--
+<?php
+$g = guestfs_create ();
+if ($g == false) {
+ echo ("Failed to create guestfs_php handle.\n");
+ exit;
+}
+if (guestfs_add_drive ($g, "/dev/null") == false) {
+ echo ("Failed add_drive, no optional arguments: " . guestfs_last_error ($g) . "\n");
+ exit;
+}
+if (guestfs_add_drive ($g, "/dev/null", 0) == false) {
+ echo ("Failed add_drive, one optional argument: " . guestfs_last_error ($g) . "\n");
+ exit;
+}
+if (guestfs_add_drive ($g, "/dev/null", 1) == false) {
+ echo (&q...
2015 Feb 10
4
[PATCH 1/4] php: fix invalid memory access with OptString
...L char* variable before
checking its length.
---
generator/php.ml | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/generator/php.ml b/generator/php.ml
index 0ef6541..1384451 100644
--- a/generator/php.ml
+++ b/generator/php.ml
@@ -192,11 +192,13 @@ PHP_FUNCTION (guestfs_last_error)
| String n | Device n | Mountable n | Pathname n
| Dev_or_Path n | Mountable_or_Path n
| FileIn n | FileOut n | Key n
- | OptString n
| BufferIn n
| GUID n ->
pr " char *%s;\n" n;
pr " int %s_size;\n&...
2010 Sep 11
1
Remaining syntax-check errors
..._of_x_alloc_return_value
0.05 cast_of_x_alloc_return_value
changelog
0.02 changelog
const_long_option
0.04 const_long_option
copyright_check
0.20 copyright_check
cross_check_PATH_usage_in_tests
0.01 cross_check_PATH_usage_in_tests
error_message_period
php/README-PHP:33: echo ("Error: ".guestfs_last_error ($g)."\n");
php/README-PHP:44: echo ("Error: ".guestfs_last_error ($g)."\n");
php/extension/guestfs_php_002.phpt:15: echo ("Error: ".guestfs_last_error ($g)."\n");
php/extension/guestfs_php_002.phpt:19: echo ("Error: ".guestfs_last_er...
2017 Jun 27
9
[PATCH v3 0/5] threads: Add support for thread-safe handle.
...e/msg00118.html
I have rebased and tidied up the patches, fixing a few spelling
mistakes, but they are broadly the same as before. I also ran all the
tests, which pass.
As with the previous versions, this makes a change to the API, where
you can no longer pass a handle between threads and expect
guestfs_last_error() to work. I'm somewhat more sanguine about this
change, since using the API like that is abstruse and no one should be
expecting that to have worked.
Rich.
2016 Jun 08
1
[PATCH] filesystems: don't try to get the size of btrfs subvolume
...guestfs_mountable_subvolume (g, fses[i]);
+ if (subvolume == NULL && guestfs_last_errno (g) != EINVAL) {
+ fprintf (stderr,
+ _("%s: cannot determine the subvolume for %s: %s (%d)\n"),
+ guestfs_int_program_name, fses[i],
+ guestfs_last_error (g), guestfs_last_errno (g));
exit (EXIT_FAILURE);
+ }
+
+ guestfs_pop_error_handler (g);
+
+ if (!device || !subvolume) {
+ size = guestfs_blockdev_getsize64 (g, fses[i]);
+ if (size == -1)
+ exit (EXIT_FAILURE);
+ }
}
if (is_md (fses...
2012 Dec 14
3
inspect_os error with Win7 image
...;hivex-open' first to
initialize the hivex handle
This is the process flow:
g = guestfs_create ();
guestfs_add_drive_opts (g, diskFile,GUESTFS_ADD_DRIVE_OPTS_FORMAT,
"raw",-1);
guestfs_launch (g)
char **roots = guestfs_inspect_os (g);
guestfs_inspect_os returns NULL, guestfs_last_error(g) returns message above.
And guestfs_last_errno(g) returns 0.
However this same code works fine with a Server2008 image and an XP image.
I copied the verbose output to pastebin: http://pastebin.com/U9Jb6JwH
Suggestions?
2015 Jun 06
7
[PATCH 0/5] Add support for thread-safe handle.
This patch isn't ready to go upstream. In fact, I think we might do a
quick 1.30 release soon, and save this patch, and also the extensive
changes proposed for the test suite[1], to after 1.30.
Currently it is not safe to use the same handle from multiple threads,
unless you implement your own mutexes. See:
http://libguestfs.org/guestfs.3.html#multiple-handles-and-multiple-threads
These
2013 Feb 12
7
Remaining btrfs patches
[PATCH 1/7] mount: Add mount_vfs_nochroot
This is significantly reworked from before. umount is gone as
discussed, and variable motion is minimised.
[PATCH 2/7] btrfs: Update btrfs_subvolume_list to take
Already provisionally ACKed. Previous comment was that cleanup could
be tidier. I looked into creating a new cleanup function for fs_buf,
but it isn't possible (or simple, anyway) in this
2015 Jun 16
5
[PATCH threads v2 0/5] Add support for thread-safe handle.
Previous discussion here:
https://www.redhat.com/archives/libguestfs/2015-June/thread.html#00048
v2:
- Use a cleanup handler to release the lock.
- Rebase to upstream.
Note I have not fixed the problem(s) with error handling (patch 3).
2015 Jun 11
1
Re: [PATCH 2/5] threads: Acquire and release the lock around each public guestfs_* API.
Hi,
On Saturday 06 June 2015 14:20:38 Richard W.M. Jones wrote:
> Since each ACQUIRE_LOCK/RELEASE_LOCK call must balance, this code is
> difficult to debug. Enable DEBUG_LOCK to add some prints which can
> help.
There's some way this could be simplified:
> const char *
> guestfs_last_error (guestfs_h *g)
> {
> - return g->last_error;
> + const char *r;
> +
> + ACQUIRE_LOCK (g);
> + r = unlocked_last_error (g);
> + RELEASE_LOCK (g);
> + return r;
> +}
(picking this because it is the first ACQUIRE_LOCK ... RELEASE_LOCK
pattern in the patch)
there c...
2016 Mar 02
1
[PATCH] make-fs: print error message on mkfs failure
...e (RHBZ#823883). */
- fprintf (stderr, "%s: 'mkfs' (create filesystem) operation failed.\n",
- guestfs_int_program_name);
+ fprintf (stderr, "%s: 'mkfs' (create filesystem) operation failed: %s\n",
+ guestfs_int_program_name, guestfs_last_error (g));
if (STREQ (type, "fat"))
fprintf (stderr, "Instead of 'fat', try 'vfat' (long filenames) or 'msdos' (short filenames).\n");
else
--
2.5.0
2016 Jun 15
1
[PATCH v2] filesystems: don't try to get the size of btrfs subvolume
...guestfs_mountable_subvolume (g, fses[i]);
+ if (subvolume == NULL && guestfs_last_errno (g) != EINVAL) {
+ fprintf (stderr,
+ _("%s: cannot determine the subvolume for %s: %s: %s\n"),
+ guestfs_int_program_name, fses[i],
+ guestfs_last_error (g),
+ strerror (guestfs_last_errno (g)));
exit (EXIT_FAILURE);
+ }
+
+ guestfs_pop_error_handler (g);
+
+ if (!device || !subvolume) {
+ size = guestfs_blockdev_getsize64 (g, fses[i]);
+ if (size == -1)
+ exit (EXIT_FAILURE);
+ }...
2017 Jul 10
2
Re: [PATCH v3 3/5] threads: Use thread-local storage for errors.
On Tuesday, 27 June 2017 13:55:57 CEST Richard W.M. Jones wrote:
> We permit the following constructs in libguestfs code:
>
> if (guestfs_some_call (g) == -1) {
> fprintf (stderr, "failed: error is %s\n", guestfs_last_error (g));
> }
>
> and:
>
> guestfs_push_error_handler (g, NULL, NULL);
> guestfs_some_call (g);
> guestfs_pop_error_handler (g);
>
> Neither of these would be safe if we allowed the handle to be used
> from threads concurrently, since the error string or error h...
2020 Oct 09
2
Re: [PATCH v3 8/8] lib/canonical-name.c: Hide EINVAL error from underlying API call.
...+ ret = safe_strdup (g, device);
> + else
> + /* Make sure the original error gets pushed through the
> + * error handlers.
> + */
> + guestfs_int_error_errno (g, guestfs_last_errno (g),
> + "%s", guestfs_last_error (g));
> + }
> }
> else
> ret = safe_strdup (g, device);
>
> ---
>
> Current upstream:
>
> $ guestfish scratch 1M : run : canonical-device-name "/dev/dm-999"
> libguestfs: error: lvm_canonical_lv_name: stat: /dev/dm-999: No such file or dir...
2020 Oct 09
3
Re: [PATCH v3 8/8] lib/canonical-name.c: Hide EINVAL error from underlying API call.
On Thu, Sep 17, 2020 at 01:40:04PM +0100, Richard W.M. Jones wrote:
>When guestfs_lvm_canonical_lv_name was called with a /dev/dm* or
>/dev/mapper* name which was not an LV then a noisy error would be
>printed. This would typically have happened with encrypted disks, and
>now happens very noticably when inspecting Windows BitLocker-
>encrypted guests.
>
>Using the modified
2015 Jun 11
2
Re: [PATCH 3/5] threads: Use thread-local storage for errors.
On Sat, Jun 06, 2015 at 02:20:39PM +0100, Richard W.M. Jones wrote:
> We permit the following constructs in libguestfs code:
>
> if (guestfs_some_call (g) == -1) {
> fprintf (stderr, "failed: error is %s\n", guestfs_last_error (g));
> }
>
> and:
>
> guestfs_push_error_handler (g, NULL, NULL);
> guestfs_some_call (g);
> guestfs_pop_error_handler (g);
>
> Neither of these would be safe if we allowed the handle to be used
> from threads concurrently, since the error string or error h...
2014 Sep 23
0
[PATCH 11/13] syntax-check: fix prohibit_undesirable_word_seq check
...make a inconvenient
(22 bugs)
diff --git a/guestfs-release-notes.pod b/guestfs-release-notes.pod
index a956c87..02c293c 100644
--- a/guestfs-release-notes.pod
+++ b/guestfs-release-notes.pod
@@ -2199,7 +2199,7 @@ the git repository, or the ChangeLog file distributed in the tarball.
- 811650 guestfs_last_error not set when qemu fails early during launch
- 811649 libguestfs cannot open disk images which are symlinks to files that contain ':' (colon) character
- 811117 [RFE][virt-sysprep] net-hwaddr not removed from "ifcfg-*" files on rhel
- - 811112 [RFE][virt-sysprep] hostname can n...
2009 Aug 31
1
two small patches to appease clang/llvm static analysis
...e with attribute noreturn.
---
src/guestfs.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/guestfs.h b/src/guestfs.h
index f2e108b..6412a53 100644
--- a/src/guestfs.h
+++ b/src/guestfs.h
@@ -41,7 +41,7 @@ extern void guestfs_close (guestfs_h *g);
extern const char *guestfs_last_error (guestfs_h *g);
typedef void (*guestfs_error_handler_cb) (guestfs_h *g, void *data, const char *msg);
-typedef void (*guestfs_abort_cb) (void);
+typedef void (*guestfs_abort_cb) (void) __attribute__((__noreturn__));
extern void guestfs_set_error_handler (guestfs_h *g, guestfs_error_handler_cb c...