search for: last_errno

Displaying 20 results from an estimated 60 matches for "last_errno".

2016 Jul 07
2
Re: [PATCH 1/3] mllib: add checking for btrfs subvolume
...ro = > inspect_mount_root ~mount_opts_fn:(fun _ -> "ro") > + > +let is_btrfs_subvolume g fs = > + let device = g#mountable_device fs in > + let subvol = > + try > + g#mountable_subvolume fs > + with Guestfs.Error msg as exn -> > + if g#last_errno () = Guestfs.Errno.errno_EINVAL then "" > + else raise exn in > + device <> "" && subvol <> "" Firstly I think device <> "" is always true. Secondly it wasn't obvious to me until I thought about it that you're t...
2015 Sep 30
0
[PATCH 2/2] ocaml: Improve ocamldoc.
...rder to provide predictable cleanup. *) +(** {3 Events} *) + type event = "; List.iter ( @@ -125,6 +129,8 @@ val event_to_string : event list -> string (** [event_to_string events] returns the event(s) as a printable string for debugging etc. *) +(** {3 Errors} *) + val last_errno : t -> int (** [last_errno g] returns the last errno that happened on the handle [g] (or [0] if there was no errno). Note that the returned integer is the @@ -149,41 +155,45 @@ module Errno : sig pr "\ end +(** {3 Structs} *) + "; generate_ocaml_structure_decls (); +...
2014 Mar 17
4
[PATCH 1/4] ocaml: Add Guestfs.Errno submodule exposing useful raw errno numbers.
For use when calling G.last_errno. --- generator/ocaml.ml | 15 +++++++++++++++ ocaml/guestfs-c.c | 8 ++++++++ 2 files changed, 23 insertions(+) diff --git a/generator/ocaml.ml b/generator/ocaml.ml index 78cff89..29a9eb6 100644 --- a/generator/ocaml.ml +++ b/generator/ocaml.ml @@ -121,10 +121,20 @@ val last_errno : t -> int...
2015 Jun 18
3
[PATCH v2 0/3] daemon: parted: Always use -s option even with -m.
version 2: - Turn the "unrecognised disk label" error into errno == EINVAL - Fix virt-alignment-scan - Rework the fix for virt-v2v bug 1232192 (see description of patch 3/3)
2015 Sep 30
3
[PATCH 1/2] ocaml: Use ocamlfind to run ocamldoc.
Using 'ocamlfind ocamldoc' is much faster than running 'ocamldoc' directly, because ocamlfind will run the native code program 'ocamldoc.opt' if it is available. This change approximately halves the time taken to compile the ocaml bindings. --- ocaml/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am index
2015 Aug 24
3
[PATCH 1/3] ocaml: dynamically generate the content of Guestfs.Errno
...nos to expose on Guestfs.Errno. *) +let ocaml_errnos = [ + "EINVAL"; + "ENOTSUP"; + "EPERM"; + "ESRCH"; +] + (* Generate the OCaml bindings interface. *) let rec generate_ocaml_mli () = generate_header OCamlStyle LGPLv2plus; @@ -132,10 +140,12 @@ val last_errno : t -> int which you can use to test the return value of {!Guestfs.last_errno}. *) module Errno : sig - val errno_EINVAL : int - val errno_ENOTSUP : int - val errno_EPERM : int - val errno_ESRCH : int +"; + List.iter ( + fun e -> + pr " val errno_%s : int\n&quo...
2015 Jun 29
1
Re: [PATCH v3.1 1/9] uuid: add support to change uuid of btrfs partition
...; > } else { > die $@; > } No, please investigate why you are getting such errno. One guess is that a leftover from a failing operation, and that set_uuid actually succeeded. In that case, checking first for $@ might do the trick: eval { ... } if ($@) { # failed, check last_errno } else { # good, compare with vfs_uuid } > > > +my $err = $g->last_errno (); > > > + > > > +if ($err == 0) { > > > + my $uuid = $g->vfs_uuid ("/dev/sda1"); > > > + die "unexpected uuid expecting > > > + ...
2015 Jun 24
2
Re: [PATCH v2 1/5] uuid: add support to change uuid of btrfs partition
...ols < 4.1 is used, then the test will fail (instead of being skipped). Thinking further about it: it might be better to make set_uuid return ENOTSUP for all the unsupported filesystems (including older btrfs-tools case). This way, the perl snippet above could check, when set_uuid fails, for the last_errno() and consider that a hard failure if it was different than ENOTSUP. Something like (untested): eval { $g->set_uuid (...); }; my $err = $g->last_errno (); if ($err == 0) { my $uuid = $g->vfs_uuid (...); die ... } elsif ($err != Errno::ENOTSUP()) { die $@ } -- P...
2015 Jun 30
1
Re: [PATCH v4 1/7] uuid: add support to change uuid of btrfs partition
...change uuid of btrfs fs. > > Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com> > --- > [...] > +# Setting btrfs UUID > +eval { > + $g->set_uuid ("/dev/sda1", "12345678-1234-1234-1234-123456789012"); > +}; > + > +my $err = $g->last_errno (); > + > +if ($@) { $@ contains the last Perl error, so it's better to check for it right after the eval block, otherwise other functions might change it. Also, $err can be moved in the if block. > + if ($err == Errno::ENOTSUP()) { > + warn "$0: skipping test for b...
2016 Jul 07
0
Re: [PATCH 1/3] mllib: add checking for btrfs subvolume
...pts_fn:(fun _ -> "ro") > > + > > +let is_btrfs_subvolume g fs = > > + let device = g#mountable_device fs in > > + let subvol = > > + try > > + g#mountable_subvolume fs > > + with Guestfs.Error msg as exn -> > > + if g#last_errno () = Guestfs.Errno.errno_EINVAL then "" > > + else raise exn in > > + device <> "" && subvol <> "" > > Firstly I think device <> "" is always true. > > Secondly it wasn't obvious to me until I thou...
2015 Mar 26
2
[PATCH v3] customize: fix --upload to FAT partition (RHBZ#1196101)
Some filesystems, such as FAT doesn't support file ownership, so show warning instead of error on EPERM. Maros Zatko (1): customize: fix --upload to FAT partition (RHBZ#1196101) customize/customize_run.ml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 1.9.3
2015 Jun 26
3
Re: [PATCH v3.1 1/9] uuid: add support to change uuid of btrfs partition
...9;$label'" > unless $label eq "newlabel"; > > +# Setting btrfs UUID > +eval { > + $g->set_uuid ("/dev/sda1", "12345678-1234-1234-1234-123456789012"); > +}; > +# FIXME: ignore ESRCH What is ESRCH about? > +my $err = $g->last_errno (); > + > +if ($err == 0) { > + my $uuid = $g->vfs_uuid ("/dev/sda1"); > + die "unexpected uuid expecting > + '12345678-1234-1234-1234-123456789012' but got '$uuid'" > + unless $uuid eq "12345678-1234-1234-1234-123456789012&...
2017 Sep 25
0
[PATCH] customize: Unconditionally set the machine-id if not set already.
...the end. *) let passwords = Hashtbl.create 13 in let set_password user pw = @@ -399,8 +421,8 @@ exec >>%s 2>&1 let uid, gid = statbuf.st_uid, statbuf.st_gid in let chown () = try g#chown uid gid dest - with Guestfs.Error m as e -> - if g#last_errno () = Guestfs.Errno.errno_EPERM + with G.Error m as e -> + if g#last_errno () = G.Errno.errno_EPERM then warning "%s" m else raise e in chown () -- 2.13.2
2016 Jul 07
7
[PATCH 0/3] fix btrfs subvolume procession in tools
This patcheset fixes errors in virt-sysprep and virt-sparsify. Here we have a common functionality: is_btrfs_subvolume. Doesn't it make sense to turn it into guestfs API? Also I found an issue. In 'virt-sysprep fs-uuids', the uuids for ALL filesystems are regenerated as many times as many roots are in guest. Is it done intentionally? Maxim Perevedentsev (3): mllib: add checking
2015 Mar 12
3
mysql replication - problems
...n.000002 *Slave_IO_Running: Connecting* Slave_SQL_Running: Yes Replicate_Do_DB: testdb Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 761404 Relay_Log_Space: 107 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: Yes Master_SSL_CA...
2015 Jun 25
0
Re: [PATCH v2 1/5] uuid: add support to change uuid of btrfs partition
...test will fail (instead > of being skipped). > > Thinking further about it: it might be better to make set_uuid return > ENOTSUP for all the unsupported filesystems (including older > btrfs-tools case). This way, the perl snippet above could check, when > set_uuid fails, for the last_errno() and consider that a hard failure > if it was different than ENOTSUP. Something like (untested): > > eval { > $g->set_uuid (...); > }; > my $err = $g->last_errno (); > if ($err == 0) { > my $uuid = $g->vfs_uuid (...); > die ... > } elsif...
2015 Jul 01
5
[PATCH v5 0/3] uuid: add btrfs uuid change support and set_uuid_random
- Btrfs-progs v4.1 introduced new feature of changing uuid of btrfs partition. This patch add support of this. - Introduce set_uuid_random - uuids.c did a lot of deplicated work for changing uuid of fs. Use existing functions. v5: use NOT_SUPPORTED macro improve testcases v4: introduce get_random_uuid improve testcases squash internal API patches v3.1: fix typos v3: set errno
2016 Aug 05
6
[PATCH 0/4] sparsify: Warn instead of error if a filesystem cannot be fstrimmed.
Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1364347
2015 Mar 12
0
mysql replication - problems
...Connecting* > Slave_SQL_Running: Yes > Replicate_Do_DB: testdb > Replicate_Ignore_DB: > Replicate_Do_Table: > Replicate_Ignore_Table: > Replicate_Wild_Do_Table: > Replicate_Wild_Ignore_Table: > Last_Errno: 0 > Last_Error: > Skip_Counter: 0 > Exec_Master_Log_Pos: 761404 > Relay_Log_Space: 107 > Until_Condition: None > Until_Log_File: > Until_Log_Pos: 0 > Master_S...
2015 Jul 02
1
[PATCH v6] New API: set_uuid_random
...sts/btrfs/test-btrfs-misc.pl +++ b/tests/btrfs/test-btrfs-misc.pl @@ -67,5 +67,19 @@ if ($@) { unless $uuid eq "12345678-1234-1234-1234-123456789012"; } +# Setting btrfs random UUID. +eval { + $g->set_uuid_random ("/dev/sda1") +}; + +if ($@) { + my $err = $g->last_errno (); + if ($err == Errno::ENOTSUP()) { + warn "$0: skipping test for btrfs UUID change feature is not available"; + } else { + die $@; + } +} + $g->shutdown (); $g->close (); -- 2.1.0