search for: stringset

Displaying 20 results from an estimated 177 matches for "stringset".

2015 Aug 31
2
StringSet copy constructor
I'm trying to make a string set that has a flag to become the universal set, and figured StringSet might be a good starting point struct Selection : StringSet<> { bool all; Selection(const Selection &selection) : StringSet<>(selection), all(selection.all) {} Selection(bool all) : all(all) {} size_t count(const string &s) const { if (all) return tru...
2017 Jul 24
0
Re: [PATCH] common/mlstdutils: Implement StringSet.
On Friday, 21 July 2017 18:11:58 CEST Richard W.M. Jones wrote: > --- > builder/sources.ml | 2 -- > common/mlstdutils/Makefile.am | 4 ++- > common/mlstdutils/stringSet.ml | 19 ++++++++++++ > common/mlstdutils/stringSet.mli | 46 ++++++++++++++++++++++++++++ > dib/elements.ml | 2 -- > sysprep/sysprep_operation_ca_certificates.ml | 1 - > sysprep/sysprep_operation_kerberos_data.ml | 1 - >...
2012 May 18
1
[PATCH] sysprep: remove kerberos data in the guest
...details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + *) + +open Sysprep_operation +open Sysprep_gettext.Gettext + +module StringSet = Set.Make (String) +module G = Guestfs + +let kerberos_data_perform g root = + let typ = g#inspect_get_type root in + if typ <> "windows" then ( + let excepts = [ "/var/kerberos/krb5kdc/kadm5.acl"; + "/var/kerberos/krb5kdc/kdc.conf"; ] in...
2017 Oct 09
1
Re: [PATCH v11 6/6] New tool: virt-builder-repository
...@@ -286,7 +368,7 @@ yajl_tests_LINK = \ > > index_parser_tests_DEPENDENCIES = \ > $(index_parser_tests_THEOBJECTS) \ > - ../mllib/mllib.$(MLARCHIVE) \ > + ../common/mltools/mltools.$(MLARCHIVE) \ This looks like a general fix? Should this go into a separate patch? > +open StringSet I'm 99% certain that you shouldn't be opening StringSet. What did you need that for? > + let gpgkey = match !gpgkey with "" -> None | s -> Some s in Using my proposed, not upstream, Option module, you will be able to write this as: let gpgkey = Option.default &quo...
2016 Jul 22
3
[PATCH RFC supermin] ext2_initrd: error out if we can't add anything
...ged, 5 insertions(+), 1 deletion(-) diff --git a/src/ext2_initrd.ml b/src/ext2_initrd.ml index d4a4e2f..d9a3a99 100644 --- a/src/ext2_initrd.ml +++ b/src/ext2_initrd.ml @@ -151,8 +151,12 @@ let rec build_initrd debug tmpdir modpath initrd = visit topset; close_out chan; + let num_visted = StringSet.cardinal !visited in if debug >= 1 then - printf "supermin: ext2: wrote %d modules to minimal initrd\n%!" (StringSet.cardinal !visited); + printf "supermin: ext2: wrote %d modules to minimal initrd\n%!" num_visted; + + if num_visited == 0 then + error "faile...
2016 May 30
0
[cfe-dev] How to debug if LTO generate wrong code?
...4:33: note: 'std::string' declared here > typedef basic_string<char> string; > ^ > /home/jshi19/llvm-3.8.0.src/tools/gold/gold-plugin.cpp:800:9: error: no template named 'StringSwitch' in namespace 'llvm'; did you mean 'StringSet'? > llvm::StringSwitch<unsigned>(LTOCodeModel) > ~~~~~~^~~~~~~~~~~~ > StringSet > /home/jshi19/llvm-3.8.0.src/include/llvm/ADT/StringSet.h:23:9: note: 'StringSet' declared here > class StringSet : public llvm::StringMap<char, AllocatorTy> { >...
2018 Jan 23
2
Re: [RFC PATCH v1 3/3] daemon: list-filesystems: Don't list partitioned md devices
...> - * get the list of partitions and exclude the corresponding devices > - * by using part-to-dev. > + * get the list of partitions and exclude the corresponding devices. > *) > - let devices_containing_partitions = List.fold_left ( > - fun set part -> > - StringSet.add (Devsparts.part_to_dev part) set > - ) StringSet.empty partitions in > - let devices = List.filter ( > - fun dev -> > - not (StringSet.mem dev devices_containing_partitions) > - ) devices in > + let device_without_partitions device = > + not (Devsparts.is_...
2014 Oct 31
0
[PATCH] v2v: -o libvirt: Get the <features/> right in the output XML (RHBZ#1159258).
...+++- v2v/test-v2v-i-ova.xml | 5 ++- 4 files changed, 128 insertions(+), 10 deletions(-) diff --git a/v2v/output_libvirt.ml b/v2v/output_libvirt.ml index 305ce35..7fdc0d9 100644 --- a/v2v/output_libvirt.ml +++ b/v2v/output_libvirt.ml @@ -25,6 +25,42 @@ open Types open Utils open DOM +module StringSet = Set.Make (String) + +let string_set_of_list = + List.fold_left (fun set x -> StringSet.add x set) StringSet.empty + +let target_features_of_capabilities_doc doc arch = + let xpathctx = Xml.xpath_new_context doc in + let expr = + (* NB: Pay attention to the square brackets. This returns...
2017 Jul 21
4
[PATCH] common/mlstdutils: Implement StringSet.
--- builder/sources.ml | 2 -- common/mlstdutils/Makefile.am | 4 ++- common/mlstdutils/stringSet.ml | 19 ++++++++++++ common/mlstdutils/stringSet.mli | 46 ++++++++++++++++++++++++++++ dib/elements.ml | 2 -- sysprep/sysprep_operation_ca_certificates.ml | 1 - sysprep/sysprep_operation_kerberos_data.ml | 1 - sysprep/sysprep_operati...
2014 Mar 20
3
[PATCH 1/2] builder: allow the index parser to parse files with no sections
Gracefully handle files with no sections; extend the validate.sh test to try to validate an empty file. --- builder/index-parse.y | 2 ++ builder/website/validate.sh | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/builder/index-parse.y b/builder/index-parse.y index 9355bd4..5133959 100644 --- a/builder/index-parse.y +++ b/builder/index-parse.y @@ -108,6 +108,8 @@ sections:
2016 May 30
0
[cfe-dev] How to debug if LTO generate wrong code?
...s/stringfwd.h:74:33: note: 'std::string' declared here typedef basic_string<char> string; ^ /home/jshi19/llvm-3.8.0.src/tools/gold/gold-plugin.cpp:800:9: error: no template named 'StringSwitch' in namespace 'llvm'; did you mean 'StringSet'? llvm::StringSwitch<unsigned>(LTOCodeModel) ~~~~~~^~~~~~~~~~~~ StringSet /home/jshi19/llvm-3.8.0.src/include/llvm/ADT/StringSet.h:23:9: note: 'StringSet' declared here class StringSet : public llvm::StringMap<char, AllocatorTy> { ^ In file included fro...
2012 May 09
2
[PATCH 1/2] sysprep: remove ca certificates in the guest
Remove the ca certificates. Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com> --- sysprep/Makefile.am | 2 + sysprep/sysprep_operation_ca_certificates.ml | 62 ++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 sysprep/sysprep_operation_ca_certificates.ml diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am index
2015 Nov 04
2
[PATCH] tests/c-api: cache available features
...+++++++++++++++++--- 1 file changed, 73 insertions(+), 4 deletions(-) diff --git a/generator/tests_c_api.ml b/generator/tests_c_api.ml index 6be753f..8c4e5ef 100644 --- a/generator/tests_c_api.ml +++ b/generator/tests_c_api.ml @@ -28,6 +28,8 @@ open Optgroups open Actions open Structs +module StringSet = Set.Make (String) + (* Generate the C API tests. *) let rec generate_c_api_tests () = generate_header CStyle GPLv2plus; @@ -41,6 +43,7 @@ let rec generate_c_api_tests () = #include <string.h> #include <sys/types.h> #include <sys/stat.h> +#include <stdbool.h> #in...
2017 Jul 20
1
Re: [PATCH 19/27] daemon: Reimplement ‘list_filesystems’ API in the daemon, in OCaml.
...devices = List.fold_left ( > + fun devices part -> > + let d = Devsparts.part_to_dev part in > + List.filter ((<>) d) devices > + ) devices partitions in Hm it took me a couple of reading to get it -- what would you think about the following (untested): module StringSet = Set.Make (String) ... let devices_of_partitions = List.fold_left ( fun set part -> StringSet.add part set ) partitions StringSet.empty in (* Remove *) let devices = List.filter ( fun dev -> not (StringSet.mem dev devices_of_partitions) ) devices in let dev...
2014 Sep 17
4
[PATCH 0/2] supermin: use librpm for rpm support
Hi, this work makes supermin use the rpm library instead of invoking rpm directly. This, together with a needed refactoring of the dependency resolution, should help in make supermin faster on rpm-based systems. Surely the patches will still need polishing, especially for behaviours of newly added stuff, but at least it's a good starting point. Noting that you need rpm-devel on most of rpm
2017 Feb 02
7
[PATCH 0/6] dib: various improvements
Hi, this series improves virt-dib, adding some upstream changes, and refactoring the handling of output formats. Thanks, Pino Toscano (6): dib: clear up "already provided" message dib: add --checksum dib: pass custom mkfs options after the filesystem type dib: refactor output formats handling dib: clarify "output:" lines in --machine-readable documentation dib:
2016 May 30
2
[cfe-dev] How to debug if LTO generate wrong code?
Hi Steven, > On May 29, 2016, at 11:28 PM, Shi, Steven <steven.shi at intel.com> wrote: > > Hi Mehdi, > Should I apply your attached patch on my llvm3.8 source firstly? Or should I use the latest llvm SVN trunk instead? I wrote it on trunk, but I expect it to be fairly easy to port on 3.8. This is really just quickly plumbing an option on the TargetMachine creation. --
2013 May 16
2
[PATCH] virtio-net: Reporting traffic queue distribution statistics through ethtool
...bh(&rstats->rx_syncp, start)); tot->rx_packets += rpackets; tot->tx_packets += tpackets; @@ -1177,12 +1211,83 @@ static void virtnet_get_channels(struct net_device *dev, channels->other_count = 0; } +static void virtnet_get_stat_strings(struct net_device *dev, + u32 stringset, + u8 *data) +{ + struct virtnet_info *vi = netdev_priv(dev); + int i, j; + + switch (stringset) { + case ETH_SS_STATS: + for (i = 0; i < vi->max_queue_pairs; i++) { + for (j = 0; j < VIRTNET_RX_STATS_NUM; j++) { + sprintf(data, "rxq%d: %s", i, + virtnet_et_rx_stats...
2013 May 16
2
[PATCH] virtio-net: Reporting traffic queue distribution statistics through ethtool
...bh(&rstats->rx_syncp, start)); tot->rx_packets += rpackets; tot->tx_packets += tpackets; @@ -1177,12 +1211,83 @@ static void virtnet_get_channels(struct net_device *dev, channels->other_count = 0; } +static void virtnet_get_stat_strings(struct net_device *dev, + u32 stringset, + u8 *data) +{ + struct virtnet_info *vi = netdev_priv(dev); + int i, j; + + switch (stringset) { + case ETH_SS_STATS: + for (i = 0; i < vi->max_queue_pairs; i++) { + for (j = 0; j < VIRTNET_RX_STATS_NUM; j++) { + sprintf(data, "rxq%d: %s", i, + virtnet_et_rx_stats...
2015 Mar 31
0
[PATCH] WIP: New virt-dib tool
...e Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + *) + +open Common_gettext.Gettext +open Common_utils + +open Cmdline +open Utils +open Elements + +open Printf +open Unix + +module G = Guestfs + +let exclude_elements elements excluded_elements = + StringSet.filter (fun x -> List.mem x excluded_elements <> true) elements + +let read_envvars envvars = + filter_map ( + fun var -> + let len = String.length var in + let i = string_find var "=" in + if i = -1 then ( + try Some (var, Sys.getenv var) + wi...