search for: rstructlist

Displaying 20 results from an estimated 156 matches for "rstructlist".

2015 Oct 20
0
[PATCH 2/2] actions: turn some params into RelativePathnameList (RHBZ#1174551).
...s(-) diff --git a/generator/actions.ml b/generator/actions.ml index 274ef3f..a6de484 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -2655,7 +2655,7 @@ See also C<guestfs_write>." }; { defaults with name = "lstatlist"; added = (1, 0, 77); - style = RStructList ("statbufs", "stat"), [Pathname "path"; StringList "names"], []; + style = RStructList ("statbufs", "stat"), [Pathname "path"; RelativePathnameList "names"], []; deprecated_by = Some "lstatnslist";...
2009 Aug 14
1
Code snippet to work out which RStruct/RStructList structs are used and how
...to Xen guests. http://et.redhat.com/~rjones/virt-p2v -------------- next part -------------- >From 9efa77d717bd9bba5f61965eb6920429b7ae5d8e Mon Sep 17 00:00:00 2001 From: Richard W.M. Jones <rjones at redhat.com> Date: Fri, 14 Aug 2009 16:54:55 +0100 Subject: [PATCH] Work out which RStruct/RStructList structs are really used, and how. --- src/generator.ml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 58 insertions(+), 0 deletions(-) diff --git a/src/generator.ml b/src/generator.ml index b8f9ace..b76f502 100755 --- a/src/generator.ml +++ b/src/generator.ml @@...
2016 Feb 25
2
Re: [PATCH 3/3] src: print contents of structs and struct lists on tracing
...ew things that would be good though: - Export the functions through the public API. We already have functions to copy structs (eg. guestfs_copy_application, guestfs_copy_application_list). - Provide another function for printing lists of structs too, so you don't need the loop for RStructList. - With those two changes, you can get rid of the internal structs-print.h header. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. T...
2017 Apr 25
0
[PATCH] daemon: Use CLEANUP_* functions to avoid an explicit free in stub functions.
...failwithf "RConstString|RConstOptString cannot be used by daemon functions" - | RString _ -> pr " char *r;\n" - | RStringList _ | RHashtable _ -> pr " char **r;\n" - | RStruct (_, typ) -> pr " guestfs_int_%s *r;\n" typ - | RStructList (_, typ) -> pr " guestfs_int_%s_list *r;\n" typ + | RString _ -> pr " CLEANUP_FREE char *r = NULL;\n" + | RStringList _ | RHashtable _ -> pr " CLEANUP_FREE_STRING_LIST char **r = NULL;\n" + | RStruct (_, typ) -> pr " CLEANUP_FREE...
2015 Oct 20
3
[PATCH 1/2] generator: add a RelativePathnameList parameter type
Mostly like StringList (so it can used in current StringList parameters), but checking client- and daemon-side that the elements are relative paths. --- generator/bindtests.ml | 3 ++- generator/c.ml | 29 ++++++++++++++++++++++++----- generator/csharp.ml | 4 ++-- generator/daemon.ml | 20 ++++++++++++++++++-- generator/erlang.ml | 2 +- generator/fish.ml |
2016 Mar 07
1
Re: [PATCH 1/2] added icat and fls0 APIs
...ins the file type, the metadata address > +and the full path of the file. > + > +If the file was deleted, an asterisk will be shown between the file type > +and the metadata address." }; As discussed, this shouldn't be a FileOut API at all. It should return a list of structs (RStructList). If the output could be very large then we may need to split it into an internal API, but let's not worry about that right now. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt...
2015 Oct 21
2
[PATCH 1/2] generator: add a FilenameList parameter type
Mostly like StringList (so it can used in current StringList parameters), but checking client- and daemon-side that the elements are file names. --- generator/bindtests.ml | 3 ++- generator/c.ml | 29 ++++++++++++++++++++++++----- generator/csharp.ml | 4 ++-- generator/daemon.ml | 20 ++++++++++++++++++-- generator/erlang.ml | 2 +- generator/fish.ml | 10
2016 Feb 24
0
[PATCH 3/3] src: print contents of structs and struct lists on tracing
...rotocol.h\" #include \"errnostring.h\" +#include \"structs-print.h\" "; @@ -1623,7 +1624,7 @@ and generate_client_actions hash () = let needs_i = match ret with - | RStringList _ | RHashtable _ -> true + | RStringList _ | RHashtable _ | RStructList _ -> true | _ -> false in if needs_i then ( pr "%s size_t i;\n" indent; @@ -1656,15 +1657,25 @@ and generate_client_actions hash () = pr "%s }\n" indent; pr "%s fputs (\"]\", trace_buffer.fp);\n" indent; |...
2016 Feb 25
0
Re: [PATCH 3/3] src: print contents of structs and struct lists on tracing
...not find immediate use cases; although I can change idea if there are enough/good ones. After all, making the current functions public is trivial job once there's the need for them. > - Provide another function for printing lists of structs too, so you > don't need the loop for RStructList. That would follow suit with the above: currently the loops for RStructList is needed only in one (private) place. -- Pino Toscano
2012 Jan 25
2
[PATCH 1/2] gobject: Allow RConstOptString to return an error
RConstOptString cannot return an error in the C api. This makes it a special case for the GObject api, as all other return types have a corresponding GError **err argument to return an error. This change removes this special case, and includes the possibility of an error return in the API. An error is indicated by setting *err to a non-NULL value. This change is in preparation for adding a close
2016 Feb 25
1
Re: [PATCH 3/3] src: print contents of structs and struct lists on tracing
...well designed and future-proof I don't see why not. Rich. > After all, making the current functions public is trivial job once > there's the need for them. > > > - Provide another function for printing lists of structs too, so you > > don't need the loop for RStructList. > > That would follow suit with the above: currently the loops for > RStructList is needed only in one (private) place. > > -- > Pino Toscano > _______________________________________________ > Libguestfs mailing list > Libguestfs@redhat.com > https://www.redhat...
2020 Jul 06
2
[PATCH] python: Add type hints
...-> "bool" + | RConstOptString _ -> "Optional[str]" + | RConstString _ | RString _ -> "str" + | RBufferOut _ -> "bytes" + | RStringList _ -> "List[str]" + | RStruct _ -> "dict" + | RStructList _ -> "List[dict]" + | RHashtable _ -> "Union[List[Tuple[str, str]], dict]" in + let type_hint_of_argt arg = + match arg with + | String _ -> ": str" + | OptString _ -> ": Optional[str]" + | Bool _ -> &quo...
2016 Mar 07
2
Re: [PATCH 0/2] added icat and fls0 APIs for deleted files recovery
...ith this API is it pushes all the parsing up in the > stack, to libguestfs consumers. > > In general we'd like to avoid that and have just one place where all > parsing needs to be done (ie. libguestfs itself), so it'd be nicer to > have an API that returns a list of structs (RStructList) with all the > important fields parsed out. As the API documentation says, this is the low level API which I have provided as an example. I took inspiration from the guestfs_ls0 API which does a similar job storing the content of a directory onto a host file. If I understood correctly (the...
2015 Jun 18
2
Re: [PATCH] New API: btrfs_device_stats
Hi, Pino 在 2015年06月18日 16:41, Pino Toscano 写道: > Hi, > > On Thursday 18 June 2015 11:01:37 Cao jin wrote: >>> Speaking of this: you said that you have a colleague working on >>> btrfs-progs? What about suggesting to create some machine-parseable >>> output (csv, xml, yaml, json, whatever) so extracting the results of >>> btrfs tools is a lot more easy?
2009 Sep 24
1
[PATCH libguestfs] maint: use spaces, not TABs for indentation
...ring _ -> + match fst style with + | RErr -> false + | RConstString _ | RConstOptString _ -> failwithf "RConstString|RConstOptString cannot be used by daemon functions" - | RInt _ | RInt64 _ - | RBool _ | RString _ | RStringList _ - | RStruct _ | RStructList _ - | RHashtable _ | RBufferOut _ -> + | RInt _ | RInt64 _ + | RBool _ | RString _ | RStringList _ + | RStruct _ | RStructList _ + | RHashtable _ | RBufferOut _ -> pr " struct %s_ret ret;\n" name; - true in + true in p...
2016 Feb 15
1
[PATCH] Start adding return values tests for bindings
...fail('internal_test_rstringlist', v.join(' ')); -check_error('internal_test_rstringlisterr'); - -v = g.internal_test_rstruct('1'); -v.pv_size == 0 || eq_fail('internal_test_rstruct', v); -check_error('internal_test_rstructerr'); - -v = g.internal_test_rstructlist('5'); -eq = v.length == 5; -for (var i = 0; eq && i < 5; i++) { - if (v[i].pv_size != i) eq = false; -} -eq || eq_fail('internal_test_rstructlist', v); -check_error('internal_test_rstructlisterr'); - -v = g.internal_test_rhashtable('5'); -eq = true; -for...
2009 Nov 19
1
[PATCH libguestfs] syntax-check: expand TABs in generator.ml
...return p;\n"; - pr " }\n"; + pr " }\n"; ); pr "}\n\n" @@ -5592,18 +5592,18 @@ and generate_daemon_actions () = | RConstString _ | RConstOptString _ | RString _ | RStringList _ | RHashtable _ | RStruct (_, _) | RStructList (_, _) -> - pr " if (r == %s)\n" error_code; - pr " /* do_%s has already called reply_with_error */\n" name; - pr " goto done;\n"; - pr "\n" + pr " if (r == %s)\n" error_code; + pr " /* do_%s has al...
2016 Feb 24
3
[PATCH 1/3] src: generate code for printing contents of structs
Extend the generator to generate a source (and the header for it) with functions that print the content of a guestfs struct. The code is modelled after the code for it in fish.ml, although made a bit more generic (destination FILE*, line separator) so it can be used also in the library, when tracing. This just introduces the new code and builds it as part of the helper libutils.la. ---
2017 Apr 21
0
[PATCH 1/2] generator: Simplify the handling of string parameters.
...tests = [ InitScratchFS, Always, TestResultString ( [["write"; "/write_append"; "line1\n"]; @@ -1150,7 +1150,7 @@ See also C<guestfs_write>." }; { defaults with name = "lstatnslist"; added = (1, 27, 53); - style = RStructList ("statbufs", "statns"), [Pathname "path"; FilenameList "names"], []; + style = RStructList ("statbufs", "statns"), [String (Pathname, "path"); StringList (Filename, "names")], []; shortdesc = "lstat on mult...
2017 Apr 21
4
[PATCH 0/2] generator: Simplify the handling of string parameters.
Very large but mechanical change to the generator. Rich.