Pino Toscano | 23 Apr 15:19 2014
Picon

[HIVEX] port ruby tests to MiniTest (#1090407)

Just like it has been done in libguestfs, port the ruby tests in hivex
from Test::Unit to MiniTest, keeping backward compatibility with the old
test framework.

Pino Toscano (2):
  ruby: tests: isolate boilerplate in common file
  ruby: tests: convert from Test::Unit to MiniTest (RHBZ#1090407)

 ruby/Makefile.am               |  3 ++-
 ruby/tests/tc_010_load.rb      |  9 ++++-----
 ruby/tests/tc_021_close.rb     |  9 ++++-----
 ruby/tests/tc_120_rlenvalue.rb | 13 ++++++-------
 ruby/tests/tc_130_special.rb   |  9 ++++-----
 ruby/tests/tc_200_write.rb     |  9 ++++-----
 ruby/tests/tc_210_setvalue.rb  |  9 ++++-----
 ruby/tests/test_helper.rb      | 31 +++++++++++++++++++++++++++++++
 8 files changed, 59 insertions(+), 33 deletions(-)
 create mode 100644 ruby/tests/test_helper.rb

--

-- 
1.9.0
Pino Toscano | 23 Apr 10:40 2014
Picon

[PATCH] builder: isolate all the cache handling to a new Cache module

While there is not that much in it, it groups together the small
scattered-around bits handling the cache directory.
---
 builder/Makefile.am    |  3 +++
 builder/builder.ml     | 48 ++++++++++++++-----------------------
 builder/cache.ml       | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++
 builder/cache.mli      | 45 ++++++++++++++++++++++++++++++++++
 builder/downloader.ml  | 12 ++++------
 builder/downloader.mli |  7 +-----
 po/POTFILES-ml         |  1 +
 7 files changed, 137 insertions(+), 44 deletions(-)
 create mode 100644 builder/cache.ml
 create mode 100644 builder/cache.mli

diff --git a/builder/Makefile.am b/builder/Makefile.am
index 7d399d4..21710f1 100644
--- a/builder/Makefile.am
+++ b/builder/Makefile.am
 <at>  <at>  -46,6 +46,8  <at>  <at>  CLEANFILES = *~ *.cmi *.cmo *.cmx *.cmxa *.o virt-builder
 SOURCES = \
 	architecture.ml \
 	builder.ml \
+	cache.mli \
+	cache.ml \
 	cmdline.ml \
 	downloader.mli \
 	downloader.ml \
 <at>  <at>  -120,6 +122,7  <at>  <at>  deps = \
 	paths.cmx \
 	languages.cmx \
(Continue reading)

Hilko Bengen | 22 Apr 21:21 2014
Picon

[PATCH] Fix qemu version check

---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index ab072c3..9c398e0 100644
--- a/configure.ac
+++ b/configure.ac
 <at>  <at>  -777,7 +777,7  <at>  <at>  working.
         fi

         AC_MSG_CHECKING([for $QEMU version >= 1])
-        if $QEMU -version | grep -sq 'version  <at> <: <at> 1- <at> :> <at> '; then
+        if $QEMU -version | grep -sq 'version  <at> <: <at> 1-9 <at> :> <at> '; then
             AC_MSG_RESULT([yes])
         else
             AC_MSG_RESULT([no])
--

-- 
1.9.2
Pino Toscano | 22 Apr 17:41 2014
Picon

[PATCH 1/2] builder: add an optional suffix string for INI parsing errors

---
 builder/index-parse.y    | 6 ++++--
 builder/index-parser-c.c | 3 ++-
 builder/index-struct.h   | 1 +
 builder/ini_reader.ml    | 6 +++---
 builder/ini_reader.mli   | 2 +-
 5 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/builder/index-parse.y b/builder/index-parse.y
index 310870d..7ddef53 100644
--- a/builder/index-parse.y
+++ b/builder/index-parse.y
 <at>  <at>  -150,12 +150,14  <at>  <at>  emptylines:
 void
 yyerror (YYLTYPE * yylloc, yyscan_t scanner, struct parse_context *context, const char *msg)
 {
-  fprintf (stderr, "%s%s%s%ssyntax error at line %d: %s\n",
+  fprintf (stderr, "%s%s%s%ssyntax error at line %d: %s%s%s\n",
            context->program_name ? context->program_name : "",
            context->program_name ? ": " : "",
            context->input_file ? context->input_file : "",
            context->input_file ? ": " : "",
-           yylloc->first_line, msg);
+           yylloc->first_line, msg,
+           context->error_suffix ? " " : "",
+           context->error_suffix ? context->error_suffix : "");
 }

 int
diff --git a/builder/index-parser-c.c b/builder/index-parser-c.c
(Continue reading)

Pino Toscano | 18 Apr 11:45 2014
Picon

[PATCH 1/2] ruby: tests: isolate boilerplate in common file

Isolate in a common file all the standard boilerplate in tests, i.e. the
import of the test framework and the guestfs module (including the
import path hack needed for the latter).

Thanks to Vít Ondruch for the precious hints and suggestions.
---
 ruby/Makefile.am                   |  3 ++-
 ruby/t/tc_010_load.rb              |  5 +----
 ruby/t/tc_020_create.rb            |  5 +----
 ruby/t/tc_030_create_flags.rb      |  7 ++-----
 ruby/t/tc_040_create_multiple.rb   |  7 ++-----
 ruby/t/tc_050_handle_properties.rb |  7 ++-----
 ruby/t/tc_060_explicit_close.rb    |  7 ++-----
 ruby/t/tc_070_optargs.rb           |  7 ++-----
 ruby/t/tc_100_launch.rb            |  5 +----
 ruby/t/tc_410_close_event.rb       |  5 +----
 ruby/t/tc_420_log_messages.rb      |  5 +----
 ruby/t/tc_800_rhbz507346.rb        |  7 ++-----
 ruby/t/tc_810_rhbz664558c6.rb      |  7 ++-----
 ruby/t/tc_820_rhbz1046509.rb       |  7 ++-----
 ruby/t/test_helper.rb              | 22 ++++++++++++++++++++++
 15 files changed, 45 insertions(+), 61 deletions(-)
 create mode 100644 ruby/t/test_helper.rb

diff --git a/ruby/Makefile.am b/ruby/Makefile.am
index 8c96844..f605188 100644
--- a/ruby/Makefile.am
+++ b/ruby/Makefile.am
 <at>  <at>  -29,7 +29,8  <at>  <at>  EXTRA_DIST = \
 	lib/guestfs.rb \
(Continue reading)

Pino Toscano | 17 Apr 11:38 2014
Picon

[PATCH] daemon: parted: part-get-name: switch from sgdisk to parted (RHBZ#1088424).

Use parted to get the name of partitions in GPT layouts instead of
sgdisk, to reduce the possible discrepancy between output of tools.

The actual case here is that recent parted versions fixed/improved their
UTF-16 handling of partition names in GPT, and sgdisk seems to not be
properly handling them, returning also unicode control bytes.
Since parted can provide partition names already, just make use of it.

Since sgdisk is no more needed for part_get_name, the function is no
more optional on it.
---
 daemon/parted.c      | 80 ++++++++++++++++++++++++++++++++++++----------------
 generator/actions.ml |  1 -
 2 files changed, 55 insertions(+), 26 deletions(-)

diff --git a/daemon/parted.c b/daemon/parted.c
index fce4cf9..5b049f5 100644
--- a/daemon/parted.c
+++ b/daemon/parted.c
 <at>  <at>  -886,27 +886,6  <at>  <at>  extract_uuid (const char *value)
   return ret;
 }

-static char *
-extract_optionally_quoted (const char *value)
-{
-  size_t value_len = strlen (value);
-
-  if (value_len >= 2 &&
-      ((value[0] == '\'' && value[value_len - 1] == '\'') ||
(Continue reading)

Richard W.M. Jones | 16 Apr 13:09 2014
Picon

[PATCH] disk-create: Fix this API so it works correctly with block devices (RHBZ#1088262).

When you call guestfs_disk_create on a block device with format=raw
then it will try to discard the blocks on the device.
---
 configure.ac         |  1 +
 daemon/blkdiscard.c  |  3 +++
 generator/actions.ml |  4 ++++
 src/create.c         | 46 +++++++++++++++++++++++++++++++++++++++-------
 4 files changed, 47 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index 887feea..014332e 100644
--- a/configure.ac
+++ b/configure.ac
 <at>  <at>  -291,6 +291,7  <at>  <at>  AC_CHECK_HEADERS([\
     byteswap.h \
     endian.h \
     errno.h \
+    linux/fs.h \
     linux/raid/md_u.h \
     printf.h \
     sys/inotify.h \
diff --git a/daemon/blkdiscard.c b/daemon/blkdiscard.c
index 7b63b99..612c97f 100644
--- a/daemon/blkdiscard.c
+++ b/daemon/blkdiscard.c
 <at>  <at>  -25,7 +25,10  <at>  <at> 
 #include <fcntl.h>
 #include <unistd.h>
 #include <sys/ioctl.h>
+
(Continue reading)

Pino Toscano | 15 Apr 14:15 2014
Picon

[PATCH] builder: add per-repository proxy configuration

Add the possibility to configure the proxy in each repository .conf
file, specifying whether use no proxy at all, follow the system
configuration or use a specific proxy.
---
 builder/builder.ml       | 10 +++++-----
 builder/downloader.ml    | 44 ++++++++++++++++++++++++++++++++++++--------
 builder/downloader.mli   | 15 +++++++++++++--
 builder/index_parser.ml  |  4 ++--
 builder/index_parser.mli |  2 +-
 builder/list_entries.ml  |  4 ++--
 builder/list_entries.mli |  2 +-
 builder/sources.ml       | 12 +++++++++++-
 builder/sources.mli      |  1 +
 builder/virt-builder.pod | 25 +++++++++++++++++++++++++
 10 files changed, 97 insertions(+), 22 deletions(-)

diff --git a/builder/builder.ml b/builder/builder.ml
index 81eb2d9..062dbb9 100644
--- a/builder/builder.ml
+++ b/builder/builder.ml
 <at>  <at>  -136,25 +136,25  <at>  <at>  let main () =
   let downloader = Downloader.create ~debug ~curl ~cache in
   let repos = Sources.read_sources ~prog ~debug in
   let repos = List.map (
-    fun { Sources.uri = uri; Sources.gpgkey = gpgkey } ->
+    fun { Sources.uri = uri; Sources.gpgkey = gpgkey; Sources.proxy = proxy } ->
       let gpgkey =
         match gpgkey with
         | None -> Sigchecker.No_Key
         | Some key -> Sigchecker.KeyFile key in
(Continue reading)

Richard W.M. Jones | 14 Apr 19:00 2014
Picon

[PATCH v4 NOT TO BE APPLIED] New tool: virt-v2v.

This is a rewrite of the original virt-v2v tool.  The original was
written by Matt Booth et al in Perl between 2009 and 2013.
---
 .gitignore                       |   6 +
 Makefile.am                      |   6 +-
 configure.ac                     |   5 +-
 fish/guestfish.pod               |   1 +
 po/POTFILES                      |   2 +
 po/POTFILES-ml                   |  11 +
 src/guestfs.pod                  |   5 +
 v2v/Makefile.am                  | 163 ++++++++++
 v2v/README                       |  23 ++
 v2v/cmdline.ml                   | 197 ++++++++++++
 v2v/convert_linux_common.ml      | 236 +++++++++++++++
 v2v/convert_linux_common.mli     |  45 +++
 v2v/convert_linux_enterprise.ml  | 637 +++++++++++++++++++++++++++++++++++++++
 v2v/convert_linux_enterprise.mli |  19 ++
 v2v/convert_linux_grub.ml        | 330 ++++++++++++++++++++
 v2v/convert_linux_grub.mli       |  43 +++
 v2v/convert_windows.ml           |  22 ++
 v2v/convert_windows.mli          |  19 ++
 v2v/link.sh.in                   |  22 ++
 v2v/source_libvirt.ml            | 118 ++++++++
 v2v/source_libvirt.mli           |  27 ++
 v2v/target_local.ml              |  86 ++++++
 v2v/target_local.mli             |  21 ++
 v2v/types.ml                     |  84 ++++++
 v2v/types.mli                    |  77 +++++
 v2v/utils-c.c                    |  43 +++
 v2v/utils.ml                     |  44 +++
(Continue reading)

Pino Toscano | 14 Apr 14:29 2014
Picon

[PATCH] sysprep: remove also hidden files/dirs in temporary dirs

List manually and remove the content left (hidden files/directories) in
temporary directories after the glob listing & removal.
---
 sysprep/sysprep_operation_tmp_files.ml | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/sysprep/sysprep_operation_tmp_files.ml b/sysprep/sysprep_operation_tmp_files.ml
index dc0247e..d5a52f3 100644
--- a/sysprep/sysprep_operation_tmp_files.ml
+++ b/sysprep/sysprep_operation_tmp_files.ml
 <at>  <at>  -24,15 +24,22  <at>  <at>  module G = Guestfs
 let tmp_files_perform ~debug ~quiet g root side_effects =
   let typ = g#inspect_get_type root in
   if typ <> "windows" then (
-    let paths = [ "/tmp/*";
-                  "/var/tmp/*"; ] in
+    let paths = [ "/tmp";
+                  "/var/tmp"; ] in
     List.iter (
       fun path ->
-        let files = g#glob_expand path in
+        let files = g#glob_expand (path ^ "/*") in
         Array.iter (
           fun file ->
             g#rm_rf file;
         ) files;
+        (try
+          let files = g#ls path in
+          Array.iter (
+            fun file ->
(Continue reading)

Richard W.M. Jones | 9 Apr 15:50 2014
Picon

[PATCH v3 NOT TO BE APPLIED] New tool: virt-v2v.

This is a rewrite of the original virt-v2v tool.  The original was
written by Matt Booth et al in Perl between 2009 and 2013.
---
 .gitignore                       |   5 +
 Makefile.am                      |   6 +-
 configure.ac                     |   3 +-
 fish/guestfish.pod               |   1 +
 po/POTFILES                      |   2 +
 po/POTFILES-ml                   |  11 ++
 src/guestfs.pod                  |   5 +
 v2v/Makefile.am                  | 185 +++++++++++++++++++++
 v2v/README                       |  15 ++
 v2v/cmdline.ml                   | 197 ++++++++++++++++++++++
 v2v/convert_linux_common.ml      | 131 +++++++++++++++
 v2v/convert_linux_common.mli     |  35 ++++
 v2v/convert_linux_enterprise.ml  | 185 +++++++++++++++++++++
 v2v/convert_linux_enterprise.mli |  19 +++
 v2v/convert_linux_grub.ml        | 160 ++++++++++++++++++
 v2v/convert_linux_grub.mli       |  35 ++++
 v2v/convert_windows.ml           |  22 +++
 v2v/convert_windows.mli          |  19 +++
 v2v/source_libvirt.ml            | 118 ++++++++++++++
 v2v/source_libvirt.mli           |  27 +++
 v2v/target_local.ml              |  86 ++++++++++
 v2v/target_local.mli             |  21 +++
 v2v/types.ml                     |  84 ++++++++++
 v2v/types.mli                    |  77 +++++++++
 v2v/utils-c.c                    |  43 +++++
 v2v/utils.ml                     |  44 +++++
 v2v/v2v.ml                       | 344 +++++++++++++++++++++++++++++++++++++++
(Continue reading)


Gmane