Displaying 20 results from an estimated 32 matches for "shell_unquot".
Did you mean:
shell_unquote
2017 Jun 15
0
[PATCH v6 10/41] mllib, v2v: Split out OCaml utils bindings ‘common/mlutils’.
Create a module ‘C_utils’ containing functions like ‘drive_name’ and
‘shell_unquote’ which come from the C utilities.
The new directory ‘common/mlutils’ also contains the ‘Unix_utils’
wrappers around POSIX functions missing from the OCaml stdlib.
---
.gitignore | 3 +
Makefile.am | 24 ++---
builder/Makefile.am...
2018 Jul 27
1
[PATCH] daemon: inspect: ignore fstab devs that cannot be resolved (RHBZ#1608131)
.../daemon/inspect_fs_unix_fstab.ml
+++ b/daemon/inspect_fs_unix_fstab.ml
@@ -115,12 +115,20 @@ and check_fstab_entry md_map root_mountable os_type aug entry =
if String.is_prefix spec "UUID=" then (
let uuid = String.sub spec 5 (String.length spec - 5) in
let uuid = shell_unquote uuid in
- Mountable.of_device (Findfs.findfs_uuid uuid)
+ (* Just ignore the device if the UUID cannot be resolved. *)
+ try
+ Mountable.of_device (Findfs.findfs_uuid uuid)
+ with
+ Failure _ -> return None
)
else if String.is_prefix s...
2017 Oct 16
2
Re: [PATCH v2 1/2] daemon: add split_key_value_strings helper
...= '"') || (s.[0] = '\'' && s.[n-1] = '\'')) then
> + String.sub s 1 (n-2)
> + else
> + s
According to:
https://www.freedesktop.org/software/systemd/man/os-release.html
os-release uses some kind of escaping system. It does look as if
shell_unquote may be appropriate here. (Of course whether writers of
/etc/os-release are doing the right thing is another issue. I guess
there is no validation).
> +let split_key_value_strings ?unquote lines =
Can we call this function something like ‘parse_key_value_file’? Most
of our other parsing fun...
2017 Feb 06
2
[PATCH v2] v2v: ova: Don't rely on qemu-img version, test "offset"
v1 -> v2:
- Use 'qemu-img info' which avoids one of the temporary files
(thanks Tomáš).
- Add a unit test.
Unfortunately when I run 'make -C v2v check' I don't think this code
is being run at all, so there may be something else going on here
which I don't understand.
Rich.
2017 Oct 16
3
[PATCH v2 0/2] daemon: add and use split_key_value_strings helper
Changes from v1 to v2:
- split the "simple unquoting" as helper
- pass the unquoting function to split_key_value_strings
- use right unquoting function when applying split_key_value_strings
Pino Toscano (2):
daemon: add split_key_value_strings helper
daemon: use split_key_value_strings
daemon/inspect_fs_unix.ml | 93 +++++++++++++++++++----------------------------
daemon/md.ml
2017 Nov 21
2
[PATCH REPOST 1/2] common/mlstdutils: Add return statement.
No change, just reposting without the "for discussion" tag.
I think we should allow this as it seems like a nice coding style for
a limited subset of imperative-style code.
Rich.
2017 Nov 05
2
[PATCH 0/2] (mainly for discussion) Add ‘return’ statement.
When rewriting the heavily imperative original inspection code, I
longed for a ‘return’ statement so I could keep the new code as close
as possible to the original. OCaml of course does not have such a
statement, but it's relatively simply to implement it in the language.
The first patch does so, and the second patch rewrites a sample of the
inspection code to use it.
Rich.
2017 Jun 16
1
Re: [PATCH v6 10/41] mllib, v2v: Split out OCaml utils bindings ‘common/mlutils’.
On Thursday, 15 June 2017 19:06:00 CEST Richard W.M. Jones wrote:
> Create a module ‘C_utils’ containing functions like ‘drive_name’ and
> ‘shell_unquote’ which come from the C utilities.
>
> The new directory ‘common/mlutils’ also contains the ‘Unix_utils’
> wrappers around POSIX functions missing from the OCaml stdlib.
> ---
I fear we are spreading the code among too many helper libraries...
Why not just add these small bindings to...
2017 Oct 16
0
Re: [PATCH v2 1/2] daemon: add split_key_value_strings helper
...amp;& s.[n-1] = '\'')) then
> > + String.sub s 1 (n-2)
> > + else
> > + s
>
> According to:
>
> https://www.freedesktop.org/software/systemd/man/os-release.html
>
> os-release uses some kind of escaping system. It does look as if
> shell_unquote may be appropriate here. (Of course whether writers of
> /etc/os-release are doing the right thing is another issue. I guess
> there is no validation).
Yes, this is what patch #2 already does, in parse_os_release:
+ let values = split_key_value_strings ~unquote:shell_unquote lines in...
2017 Jun 29
0
[PATCH] v2v: Allow -i libvirtxml to open network disks over http or https.
...h_string "source/@pool", xpath_string "source/@volume" with
diff --git a/v2v/utils.ml b/v2v/utils.ml
index e0275db53..e20159019 100644
--- a/v2v/utils.ml
+++ b/v2v/utils.ml
@@ -28,6 +28,21 @@ external drive_index : string -> int = "v2v_utils_drive_index"
external shell_unquote : string -> string = "v2v_utils_shell_unquote"
+(* URI quoting. *)
+let uri_quote str =
+ let len = String.length str in
+ let xs = ref [] in
+ for i = 0 to len-1 do
+ xs :=
+ (match str.[i] with
+ | ('A'..'Z' | 'a'..'z' | '0'....
2017 Oct 16
3
[PATCH v3 0/2] daemon: add and use parse_key_value_strings helper
Changes from v2 to v3:
- split_key_value_strings renamed to parse_key_value_strings
Changes from v1 to v2:
- split the "simple unquoting" as helper
- pass the unquoting function to split_key_value_strings
- use right unquoting function when applying split_key_value_strings
Pino Toscano (2):
daemon: add split_key_value_strings helper
daemon: use parse_key_value_strings
2016 Aug 18
3
[PATCH v2 0/2] v2v: Use OVMF secure boot file (RHBZ#1367615).
First version was posted here:
https://www.redhat.com/archives/libguestfs/2016-August/thread.html#00100
This is semantically the same as the first version. However
I've split the patch up into two parts. In the first part,
I factor out the UEFI paths so now they are created by the
generator and written in the library and v2v/ directory directly,
instead of the complex business of having a C
2017 Oct 16
0
[PATCH v2 1/2] daemon: add split_key_value_strings helper
...ause the result is always
the same length or shorter than the argument passed. *)
+val simple_unquote : string -> string
+(** Unquote the string, by removing a pair of single- or double-quotes
+ at the beginning and the end of the string.
+
+ No other handling is done, unlike what {!shell_unquote} does. *)
+
+val split_key_value_strings : ?unquote:(string -> string) -> string list -> (string * string) list
+(** Split the lines by the [=] separator; if [unquote] is specified,
+ it is applied on the values as unquote function. Empty lines,
+ or that start with a comment chara...
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:
-
2018 Oct 01
7
[PATCH v2 API PROPOSAL 0/5] inspection Add network interfaces to inspection data.
The proposed API is the same as v1, but this includes an
implementation (for /etc/sysconfig/network-scripts/ifcfg-*) and
modifications to virt-inspector. This compiles and works.
If you look in patch 5 you can see proposed output as virt-inspector
XML for a guest (although this guest has not been booted, so a real
guest would hopefully have a hwaddr="MAC" attribute too).
Rich.
2017 Oct 16
4
[PATCH 1/3] daemon: add split_key_value_strings helper
Add a simple helper to turn a list of strings into key/value pairs,
splitting by '='.
---
daemon/utils.ml | 15 +++++++++++++++
daemon/utils.mli | 6 ++++++
2 files changed, 21 insertions(+)
diff --git a/daemon/utils.ml b/daemon/utils.ml
index d87ad75db..fd1681a86 100644
--- a/daemon/utils.ml
+++ b/daemon/utils.ml
@@ -229,3 +229,18 @@ let unix_canonical_path path =
let path =
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