Displaying 20 results from an estimated 48 matches for "guestfs_shutdown".
2012 Jul 03
8
[PATCH 0/7 v2] Fix and workaround for qcow2 issues in qemu causing data corruption.
...sult in unwritten data. Unfortunately libguestfs ignored
the result of waitpid(2) so we didn't see this problem happening.
Patch 1/7 fixes the first problem by issuing fsync(2) on each whole
block device when we sync.
Patches 2/7 - 7/7 are needed to fix the second problem. We add a new
API (guestfs_shutdown) so that we can actually catch the case where
qemu is segfaulting instead of just ignoring it. Since qemu itself
isn't likely to be fixed any time soon, patch 7/7 adds a crude but
effective workaround to virt-resize.
Rich.
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
2012 Jul 04
1
NOTICE: Data corruption bug when writing to qcow2 files
...1.1.0 fixed the bug, and
doing a git bisect is difficult because the data corruption bug is
very hard to reproduce reliably.
Bugs (iii) and (iv) will be fixed by forthcoming patches to libguestfs
>= 1.19.16 which will be backported to 1.16 and 1.18 branches. Note
that this requires a new API, guestfs_shutdown[5]. If your program
wants to handle write errors correctly it will need to use this new
API, otherwise an error will be printed and ignored. All libguestfs
tools that modify disk images have been updated to use the new API.
Hans de Goede is currently updating Fedora to qemu-kvm 1.1.0.
Versions...
2012 Oct 10
0
NOTE: Relaunching handles (don't do it!)
It's possible through the API to do a sequence of calls like this:
g = guestfs_create ();
guestfs_add_drive (g, "foo");
guestfs_launch (g);
guestfs_shutdown (g);
guestfs_launch (g); # relaunch the handle
The question is, what should be the state of the handle at the second
launch? Would the verbose flag still be set if it had been set
earlier? (I think fairly obviously yes). Would drives added the
first time be automatically added the second ti...
2013 Jan 24
0
Libguestfs with Perl 6 :-)
...nt(OpaquePointer $handle, Str $path, Str $target) returns Int is native('libguestfs') {}
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");
sa...
2013 Jul 17
0
Re: Redirecting libguestfs error messages
...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 error handler to NULL and handle errors as above.
Typically they are turned into exceptions. Most (but not all) also
support the new gue...
2013 Jul 17
1
Re: Redirecting libguestfs error messages
...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 error handler to NULL and handle errors as above.
> Typically they are turned into exceptions. Most (but...
2015 May 06
0
Re: libguestfs init problem
...local file /etc/resolv.conf into
> * the disk image.
> */
> if (guestfs_upload (g, "/etc/resolv.conf", "/foo/resolv.conf") == -1)
> exit (EXIT_FAILURE);
>
> /* Because we wrote to the disk and we want to detect write
> * errors, call guestfs_shutdown. You don't need to do this:
> * guestfs_close will do it implicitly.
> */
> if (guestfs_shutdown (g) == -1)
> exit (EXIT_FAILURE);
>
> guestfs_close (g);
>
> /* Free up the lists. */
> for (i = 0; devices[i] != NULL; ++i)
> free (de...
2016 Jan 19
1
Re: [PATCH libguestfs v3] lib: Handle slow USB devices more gracefully.
...ions.
>
> So perhaps you don't want to check flags here ?
It's a bit confusing: As you say, testing `flags' is wrong, that part
was carried over from an earlier patch.
But I think I should test `check_for_errors' instead, since that flag
basically means did we come from the guestfs_shutdown method -- where
we want to be careful about data integrity -- or did we come from the
guestfs_close method -- where the user just wants to close the
connection without caring about data integrity.
> > +
> > + /* "Domain not found" is not treated as an error. */
> > +...
2018 Apr 05
5
[nbdkit PATCH 0/3] Test zero callback of python plugin
I'm planning on tweaking the language callbacks to support fua;
first up is the python bindings. I want to move from:
def zero(h, count, offset, may_trim):
to a nicer:
def zero(h, count, offset, may_trim=False, fua=False):
where the C code passes keywords for the flags (we can add new
flags as needed), perhaps by using introspection to learn
whether the plugin has a mandatory may_trim
2012 Aug 06
1
[PATCH V2] virt-diff: add new virt-diff tool
...dtempdir, dir);
+ sleep (5);
+ if (system (system_arg) == -1)
+ exit (EXIT_FAILURE);
+
+ guestfs_umount_local (sg, GUESTFS_UMOUNT_LOCAL_RETRY, 1, -1);
+ waitpid (spid, NULL, 0);
+ guestfs_umount_local (dg, GUESTFS_UMOUNT_LOCAL_RETRY, 1, -1);
+ waitpid (dpid, NULL, 0);
+
+ if (guestfs_shutdown (sg) == -1)
+ exit (EXIT_FAILURE);
+ if (guestfs_shutdown (dg) == -1)
+ exit (EXIT_FAILURE);
+
+ free_drive (sdrv);
+ free_drive (ddrv);
+
+ guestfs_close (sg);
+ guestfs_close (dg);
+
+ exit (EXIT_SUCCESS);
+}
diff --git a/po/POTFILES b/po/POTFILES
index dffa899..3f51648 100644
--- a/p...
2018 Apr 05
0
[nbdkit PATCH 2/3] tests: Add coverage of zero in language bindings
...evice to test zero path. */
+ if (guestfs_umount (g, "/") == 01)
+ exit (EXIT_FAILURE);
+ const char *cmd[] = { "fallocate", "-nzl", "64k", "/dev/sda", NULL };
+ char *s = guestfs_debug (g, "sh", (char **) cmd);
+ free (s);
+
if (guestfs_shutdown (g) == -1)
exit (EXIT_FAILURE);
--
2.14.3
2015 May 05
3
libguestfs init problem
Hi ,all :
thanks for helping me ! I am using libguestfs-1.28.1 on ubuntu
12.04 to manage vm disk created by KVM. I downloaded
libguestfs-1.28.1.tar.gz ,and then executed
(1) ./autogen.sh (2) ./configure (3) make (4) make check .there is
the error.
/usr/Libvmi/libguestfs-1.28.1/run --test guest-aux/make-fedora-img.pl
md_create: feature 'mdadm' is not available in this
2015 May 26
6
[PATCH 0/6] Update the way that API versions are generated for the man page.
The existing mechanism was clunky, slow and used ~ 10 MB of
local disk.
Rich.
2016 Jun 01
2
[PATCH v2] rescue: add --autosysroot option RHBZ#1183493
--autosysroot option uses suggestions to user on how to mount filesystems
and change root suggested by --suggest option in virt-rescue.
Commands are passed on kernel command line in format
guestfs_command=command;. Command ends with a semicolon and there can be
multiple commands specified. These are executed just before bash starts.
On successfull run user is presented directly with bash in
2014 Jun 23
2
[PATCH] edit: add -m option
...point. */
free_drives (drvs);
+ free_mps (mps);
- edit_files (argc - optind, &argv[optind]);
+ if (inspector)
+ edit_files (argc - optind, &argv[optind]);
+ else
+ edit_files_simple (argc - optind, &argv[optind]);
/* Cleanly unmount the disks after editing. */
if (guestfs_shutdown (g) == -1)
@@ -304,6 +323,15 @@ edit_files (int argc, char *argv[])
}
static void
+edit_files_simple (int argc, char *argv[])
+{
+ int i;
+
+ for (i = 0; i < argc; ++i)
+ edit (argv[i], NULL);
+}
+
+static void
edit (const char *filename, const char *root)
{
CLEANUP_FREE char *file...
2013 Dec 16
0
[PATCH] drives: add CD-ROM disk images as read-only drives (RHBZ#563450).
...)
create mode 100755 tests/regressions/rhbz563450.sh
create mode 100755 tests/regressions/rhbz563450b.sh
diff --git a/generator/actions.ml b/generator/actions.ml
index cb6d137..b884efb 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -241,14 +241,14 @@ Do not call this. See: C<guestfs_shutdown> instead." };
{ defaults with
name = "add_cdrom";
style = RErr, [String "filename"], [];
- deprecated_by = Some "add_drive"; config_only = true;
+ deprecated_by = Some "add_drive_ro"; config_only = true;
blocking = false;...
2017 Mar 03
5
[PATCH WIP 0/5] Fix virt-rescue.
This set of patches fixes virt-rescue rather cleanly. In particular
the problems with handling ^C are completely fixed.
Work still to be done before this can go upstream:
- Shutdown doesn't work properly if you exit the shell. At the
moment to exit you must do 'reboot -f'.
Future improvements:
- An escape sequence and escape commands that could be handled by
virt-rescue,
2016 Jun 01
0
[PATCH v2] rescue: add --autosysroot option RHBZ#1183493
...t;);
+
+ parse_opts (argc, argv);
+
/* --suggest flag */
if (suggest) {
- do_suggestion (drvs);
- exit (EXIT_SUCCESS);
+ cmds = do_suggestion (drvs);
+ if (!autosysroot) {
+ exit (EXIT_SUCCESS);
+ } else {
+ /* Shut down libguestfs so we can start a new one */
+ guestfs_shutdown (g);
+ guestfs_close (g);
+
+ /* remove --suggest flag */
+ size_t newcount = argc;
+ for (int i = 0; i < argc; i++) {
+ if (strcmp (argv[i], "--suggest") == 0) {
+ newcount--;
+ }
+ }
+
+ char ** args = malloc (sizeof (char*) * (new...
2017 Mar 03
5
[PATCH 0/5] Fix virt-rescue.
This fixes the main issues in virt-rescue and is usable.
There are some enhancements which could be made (in follow up work):
- An escape sequence and escape commands that could be handled by
virt-rescue, eg. to shut down the appliance, mount or unmount
filesystems.
- `virt-rescue -i' could be implemented cleanly by performing the
right API calls before handing control to the