search for: guestfs_close

Displaying 20 results from an estimated 183 matches for "guestfs_close".

2018 Feb 28
0
[PATCH] lib: Don't abort if a signal handler calls exit(2) during a guestfs_* function.
$ virt-sparsify input output [ 0.0] Create overlay file in /tmp to protect source disk [ 0.0] Examine source disk ^C guestfs_close: g->lock: Device or resource busy Aborted (core dumped) The reason for this is because virt-sparsify calls exit(2) in the SIGINT signal handler, which causes the close_handles atexit handler to run, which calls guestfs_close. However the same handle is in the middle of a guestfs_* call, and th...
2012 Jul 03
8
[PATCH 0/7 v2] Fix and workaround for qcow2 issues in qemu causing data corruption.
https://bugzilla.redhat.com/show_bug.cgi?id=836710 https://bugzilla.redhat.com/show_bug.cgi?id=836913 There are at least two related bugs going on: (1) Linux sync(2) system call doesn't send a write barrier to the disk, so in effect it doesn't force the hard disk to flush its cache. libguestfs used sync(2) to force changes to disk. We didn't expect that qemu was caching anything
2009 Aug 22
1
[PATCH] Add waitpid along guestfs_close path (RHBZ#518747)
...tp://et.redhat.com/~rjones/libguestfs/recipes.html -------------- next part -------------- >From 0abb1ec2b3f0e1f482f93b1c8b3d2ef59bc0321e Mon Sep 17 00:00:00 2001 From: Richard Jones <rjones at trick.home.annexia.org> Date: Sat, 22 Aug 2009 10:40:42 +0100 Subject: [PATCH] Add waitpid along guestfs_close path (RHBZ#518747). --- src/guestfs.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/guestfs.c b/src/guestfs.c index 04bd4e8..204125b 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -348,6 +348,10 @@ guestfs_close (guestfs_h *g) g->fd[1] = -1; g->soc...
2011 Apr 29
3
running libguestfs as a service?
Hello, First off, many thanks for libguestfs... very useful! I'm trying to run libguestfs as an RPC service by using a python daemon with the python libguestfs bindings. With this service I'm "centrally" editing VM images, and often running many GuestFS() on the same image file in a short amount of time to edit the image's contents. The problem I'm running across is
2015 Oct 02
1
[PATCH] ruby: improve rdoc markup
...guestfs.org/guestfs.3.html#guestfs_create_flags] * to create a new libguestfs handle. The handle is represented in * Ruby as an instance of the Guestfs::Guestfs class. */ @@ -235,7 +235,7 @@ ruby_guestfs_create (int argc, VALUE *argv, VALUE module) * g.close() -> nil * * Call - * +guestfs_close+[http://libguestfs.org/guestfs.3.html#guestfs_close] + * {guestfs_close}[http://libguestfs.org/guestfs.3.html#guestfs_close] * to close the libguestfs handle. */ static VALUE @@ -258,7 +258,7 @@ ruby_guestfs_close (VALUE gv) * g.set_event_callback(cb, event_bitmask) -> event_handle *...
2009 Aug 21
2
how to clear <defunct> qemu-system-x86 processes
Hi all, I have a long term running program which call libguestfs to check VM images. but i found that each time after i call guestfs_close(), the qeum-system-x86 process which is forked by libguestfs changes to <defunct> process. as docs of guestfs_close said "This closes the connection handle and frees up all resources used.", so this is a bug or is there any other way to clear them. thanks a lot! -------------...
2013 Dec 23
1
[PATCH] tests/mountable: skip if btrfs is not available
...quot;, NULL }; g = guestfs_create (); if (g == NULL) { @@ -48,6 +49,18 @@ main (int argc, char *argv[]) if (guestfs_launch (g) == -1) goto error; + if (!guestfs_feature_available (g, (char **) feature)) { + printf ("skipping test because btrfs is not available\n"); + guestfs_close (g); + exit (77); + } + + if (!guestfs_filesystem_available (g, "btrfs")) { + printf ("skipping test because btrfs filesystem is not available\n"); + guestfs_close (g); + exit (77); + } + if (guestfs_part_disk (g, "/dev/sda", "mbr") == -1) g...
2013 Dec 23
2
[PATCH] tests/mountable: skip if btrfs is not available
...quot;, NULL }; g = guestfs_create (); if (g == NULL) { @@ -48,6 +49,12 @@ main (int argc, char *argv[]) if (guestfs_launch (g) == -1) goto error; + if (!guestfs_feature_available (g, (char **) feature)) { + printf ("skipping test because btrfs is not available\n"); + guestfs_close (g); + exit (77); + } + if (guestfs_part_disk (g, "/dev/sda", "mbr") == -1) goto error; if (guestfs_pvcreate (g, "/dev/sda1") == -1) goto error; -- 1.8.3.1
2013 Jul 17
2
Redirecting libguestfs error messages
Hi, When I register a callback for events with this function call: eh = guestfs_set_event_callback(g, message_callback, GUESTFS_EVENT_ALL, 0, dev); Shouldnt it capture and redirect messages like this to message_callback(): "libguestfs: error: lstat: /.Trash: No such file or directory" I still get them in stderr .. Thanks, Or
2017 Mar 03
5
[PATCH v2 0/4] Avoid 0-bytes malloc in bindings
Hi, some of the bindings may try to malloc with 0 bytes as size when closing an handle, because there were no event handlers registered. Since this can have different behaviours in POSIX, avoid that situation altogether by just skipping allocating anything when there were no event handlers. Thanks, Pino Toscano (4): ocaml: do not try to malloc 0 elements in get_all_event_callbacks python:
2018 Mar 01
7
[PATCH v3 0/6] v2v: Add -o rhv-upload output mode.
v2 -> v3: - Lots of code cleanups. - Documentation. However this is still spooling the file into a temporary before the upload. It turns out that fixing this is going to require a small change to qemu. Rich.
2023 Jun 27
4
[PATCH libguestfs 0/4] Fix ups for OCaml 5
No action required here as I have pushed this already, this is just for your information. Rich.
2013 Jan 24
2
[PATCH 1/2] lib: Add CLEANUP_FREE macro which automatically calls 'free' when leaving scope.
...void guestfs___defer_free (guestfs_h *g, void (*freefn) (void *), void *data); +#endif + /* errors.c */ extern void guestfs___init_error_handler (guestfs_h *g); diff --git a/src/handle.c b/src/handle.c index 39e30c7..8cf7a40 100644 --- a/src/handle.c +++ b/src/handle.c @@ -253,6 +253,9 @@ void guestfs_close (guestfs_h *g) { struct qemu_param *qp, *qp_next; +#ifndef HAVE_ATTRIBUTE_CLEANUP + struct deferred_free *dfp, *dfp_next; +#endif guestfs_h **gg; if (g->state == NO_HANDLE) { @@ -324,6 +327,18 @@ guestfs_close (guestfs_h *g) while (g->error_cb_stack) guestfs_pop_error_han...
2018 Jun 15
1
[PATCH] fuse: fix build when not available
...FUSE support, so guard it in a proper #ifdef block. Fixes commit 296370fb86e96eec095d86faf6de8f532395ea54. --- lib/handle.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/handle.c b/lib/handle.c index bc45d29b2..a47aaafab 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -399,7 +399,9 @@ guestfs_close (guestfs_h *g) free (g->hv); free (g->backend); free (g->backend_data); +#if HAVE_FUSE free (g->localmountpoint); +#endif guestfs_int_free_string_list (g->backend_settings); free (g->append); guestfs_int_free_error_data_list (g); -- 2.17.1
2019 Jun 27
0
[PATCH 2/9] Rust bindings: Add create / close functions
...er CStyle LGPLv2plus; \ No newline at end of file + generate_header CStyle LGPLv2plus; + + pr " +#[allow(non_camel_case_types)] +enum guestfs_h {} + +extern \"C\" { + fn guestfs_create() -> *mut guestfs_h; + fn guestfs_create_flags(flags: i64) -> *mut guestfs_h; + fn guestfs_close(g: *mut guestfs_h); + static GUESTFS_CREATE_NO_ENVIRONMENT: i64; + static GUESTFS_CREATE_NO_CLOSE_ON_EXIT: i64; +} + +pub struct Handle { + g: *mut guestfs_h, +} + +impl Drop for Handle { + fn drop(&mut self) { + unsafe { guestfs_close(self.g) } + } +} + +pub struct Create...
2013 Jan 24
0
Libguestfs with Perl 6 :-)
...;) {} sub guestfs_touch(OpaquePointer $handle, Str $path) returns Int is native('libguestfs') {} sub guestfs_umount(OpaquePointer $handle, Str $path) returns Int is native('libguestfs') {} sub guestfs_shutdown(OpaquePointer $handle) returns Int is native('libguestfs') {} sub guestfs_close(OpaquePointer $handle) returns Int is native('libguestfs') {} say "Creating handle"; my $g = guestfs_create(); say "Adding drive"; guestfs_add_drive($g, "guest.img"); say "Launching appliance"; guestfs_launch($g); say "Mounting root"; g...
2013 Jul 17
0
Re: Redirecting libguestfs error messages
...to put all of that in a separate utility function or macro. Note that 'errstr' does not need to be freed, but the string only valid for as long as the handle is open and there are no more errors on the handle, so if you need to store it you should probably copy (strdup) it. (5) Note that guestfs_close does not return an error indication. If you want to detect errors from shutting down the handle, you have to do: if (guestfs_shutdown (g) == -1) { /* error handling as above */ } guestfs_close (g); Non C bindings are a little bit different. Most (possibly all?) of them already set the...
2013 Jul 17
1
Re: Redirecting libguestfs error messages
...rate utility function > or macro. Note that 'errstr' does not need to be freed, but the > string only valid for as long as the handle is open and there are no > more errors on the handle, so if you need to store it you should > probably copy (strdup) it. > > (5) Note that guestfs_close does not return an error indication. If > you want to detect errors from shutting down the handle, you have to do: > > if (guestfs_shutdown (g) == -1) { > /* error handling as above */ > } > guestfs_close (g); > > Non C bindings are a little bit different. Most (...
2011 Mar 11
1
setpgid() before exec'ing qemu
...a process then "oz" starts up a VM (it uses libquestfs) then when "oz" cleans up it calls libquestfs.kill_subprocess(). At this point my test locks up. A bacetrace of the python code is: #0 0x00000036fe80ef1e in waitpid () from /lib64/libpthread.so.0 #1 0x0000003629c0df7f in guestfs_close () from /usr/lib64/libguestfs.so.0 then a mess of python stuff If I attach to it with strace it shows: wait4(0, It looks like libguestfs's children are already dead pstree 13107 python???cped???3*[{cped}] ??qpidd???9*[{qpidd}] so it's seems like it's waiting on my process to d...
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).