Pino Toscano | 12 Feb 18:04 2016
Picon

[PATCH] python: tests: use more targeted assert*() functions/checks

- use assertIsInstance, assertNotEqual, and assertIsNotNone as more
  specific checks (will produce better logging)
- use assertRaises when expecting exceptions being thrown
- when testing internal_test_rhashtable, instead of checking type and
  elements of the return values just check the return value as a whole
  (easier and already getting all the work needed by unittest)
---
 python/t/080-version.py        | 6 +++---
 python/t/420-log-messages.py   | 2 +-
 python/t/800-explicit-close.py | 6 +-----
 python/t/810-rhbz811650.py     | 5 +----
 python/t/820-rhbz912499.py     | 2 +-
 python/t/900-python-dict.py    | 9 +--------
 6 files changed, 8 insertions(+), 22 deletions(-)

diff --git a/python/t/080-version.py b/python/t/080-version.py
index e8e1e25..cda4872 100644
--- a/python/t/080-version.py
+++ b/python/t/080-version.py
 <at>  <at>  -34,13 +34,13  <at>  <at>  class Test080Version (unittest.TestCase):
         self.assertEqual (self.version['major'], 1)

     def test_minor (self):
-        self.assertTrue (isinstance (self.version['minor'], cl))
+        self.assertIsInstance (self.version['minor'], cl)

     def test_release (self):
-        self.assertTrue (isinstance (self.version['release'], cl))
+        self.assertIsInstance (self.version['release'], cl)

(Continue reading)

Richard W.M. Jones | 12 Feb 15:22 2016
Picon
Gravatar

[PATCH] tests: Make '080' be an official test of the guestfs_version API.

Useful because it tests returning a single structure.
---
 docs/guestfs-hacking.pod       |  1 +
 ocaml/Makefile.am              |  2 ++
 ocaml/t/guestfs_080_version.ml | 27 +++++++++++++++++++++++++++
 perl/t/080-version.t           | 36 ++++++++++++++++++++++++++++++++++++
 4 files changed, 66 insertions(+)
 create mode 100644 ocaml/t/guestfs_080_version.ml
 create mode 100644 perl/t/080-version.t

diff --git a/docs/guestfs-hacking.pod b/docs/guestfs-hacking.pod
index ae667c9..ecd10bf 100644
--- a/docs/guestfs-hacking.pod
+++ b/docs/guestfs-hacking.pod
 <at>  <at>  -201,6 +201,7  <at>  <at>  This is the numbering scheme used by the tests:
    060  explicit close
    065  implicit close (in GC'd languages)
    070  optargs
+   080  version

  - 100  launch, create partitions and LVs and filesystems

diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
index b79bcad..bc1d130 100644
--- a/ocaml/Makefile.am
+++ b/ocaml/Makefile.am
 <at>  <at>  -116,6 +116,7  <at>  <at>  test_progs_bc = \
 	t/guestfs_060_explicit_close.bc \
 	t/guestfs_065_implicit_close.bc \
 	t/guestfs_070_optargs.bc \
(Continue reading)

Richard W.M. Jones | 12 Feb 14:44 2016
Picon
Gravatar

[PATCH] daemon: lvm: Ignore LVs with the activationskip flag set (RHBZ#1306666).

When listing logical volumes, ignore the ones which don't get
activated automatically.  No /dev/VG/LV device node is created for
these ones which confuses APIs that attempt to do 'guestfs_lvs'
followed by opening the device node.  Note that 'guestfs_lvs_full' is
unaffected by this change.
---
 daemon/lvm.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/daemon/lvm.c b/daemon/lvm.c
index 8bef4d5..529e20d 100644
--- a/daemon/lvm.c
+++ b/daemon/lvm.c
 <at>  <at>  -157,6 +157,10  <at>  <at>  filter_convert_old_lvs_output (char *out)
     if (lv_attr[0] == 't')
       goto skip_line;

+    /* Ignore activationskip (RHBZ#1306666). */
+    if (strlen (lv_attr) >= 10 && lv_attr[9] == 'k')
+      goto skip_line;
+
     /* Ignore "unknown device" message (RHBZ#1054761). */
     if (STRNEQ (p, "unknown device")) {
       char buf[256];
 <at>  <at>  -260,7 +264,7  <at>  <at>  do_lvs (void)
     r = command (&out, &err,
                  str_lvm, "lvs",
                  "-o", "vg_name,lv_name",
-                 "-S", "lv_role=public",
+                 "-S", "lv_role=public && lv_active=active",
(Continue reading)

Pino Toscano | 12 Feb 14:20 2016
Picon

[PATCH] php: restructure and expand tests

Rename the existing tests according to the naming/numbering described in
guestfs-hacking(1), and improve the current ones:
- guestfs_php_001.phpt: rename to guestfs_020_create.phpt
- guestfs_php_003.phpt: rename to guestfs_070_optargs.phpt
- guestfs_php_bindtests.phpt: rename to guestfs_090_bindtests.phpt
- guestfs_091_version.phpt: new, checks taken from the former
  guestfs_php_002.phpt
- guestfs_100_launch.phpt: new, modelled after the equivalent in e.g.
  OCaml/Perl/Python
- guestfs_php_002.phpt: remove, as what it did is now covered by
  091_version and 100_launch
---
 .gitignore                                   | 14 ++---
 generator/main.ml                            |  2 +-
 php/Makefile.am                              |  2 +-
 php/extension/tests/guestfs_020_create.phpt  | 13 +++++
 php/extension/tests/guestfs_070_optargs.phpt | 29 ++++++++++
 php/extension/tests/guestfs_091_version.phpt | 20 +++++++
 php/extension/tests/guestfs_100_launch.phpt  | 82 ++++++++++++++++++++++++++++
 php/extension/tests/guestfs_php_001.phpt     | 13 -----
 php/extension/tests/guestfs_php_002.phpt     | 36 ------------
 php/extension/tests/guestfs_php_003.phpt     | 29 ----------
 php/run-php-tests.sh                         |  2 +-
 11 files changed, 154 insertions(+), 88 deletions(-)
 create mode 100644 php/extension/tests/guestfs_020_create.phpt
 create mode 100644 php/extension/tests/guestfs_070_optargs.phpt
 create mode 100644 php/extension/tests/guestfs_091_version.phpt
 create mode 100644 php/extension/tests/guestfs_100_launch.phpt
 delete mode 100644 php/extension/tests/guestfs_php_001.phpt
 delete mode 100644 php/extension/tests/guestfs_php_002.phpt
(Continue reading)

Pino Toscano | 11 Feb 18:41 2016
Picon

[PATCH] fish, sysprep: run FUSE-related tests only when FUSE is available

They will fail anyway in that case, so run them only when the FUSE
support is built in.
---
 fish/Makefile.am    | 6 +++++-
 sysprep/Makefile.am | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/fish/Makefile.am b/fish/Makefile.am
index fc7c729..5ffa0f1 100644
--- a/fish/Makefile.am
+++ b/fish/Makefile.am
 <at>  <at>  -297,7 +297,6  <at>  <at>  TESTS += \
 	test-find0.sh \
 	test-inspect.sh \
 	test-glob.sh \
-	test-mount-local.sh \
 	test-prep.sh \
 	test-read-file.sh \
 	test-remote.sh \
 <at>  <at>  -306,6 +305,11  <at>  <at>  TESTS += \
 	test-run.sh \
 	test-stringlist.sh \
 	test-upload-to-dir.sh
+
+if HAVE_FUSE
+TESTS += \
+	test-mount-local.sh
+endif
 endif

(Continue reading)

Roman Kagan | 9 Feb 15:53 2016

[PATCH 0/4] v2v: more control over device types

The decision on which device type to use for disks, network and video
cards on output used to be taken deep inside the converting functions.

This is not always desirable.  In particular, there are scenarios when
this decision is made before the convertion takes place.  E.g. in
in-place mode, the decisions are taken and the output VM configuration
is created outside of v2v tool.

This patchset adds support for such scenarios.  Specifically,

- the input configuration parsers are taught to extract network and
  video device models in addition to storage controllers

- the converting functions are taught to take the requested device types
  into consideration

- the main routine in in-place mode takes the relevant data from the
  input VM and passes it to the converter

The copying mode may eventually also profit from this patchset by taking
command-line options for controlling device types, but this isn't
included here.

Roman Kagan (4):
  v2v: collect source network and video adapter types
  v2v: introduce requested guestcaps type
  v2v: take requested caps into account when converting
  v2v: in-place: request caps based on source config

 test-data/phony-guests/guests.xml.in  |   8 +++
(Continue reading)

Roman Kagan | 9 Feb 15:42 2016

[PATCH] v2v: move virtio_win to windows_virtio

Now that all the stuff related to Windows virtio drivers has been moved
into a dedicated module, it makes sense to move the definition of
virtio_win there, too, and stop passing it around as a parameter.

Signed-off-by: Roman Kagan <rkagan <at> virtuozzo.com>
---
 v2v/convert_windows.ml |  9 +--------
 v2v/windows_virtio.ml  | 13 ++++++++++---
 v2v/windows_virtio.mli |  2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml
index 38fa300..f6f0911 100644
--- a/v2v/convert_windows.ml
+++ b/v2v/convert_windows.ml
 <at>  <at>  -43,13 +43,6  <at>  <at>  let convert ~keep_serial_console (g : G.guestfs) inspect source =
     try Sys.getenv "VIRT_TOOLS_DATA_DIR"
     with Not_found -> Guestfs_config.datadir // "virt-tools" in

-  let virtio_win =
-    try Sys.getenv "VIRTIO_WIN"
-    with Not_found ->
-      try Sys.getenv "VIRTIO_WIN_DIR" (* old name for VIRTIO_WIN *)
-      with Not_found ->
-        Guestfs_config.datadir // "virtio-win" in
-
   (* Check if RHEV-APT exists.  This is optional. *)
   let rhev_apt_exe = virt_tools_data_dir // "rhev-apt.exe" in
   let rhev_apt_exe =
 <at>  <at>  -289,7 +282,7  <at>  <at>  if errorlevel 3010 exit /b 0
(Continue reading)

Pino Toscano | 9 Feb 14:21 2016
Picon

[PATCH 1/2] tmpdirs: centralize permissions handling

Move to lazy_make_tmpdir the logic for making world-readable (but only
for root) newly-created temporary directories, removing the non-fatal
code doing that in guestfs_impl_launch.

Followup of commit 772f649e595d202bdb67f05aeb62157c1104be89.
---
 src/launch.c  |  7 -------
 src/tmpdirs.c | 30 ++++++++++++------------------
 2 files changed, 12 insertions(+), 25 deletions(-)

diff --git a/src/launch.c b/src/launch.c
index 9273c58..958d4b3 100644
--- a/src/launch.c
+++ b/src/launch.c
 <at>  <at>  -60,13 +60,6  <at>  <at>  guestfs_impl_launch (guestfs_h *g)
   if (guestfs_int_lazy_make_tmpdir (g) == -1)
     return -1;

-  /* Allow anyone to read the temporary directory.  The socket in this
-   * directory won't be readable but anyone can see it exists if they
-   * want. (RHBZ#610880).
-   */
-  if (chmod (g->tmpdir, 0755) == -1)
-    warning (g, "chmod: %s: %m (ignored)", g->tmpdir);
-
   /* Some common debugging information. */
   if (g->verbose) {
     CLEANUP_FREE_VERSION struct guestfs_version *v =
diff --git a/src/tmpdirs.c b/src/tmpdirs.c
index 76bf1c5..0a36f2f 100644
(Continue reading)

Richard W.M. Jones | 9 Feb 09:11 2016
Picon
Gravatar

Re: Help with Win10

On Mon, Feb 08, 2016 at 04:50:09PM -0800, Joshua Pincus wrote:
> Mr Jones,
> 
> I recently came across your excellent 2010 blog entry,
> https://rwmj.wordpress.com/2010/04/30/tip-install-a-device-driver-in-a-windows-vm/.
> The blog entry was incredibly useful for Win7.  I was wondering if you have
> any similar insights for Win10?  The CDDB is gone, and it's replacement, or
> partial replacement, the DeviceDriver database, doesn't seem to serve a
> similar purpose.
> 
> My problem is this: I have a Win10 installation that was installed natively
> onto physical media using the standard Intel storage drivers.  In short, I
> want to do precisely that you detailed in your 2010 entry under Win10; I
> want to boot that native installation using the current RedHat viostor
> driver. Win10 keeps hitting me with an 0x7B error, and it's rather
> difficult to get into debugger mode.  If I install Win7 and then try
> booting Win7 using viostor as you detailed, it works perfectly.  Win10 does
> not.  Any insights?

See:

https://github.com/libguestfs/libguestfs/blob/master/v2v/windows_virtio.ml

Rich.

--

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
(Continue reading)

Pino Toscano | 8 Feb 16:55 2016
Picon

[PATCH] tests: reduce sizes of scratch disks to 2 GB

1 GB should be enough to create a btrfs filesystem, even with 64K page
size; hence, make the /dev/sda and /dev/sdb test devices smaller so
there is less space taken during the test run.

Followup of commit 8ffad75e5b610274a664a00f1f1186070b602e18 and
commit 9e9b648770f9b8dbe8f280e4b5d1f80c4d689130.
---
 docs/guestfs-hacking.pod |  4 ++--
 generator/actions.ml     | 10 +++++-----
 tests/c-api/tests-main.c |  4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/docs/guestfs-hacking.pod b/docs/guestfs-hacking.pod
index 42d7759..ae667c9 100644
--- a/docs/guestfs-hacking.pod
+++ b/docs/guestfs-hacking.pod
 <at>  <at>  -105,11 +105,11  <at>  <at>  The test environment has 4 block devices:

 =over 4

-=item F</dev/sda> 10 GB
+=item F</dev/sda> 2 GB

 General block device for testing.

-=item F</dev/sdb> 10 GB
+=item F</dev/sdb> 2 GB

 F</dev/sdb1> is an ext2 filesystem used for testing
 filesystem write operations.
(Continue reading)

Dawid Zamirski | 6 Feb 17:50 2016

[PATCH v3] inspect: get windows drive letters for GPT disks.

This patch updates the guestfs_inspect_get_drive_mappings API call to
also return drive letters for GPT paritions. Previously this worked
only for MBR partitions. This is achieved by matching the GPT partition
GUID with the info stored in the blob from
HKLM\SYSTEM\MountedDevices\DosDevices keys. For GPT partions this blob
contains a "DMIO:ID:" prefix followed by a 16 byte binary GUID.
---

changes since v2:
 * added code review changes as per rjones

 src/inspect-fs-windows.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 94 insertions(+), 2 deletions(-)

diff --git a/src/inspect-fs-windows.c b/src/inspect-fs-windows.c
index ccf5cba..ba72727 100644
--- a/src/inspect-fs-windows.c
+++ b/src/inspect-fs-windows.c
 <at>  <at>  -25,6 +25,7  <at>  <at> 
 #include <string.h>
 #include <errno.h>
 #include <iconv.h>
+#include <inttypes.h>

 #ifdef HAVE_ENDIAN_H
 #include <endian.h>
 <at>  <at>  -57,6 +58,8  <at>  <at>  static int check_windows_arch (guestfs_h *g, struct inspect_fs *fs);
 static int check_windows_software_registry (guestfs_h *g, struct inspect_fs *fs);
 static int check_windows_system_registry (guestfs_h *g, struct inspect_fs *fs);
 static char *map_registry_disk_blob (guestfs_h *g, const void *blob);
(Continue reading)


Gmane