Just simple code fixes ... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
Richard W.M. Jones
2009-Oct-31 13:46 UTC
[Libguestfs] [PATCH 1/3] daemon: Don't warn on -Wunsafe-loop-optimizations.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v -------------- next part -------------->From f67fd5384c4a6c92ddd9fd24a996f07087e93040 Mon Sep 17 00:00:00 2001From: Richard Jones <rjones at redhat.com> Date: Sat, 31 Oct 2009 13:37:04 +0000 Subject: [PATCH 1/3] daemon: Don't warn on -Wunsafe-loop-optimizations. Ignore -Wunsafe-loop-optimizations, same as in the top level configure file. --- daemon/configure.ac | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/daemon/configure.ac b/daemon/configure.ac index c5cd0c7..52da3ad 100644 --- a/daemon/configure.ac +++ b/daemon/configure.ac @@ -93,6 +93,8 @@ if test "$gl_gcc_warnings" = yes; then nw="$nw -Winline" # daemon.h's asprintf_nowarn nw="$nw -Wshadow" # numerous, plus we're not unanimous # ?? -Wstrict-overflow + nw="$nw -Wunsafe-loop-optimizations" # just a warning that an optimization + # was not possible, safe to ignore gl_MANYWARN_ALL_GCC([ws]) gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw]) -- 1.6.5.rc2
Richard W.M. Jones
2009-Oct-31 13:46 UTC
[Libguestfs] [PATCH 2/3] Fix rstructs_used handling in guestfish generated code.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw -------------- next part -------------->From 72bbe38ea39ebcb290a2228ba721a68ea59b1bec Mon Sep 17 00:00:00 2001From: Richard Jones <rjones at redhat.com> Date: Sat, 31 Oct 2009 13:38:14 +0000 Subject: [PATCH 2/3] Fix rstructs_used handling in guestfish generated code. rstructs_used wasn't correctly generating code for guestfish because guestfish doesn't make all functions visible. Since the calculation of rstructs_used was over all functions (including ones not available in guestfish) it could have generated unnecessary functions. In fact this error didn't affect us before - but I discovered it when I added some extra struct-returning functions (future commit). --- src/generator.ml | 24 +++++++----------------- 1 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/generator.ml b/src/generator.ml index 4e056e2..2cabd4a 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -3915,7 +3915,7 @@ type rstructs_used_t = RStructOnly | RStructListOnly | RStructAndList * == there are functions returning both RStruct (_, structname) * and RStructList (_, structname) *) -let rstructs_used +let rstructs_used_by functions (* ||| is a "logical OR" for rstructs_used_t *) let (|||) a b match a, b with @@ -3944,21 +3944,11 @@ let rstructs_used | RStruct (_, structname) -> update structname RStructOnly | RStructList (_, structname) -> update structname RStructListOnly | _ -> () - ) all_functions; + ) functions; (* return key->values as a list of (key,value) *) Hashtbl.fold (fun key value xs -> (key, value) :: xs) h [] -(* debug: -let () - List.iter ( - function - | sn, RStructOnly -> printf "%s RStructOnly\n" sn - | sn, RStructListOnly -> printf "%s RStructListOnly\n" sn - | sn, RStructAndList -> printf "%s RStructAndList\n" sn - ) rstructs_used -*) - (* Used for testing language bindings. *) type callt | CallString of string @@ -6334,19 +6324,19 @@ and generate_fish_cmds () (* generate the function for typ *) emit_print_list_function typ | typ, _ -> () (* empty *) - ) rstructs_used; + ) (rstructs_used_by all_functions); (* Emit a print_TYPE function definition only if that function is used. *) List.iter ( function - | typ, RStructOnly -> + | typ, (RStructOnly | RStructAndList) -> pr "static void print_%s (struct guestfs_%s *%s)\n" typ typ typ; pr "{\n"; pr " print_%s_indent (%s, \"\");\n" typ typ; pr "}\n"; pr "\n"; | typ, _ -> () (* empty *) - ) rstructs_used; + ) (rstructs_used_by all_functions); (* run_<action> actions *) List.iter ( @@ -6942,7 +6932,7 @@ copy_table (char * const * argv) (* generate the function for typ *) emit_ocaml_copy_list_function typ | typ, _ -> () (* empty *) - ) rstructs_used; + ) (rstructs_used_by all_functions); (* The wrappers. *) List.iter ( @@ -7888,7 +7878,7 @@ py_guestfs_close (PyObject *self, PyObject *args) (* generate the function for typ *) emit_put_list_function typ | typ, _ -> () (* empty *) - ) rstructs_used; + ) (rstructs_used_by all_functions); (* Python wrapper functions. *) List.iter ( -- 1.6.5.rc2
Richard W.M. Jones
2009-Oct-31 13:46 UTC
[Libguestfs] [PATCH 3/3] guestfish: Fix printing of buffers in structs.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/ -------------- next part -------------->From 84a81da28811fda1363c6400ab5ce17e08e631ba Mon Sep 17 00:00:00 2001From: Richard Jones <rjones at redhat.com> Date: Sat, 31 Oct 2009 13:40:12 +0000 Subject: [PATCH 3/3] guestfish: Fix printing of buffers in structs. Somehow an 'indent' string crept in there, so it was printing: <char><indent><char><indent><char>... instead of: <char><char><char>... --- src/generator.ml | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generator.ml b/src/generator.ml index 2cabd4a..b17ee65 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -6289,9 +6289,9 @@ and generate_fish_cmds () pr " printf (\"%%s%s: \", indent);\n" name; pr " for (i = 0; i < %s->%s_len; ++i)\n" typ name; pr " if (c_isprint (%s->%s[i]))\n" typ name; - pr " printf (\"%%s%%c\", indent, %s->%s[i]);\n" typ name; + pr " printf (\"%%c\", %s->%s[i]);\n" typ name; pr " else\n"; - pr " printf (\"%%s\\\\x%%02x\", indent, %s->%s[i]);\n" typ name; + pr " printf (\"\\\\x%%02x\", %s->%s[i]);\n" typ name; pr " printf (\"\\n\");\n" | name, (FUInt64|FBytes) -> pr " printf (\"%%s%s: %%\" PRIu64 \"\\n\", indent, %s->%s);\n" -- 1.6.5.rc2
Matthew Booth
2009-Nov-02 15:40 UTC
[Libguestfs] [PATCH 1/3] daemon: Don't warn on -Wunsafe-loop-optimizations.
On 31/10/09 13:46, Richard W.M. Jones wrote:> > > > _______________________________________________ > Libguestfs mailing list > Libguestfs at redhat.com > https://www.redhat.com/mailman/listinfo/libguestfsACK. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
Matthew Booth
2009-Nov-02 15:54 UTC
[Libguestfs] [PATCH 2/3] Fix rstructs_used handling in guestfish generated code.
On 31/10/09 13:46, Richard W.M. Jones wrote:> > > > _______________________________________________ > Libguestfs mailing list > Libguestfs at redhat.com > https://www.redhat.com/mailman/listinfo/libguestfsACK. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
Matthew Booth
2009-Nov-02 16:04 UTC
[Libguestfs] [PATCH 3/3] guestfish: Fix printing of buffers in structs.
On 31/10/09 13:46, Richard W.M. Jones wrote:> > > > _______________________________________________ > Libguestfs mailing list > Libguestfs at redhat.com > https://www.redhat.com/mailman/listinfo/libguestfsACK. Note the other one just above here, btw: | name, FUUID -> pr " printf (\"%s: \");\n" name; pr " for (i = 0; i < 32; ++i)\n"; pr " printf (\"%%s%%c\", indent, %s->%s[i]);\n" typ name; pr " printf (\"\\n\");\n" Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
Maybe Matching Threads
- [PATCH 0/12] Add support for writing to hive files
- [PATCH REBASED] Remove main loop
- [PATCH 0/4] Fix RHBZ#597112 (get-e2uuid command)
- [PATCH 0/4] Allow QEMU if=... (block device emulation) to be overridden
- [PATCH 0/2] Use link-local addresses when communicating between appliance and host (RHBZ#588763)