search for: int_of_le32

Displaying 20 results from an estimated 38 matches for "int_of_le32".

2016 Aug 23
1
Re: [PATCH 1/2] v2v:windows: factor out getting CurrentControlSet
...onversion of the Windows guest. *) > > + (* Find the 'Current' ControlSet. *) > + let get_current_cs root = > + let select = g#hivex_node_get_child root "Select" in > + let valueh = g#hivex_node_get_value select "Current" in > + let value = int_of_le32 (g#hivex_value_value valueh) in > + sprintf "ControlSet%03Ld" value in > + > let rec configure_firstboot () = > (match installer with > | None -> () > @@ -302,14 +309,8 @@ if errorlevel 3010 exit /b 0 > (* Update the SYSTEM hive. When this fu...
2015 Jan 22
3
[PATCH 1/2] configure: look for the oUnit OCaml module
It will be used for the OCaml unit tests. --- configure.ac | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index e0fb481..e360bbb 100644 --- a/configure.ac +++ b/configure.ac @@ -1120,6 +1120,7 @@ AS_IF([test "x$OCAMLC" != "xno"],[ ]) OCAML_PKG_gettext=no +OCAML_PKG_oUnit=no AS_IF([test "x$OCAMLC" != "xno"],[ #
2015 Jan 22
0
[PATCH 2/2] mllib: convert common_utils_tests to oUnit
...prog = "common_utils_tests" +(* Utils. *) +let assert_equal_string = assert_equal ~printer:(fun x -> x) +let assert_equal_int = assert_equal ~printer:(fun x -> string_of_int x) +let assert_equal_int64 = assert_equal ~printer:(fun x -> Int64.to_string x) + (* Test Common_utils.int_of_le32 and Common_utils.le32_of_int. *) -let () = - assert (int_of_le32 "\x80\x60\x40\x20" = 0x20406080L); - assert (le32_of_int 0x20406080L = "\x80\x60\x40\x20") +let test_le32 () = + assert_equal_int64 0x20406080L (int_of_le32 "\x80\x60\x40\x20"); + assert_equal_string...
2016 Sep 01
0
Re: [PATCH v2 1/2] v2v:windows: factor out getting CurrentControlSet
...onversion of the Windows guest. *) > > + (* Find the 'Current' ControlSet. *) > + let get_current_cs root = > + let select = g#hivex_node_get_child root "Select" in > + let valueh = g#hivex_node_get_value select "Current" in > + let value = int_of_le32 (g#hivex_value_value valueh) in > + sprintf "ControlSet%03Ld" value in > + > let rec configure_firstboot () = > (match installer with > | None -> () > @@ -302,13 +309,7 @@ if errorlevel 3010 exit /b 0 > (* Update the SYSTEM hive. When this fu...
2016 Sep 01
3
[PATCH v2 0/2] v2v:windows: prevent conflicts with PnP on firstboot
Wait for driver installations fired by the PnP manager to complete before running firstboot scripts. The first patch is a minor refactoring to pave the way for the second patch. The latter contains the bulk of the changes as well as the description of the idea. Roman Kagan (2): v2v:windows: factor out getting CurrentControlSet v2v:windows: prevent conflicts with PnP on firstboot --- v1
2016 Apr 05
0
[PATCH 3/7] customize: add support for pvvxsvc
...e:true filename; - - let root_node = g#hivex_root () in - - (* Find the 'Current' ControlSet. *) - let current_cs = - let select = g#hivex_node_get_child root_node "Select" in - let valueh = g#hivex_node_get_value select "Current" in - let value = int_of_le32 (g#hivex_value_value valueh) in - sprintf "ControlSet%03Ld" value in - - (* Add a new rhsrvany service to the system registry to execute firstboot. - * NB: All these edits are in the HKLM\SYSTEM hive. No other - * hive may be modified here. - *) - let regedits = [...
2015 May 11
3
[PATCH 1/2] mllib: Require OUnit2 for tests.
...uot;common_utils_tests" @@ -30,12 +30,12 @@ let assert_equal_int64 = assert_equal ~printer:(fun x -> Int64.to_string x) let assert_equal_stringlist = assert_equal ~printer:(fun x -> "(" ^ (String.escaped (String.concat "," x)) ^ ")") (* Test Common_utils.int_of_le32 and Common_utils.le32_of_int. *) -let test_le32 () = +let test_le32 ctx = assert_equal_int64 0x20406080L (int_of_le32 "\x80\x60\x40\x20"); assert_equal_string "\x80\x60\x40\x20" (le32_of_int 0x20406080L) (* Test Common_utils.parse_size. *) -let test_parse_resize () = +l...
2014 Dec 02
1
[PATCH NOT TO BE APPLIED] v2v: windows: Make registry changes to all ControlSets, not
[Partly using the mailing list as a backup again ...] This commit changes virt-v2v to make registry changes to all ControlSets, not just the CurrentControlSet. Not sure what difference if any this would make. Rich.
2016 Aug 23
0
Re: [PATCH 2/2] v2v:windows: prevent conflicts with PnP on firstboot
...ound, create *) > + | node -> node in > + loop node xs > + in > + loop root key_path in > + let valueh = g#hivex_node_get_value node name in > + let value = > + match valueh with > + | 0L -> None > + | _ -> Some (int_of_le32 (g#hivex_value_value valueh)) in > + g#hivex_node_set_value node name 4_L (le32_of_int 1_L); > + value > + > + and reg_restore key name value = > + let strkey = String.concat "\\" key in > + match value with > + | Some value -> sprintf "\ >...
2016 Sep 01
0
Re: [PATCH v2 2/2] v2v:windows: prevent conflicts with PnP on firstboot
...ound, create *) > + | node -> node in > + loop node xs > + in > + loop root key_path in > + let valueh = g#hivex_node_get_value node name in > + let value = > + match valueh with > + | 0L -> None > + | _ -> Some (int_of_le32 (g#hivex_value_value valueh)) in > + g#hivex_node_set_value node name 4_L (le32_of_int 1_L); > + value > + > + and reg_restore key name value = > + let strkey = String.concat "\\" key in > + match value with > + | Some value -> sprintf "\ >...
2015 Jan 23
2
[PATCH 1/2] mllib: tests: add tests for string_lines_split
...rt_equal ~printer:(fun x -> string_of_int x) let assert_equal_int64 = assert_equal ~printer:(fun x -> Int64.to_string x) +let assert_equal_stringlist = assert_equal ~printer:(fun x -> "(" ^ (String.escaped (String.concat "," x)) ^ ")") (* Test Common_utils.int_of_le32 and Common_utils.le32_of_int. *) let test_le32 () = @@ -110,6 +111,22 @@ let test_string_find () = assert_equal_int (-1) (string_find "" "baz"); assert_equal_int (-1) (string_find "foobar" "baz") +(* Test Common_utils.string_lines_split. *) +let test...
2017 Feb 03
3
[PATCH v7 0/1] Import directly from OVA tar archive if possible
v7: - rebased because patch 1/3 has been pushed - changes to nsplit have been dropped (2/3) - addressed Richard's comments, notably the subfolder function was moved to mllib and renamed to subdirectory v6: - just rebase v5: - rebase, patches 1,3,5 were merged - 1/3: we still need to discuss whether to detect compressed discs - 2/3: - renamed argument noempty to keep_empty - tests were
2017 Jun 15
0
[PATCH v6 04/41] mllib: Split ‘Common_utils’ into ‘Std_utils’ + ‘Common_utils’.
...Int64.sub +let ( *^ ) = Int64.mul +let ( /^ ) = Int64.div +let ( &^ ) = Int64.logand +let ( ~^ ) = Int64.lognot + +external identity : 'a -> 'a = "%identity" + +let roundup64 i a = let a = a -^ 1L in (i +^ a) &^ (~^ a) +let div_roundup64 i a = (i +^ a -^ 1L) /^ a + +let int_of_le32 str = + assert (String.length str = 4); + let c0 = Char.code (String.unsafe_get str 0) in + let c1 = Char.code (String.unsafe_get str 1) in + let c2 = Char.code (String.unsafe_get str 2) in + let c3 = Char.code (String.unsafe_get str 3) in + Int64.of_int c0 +^ + (Int64.shift_left (Int64.of...
2017 Feb 03
0
[PATCH v7 1/1] v2v: ova: don't extract files from OVA if it's not needed
...ssert_equal_string "" (subdirectory "/foo" "/foo/"); + assert_equal_string "bar" (subdirectory "/foo" "/foo/bar"); + assert_equal_string "bar/baz" (subdirectory "/foo" "/foo/bar/baz") + (* Test Common_utils.int_of_le32 and Common_utils.le32_of_int. *) let test_le32 ctx = assert_equal_int64 0x20406080L (int_of_le32 "\x80\x60\x40\x20"); @@ -129,6 +135,7 @@ let test_string_lines_split ctx = let suite = "mllib Common_utils" >::: [ + "subdirectory" >:: test_subdire...
2017 Feb 18
11
[PATCH 0/8] Miscellaneous cleanups to Windows registry code.
A very miscellaneous set of cleanups to how we handle the Windows registry in virt-v2v, firstboot, and inspection code. This should all be straightforward non-controversial refactoring. Some highlights: - Add a new mllib Registry module containing various utility functions that are currently scattered all around. - Only compute the software/system hive paths once during inspection, and
2016 May 22
0
[PATCH 2/2] ocaml tools: Use a common debug function.
...partnum newsize start (next -^ 1L); { p with p_target_start = start; p_target_end = next -^ 1L; p_target_partnum = partnum } :: loop (partnum+1) next ps @@ -1259,7 +1252,7 @@ read the man page virt-resize(1). if verbose () then ( let old_hidden = int_of_le32 (g#pread_device target 4 0x1c_L) in - printf "old hidden sectors value: 0x%Lx\n%!" old_hidden + debug "old hidden sectors value: 0x%Lx" old_hidden ); let new_hidden = le32_of_int start in diff --git a/sparsify/copying.ml b/sparsify/copying.m...
2016 May 22
4
ocaml tools: Use a common debug function.
Add a Common_utils.debug function for printing messages only when in verbose mode. Rich.
2014 Sep 19
22
[PATCH v2 00/13] virt-resize: add support for resizing MBR logical partitions
Hi Rich, This is v2 series to add support for resizing MBR logical partitions. I found the reason of problem in v1 that parted reports error when adding logical partitions, is that logical partitions are not aligned to 2 sectors. This problem doesn't appear in v2. This is for early review, because of: 1. I'm not sure the splitting of patches is appropriate or not, but it's much
2017 Jun 19
16
[PATCH v7 00/13] Refactor utilities
This is just the utilities part of the patch series from: https://www.redhat.com/archives/libguestfs/2017-June/msg00103.html I believe this addresses everything raised in comments on that patch series. Rich.
2017 Jul 31
0
[PATCH v11 09/10] daemon: Implement inspection of Windows.
...nverts it to a + * GUID string so that it can be matched against libguestfs partition + * device GPT GUID. + *) +and extract_guid_from_registry_blob blob = + (* Copy relevant sections from blob to respective ints. + * Note we have to skip 8 byte "DMIO:ID:" prefix. + *) + let data1 = int_of_le32 (String.sub blob 8 4) + and data2 = int_of_le16 (String.sub blob 12 2) + and data3 = int_of_le16 (String.sub blob 14 2) + and data4 = int_of_be64 (String.sub blob 16 8) (* really big endian! *) in + + (* Must be lowercase hex. *) + sprintf "%08Lx-%04Lx-%04Lx-%04Lx-%012Lx" +...