search for: failwithf

Displaying 20 results from an estimated 152 matches for "failwithf".

2014 Nov 25
1
[PATCH] generator: force longdesc to begin with uppercase
...it a/generator/checks.ml b/generator/checks.ml index b57134b..376de3b 100644 --- a/generator/checks.ml +++ b/generator/checks.ml @@ -157,7 +157,9 @@ let () = List.iter ( fun { name = name; longdesc = longdesc } -> if longdesc.[String.length longdesc-1] = '\n' then - failwithf "long description of %s should not end with \\n." name + failwithf "long description of %s should not end with \\n." name; + if longdesc.[0] <> Char.uppercase longdesc.[0] then + failwithf "long description of %s should begin with uppercase." n...
2019 Sep 05
0
[PATCH libnbd] generator: Move first_version fields to a single table.
...@@ let () = | _ -> () ) handle_calls; - (* First stable version must be 1.x where x is even. *) + (* first_version must be (0, 0) in handle_calls (we will modify it). *) List.iter ( - fun (name, { first_version = (major, minor) }) -> - if major <> 1 then - failwithf "%s: first_version must be 1.x" name; - if minor mod 2 <> 0 then - failwithf "%s: first_version must refer to a stable release" name + function + | (_, { first_version = (0, 0) }) -> () + | (name, _) -> + failwithf "%s: first_version...
2019 Sep 05
3
[PATCH libnbd] generator: Move first_version fields to a single table.
This doesn't include Eric's new APIs, but if you push those then I can rebase this one on top. Rich.
2019 Aug 15
0
[PATCH libnbd v2 10/10] generator: Check requirements for BytesPersistIn/Out and completion callbacks.
--- generator/generator | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/generator/generator b/generator/generator index 1252bdb..13cb0b9 100755 --- a/generator/generator +++ b/generator/generator @@ -3121,6 +3121,31 @@ let () = failwithf "%s: first_version must be 1.x" name; if minor mod 2 <> 0 then failwithf "%s: first_version must refer to a stable release" name + ) handle_calls; + + (* Because of the way we use completion free callbacks to + * free persistent buffers in non-C languag...
2023 Aug 04
1
[libnbd PATCH] golang: Optionally use gofmt on generated .go files
...te_rust_sys_bindings; + output_to ~formatter:(Some Rustfmt) "rust/src/bindings.rs" + Rust.generate_rust_bindings; diff --git a/generator/utils.ml b/generator/utils.ml index 3302b309..443ac6df 100644 --- a/generator/utils.ml +++ b/generator/utils.ml @@ -420,6 +420,7 @@ let | i -> failwithf "%s: failed with error code %d" cmd i type formatter = + | Gofmt | Rustfmt let output_to ?(formatter = None) filename k = @@ -431,6 +432,15 @@ let close_out c; chan := NoOutput; (match formatter with + | Some Gofmt -> + if Config.gofmt <> "no" then...
2016 Sep 02
6
[PATCH 0/4] generator: Some work to split large C files
By splitting up large C files we can make parallel compiles a bit faster. Rich.
2009 Aug 19
1
[PATCH libguestfs] avoid build failure due to Haskell keyword clash
...e", (RErr, [String "modulename"]), 194, [], [InitNone, Always, TestRun [["modprobe"; "ext2"]]], "load a kernel module", "\ @@ -4050,7 +4050,35 @@ let check_functions () = if n = "i" || n = "n" then failwithf "%s has a param/ret called 'i' or 'n', which will cause some conflicts in the generated code" name; if n = "argv" || n = "args" then - failwithf "%s has a param/ret called 'argv' or 'args', which will cause some co...
2019 Aug 13
5
[PATCH 0/3] generator: pod2text-related improvements
- refactor memoization code - pass pod as stdin rather than files Pino Toscano (3): generator: isolate memoized cache in own module generator: adjust variable names generator: improve pod2text invocation generator/Makefile.am | 3 ++ generator/memoized_cache.ml | 62 +++++++++++++++++++++ generator/memoized_cache.mli | 29 ++++++++++ generator/utils.ml | 101
2018 Apr 23
3
[PATCH 0/3] v2v: Miscellaneous refactoring and fixes.
Originally an attempt to fix: https://bugzilla.redhat.com/show_bug.cgi?id=1570407 However this isn't a complete fix. The OVA supplied doesn't even conform to VMware's own "specification" (I use the word loosely). The OVF inside the OVA references the disk.vmdk file, but the OVA doesn't contain that disk.vmdk file, only a snapshot called disk.vmdk.000000000. Therefore
2019 Aug 09
1
Re: [PATCH libnbd 2/2] generator: Change handling of Flags to be a true optional argument.
...; List.iter ( > - fun (name, { args }) -> > - let args = List.rev args in > - match args with > - | [] -> () > - | Flags _ :: xs > - | xs -> > - if List.exists (function Flags _ -> true | _ -> false) xs then > - failwithf "%s: Flags must appear in final argument position only" > - name > + function > + | _, { optargs = [] } | _, { optargs = [OFlags _] } -> () > + | (name, _) -> > + failwithf "%s: optargs can only be empty list of [OFlags]" n...
2017 May 26
2
[PATCH 0/2] mllib: Export some more functions to the generator.
These functions are already linked to the generator, they're just not exported. Rich.
2019 Aug 13
0
[PATCH 3/3] generator: improve pod2text invocation
...nes in - unlink filename; - (match close_process_in chan with + (try while true do lines := input_line chan_out :: !lines done + with End_of_file -> ()); + let lines = List.rev !lines in + (match close_process (chan_out, chan_in) with | WEXITED 0 -> () | WEXITED i -> failwithf "pod2text: process exited with non-zero status (%d)" i | WSIGNALED i | WSTOPPED i -> failwithf "pod2text: process signalled or stopped by signal %d" i ); + let lines = + if discard then (* discard the first line of output *) List.tl lines + else lines in...
2020 Sep 06
0
[libnbd PATCH 1/3] generator: Introduce REnum/RFlags return types
..."get_handshake_flags", { default_call with - args = []; ret = RUInt; + args = []; ret = RFlags (handshake_flags); may_set_error = false; shortdesc = "see which handshake flags are supported"; longdesc = "\ @@ -2708,11 +2710,13 @@ let () = failwithf "%s: if may_set_error is false, permitted_states must be empty (any permitted state)" name - (* may_set_error = true is incompatible with RUInt because - * these calls cannot return an error indication. + (* may_set_error = true is incompatible with RUInt, REn...
2019 Jul 27
3
[PATCH libnbd] lib: Use symbol versions.
This patch adds support for symbol versions. It is based on what libvirt does. The generated syms file looks like: LIBNBD_1.0 { global: nbd_...; nbd_...; local: *; }; In a future stable 1.2 release, new symbols would go into a new section which would look like this: LIBNBD_1.2 { global: nbd_new_symbol; nbd_another_new_symbol; local: *; } LIBNBD_1.0; In my testing the
2018 Feb 06
2
Re: [PATCH v3 1/3] daemon: Reimplement 'part_get_mbr_part_type' API in OCaml.
...lementation has a nod towards gpt: > - for (i = 0, row = start; row < end; ++i, ++row) { > - if (STREQ (parttype, "gpt")) { > - memcpy (temp_type, "primary", strlen ("primary")); whereas the replacement deliberately breaks this case: > + failwithf "part_get_mbr_part_type can only be used on MBR Partitions" This change is too fundamental to go in just before the stable release (1.38). I'm going to release 1.38 real soon and then we can look at this again. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.r...
2018 Jan 15
6
[PATCH v2 0/3] copying gpt attributes
Hi all, Here is the latest version of the series addressing Pino's comments. Cédric Bosdonnat (3): daemon: make sgdisk_info_extract_uuid_field more generic New APIs: part_set_gpt_attributes and part_get_gpt_attributes resize: copy GPT partition flags daemon/parted.ml | 45 +++++++++++++++++++++++++++++++++++---------- daemon/parted.mli | 3 +++
2017 Nov 05
0
[PATCH 2/2] common/mlstdutils: Add with_openfile function.
...d device size offset = - let fd = Unix.openfile device [Unix.O_RDONLY; Unix.O_CLOEXEC] 0 in - let ret = - protect ~f:( - fun () -> - ignore (Unix.lseek fd offset Unix.SEEK_SET); - let ret = Bytes.create size in - if Unix.read fd ret 0 size < size then - failwithf "pread: %s: short read" device; - ret - ) ~finally:(fun () -> Unix.close fd) in + with_openfile device [Unix.O_RDONLY; Unix.O_CLOEXEC] 0 ( + fun fd -> + ignore (Unix.lseek fd offset Unix.SEEK_SET); + let ret = Bytes.create size in + if Unix.read fd ret 0...
2018 Jan 16
0
[PATCH v3 2/3] New APIs: part_set_gpt_attributes and part_get_gpt_attributes
...nsertions(+), 1 deletion(-) diff --git a/daemon/parted.ml b/daemon/parted.ml index 6fe803613..ce8da8a60 100644 --- a/daemon/parted.ml +++ b/daemon/parted.ml @@ -17,6 +17,7 @@ *) open Scanf +open Printf open Std_utils @@ -124,10 +125,29 @@ let part_get_parttype device = | _ -> failwithf "%s: cannot parse the output of parted" device +let part_set_gpt_attributes device partnum attributes = + if partnum <= 0 then failwith "partition number must be >= 1"; + + udev_settle (); + + let arg = sprintf "%d:=:%LX" partnum attributes in + let r, _, e...
2018 Jan 15
0
[PATCH v2 2/3] New APIs: part_set_gpt_attributes and part_get_gpt_attributes
...| 2 ++ lib/MAX_PROC_NR | 2 +- 5 files changed, 66 insertions(+), 1 deletion(-) diff --git a/daemon/parted.ml b/daemon/parted.ml index 6fe803613..e3ab823bd 100644 --- a/daemon/parted.ml +++ b/daemon/parted.ml @@ -124,10 +124,30 @@ let part_get_parttype device = | _ -> failwithf "%s: cannot parse the output of parted" device +let part_set_gpt_attributes device partnum attributes = + if partnum <= 0 then failwith "partition number must be >= 1"; + + udev_settle (); + + let hex = Printf.sprintf "%LX" attributes in + let arg = string_...
2017 Oct 04
0
[PATCH 2/9] ocaml: Replace pattern matching { field = field } with { field }.
...= "guestfs" then @@ -65,7 +65,7 @@ let () = (* Check added field was set to something. *) List.iter ( function - | { name = name; visibility = VPublic|VPublicNoFish|VDebug; + | { name; visibility = VPublic|VPublicNoFish|VDebug; added = (-1, _, _) } -> failwithf "function %s has no 'added' (version when added) field" name | _ -> () @@ -73,7 +73,7 @@ let () = (* Check function parameter/return names. *) List.iter ( - fun { name = name; style = style } -> + fun { name; style } -> let check_arg_ret_name n =...