[PATCH] v2v: windows: save log file from rhev-apt installer
by Tomáš Golembiovský
Store log from MSI installer. Log file will be located in firstboot
scripts-done directory with name rhev-apt.log. The path has to be
double-quoted to handle spaces in path name properly.
Hopefully this can help resolve RHBZ#1584678 someday.
Signed-off-by: Tomáš Golembiovský <tgolembi(a)redhat.com>
---
v2v/convert_windows.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml
index 1db3c0ea6..7ea56592c 100644
--- a/v2v/convert_windows.ml
+++ b/v2v/convert_windows.ml
@@ -378,7 +378,7 @@ echo Wait for PnP to complete
@echo off
echo installing rhev-apt
-\"\\rhev-apt.exe\" /S /v/qn
+\"\\rhev-apt.exe\" /S /v/qn /v/l*vx \"/v\\\"%cd%\\rhev-apt.log\\\"\"
echo starting rhev-apt
net start rhev-apt
--
2.20.1
5 years, 9 months
[PATCH v2 0/3] allow alternative guest tools directories for distributions
by Tomáš Golembiovský
First patch just fixes installing guest tools from directory that was broken.
Second patch revamps how virt-v2v chooses from which directory install guest
tools on Linux. Details in commit message.
v2:
- included comments from Pino and Rich
- added test
Tomáš Golembiovský (3):
v2v: fix path to source when copying files from guest tools directory
v2v: allow alternative directories for distributions
v2v: tests: test paths for installation of linux guest tools
v2v/Makefile.am | 1 +
v2v/test-v2v-copy-guest-tools.sh | 87 ++++++++++++++++++++++++++++++++
v2v/windows_virtio.ml | 82 ++++++++++++++++++------------
3 files changed, 137 insertions(+), 33 deletions(-)
create mode 100755 v2v/test-v2v-copy-guest-tools.sh
--
2.20.1
5 years, 9 months
[PATCH 0/3] v2v: improve RHV guest tools installation
by Pino Toscano
This series slightly improves the way qemu-ga is installed from the
RHV Tools ISO, simplifying the feedback to the user.
Patch #3 sort of conflicts with patch #2 of a related series by
Tomáš Golembiovský:
https://www.redhat.com/archives/libguestfs/2019-February/msg00016.html
Pino Toscano (3):
v2v: linux: add helper functions for pkg arch and extension
v2v: try to pick the right arch for qemu-ga pkgs
v2v: change the reporting of RHV Tools messages/warnings/error
v2v/linux.ml | 21 +++++++++++++++++++++
v2v/linux.mli | 8 ++++++++
v2v/windows_virtio.ml | 21 ++++++++++++++-------
3 files changed, 43 insertions(+), 7 deletions(-)
--
2.20.1
5 years, 9 months
[PATCH] lib: direct: Set QEMU_AUDIO_DRV=none when testing schema.
by Richard W.M. Jones
Schema parsing was failing with errors such as:
libguestfs: QMP parse error: '[' or '{' expected near end of file (ignored)
This happened because the QMP command was actually completely failing
and never printing a result at all. This happens because the qemu
audio driver can't be set up without a console. We can suppress this
by setting the environment variable QEMU_AUDIO_DRV=none, which is the
same thing that libvirt does, and also the same thing that we are
already doing when launching the real appliance subprocess.
See also: https://bugzilla.redhat.com/show_bug.cgi?id=1692047
---
lib/qemu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/qemu.c b/lib/qemu.c
index 10bb83105..2f3493217 100644
--- a/lib/qemu.c
+++ b/lib/qemu.c
@@ -566,6 +566,7 @@ generic_qmp_test (guestfs_h *g, struct qemu_data *data,
/* Exit QEMU after sending the commands. */
guestfs_int_cmd_add_string_unquoted (cmd, "'{ \"execute\": \"quit\" }' ");
guestfs_int_cmd_add_string_unquoted (cmd, " | ");
+ guestfs_int_cmd_add_string_unquoted (cmd, "QEMU_AUDIO_DRV=none ");
guestfs_int_cmd_add_string_quoted (cmd, g->hv);
guestfs_int_cmd_add_string_unquoted (cmd, " -display none");
guestfs_int_cmd_add_string_unquoted (cmd, " -machine ");
--
2.21.0
5 years, 9 months
[PATCH 1/3] v2v: tests: add debian-9 and fedora-29 for test-v2v-conversion-of
by Pino Toscano
Test the newer versions of these distros.
---
v2v/Makefile.am | 2 ++
1 file changed, 2 insertions(+)
diff --git a/v2v/Makefile.am b/v2v/Makefile.am
index 53c137fc6..39511022e 100644
--- a/v2v/Makefile.am
+++ b/v2v/Makefile.am
@@ -530,8 +530,10 @@ real_guests_scripts = \
test-v2v-conversion-of-debian-6.sh \
test-v2v-conversion-of-debian-7.sh \
test-v2v-conversion-of-debian-8.sh \
+ test-v2v-conversion-of-debian-9.sh \
test-v2v-conversion-of-fedora-20.sh \
test-v2v-conversion-of-fedora-23.sh \
+ test-v2v-conversion-of-fedora-29.sh \
test-v2v-conversion-of-opensuse-13.1.sh \
test-v2v-conversion-of-opensuse-13.2.sh \
test-v2v-conversion-of-opensuse-42.1.sh \
--
2.20.1
5 years, 9 months
nbdkit & qemu 2.12: qemu-img: Protocol error: simple reply when structured reply chunk was expected
by Richard W.M. Jones
nbdkit (upstream 5a7a394c699) currently fails with qemu 2.12.0:
$ ./nbdkit memory size=64M --run 'qemu-img convert $nbd /var/tmp/out'
nbdkit: memory.2: error: invalid request: unknown command (7) ignored
qemu-img: Protocol error: simple reply when structured reply chunk was expected
This was a bug in qemu which was fixed upstream quite a long time ago
by the commit I've attached at the end of this email.
Unfortunately RHEL 7.6 & 7.7 (qemu-kvm-rhev-2.12.0-25.el7) doesn't
contain the fix. I wonder if we should:
(a) Not worry about it - it's Red Hat's problem.
(b) Try and get it fixed in RHEL. I filed a BZ already but I guess it
won't be fixed any time soon: https://bugzilla.redhat.com/1692018
(c) Add a workaround in nbdkit.
I feel that we probably shouldn't be broken out of the box with RHEL
and CentOS 7.6 and 7.7, even though it's not an nbdkit (or qemu) bug.
Rich.
----------------------------------------------------------------------
89aa0d87634e2cb98517509dc8bdb876f26ecf8b is the first bad commit
commit 89aa0d87634e2cb98517509dc8bdb876f26ecf8b
Author: Vladimir Sementsov-Ogievskiy <vsementsov(a)virtuozzo.com>
Date: Fri Apr 27 17:20:01 2018 +0300
nbd/client: fix nbd_negotiate_simple_meta_context
Initialize received variable. Otherwise, is is possible for server to
answer without any contexts, but we will set context_id to something
random (received_id is not initialized too) and return 1, which is
wrong.
To solve it, just initialize received to false. Initialize received_id
too, just to make all possible checkers happy.
Bug was introduced in 78a33ab58782efdb206de14 "nbd: BLOCK_STATUS for
standard get_block_status function: client part" with the whole
function.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov(a)virtuozzo.com>
Message-Id: <20180427142002.21930-2-vsementsov(a)virtuozzo.com>
Reviewed-by: Eric Blake <eblake(a)redhat.com>
CC: qemu-stable(a)nongnu.org
Signed-off-by: Eric Blake <eblake(a)redhat.com>
:040000 040000 9993feb118af1a9a59dbc8fe92015a324e93e557 14db90d621d6b7f1ee5ff97a0ca2cb92f6f2f7e9 M nbd
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v
5 years, 9 months
[PATCH] inspect: fix icon of RHEL
by Pino Toscano
Use a better icon for RHEL guests, still provided by redhat-logos (or
equivalent in downstream distributions), and which fits a better
definition of logo for the distribution.
Thanks to Ray Strode for the hints.
---
lib/inspect-icon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/inspect-icon.c b/lib/inspect-icon.c
index e785a2172..5c7da0476 100644
--- a/lib/inspect-icon.c
+++ b/lib/inspect-icon.c
@@ -321,7 +321,7 @@ icon_rhel (guestfs_h *g, int major, size_t *size_r)
if (major < 7)
shadowman = "/usr/share/pixmaps/redhat/shadowman-transparent.png";
else
- shadowman = "/usr/share/pixmaps/fedora-logo-sprite.png";
+ shadowman = "/usr/share/icons/hicolor/96x96/apps/system-logo-icon.png";
return get_png (g, shadowman, size_r, 102400);
}
--
2.20.1
5 years, 9 months
[PATCH] v2v: -o libvirt: write win2k19 osinfo ID
by Pino Toscano
When writing the libosinfo metadata in the libvirt XML, use the newly
added (in osinfo-db) ID for Windows Server 2019; sadly, this version of
Windows has the same version as Windows Server 2016, so distinguish it
by looking at its product name.
---
v2v/create_libvirt_xml.ml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/v2v/create_libvirt_xml.ml b/v2v/create_libvirt_xml.ml
index a8dc1f2f0..dbc24315f 100644
--- a/v2v/create_libvirt_xml.ml
+++ b/v2v/create_libvirt_xml.ml
@@ -124,6 +124,11 @@ let get_osinfo_id = function
| { i_type = "windows"; i_major_version = 6; i_minor_version = 3 } ->
Some "http://microsoft.com/win/8.1"
+ | { i_type = "windows"; i_major_version = 10; i_minor_version = 0;
+ i_product_variant = "Server"; i_product_name = product }
+ when String.find product "2019" >= 0 ->
+ Some "http://microsoft.com/win/2k19"
+
| { i_type = "windows"; i_major_version = 10; i_minor_version = 0;
i_product_variant = "Server" } ->
Some "http://microsoft.com/win/2k16"
--
2.20.1
5 years, 9 months
[PATCH v2] inspect: return osinfo short IDs for recent Windows versions
by Pino Toscano
Return the right osinfo short IDs for the majority of Windows versions
since Windows XP.
---
Changes from v1:
- used the new win2k19 osinfo ID
lib/inspect-osinfo.c | 63 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)
diff --git a/lib/inspect-osinfo.c b/lib/inspect-osinfo.c
index 816d317f1..e0d19c672 100644
--- a/lib/inspect-osinfo.c
+++ b/lib/inspect-osinfo.c
@@ -69,6 +69,69 @@ guestfs_impl_inspect_get_osinfo (guestfs_h *g, const char *root)
if (STREQ (distro, "msdos"))
return safe_strdup (g, "msdos6.22");
}
+ else if (STREQ (type, "windows")) {
+ CLEANUP_FREE char *product_name = NULL;
+ CLEANUP_FREE char *product_variant = NULL;
+
+ product_name = guestfs_inspect_get_product_name (g, root);
+ if (!product_name)
+ return NULL;
+ product_variant = guestfs_inspect_get_product_variant (g, root);
+ if (!product_variant)
+ return NULL;
+
+ switch (major) {
+ case 5:
+ switch (minor) {
+ case 1:
+ return safe_strdup (g, "winxp");
+ case 2:
+ if (strstr (product_name, "XP"))
+ return safe_strdup (g, "winxp");
+ else if (strstr (product_name, "R2"))
+ return safe_strdup (g, "win2k3r2");
+ else
+ return safe_strdup (g, "win2k3");
+ }
+ break;
+ case 6:
+ switch (minor) {
+ case 0:
+ if (strstr (product_variant, "Server"))
+ return safe_strdup (g, "win2k8");
+ else
+ return safe_strdup (g, "winvista");
+ case 1:
+ if (strstr (product_variant, "Server"))
+ return safe_strdup (g, "win2k8r2");
+ else
+ return safe_strdup (g, "win7");
+ case 2:
+ if (strstr (product_variant, "Server"))
+ return safe_strdup (g, "win2k12");
+ else
+ return safe_strdup (g, "win8");
+ case 3:
+ if (strstr (product_variant, "Server"))
+ return safe_strdup (g, "win2k12r2");
+ else
+ return safe_strdup (g, "win8.1");
+ }
+ break;
+ case 10:
+ switch (minor) {
+ case 0:
+ if (strstr (product_variant, "Server")) {
+ if (strstr (product_name, "2019"))
+ return safe_strdup (g, "win2k19");
+ else
+ return safe_strdup (g, "win2k16");
+ } else
+ return safe_strdup (g, "win10");
+ }
+ break;
+ }
+ }
/* No ID could be guessed, return "unknown". */
return safe_strdup (g, "unknown");
--
2.20.1
5 years, 9 months
[PATCH] v2v: linux: do not uninstall open-vm-tools w/ ubuntu-server
by Pino Toscano
ubuntu-server depends on open-vm-tools on Ubuntu, so if v2v tries to
uninstall open-vm-tools then dpkg will (rightfully) fail with a
dependency issue.
Since open-vm-tools is harmless after the conversion anyway (it will
not even run), then do not attempt to uninstall it if ubuntu-server is
installed too.
Followup of commit 2bebacf8bf611f0f80a66915f78653ce30b38129.
---
v2v/convert_linux.ml | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml
index 3d61400b5..b4b2f24c4 100644
--- a/v2v/convert_linux.ml
+++ b/v2v/convert_linux.ml
@@ -289,6 +289,18 @@ let convert (g : G.guestfs) inspect source output rcaps =
(* Uninstall VMware Tools. *)
let remove = ref [] and libraries = ref [] in
+ (* On Ubuntu, the ubuntu-server metapackage depends on
+ * open-vm-tools, and thus any attempt to remove it will cause
+ * dependency issues. Hence, special case this situation, and
+ * leave open-vm-tools installed in this case.
+ *)
+ let has_ubuntu_server =
+ if family = `Debian_family then
+ List.exists (
+ fun { G.app2_name = name } ->
+ name = "ubuntu-server"
+ ) inspect.i_apps
+ else false in
List.iter (
fun { G.app2_name = name } ->
if String.is_prefix name "vmware-tools-libraries-" then
@@ -301,7 +313,7 @@ let convert (g : G.guestfs) inspect source output rcaps =
List.push_front name remove
else if String.is_prefix name "open-vm-tools-" then
List.push_front name remove
- else if name = "open-vm-tools" then
+ else if name = "open-vm-tools" && not has_ubuntu_server then
List.push_front name remove
) inspect.i_apps;
let libraries = !libraries in
--
2.20.1
5 years, 9 months