search for: logand

Displaying 13 results from an estimated 13 matches for "logand".

Did you mean: logan
2016 Sep 30
2
[PATCH] customize: Add --append-line.
...t; "\n" + in + + if not (g#exists path) then ( + g#write path (line ^ default_newline ()) + ) + else ( + (* Stat the file. We want to know it's a regular file, and + * also its size. + *) + let { G.st_mode = mode; st_size = size } = g#statns path in + if Int64.logand mode 0o170000_L <> 0o100000_L then + error (f_"append_line: %s is not a file") path; + + (* Guess the line ending from the first part of the file, else + * use the default for this guest type. + *) + let newline = + let content = g#pread path 8192 0L in +...
2016 Sep 30
0
Re: [PATCH] customize: Add --append-line.
...e. > > Also adds a test. > --- Makes sense, just a couple of notes. > + else ( > + (* Stat the file. We want to know it's a regular file, and > + * also its size. > + *) > + let { G.st_mode = mode; st_size = size } = g#statns path in > + if Int64.logand mode 0o170000_L <> 0o100000_L then I guess maybe it could be better to use g#is_file and g#filesize, to avoid having to deal at application side with the file mode got in the appliance. > + (* Guess the line ending from the first part of the file, else > + * use the default for...
2017 Apr 12
1
[PATCH] mllib: Bind %identity C primitive to Common_utils.identity.
...- v2v/v2v_unit_tests.ml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 63d8dd92e..6a9b08973 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -282,6 +282,8 @@ 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 diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index ec41a8ff8..0669a42bf 10064...
2017 Sep 25
0
[PATCH] customize: Unconditionally set the machine-id if not set already.
...ID and will fail if it is not set. + *) + let () = + let etc_machine_id = "/etc/machine-id" in + let statbuf = + try Some (g#lstatns etc_machine_id) with G.Error _ -> None in + (match statbuf with + | Some { G.st_size = 0L; G.st_mode = mode } + when (Int64.logand mode 0o170000_L) = 0o100000_L -> + message (f_"Setting the machine ID in %s") etc_machine_id; + let id = Urandom.urandom_bytes 16 in + let id = String.map_chars (fun c -> sprintf "%02x" (Char.code c)) id in + let id = String.concat ""...
2017 Oct 04
0
[PATCH 2/9] ocaml: Replace pattern matching { field = field } with { field }.
...tomize/append_line.ml +++ b/customize/append_line.ml @@ -39,8 +39,8 @@ let append_line (g : G.guestfs) root path line = (* Stat the file. We want to know it's a regular file, and * also its size. *) - let { G.st_mode = mode; st_size = size } = g#statns path in - if Int64.logand mode 0o170000_L <> 0o100000_L then + let { G.st_mode; st_size = size } = g#statns path in + if Int64.logand st_mode 0o170000_L <> 0o100000_L then error (f_"append_line: %s is not a file") path; (* Guess the line ending from the first part of the file, else...
2017 Oct 04
11
[PATCH 0/9] build: Require OCaml >= 4.02.
Per my previous email: https://www.redhat.com/archives/libguestfs/2017-September/msg00203.html I'd like to talk about requiring a more modern version of the OCaml compiler. These commits show some of the code changes which would be possible with OCaml >= 3.12 [which it turns out we already require by accident] and also with OCaml >= 4.02. The latter is my favoured option. Rich.
2006 Aug 24
26
mongrel logging on win32 platform and win32 service
Hi All I am using version 0.3.13.3 and since there is no logging support for win32 application. I was wondering if it was possible to get any kind of logging at all. I have tried to these two options 1. Stream redirection using "mongrel_rails start -c C:/myspace/snapshot -p 4111 -t 70 -e production -P log/mongrel-1.pid > C:\temp\mongrel-1.log" The console print the output stream
2017 Jun 15
0
[PATCH v6 04/41] mllib: Split ‘Common_utils’ into ‘Std_utils’ + ‘Common_utils’.
...en = String.length parent in + String.sub path (len+1) (String.length path - len-1) + ) else + invalid_arg (sprintf "%S is not a path prefix of %S" parent path) + +let ( +^ ) = Int64.add +let ( -^ ) = 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.unsaf...
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 Jun 09
12
[PATCH 00/12] Refactor utility functions.
This turned out to be rather more involved than I thought. We have lots of utility functions, spread all over the repository, with not a lot of structure. This moves many of them under common/ and structures them so there are clear dependencies. This doesn't complete the job by any means. Other items I had on my to-do list for this change were: - Split up mllib/common_utils into: -
2017 Jun 12
32
[PATCH v5 00/32] Refactor utilities, implement some APIs in OCaml.
This is a combination of: https://www.redhat.com/archives/libguestfs/2017-June/msg00046.html [PATCH 00/12] Refactor utility functions. plus: https://www.redhat.com/archives/libguestfs/2017-June/msg00023.html [PATCH v3 00/19] Allow APIs to be implemented in OCaml. with the second patches rebased on top of the utility refactoring, and some other adjustments and extensions. This passes
2017 Jun 15
45
[PATCH v6 00/41] Refactor utilities, reimplement inspection in the daemon.
v5: https://www.redhat.com/archives/libguestfs/2017-June/msg00065.html Since v5, this now implements inspection almost completely for Linux and Windows guests. Rich.
2017 Jun 21
45
[PATCH v8 00/42] Refactor utilities and reimplement inspection.
v7 was: https://www.redhat.com/archives/libguestfs/2017-June/msg00169.html https://www.redhat.com/archives/libguestfs/2017-June/msg00184.html I believe this addresses all comments received so far. Also it now passes a test where I compared about 100 disk images processed with old and new virt-inspector binaries. The output is identical in all cases except one which is caused by a bug in blkid