Compare commits
8 Commits
imports/c8
...
c8-stream-
Author | SHA1 | Date | |
---|---|---|---|
|
540294472a | ||
|
f8538d2090 | ||
|
55b111a4aa | ||
|
e951e074b3 | ||
|
4f024df730 | ||
|
893b57ed4a | ||
|
efeedb8128 | ||
|
98b7fd7341 |
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,4 +1,2 @@
|
||||
SOURCES/RHEV-Application-Provisioning-Tool.exe_4.42
|
||||
SOURCES/libguestfs-1.38.4.tar.gz
|
||||
SOURCES/libguestfs-1.44.0.tar.gz
|
||||
SOURCES/libguestfs.keyring
|
||||
SOURCES/rhsrvany.exe
|
||||
|
@ -1,4 +1,2 @@
|
||||
c44dcbd8c9b390e151c16821ff093e4dc408be66 SOURCES/RHEV-Application-Provisioning-Tool.exe_4.42
|
||||
15c8f487ee163374cb7be9436fb1bb697cef7d9e SOURCES/libguestfs-1.38.4.tar.gz
|
||||
99d241dc4a5ba0dc6111954ed7a872e0b0bb6944 SOURCES/libguestfs-1.44.0.tar.gz
|
||||
1bbc40f501a7fef9eef2a39b701a71aee2fea7c4 SOURCES/libguestfs.keyring
|
||||
2bd96e478fc004cd323b5bd754c856641877dac6 SOURCES/rhsrvany.exe
|
||||
|
@ -1,15 +1,18 @@
|
||||
From ba47c0afc593c329189d9064e718ca81e7d6ef49 Mon Sep 17 00:00:00 2001
|
||||
From 5b6d2b05fe0c4035b9791a751e3133d26c7baa2d Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 21 Dec 2012 15:50:11 +0000
|
||||
Subject: [PATCH] RHEL 8: Remove libguestfs live (RHBZ#798980).
|
||||
|
||||
This isn't supported in RHEL 8.
|
||||
|
||||
Disable daemon tests that require the 'unix' backend.
|
||||
---
|
||||
lib/launch-unix.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
tests/daemon/Makefile.am | 4 +---
|
||||
2 files changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lib/launch-unix.c b/lib/launch-unix.c
|
||||
index 9af481fd9..974336ccd 100644
|
||||
index 0d344f9df..74dd1bb4a 100644
|
||||
--- a/lib/launch-unix.c
|
||||
+++ b/lib/launch-unix.c
|
||||
@@ -37,6 +37,12 @@
|
||||
@ -33,6 +36,21 @@ index 9af481fd9..974336ccd 100644
|
||||
}
|
||||
|
||||
static int
|
||||
--
|
||||
2.21.0
|
||||
diff --git a/tests/daemon/Makefile.am b/tests/daemon/Makefile.am
|
||||
index 921e6d1df..8b2887247 100644
|
||||
--- a/tests/daemon/Makefile.am
|
||||
+++ b/tests/daemon/Makefile.am
|
||||
@@ -23,9 +23,7 @@ include $(top_srcdir)/subdir-rules.mk
|
||||
|
||||
check_DATA = captive-daemon.pm
|
||||
|
||||
-TESTS = \
|
||||
- test-daemon-start.pl \
|
||||
- test-btrfs.pl
|
||||
+TESTS =
|
||||
|
||||
TESTS_ENVIRONMENT = $(top_builddir)/run --test
|
||||
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,973 +0,0 @@
|
||||
From 21f0a22072f0543c416c440665bcf75ae09e6233 Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Mon, 12 Feb 2018 11:24:06 +0100
|
||||
Subject: [PATCH] Switch from YAJL to Jansson
|
||||
|
||||
While YAJL mostly works fine, it did not see any active development in
|
||||
the last 3 years. OTOH, Jansson is another JSON C implementation, with
|
||||
a very liberal license, and a much nicer API.
|
||||
|
||||
Hence, switch all of libguestfs from YAJL to Jansson:
|
||||
- configure checks, and buildsystem in general
|
||||
- packages pulled in the appliance
|
||||
- actual implementations
|
||||
- contrib scripts
|
||||
- documentation
|
||||
|
||||
This also makes use of the better APIs available (e.g. json_object_get,
|
||||
json_array_foreach, and json_object_foreach). This does not change the
|
||||
API of our OCaml Yajl module.
|
||||
|
||||
(cherry picked from commit bd1c5c9f4dcf38458099db8a0bf4659a07ef055d)
|
||||
---
|
||||
appliance/packagelist.in | 13 ++--
|
||||
builder/Makefile.am | 4 +-
|
||||
builder/yajl-c.c | 66 ++++++++--------
|
||||
contrib/p2v/aux-scripts/do-build.sh | 8 +-
|
||||
contrib/p2v/build-p2v-iso.sh | 3 +-
|
||||
daemon/Makefile.am | 4 +-
|
||||
daemon/ldm.c | 113 ++++++++++++----------------
|
||||
docs/guestfs-building.pod | 2 +-
|
||||
lib/Makefile.am | 4 +-
|
||||
lib/info.c | 113 +++++++++++-----------------
|
||||
lib/qemu.c | 64 ++++++----------
|
||||
m4/guestfs-libraries.m4 | 4 +-
|
||||
12 files changed, 168 insertions(+), 230 deletions(-)
|
||||
|
||||
diff --git a/appliance/packagelist.in b/appliance/packagelist.in
|
||||
index 8ded2588a..f92a6ce95 100644
|
||||
--- a/appliance/packagelist.in
|
||||
+++ b/appliance/packagelist.in
|
||||
@@ -35,6 +35,7 @@ ifelse(REDHAT,1,
|
||||
hivex
|
||||
iproute
|
||||
iputils
|
||||
+ jansson
|
||||
kernel
|
||||
libcap
|
||||
libldm
|
||||
@@ -51,7 +52,6 @@ ifelse(REDHAT,1,
|
||||
systemd dnl for /sbin/reboot and udevd
|
||||
vim-minimal
|
||||
xz
|
||||
- yajl
|
||||
yara
|
||||
zfs-fuse
|
||||
)
|
||||
@@ -82,12 +82,12 @@ dnl iproute has been renamed to iproute2
|
||||
libc-bin
|
||||
libcap2
|
||||
libhivex0
|
||||
+ libjansson4
|
||||
libpcre3
|
||||
libsystemd0
|
||||
libsystemd-id128-0
|
||||
libsystemd-journal0
|
||||
libtirpc1
|
||||
- libyajl2
|
||||
libyara3
|
||||
linux-image
|
||||
dnl syslinux 'suggests' mtools, but in reality it's a hard dependency:
|
||||
@@ -116,6 +116,7 @@ ifelse(ARCHLINUX,1,
|
||||
hivex
|
||||
iproute2
|
||||
iputils
|
||||
+ jansson
|
||||
libcap
|
||||
libtirpc
|
||||
linux
|
||||
@@ -131,7 +132,6 @@ ifelse(ARCHLINUX,1,
|
||||
systemd
|
||||
vim
|
||||
xz
|
||||
- yajl
|
||||
yara
|
||||
)
|
||||
|
||||
@@ -153,9 +153,9 @@ ifelse(SUSE,1,
|
||||
iputils
|
||||
libcap2
|
||||
libhivex0
|
||||
+ libjansson4
|
||||
libselinux1
|
||||
libtirpc3
|
||||
- libyajl2
|
||||
libyara3
|
||||
mkisofs
|
||||
ntfsprogs
|
||||
@@ -177,6 +177,7 @@ ifelse(FRUGALWARE,1,
|
||||
hfsplus
|
||||
iproute2
|
||||
iputils
|
||||
+ jansson
|
||||
kernel
|
||||
libcap
|
||||
libtirpc
|
||||
@@ -188,7 +189,6 @@ ifelse(FRUGALWARE,1,
|
||||
systemd
|
||||
vim
|
||||
xz
|
||||
- yajl
|
||||
xfsprogs-acl
|
||||
xfsprogs-attr
|
||||
gptfdisk
|
||||
@@ -209,9 +209,9 @@ ifelse(MAGEIA,1,
|
||||
iproute2
|
||||
iputils
|
||||
libcap
|
||||
+ libjansson4
|
||||
libldm
|
||||
libtirpc
|
||||
- libyajl
|
||||
dnl syslinux uses mtools without depending on it
|
||||
mtools
|
||||
nilfs-utils
|
||||
@@ -224,7 +224,6 @@ ifelse(MAGEIA,1,
|
||||
systemd /* for /sbin/reboot and udevd */
|
||||
vim-minimal
|
||||
xz
|
||||
- yajl
|
||||
)
|
||||
|
||||
acl
|
||||
diff --git a/builder/Makefile.am b/builder/Makefile.am
|
||||
index e5872bdd9..c7b50778a 100644
|
||||
--- a/builder/Makefile.am
|
||||
+++ b/builder/Makefile.am
|
||||
@@ -157,7 +157,7 @@ virt_builder_CFLAGS = \
|
||||
$(LIBLZMA_CFLAGS) \
|
||||
$(LIBTINFO_CFLAGS) \
|
||||
$(LIBXML2_CFLAGS) \
|
||||
- $(YAJL_CFLAGS)
|
||||
+ $(JANSSON_CFLAGS)
|
||||
|
||||
BOBJECTS = $(SOURCES_ML:.ml=.cmo)
|
||||
XOBJECTS = $(BOBJECTS:.cmo=.cmx)
|
||||
@@ -211,7 +211,7 @@ OCAMLCLIBS = \
|
||||
$(LIBCRYPT_LIBS) \
|
||||
$(LIBLZMA_LIBS) \
|
||||
$(LIBXML2_LIBS) \
|
||||
- $(YAJL_LIBS) \
|
||||
+ $(JANSSON_LIBS) \
|
||||
$(LIBINTL) \
|
||||
-lgnu
|
||||
|
||||
diff --git a/builder/yajl-c.c b/builder/yajl-c.c
|
||||
index 3c2402e42..e53755f55 100644
|
||||
--- a/builder/yajl-c.c
|
||||
+++ b/builder/yajl-c.c
|
||||
@@ -23,24 +23,17 @@
|
||||
#include <caml/memory.h>
|
||||
#include <caml/mlvalues.h>
|
||||
|
||||
-#include <yajl/yajl_tree.h>
|
||||
+#include <jansson.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
-/* GCC can't work out that the YAJL_IS_<foo> test is sufficient to
|
||||
- * ensure that YAJL_GET_<foo> later doesn't return NULL.
|
||||
- */
|
||||
-#if defined(__GNUC__) && __GNUC__ >= 6 /* gcc >= 6 */
|
||||
-#pragma GCC diagnostic ignored "-Wnull-dereference"
|
||||
-#endif
|
||||
-
|
||||
#define Val_none (Val_int (0))
|
||||
|
||||
value virt_builder_yajl_tree_parse (value stringv);
|
||||
|
||||
static value
|
||||
-convert_yajl_value (yajl_val val, int level)
|
||||
+convert_json_t (json_t *val, int level)
|
||||
{
|
||||
CAMLparam0 ();
|
||||
CAMLlocal4 (rv, lv, v, sv);
|
||||
@@ -48,46 +41,51 @@ convert_yajl_value (yajl_val val, int level)
|
||||
if (level > 20)
|
||||
caml_invalid_argument ("too many levels of object/array nesting");
|
||||
|
||||
- if (YAJL_IS_OBJECT (val)) {
|
||||
- const size_t len = YAJL_GET_OBJECT(val)->len;
|
||||
+ if (json_is_object (val)) {
|
||||
+ const size_t len = json_object_size (val);
|
||||
size_t i;
|
||||
+ const char *key;
|
||||
+ json_t *jvalue;
|
||||
rv = caml_alloc (1, 3);
|
||||
lv = caml_alloc_tuple (len);
|
||||
- for (i = 0; i < len; ++i) {
|
||||
+ i = 0;
|
||||
+ json_object_foreach (val, key, jvalue) {
|
||||
v = caml_alloc_tuple (2);
|
||||
- sv = caml_copy_string (YAJL_GET_OBJECT(val)->keys[i]);
|
||||
+ sv = caml_copy_string (key);
|
||||
Store_field (v, 0, sv);
|
||||
- sv = convert_yajl_value (YAJL_GET_OBJECT(val)->values[i], level + 1);
|
||||
+ sv = convert_json_t (jvalue, level + 1);
|
||||
Store_field (v, 1, sv);
|
||||
Store_field (lv, i, v);
|
||||
+ ++i;
|
||||
}
|
||||
Store_field (rv, 0, lv);
|
||||
- } else if (YAJL_IS_ARRAY (val)) {
|
||||
- const size_t len = YAJL_GET_ARRAY(val)->len;
|
||||
+ } else if (json_is_array (val)) {
|
||||
+ const size_t len = json_array_size (val);
|
||||
size_t i;
|
||||
+ json_t *jvalue;
|
||||
rv = caml_alloc (1, 4);
|
||||
lv = caml_alloc_tuple (len);
|
||||
- for (i = 0; i < len; ++i) {
|
||||
- v = convert_yajl_value (YAJL_GET_ARRAY(val)->values[i], level + 1);
|
||||
+ json_array_foreach (val, i, jvalue) {
|
||||
+ v = convert_json_t (jvalue, level + 1);
|
||||
Store_field (lv, i, v);
|
||||
}
|
||||
Store_field (rv, 0, lv);
|
||||
- } else if (YAJL_IS_STRING (val)) {
|
||||
+ } else if (json_is_string (val)) {
|
||||
rv = caml_alloc (1, 0);
|
||||
- v = caml_copy_string (YAJL_GET_STRING(val));
|
||||
+ v = caml_copy_string (json_string_value (val));
|
||||
Store_field (rv, 0, v);
|
||||
- } else if (YAJL_IS_DOUBLE (val)) {
|
||||
+ } else if (json_is_real (val)) {
|
||||
rv = caml_alloc (1, 2);
|
||||
- v = caml_copy_double (YAJL_GET_DOUBLE(val));
|
||||
+ v = caml_copy_double (json_real_value (val));
|
||||
Store_field (rv, 0, v);
|
||||
- } else if (YAJL_IS_INTEGER (val)) {
|
||||
+ } else if (json_is_integer (val)) {
|
||||
rv = caml_alloc (1, 1);
|
||||
- v = caml_copy_int64 (YAJL_GET_INTEGER(val));
|
||||
+ v = caml_copy_int64 (json_integer_value (val));
|
||||
Store_field (rv, 0, v);
|
||||
- } else if (YAJL_IS_TRUE (val)) {
|
||||
+ } else if (json_is_true (val)) {
|
||||
rv = caml_alloc (1, 5);
|
||||
Store_field (rv, 0, Val_true);
|
||||
- } else if (YAJL_IS_FALSE (val)) {
|
||||
+ } else if (json_is_false (val)) {
|
||||
rv = caml_alloc (1, 5);
|
||||
Store_field (rv, 0, Val_false);
|
||||
} else
|
||||
@@ -101,21 +99,21 @@ virt_builder_yajl_tree_parse (value stringv)
|
||||
{
|
||||
CAMLparam1 (stringv);
|
||||
CAMLlocal1 (rv);
|
||||
- yajl_val tree;
|
||||
- char error_buf[256];
|
||||
+ json_t *tree;
|
||||
+ json_error_t err;
|
||||
|
||||
- tree = yajl_tree_parse (String_val (stringv), error_buf, sizeof error_buf);
|
||||
+ tree = json_loads (String_val (stringv), JSON_DECODE_ANY, &err);
|
||||
if (tree == NULL) {
|
||||
- char buf[256 + sizeof error_buf];
|
||||
- if (strlen (error_buf) > 0)
|
||||
- snprintf (buf, sizeof buf, "JSON parse error: %s", error_buf);
|
||||
+ char buf[256 + JSON_ERROR_TEXT_LENGTH];
|
||||
+ if (strlen (err.text) > 0)
|
||||
+ snprintf (buf, sizeof buf, "JSON parse error: %s", err.text);
|
||||
else
|
||||
snprintf (buf, sizeof buf, "unknown JSON parse error");
|
||||
caml_invalid_argument (buf);
|
||||
}
|
||||
|
||||
- rv = convert_yajl_value (tree, 1);
|
||||
- yajl_tree_free (tree);
|
||||
+ rv = convert_json_t (tree, 1);
|
||||
+ json_decref (tree);
|
||||
|
||||
CAMLreturn (rv);
|
||||
}
|
||||
diff --git a/contrib/p2v/aux-scripts/do-build.sh b/contrib/p2v/aux-scripts/do-build.sh
|
||||
index 5edb53d0e..dd6424bb4 100644
|
||||
--- a/contrib/p2v/aux-scripts/do-build.sh
|
||||
+++ b/contrib/p2v/aux-scripts/do-build.sh
|
||||
@@ -53,8 +53,8 @@ case $osversion in
|
||||
# This just forces configure to ignore these missing dependencies.
|
||||
export LIBTINFO_CFLAGS=-D_GNU_SOURCE
|
||||
export LIBTINFO_LIBS=-lncurses
|
||||
- export YAJL_CFLAGS=-D_GNU_SOURCE
|
||||
- export YAJL_LIBS=-lyajl
|
||||
+ export JANSSON_CFLAGS=-D_GNU_SOURCE
|
||||
+ export JANSSON_LIBS=-ljansson
|
||||
# Remove some unsupported flags that the configure script hard codes.
|
||||
sed -i -e 's/-fno-strict-overflow//' configure
|
||||
sed -i -e 's/-Wno-strict-overflow//' configure
|
||||
@@ -66,8 +66,8 @@ case $osversion in
|
||||
# This just forces configure to ignore these missing dependencies.
|
||||
export LIBTINFO_CFLAGS=-D_GNU_SOURCE
|
||||
export LIBTINFO_LIBS=-lncurses
|
||||
- export YAJL_CFLAGS=-D_GNU_SOURCE
|
||||
- export YAJL_LIBS=-lyajl
|
||||
+ export JANSSON_CFLAGS=-D_GNU_SOURCE
|
||||
+ export JANSSON_LIBS=-ljansson
|
||||
;;
|
||||
esac
|
||||
|
||||
diff --git a/contrib/p2v/build-p2v-iso.sh b/contrib/p2v/build-p2v-iso.sh
|
||||
index c80a1b134..ae25cebc8 100755
|
||||
--- a/contrib/p2v/build-p2v-iso.sh
|
||||
+++ b/contrib/p2v/build-p2v-iso.sh
|
||||
@@ -86,7 +86,6 @@ done
|
||||
# Various hacks for different versions of RHEL.
|
||||
if=virtio
|
||||
netdev=virtio-net-pci
|
||||
-pkgs="$pkgs,yajl-devel"
|
||||
declare -a epel
|
||||
case $osversion in
|
||||
rhel-5.*|centos-5.*)
|
||||
@@ -105,10 +104,12 @@ case $osversion in
|
||||
rhel-6.*|centos-6.*)
|
||||
epel[0]="--run-command"
|
||||
epel[1]="yum install -y --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm"
|
||||
+ pkgs="$pkgs,jansson-devel"
|
||||
;;
|
||||
rhel-7.*|centos-7.*)
|
||||
epel[0]="--run-command"
|
||||
epel[1]="yum install -y --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
|
||||
+ pkgs="$pkgs,jansson-devel"
|
||||
;;
|
||||
esac
|
||||
|
||||
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
|
||||
index 6240f517d..d9ed5625e 100644
|
||||
--- a/daemon/Makefile.am
|
||||
+++ b/daemon/Makefile.am
|
||||
@@ -218,7 +218,7 @@ guestfsd_LDADD = \
|
||||
camldaemon.o \
|
||||
$(ACL_LIBS) \
|
||||
$(CAP_LIBS) \
|
||||
- $(YAJL_LIBS) \
|
||||
+ $(JANSSON_LIBS) \
|
||||
$(SELINUX_LIBS) \
|
||||
$(AUGEAS_LIBS) \
|
||||
$(HIVEX_LIBS) \
|
||||
@@ -256,7 +256,7 @@ guestfsd_CFLAGS = \
|
||||
$(AUGEAS_CFLAGS) \
|
||||
$(HIVEX_CFLAGS) \
|
||||
$(SD_JOURNAL_CFLAGS) \
|
||||
- $(YAJL_CFLAGS) \
|
||||
+ $(JANSSON_CFLAGS) \
|
||||
$(PCRE_CFLAGS)
|
||||
|
||||
# Parts of the daemon are written in OCaml. These are linked into a
|
||||
diff --git a/daemon/ldm.c b/daemon/ldm.c
|
||||
index 2f4d2aef3..be4fb9701 100644
|
||||
--- a/daemon/ldm.c
|
||||
+++ b/daemon/ldm.c
|
||||
@@ -25,19 +25,12 @@
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
|
||||
-#include <yajl/yajl_tree.h>
|
||||
+#include <jansson.h>
|
||||
|
||||
#include "daemon.h"
|
||||
#include "actions.h"
|
||||
#include "optgroups.h"
|
||||
|
||||
-/* GCC can't work out that the YAJL_IS_<foo> test is sufficient to
|
||||
- * ensure that YAJL_GET_<foo> later doesn't return NULL.
|
||||
- */
|
||||
-#if defined(__GNUC__) && GUESTFS_GCC_VERSION >= 60000 /* gcc >= 6 */
|
||||
-#pragma GCC diagnostic ignored "-Wnull-dereference"
|
||||
-#endif
|
||||
-
|
||||
int
|
||||
optgroup_ldm_available (void)
|
||||
{
|
||||
@@ -72,44 +65,42 @@ do_ldmtool_remove_all (void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static yajl_val
|
||||
+static json_t *
|
||||
parse_json (const char *json, const char *func)
|
||||
{
|
||||
- yajl_val tree;
|
||||
- char parse_error[1024];
|
||||
+ json_t *tree;
|
||||
+ json_error_t err;
|
||||
|
||||
if (verbose)
|
||||
fprintf (stderr, "%s: parsing json: %s\n", func, json);
|
||||
|
||||
- tree = yajl_tree_parse (json, parse_error, sizeof parse_error);
|
||||
+ tree = json_loads (json, 0, &err);
|
||||
if (tree == NULL) {
|
||||
reply_with_error ("parse error: %s",
|
||||
- strlen (parse_error) ? parse_error : "unknown error");
|
||||
+ strlen (err.text) ? err.text : "unknown error");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- /* Caller should free this by doing 'yajl_tree_free (tree);'. */
|
||||
+ /* Caller should free this by doing 'json_decref (tree);'. */
|
||||
return tree;
|
||||
}
|
||||
|
||||
#define TYPE_ERROR ((char **) -1)
|
||||
|
||||
static char **
|
||||
-json_value_to_string_list (yajl_val node)
|
||||
+json_value_to_string_list (json_t *node)
|
||||
{
|
||||
CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (strs);
|
||||
- yajl_val n;
|
||||
- size_t i, len;
|
||||
+ json_t *n;
|
||||
+ size_t i;
|
||||
|
||||
- if (! YAJL_IS_ARRAY (node))
|
||||
+ if (!json_is_array (node))
|
||||
return TYPE_ERROR;
|
||||
|
||||
- len = YAJL_GET_ARRAY (node)->len;
|
||||
- for (i = 0; i < len; ++i) {
|
||||
- n = YAJL_GET_ARRAY (node)->values[i];
|
||||
- if (! YAJL_IS_STRING (n))
|
||||
+ json_array_foreach (node, i, n) {
|
||||
+ if (!json_is_string (n))
|
||||
return TYPE_ERROR;
|
||||
- if (add_string (&strs, YAJL_GET_STRING (n)) == -1)
|
||||
+ if (add_string (&strs, json_string_value (n)) == -1)
|
||||
return NULL;
|
||||
}
|
||||
if (end_stringsbuf (&strs) == -1)
|
||||
@@ -123,14 +114,14 @@ parse_json_get_string_list (const char *json,
|
||||
const char *func, const char *cmd)
|
||||
{
|
||||
char **ret;
|
||||
- yajl_val tree = NULL;
|
||||
+ json_t *tree = NULL;
|
||||
|
||||
tree = parse_json (json, func);
|
||||
if (tree == NULL)
|
||||
return NULL;
|
||||
|
||||
ret = json_value_to_string_list (tree);
|
||||
- yajl_tree_free (tree);
|
||||
+ json_decref (tree);
|
||||
if (ret == TYPE_ERROR) {
|
||||
reply_with_error ("output of '%s' was not a JSON array of strings", cmd);
|
||||
return NULL;
|
||||
@@ -144,43 +135,40 @@ static char *
|
||||
parse_json_get_object_string (const char *json, const char *key, int flags,
|
||||
const char *func, const char *cmd)
|
||||
{
|
||||
- char *str, *ret;
|
||||
- yajl_val tree = NULL, node;
|
||||
- size_t i, len;
|
||||
+ const char *str;
|
||||
+ char *ret;
|
||||
+ json_t *tree = NULL, *node;
|
||||
|
||||
tree = parse_json (json, func);
|
||||
if (tree == NULL)
|
||||
return NULL;
|
||||
|
||||
- if (! YAJL_IS_OBJECT (tree))
|
||||
+ if (!json_is_object (tree))
|
||||
goto bad_type;
|
||||
|
||||
- len = YAJL_GET_OBJECT (tree)->len;
|
||||
- for (i = 0; i < len; ++i) {
|
||||
- if (STREQ (YAJL_GET_OBJECT (tree)->keys[i], key)) {
|
||||
- node = YAJL_GET_OBJECT (tree)->values[i];
|
||||
-
|
||||
- if ((flags & GET_STRING_NULL_TO_EMPTY) && YAJL_IS_NULL (node))
|
||||
- ret = strdup ("");
|
||||
- else {
|
||||
- str = YAJL_GET_STRING (node);
|
||||
- if (str == NULL)
|
||||
- goto bad_type;
|
||||
- ret = strdup (str);
|
||||
- }
|
||||
- if (ret == NULL)
|
||||
- reply_with_perror ("strdup");
|
||||
-
|
||||
- yajl_tree_free (tree);
|
||||
+ node = json_object_get (tree, key);
|
||||
+ if (node == NULL)
|
||||
+ goto bad_type;
|
||||
|
||||
- return ret;
|
||||
- }
|
||||
+ if ((flags & GET_STRING_NULL_TO_EMPTY) && json_is_null (node))
|
||||
+ ret = strdup ("");
|
||||
+ else {
|
||||
+ str = json_string_value (node);
|
||||
+ if (str == NULL)
|
||||
+ goto bad_type;
|
||||
+ ret = strndup (str, json_string_length (node));
|
||||
}
|
||||
+ if (ret == NULL)
|
||||
+ reply_with_perror ("strdup");
|
||||
+
|
||||
+ json_decref (tree);
|
||||
+
|
||||
+ return ret;
|
||||
|
||||
bad_type:
|
||||
reply_with_error ("output of '%s' was not a JSON object "
|
||||
"containing a key '%s' of type string", cmd, key);
|
||||
- yajl_tree_free (tree);
|
||||
+ json_decref (tree);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -189,33 +177,30 @@ parse_json_get_object_string_list (const char *json, const char *key,
|
||||
const char *func, const char *cmd)
|
||||
{
|
||||
char **ret;
|
||||
- yajl_val tree, node;
|
||||
- size_t i, len;
|
||||
+ json_t *tree, *node;
|
||||
|
||||
tree = parse_json (json, func);
|
||||
if (tree == NULL)
|
||||
return NULL;
|
||||
|
||||
- if (! YAJL_IS_OBJECT (tree))
|
||||
+ if (!json_is_object (tree))
|
||||
goto bad_type;
|
||||
|
||||
- len = YAJL_GET_OBJECT (tree)->len;
|
||||
- for (i = 0; i < len; ++i) {
|
||||
- if (STREQ (YAJL_GET_OBJECT (tree)->keys[i], key)) {
|
||||
- node = YAJL_GET_OBJECT (tree)->values[i];
|
||||
- ret = json_value_to_string_list (node);
|
||||
- if (ret == TYPE_ERROR)
|
||||
- goto bad_type;
|
||||
- yajl_tree_free (tree);
|
||||
- return ret;
|
||||
- }
|
||||
- }
|
||||
+ node = json_object_get (tree, key);
|
||||
+ if (node == NULL)
|
||||
+ goto bad_type;
|
||||
+
|
||||
+ ret = json_value_to_string_list (node);
|
||||
+ if (ret == TYPE_ERROR)
|
||||
+ goto bad_type;
|
||||
+ json_decref (tree);
|
||||
+ return ret;
|
||||
|
||||
bad_type:
|
||||
reply_with_error ("output of '%s' was not a JSON object "
|
||||
"containing a key '%s' of type array of strings",
|
||||
cmd, key);
|
||||
- yajl_tree_free (tree);
|
||||
+ json_decref (tree);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
diff --git a/docs/guestfs-building.pod b/docs/guestfs-building.pod
|
||||
index d350b1d73..2029429fd 100644
|
||||
--- a/docs/guestfs-building.pod
|
||||
+++ b/docs/guestfs-building.pod
|
||||
@@ -172,7 +172,7 @@ I<Required>.
|
||||
|
||||
I<Required>.
|
||||
|
||||
-=item yajl E<ge> 2.0.4
|
||||
+=item Jansson
|
||||
|
||||
I<Required>.
|
||||
|
||||
diff --git a/lib/Makefile.am b/lib/Makefile.am
|
||||
index 91c4e0a2e..d075174d9 100644
|
||||
--- a/lib/Makefile.am
|
||||
+++ b/lib/Makefile.am
|
||||
@@ -141,7 +141,7 @@ libguestfs_la_CFLAGS = \
|
||||
$(PCRE_CFLAGS) \
|
||||
$(LIBVIRT_CFLAGS) \
|
||||
$(LIBXML2_CFLAGS) \
|
||||
- $(YAJL_CFLAGS)
|
||||
+ $(JANSSON_CFLAGS)
|
||||
|
||||
libguestfs_la_LIBADD = \
|
||||
../common/errnostring/liberrnostring.la \
|
||||
@@ -152,7 +152,7 @@ libguestfs_la_LIBADD = \
|
||||
$(PCRE_LIBS) \
|
||||
$(LIBVIRT_LIBS) $(LIBXML2_LIBS) \
|
||||
$(SELINUX_LIBS) \
|
||||
- $(YAJL_LIBS) \
|
||||
+ $(JANSSON_LIBS) \
|
||||
../gnulib/lib/libgnu.la \
|
||||
$(GETADDRINFO_LIB) \
|
||||
$(HOSTENT_LIB) \
|
||||
diff --git a/lib/info.c b/lib/info.c
|
||||
index 93fadcd39..2eadc1c11 100644
|
||||
--- a/lib/info.c
|
||||
+++ b/lib/info.c
|
||||
@@ -37,53 +37,46 @@
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
-#include <yajl/yajl_tree.h>
|
||||
+#include <jansson.h>
|
||||
|
||||
#include "guestfs.h"
|
||||
#include "guestfs-internal.h"
|
||||
#include "guestfs-internal-actions.h"
|
||||
|
||||
#ifdef HAVE_ATTRIBUTE_CLEANUP
|
||||
-#define CLEANUP_YAJL_TREE_FREE __attribute__((cleanup(cleanup_yajl_tree_free)))
|
||||
+#define CLEANUP_JSON_T_DECREF __attribute__((cleanup(cleanup_json_t_decref)))
|
||||
|
||||
static void
|
||||
-cleanup_yajl_tree_free (void *ptr)
|
||||
+cleanup_json_t_decref (void *ptr)
|
||||
{
|
||||
- yajl_tree_free (* (yajl_val *) ptr);
|
||||
+ json_decref (* (json_t **) ptr);
|
||||
}
|
||||
|
||||
#else
|
||||
-#define CLEANUP_YAJL_TREE_FREE
|
||||
+#define CLEANUP_JSON_T_DECREF
|
||||
#endif
|
||||
|
||||
-static yajl_val get_json_output (guestfs_h *g, const char *filename);
|
||||
+static json_t *get_json_output (guestfs_h *g, const char *filename);
|
||||
static void set_child_rlimits (struct command *);
|
||||
|
||||
char *
|
||||
guestfs_impl_disk_format (guestfs_h *g, const char *filename)
|
||||
{
|
||||
- size_t i, len;
|
||||
- CLEANUP_YAJL_TREE_FREE yajl_val tree = get_json_output (g, filename);
|
||||
+ CLEANUP_JSON_T_DECREF json_t *tree = get_json_output (g, filename);
|
||||
+ json_t *node;
|
||||
|
||||
if (tree == NULL)
|
||||
return NULL;
|
||||
|
||||
- if (! YAJL_IS_OBJECT (tree))
|
||||
+ if (!json_is_object (tree))
|
||||
goto bad_type;
|
||||
|
||||
- len = YAJL_GET_OBJECT(tree)->len;
|
||||
- for (i = 0; i < len; ++i) {
|
||||
- if (STREQ (YAJL_GET_OBJECT(tree)->keys[i], "format")) {
|
||||
- const char *str;
|
||||
- yajl_val node = YAJL_GET_OBJECT(tree)->values[i];
|
||||
- if (YAJL_IS_NULL (node))
|
||||
- goto bad_type;
|
||||
- str = YAJL_GET_STRING (node);
|
||||
- if (str == NULL)
|
||||
- goto bad_type;
|
||||
- return safe_strdup (g, str); /* caller frees */
|
||||
- }
|
||||
- }
|
||||
+ node = json_object_get (tree, "format");
|
||||
+ if (!json_is_string (node))
|
||||
+ goto bad_type;
|
||||
+
|
||||
+ return safe_strndup (g, json_string_value (node),
|
||||
+ json_string_length (node)); /* caller frees */
|
||||
|
||||
bad_type:
|
||||
error (g, _("qemu-img info: JSON output did not contain ‘format’ key"));
|
||||
@@ -93,30 +86,20 @@ guestfs_impl_disk_format (guestfs_h *g, const char *filename)
|
||||
int64_t
|
||||
guestfs_impl_disk_virtual_size (guestfs_h *g, const char *filename)
|
||||
{
|
||||
- size_t i, len;
|
||||
- CLEANUP_YAJL_TREE_FREE yajl_val tree = get_json_output (g, filename);
|
||||
+ CLEANUP_JSON_T_DECREF json_t *tree = get_json_output (g, filename);
|
||||
+ json_t *node;
|
||||
|
||||
if (tree == NULL)
|
||||
return -1;
|
||||
|
||||
- if (! YAJL_IS_OBJECT (tree))
|
||||
+ if (!json_is_object (tree))
|
||||
goto bad_type;
|
||||
|
||||
- len = YAJL_GET_OBJECT(tree)->len;
|
||||
- for (i = 0; i < len; ++i) {
|
||||
- if (STREQ (YAJL_GET_OBJECT(tree)->keys[i], "virtual-size")) {
|
||||
- yajl_val node = YAJL_GET_OBJECT(tree)->values[i];
|
||||
- if (YAJL_IS_NULL (node))
|
||||
- goto bad_type;
|
||||
- if (! YAJL_IS_NUMBER (node))
|
||||
- goto bad_type;
|
||||
- if (! YAJL_IS_INTEGER (node)) {
|
||||
- error (g, _("qemu-img info: ‘virtual-size’ is not representable as a 64 bit integer"));
|
||||
- return -1;
|
||||
- }
|
||||
- return YAJL_GET_INTEGER (node);
|
||||
- }
|
||||
- }
|
||||
+ node = json_object_get (tree, "virtual-size");
|
||||
+ if (!json_is_integer (node))
|
||||
+ goto bad_type;
|
||||
+
|
||||
+ return json_integer_value (node);
|
||||
|
||||
bad_type:
|
||||
error (g, _("qemu-img info: JSON output did not contain ‘virtual-size’ key"));
|
||||
@@ -126,29 +109,25 @@ guestfs_impl_disk_virtual_size (guestfs_h *g, const char *filename)
|
||||
int
|
||||
guestfs_impl_disk_has_backing_file (guestfs_h *g, const char *filename)
|
||||
{
|
||||
- size_t i, len;
|
||||
- CLEANUP_YAJL_TREE_FREE yajl_val tree = get_json_output (g, filename);
|
||||
+ CLEANUP_JSON_T_DECREF json_t *tree = get_json_output (g, filename);
|
||||
+ json_t *node;
|
||||
|
||||
if (tree == NULL)
|
||||
return -1;
|
||||
|
||||
- if (! YAJL_IS_OBJECT (tree))
|
||||
+ if (!json_is_object (tree))
|
||||
goto bad_type;
|
||||
|
||||
- len = YAJL_GET_OBJECT(tree)->len;
|
||||
- for (i = 0; i < len; ++i) {
|
||||
- if (STREQ (YAJL_GET_OBJECT(tree)->keys[i], "backing-filename")) {
|
||||
- yajl_val node = YAJL_GET_OBJECT(tree)->values[i];
|
||||
- /* Work on the assumption that if this field is null, it means
|
||||
- * no backing file, rather than being an error.
|
||||
- */
|
||||
- if (YAJL_IS_NULL (node))
|
||||
- return 0;
|
||||
- return 1;
|
||||
- }
|
||||
- }
|
||||
+ node = json_object_get (tree, "backing-filename");
|
||||
+ if (node == NULL)
|
||||
+ return 0; /* no backing-filename key means no backing file */
|
||||
|
||||
- return 0; /* no backing-filename key means no backing file */
|
||||
+ /* Work on the assumption that if this field is null, it means
|
||||
+ * no backing file, rather than being an error.
|
||||
+ */
|
||||
+ if (json_is_null (node))
|
||||
+ return 0;
|
||||
+ return 1;
|
||||
|
||||
bad_type:
|
||||
error (g, _("qemu-img info: JSON output was not an object"));
|
||||
@@ -161,12 +140,12 @@ guestfs_impl_disk_has_backing_file (guestfs_h *g, const char *filename)
|
||||
static void parse_json (guestfs_h *g, void *treevp, const char *input, size_t len);
|
||||
#define PARSE_JSON_NO_OUTPUT ((void *) -1)
|
||||
|
||||
-static yajl_val
|
||||
+static json_t *
|
||||
get_json_output (guestfs_h *g, const char *filename)
|
||||
{
|
||||
CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g);
|
||||
int r;
|
||||
- yajl_val tree = NULL;
|
||||
+ json_t *tree = NULL;
|
||||
|
||||
guestfs_int_cmd_add_arg (cmd, "qemu-img");
|
||||
guestfs_int_cmd_add_arg (cmd, "info");
|
||||
@@ -196,16 +175,15 @@ get_json_output (guestfs_h *g, const char *filename)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- return tree; /* caller must call yajl_tree_free (tree) */
|
||||
+ return tree; /* caller must call json_decref (tree) */
|
||||
}
|
||||
|
||||
/* Parse the JSON document printed by qemu-img info --output json. */
|
||||
static void
|
||||
parse_json (guestfs_h *g, void *treevp, const char *input, size_t len)
|
||||
{
|
||||
- yajl_val *tree_ret = treevp;
|
||||
- CLEANUP_FREE char *input_copy = NULL;
|
||||
- char parse_error[256];
|
||||
+ json_t **tree_ret = treevp;
|
||||
+ json_error_t err;
|
||||
|
||||
assert (*tree_ret == NULL);
|
||||
|
||||
@@ -218,15 +196,12 @@ parse_json (guestfs_h *g, void *treevp, const char *input, size_t len)
|
||||
return;
|
||||
}
|
||||
|
||||
- /* 'input' is not \0-terminated; we have to make it so. */
|
||||
- input_copy = safe_strndup (g, input, len);
|
||||
+ debug (g, "%s: qemu-img info JSON output:\n%.*s\n", __func__, (int) len, input);
|
||||
|
||||
- debug (g, "%s: qemu-img info JSON output:\n%s\n", __func__, input_copy);
|
||||
-
|
||||
- *tree_ret = yajl_tree_parse (input_copy, parse_error, sizeof parse_error);
|
||||
+ *tree_ret = json_loadb (input, len, 0, &err);
|
||||
if (*tree_ret == NULL) {
|
||||
- if (strlen (parse_error) > 0)
|
||||
- error (g, _("qemu-img info: JSON parse error: %s"), parse_error);
|
||||
+ if (strlen (err.text) > 0)
|
||||
+ error (g, _("qemu-img info: JSON parse error: %s"), err.text);
|
||||
else
|
||||
error (g, _("qemu-img info: unknown JSON parse error"));
|
||||
}
|
||||
diff --git a/lib/qemu.c b/lib/qemu.c
|
||||
index 6159b5a52..a50eca988 100644
|
||||
--- a/lib/qemu.c
|
||||
+++ b/lib/qemu.c
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
#include <libxml/uri.h>
|
||||
|
||||
-#include <yajl/yajl_tree.h>
|
||||
+#include <jansson.h>
|
||||
|
||||
#include "full-write.h"
|
||||
#include "ignore-value.h"
|
||||
@@ -57,7 +57,7 @@ struct qemu_data {
|
||||
|
||||
/* The following fields are derived from the fields above. */
|
||||
struct version qemu_version; /* Parsed qemu version number. */
|
||||
- yajl_val qmp_schema_tree; /* qmp_schema parsed into a JSON tree */
|
||||
+ json_t *qmp_schema_tree; /* qmp_schema parsed into a JSON tree */
|
||||
};
|
||||
|
||||
static char *cache_filename (guestfs_h *g, const char *cachedir, const struct stat *, const char *suffix);
|
||||
@@ -73,7 +73,7 @@ static int write_cache_qmp_schema (guestfs_h *g, const struct qemu_data *data, c
|
||||
static int read_cache_qemu_stat (guestfs_h *g, struct qemu_data *data, const char *filename);
|
||||
static int write_cache_qemu_stat (guestfs_h *g, const struct qemu_data *data, const char *filename);
|
||||
static void parse_qemu_version (guestfs_h *g, const char *, struct version *qemu_version);
|
||||
-static void parse_json (guestfs_h *g, const char *, yajl_val *);
|
||||
+static void parse_json (guestfs_h *g, const char *, json_t **);
|
||||
static void read_all (guestfs_h *g, void *retv, const char *buf, size_t len);
|
||||
static int generic_read_cache (guestfs_h *g, const char *filename, char **strp);
|
||||
static int generic_write_cache (guestfs_h *g, const char *filename, const char *str);
|
||||
@@ -405,17 +405,17 @@ parse_qemu_version (guestfs_h *g, const char *qemu_help,
|
||||
* is not possible.
|
||||
*/
|
||||
static void
|
||||
-parse_json (guestfs_h *g, const char *json, yajl_val *treep)
|
||||
+parse_json (guestfs_h *g, const char *json, json_t **treep)
|
||||
{
|
||||
- char parse_error[256] = "";
|
||||
+ json_error_t err;
|
||||
|
||||
if (!json)
|
||||
return;
|
||||
|
||||
- *treep = yajl_tree_parse (json, parse_error, sizeof parse_error);
|
||||
+ *treep = json_loads (json, 0, &err);
|
||||
if (*treep == NULL) {
|
||||
- if (strlen (parse_error) > 0)
|
||||
- debug (g, "QMP parse error: %s (ignored)", parse_error);
|
||||
+ if (strlen (err.text) > 0)
|
||||
+ debug (g, "QMP parse error: %s (ignored)", err.text);
|
||||
else
|
||||
debug (g, "QMP unknown parse error (ignored)");
|
||||
}
|
||||
@@ -580,17 +580,6 @@ guestfs_int_qemu_supports_device (guestfs_h *g,
|
||||
return strstr (data->qemu_devices, device_name) != NULL;
|
||||
}
|
||||
|
||||
-/* GCC can't work out that the YAJL_IS_<foo> test is sufficient to
|
||||
- * ensure that YAJL_GET_<foo> later doesn't return NULL.
|
||||
- */
|
||||
-#pragma GCC diagnostic push
|
||||
-#if defined(__GNUC__) && __GNUC__ >= 6 /* gcc >= 6 */
|
||||
-#pragma GCC diagnostic ignored "-Wnull-dereference"
|
||||
-#endif
|
||||
-#if defined(__GNUC__) && GUESTFS_GCC_VERSION >= 40800 /* gcc >= 4.8.0 */
|
||||
-#pragma GCC diagnostic ignored "-Wnonnull"
|
||||
-#endif
|
||||
-
|
||||
/**
|
||||
* Test if the qemu binary uses mandatory file locking, added in
|
||||
* QEMU >= 2.10 (but sometimes disabled).
|
||||
@@ -599,11 +588,7 @@ int
|
||||
guestfs_int_qemu_mandatory_locking (guestfs_h *g,
|
||||
const struct qemu_data *data)
|
||||
{
|
||||
- const char *return_path[] = { "return", NULL };
|
||||
- const char *meta_type_path[] = { "meta-type", NULL };
|
||||
- const char *members_path[] = { "members", NULL };
|
||||
- const char *name_path[] = { "name", NULL };
|
||||
- yajl_val schema, v, meta_type, members, m, name;
|
||||
+ json_t *schema, *v, *meta_type, *members, *m, *name;
|
||||
size_t i, j;
|
||||
|
||||
/* If there's no QMP schema, fall back to checking the version. */
|
||||
@@ -616,27 +601,24 @@ guestfs_int_qemu_mandatory_locking (guestfs_h *g,
|
||||
* Extract the schema from the wrapper. Note the returned ‘schema’
|
||||
* will be an array.
|
||||
*/
|
||||
- schema = yajl_tree_get (data->qmp_schema_tree, return_path, yajl_t_array);
|
||||
- if (schema == NULL)
|
||||
+ schema = json_object_get (data->qmp_schema_tree, "return");
|
||||
+ if (!json_is_array (schema))
|
||||
goto fallback;
|
||||
- assert (YAJL_IS_ARRAY(schema));
|
||||
|
||||
/* Now look for any member of the array which has:
|
||||
* { "meta-type": "object",
|
||||
* "members": [ ... { "name": "locking", ... } ... ] ... }
|
||||
*/
|
||||
- for (i = 0; i < YAJL_GET_ARRAY(schema)->len; ++i) {
|
||||
- v = YAJL_GET_ARRAY(schema)->values[i];
|
||||
- meta_type = yajl_tree_get (v, meta_type_path, yajl_t_string);
|
||||
- if (meta_type && YAJL_IS_STRING (meta_type) &&
|
||||
- STREQ (YAJL_GET_STRING (meta_type), "object")) {
|
||||
- members = yajl_tree_get (v, members_path, yajl_t_array);
|
||||
- if (members) {
|
||||
- for (j = 0; j < YAJL_GET_ARRAY(members)->len; ++j) {
|
||||
- m = YAJL_GET_ARRAY(members)->values[j];
|
||||
- name = yajl_tree_get (m, name_path, yajl_t_string);
|
||||
- if (name && YAJL_IS_STRING (name) &&
|
||||
- STREQ (YAJL_GET_STRING (name), "locking"))
|
||||
+ json_array_foreach (schema, i, v) {
|
||||
+ meta_type = json_object_get (v, "meta-type");
|
||||
+ if (json_is_string (meta_type) &&
|
||||
+ STREQ (json_string_value (meta_type), "object")) {
|
||||
+ members = json_object_get (v, "members");
|
||||
+ if (json_is_array (members)) {
|
||||
+ json_array_foreach (members, j, m) {
|
||||
+ name = json_object_get (v, "name");
|
||||
+ if (json_is_string (name) &&
|
||||
+ STREQ (json_string_value (name), "locking"))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -646,8 +628,6 @@ guestfs_int_qemu_mandatory_locking (guestfs_h *g,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-#pragma GCC diagnostic pop
|
||||
-
|
||||
/**
|
||||
* Escape a qemu parameter.
|
||||
*
|
||||
@@ -996,7 +976,7 @@ guestfs_int_free_qemu_data (struct qemu_data *data)
|
||||
free (data->qemu_help);
|
||||
free (data->qemu_devices);
|
||||
free (data->qmp_schema);
|
||||
- yajl_tree_free (data->qmp_schema_tree);
|
||||
+ json_decref (data->qmp_schema_tree);
|
||||
free (data);
|
||||
}
|
||||
}
|
||||
diff --git a/m4/guestfs-libraries.m4 b/m4/guestfs-libraries.m4
|
||||
index 78a9e792f..2fdbd9669 100644
|
||||
--- a/m4/guestfs-libraries.m4
|
||||
+++ b/m4/guestfs-libraries.m4
|
||||
@@ -299,8 +299,8 @@ LIBS="$LIBS $LIBXML2_LIBS"
|
||||
AC_CHECK_FUNCS([xmlBufferDetach])
|
||||
LIBS="$old_LIBS"
|
||||
|
||||
-dnl Check for yajl JSON library (required).
|
||||
-PKG_CHECK_MODULES([YAJL], [yajl >= 2.0.4])
|
||||
+dnl Check for Jansson JSON library (required).
|
||||
+PKG_CHECK_MODULES([JANSSON], [jansson])
|
||||
|
||||
dnl Check for C++ (optional, we just use this to test the header works).
|
||||
AC_PROG_CXX
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,22 +1,22 @@
|
||||
From 51b21bfa82b78690f1bf8836d182e51c20ba7af4 Mon Sep 17 00:00:00 2001
|
||||
From 91b2a6e50211c58ea31a36351ec63c358f708bf9 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 18 Jul 2013 18:31:53 +0100
|
||||
Subject: [PATCH] RHEL 8: Remove 9p APIs from RHEL (RHBZ#921710).
|
||||
|
||||
---
|
||||
Makefile.am | 2 +-
|
||||
daemon/9p.c | 224 --------------------------------------
|
||||
daemon/9p.c | 182 --------------------------------------
|
||||
daemon/Makefile.am | 1 -
|
||||
docs/C_SOURCE_FILES | 1 -
|
||||
generator/actions_core.ml | 21 ----
|
||||
generator/actions_core.ml | 21 -----
|
||||
generator/proc_nr.ml | 2 -
|
||||
gobject/Makefile.inc | 2 -
|
||||
po/POTFILES | 2 -
|
||||
8 files changed, 1 insertion(+), 254 deletions(-)
|
||||
8 files changed, 1 insertion(+), 212 deletions(-)
|
||||
delete mode 100644 daemon/9p.c
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index cc363341f..8fb25a57c 100644
|
||||
index 3df1b6a7a..36e44dfd5 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -78,7 +78,7 @@ SUBDIRS += tests/xfs
|
||||
@ -30,10 +30,10 @@ index cc363341f..8fb25a57c 100644
|
||||
SUBDIRS += tests/disk-labels
|
||||
diff --git a/daemon/9p.c b/daemon/9p.c
|
||||
deleted file mode 100644
|
||||
index 55644249d..000000000
|
||||
index 743a96abd..000000000
|
||||
--- a/daemon/9p.c
|
||||
+++ /dev/null
|
||||
@@ -1,224 +0,0 @@
|
||||
@@ -1,182 +0,0 @@
|
||||
-/* libguestfs - the guestfsd daemon
|
||||
- * Copyright (C) 2011 Red Hat Inc.
|
||||
- *
|
||||
@ -65,21 +65,32 @@ index 55644249d..000000000
|
||||
-#include <dirent.h>
|
||||
-#include <fcntl.h>
|
||||
-
|
||||
-#include "ignore-value.h"
|
||||
-
|
||||
-#include "daemon.h"
|
||||
-#include "actions.h"
|
||||
-
|
||||
-#define BUS_PATH "/sys/bus/virtio/drivers/9pnet_virtio"
|
||||
-
|
||||
-static char *read_whole_file (const char *filename);
|
||||
-static void
|
||||
-modprobe_9pnet_virtio (void)
|
||||
-{
|
||||
- /* Required with Linux 5.6 and maybe earlier kernels. For unclear
|
||||
- * reasons the module is not an automatic dependency of the 9p
|
||||
- * module so doesn't get loaded automatically.
|
||||
- */
|
||||
- ignore_value (command (NULL, NULL, "modprobe", "9pnet_virtio", NULL));
|
||||
-}
|
||||
-
|
||||
-/* https://bugzilla.redhat.com/show_bug.cgi?id=714981#c1 */
|
||||
-char **
|
||||
-do_list_9p (void)
|
||||
-{
|
||||
- CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (r);
|
||||
-
|
||||
- DIR *dir;
|
||||
-
|
||||
- modprobe_9pnet_virtio ();
|
||||
-
|
||||
- dir = opendir (BUS_PATH);
|
||||
- if (!dir) {
|
||||
- perror ("opendir: " BUS_PATH);
|
||||
@ -118,7 +129,7 @@ index 55644249d..000000000
|
||||
- * the mount tag length to be unlimited (or up to 65536 bytes).
|
||||
- * See: linux/include/linux/virtio_9p.h
|
||||
- */
|
||||
- CLEANUP_FREE char *mount_tag = read_whole_file (mount_tag_path);
|
||||
- CLEANUP_FREE char *mount_tag = read_whole_file (mount_tag_path, NULL);
|
||||
- if (mount_tag == 0)
|
||||
- continue;
|
||||
-
|
||||
@ -153,60 +164,6 @@ index 55644249d..000000000
|
||||
- return take_stringsbuf (&r);
|
||||
-}
|
||||
-
|
||||
-/* Read whole file into dynamically allocated array. If there is an
|
||||
- * error, DON'T call reply_with_perror, just return NULL. Returns a
|
||||
- * \0-terminated string.
|
||||
- */
|
||||
-static char *
|
||||
-read_whole_file (const char *filename)
|
||||
-{
|
||||
- char *r = NULL;
|
||||
- size_t alloc = 0, size = 0;
|
||||
- int fd;
|
||||
-
|
||||
- fd = open (filename, O_RDONLY|O_CLOEXEC);
|
||||
- if (fd == -1) {
|
||||
- perror (filename);
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- while (1) {
|
||||
- alloc += 256;
|
||||
- char *r2 = realloc (r, alloc);
|
||||
- if (r2 == NULL) {
|
||||
- perror ("realloc");
|
||||
- free (r);
|
||||
- close (fd);
|
||||
- return NULL;
|
||||
- }
|
||||
- r = r2;
|
||||
-
|
||||
- /* The '- 1' in the size calculation ensures there is space below
|
||||
- * to add \0 to the end of the input.
|
||||
- */
|
||||
- ssize_t n = read (fd, r + size, alloc - size - 1);
|
||||
- if (n == -1) {
|
||||
- fprintf (stderr, "read: %s: %m\n", filename);
|
||||
- free (r);
|
||||
- close (fd);
|
||||
- return NULL;
|
||||
- }
|
||||
- if (n == 0)
|
||||
- break;
|
||||
- size += n;
|
||||
- }
|
||||
-
|
||||
- if (close (fd) == -1) {
|
||||
- fprintf (stderr, "close: %s: %m\n", filename);
|
||||
- free (r);
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- r[size] = '\0';
|
||||
-
|
||||
- return r;
|
||||
-}
|
||||
-
|
||||
-/* Takes optional arguments, consult optargs_bitmask. */
|
||||
-int
|
||||
-do_mount_9p (const char *mount_tag, const char *mountpoint, const char *options)
|
||||
@ -249,6 +206,7 @@ index 55644249d..000000000
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- modprobe_9pnet_virtio ();
|
||||
- r = command (NULL, &err,
|
||||
- "mount", "-o", opts, "-t", "9p", mount_tag, mp, NULL);
|
||||
- if (r == -1) {
|
||||
@ -259,10 +217,10 @@ index 55644249d..000000000
|
||||
- return 0;
|
||||
-}
|
||||
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
|
||||
index dcae1a66c..75bef5500 100644
|
||||
index 038be592c..df9dcc4ee 100644
|
||||
--- a/daemon/Makefile.am
|
||||
+++ b/daemon/Makefile.am
|
||||
@@ -76,7 +76,6 @@ guestfsd_SOURCES = \
|
||||
@@ -82,7 +82,6 @@ guestfsd_SOURCES = \
|
||||
../common/protocol/guestfs_protocol.h \
|
||||
../common/utils/cleanups.h \
|
||||
../common/utils/guestfs-utils.h \
|
||||
@ -271,22 +229,22 @@ index dcae1a66c..75bef5500 100644
|
||||
actions.h \
|
||||
available.c \
|
||||
diff --git a/docs/C_SOURCE_FILES b/docs/C_SOURCE_FILES
|
||||
index f3ee61e0d..e8b1d5283 100644
|
||||
index cd5bd2924..831b7e25a 100644
|
||||
--- a/docs/C_SOURCE_FILES
|
||||
+++ b/docs/C_SOURCE_FILES
|
||||
@@ -70,7 +70,6 @@ common/windows/windows.h
|
||||
@@ -63,7 +63,6 @@ common/windows/windows.c
|
||||
common/windows/windows.h
|
||||
customize/crypt-c.c
|
||||
customize/dummy.c
|
||||
customize/perl_edit-c.c
|
||||
-daemon/9p.c
|
||||
daemon/acl.c
|
||||
daemon/actions.h
|
||||
daemon/augeas.c
|
||||
diff --git a/generator/actions_core.ml b/generator/actions_core.ml
|
||||
index 2ae3ec1d9..237edafce 100644
|
||||
index 806565b19..37476c93e 100644
|
||||
--- a/generator/actions_core.ml
|
||||
+++ b/generator/actions_core.ml
|
||||
@@ -6179,27 +6179,6 @@ This returns true iff the device exists and contains all zero bytes.
|
||||
@@ -6157,27 +6157,6 @@ This returns true iff the device exists and contains all zero bytes.
|
||||
|
||||
Note that for large devices this can take a long time to run." };
|
||||
|
||||
@ -315,7 +273,7 @@ index 2ae3ec1d9..237edafce 100644
|
||||
name = "list_dm_devices"; added = (1, 11, 15);
|
||||
style = RStringList (RDevice, "devices"), [], [];
|
||||
diff --git a/generator/proc_nr.ml b/generator/proc_nr.ml
|
||||
index 9e16ab14a..e6b018c62 100644
|
||||
index 30e42864f..57976be36 100644
|
||||
--- a/generator/proc_nr.ml
|
||||
+++ b/generator/proc_nr.ml
|
||||
@@ -295,8 +295,6 @@ let proc_nr = [
|
||||
@ -328,10 +286,10 @@ index 9e16ab14a..e6b018c62 100644
|
||||
288, "ntfsresize";
|
||||
289, "btrfs_filesystem_resize";
|
||||
diff --git a/gobject/Makefile.inc b/gobject/Makefile.inc
|
||||
index 5aa2dcafe..b8f8e9226 100644
|
||||
index 650f8ddac..c4e735967 100644
|
||||
--- a/gobject/Makefile.inc
|
||||
+++ b/gobject/Makefile.inc
|
||||
@@ -93,7 +93,6 @@ guestfs_gobject_headers= \
|
||||
@@ -94,7 +94,6 @@ guestfs_gobject_headers= \
|
||||
include/guestfs-gobject/optargs-mksquashfs.h \
|
||||
include/guestfs-gobject/optargs-mkswap.h \
|
||||
include/guestfs-gobject/optargs-mktemp.h \
|
||||
@ -339,7 +297,7 @@ index 5aa2dcafe..b8f8e9226 100644
|
||||
include/guestfs-gobject/optargs-mount_local.h \
|
||||
include/guestfs-gobject/optargs-ntfsclone_out.h \
|
||||
include/guestfs-gobject/optargs-ntfsfix.h \
|
||||
@@ -186,7 +185,6 @@ guestfs_gobject_sources= \
|
||||
@@ -188,7 +187,6 @@ guestfs_gobject_sources= \
|
||||
src/optargs-mksquashfs.c \
|
||||
src/optargs-mkswap.c \
|
||||
src/optargs-mktemp.c \
|
||||
@ -348,18 +306,18 @@ index 5aa2dcafe..b8f8e9226 100644
|
||||
src/optargs-ntfsclone_out.c \
|
||||
src/optargs-ntfsfix.c \
|
||||
diff --git a/po/POTFILES b/po/POTFILES
|
||||
index a049d66fe..5daec8a89 100644
|
||||
index 69ea7134a..0782e8ceb 100644
|
||||
--- a/po/POTFILES
|
||||
+++ b/po/POTFILES
|
||||
@@ -58,7 +58,6 @@ customize/crypt-c.c
|
||||
customize/dummy.c
|
||||
@@ -47,7 +47,6 @@ common/visit/visit.c
|
||||
common/windows/windows.c
|
||||
customize/crypt-c.c
|
||||
customize/perl_edit-c.c
|
||||
customize/test-password.pl
|
||||
-daemon/9p.c
|
||||
daemon/acl.c
|
||||
daemon/augeas.c
|
||||
daemon/available.c
|
||||
@@ -290,7 +289,6 @@ gobject/src/optargs-mkfs_btrfs.c
|
||||
@@ -277,7 +276,6 @@ gobject/src/optargs-mkfs_btrfs.c
|
||||
gobject/src/optargs-mksquashfs.c
|
||||
gobject/src/optargs-mkswap.c
|
||||
gobject/src/optargs-mktemp.c
|
||||
@ -368,5 +326,5 @@ index a049d66fe..5daec8a89 100644
|
||||
gobject/src/optargs-ntfsclone_out.c
|
||||
gobject/src/optargs-ntfsfix.c
|
||||
--
|
||||
2.21.0
|
||||
2.31.1
|
||||
|
@ -1,31 +0,0 @@
|
||||
From 898e6c1e39deb130566220a11a2eaf2dcb2cb733 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 29 Mar 2018 20:18:34 +0100
|
||||
Subject: [PATCH] qemu: Fix transcription error in conversion of yajl to
|
||||
jansson.
|
||||
|
||||
This broke qemu mandatory locking detection.
|
||||
|
||||
Fixes commit bd1c5c9f4dcf38458099db8a0bf4659a07ef055d.
|
||||
|
||||
(cherry picked from commit e79286f71738d9385157d9e87211be02645722c3)
|
||||
---
|
||||
lib/qemu.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/qemu.c b/lib/qemu.c
|
||||
index a50eca988..3e7f15946 100644
|
||||
--- a/lib/qemu.c
|
||||
+++ b/lib/qemu.c
|
||||
@@ -616,7 +616,7 @@ guestfs_int_qemu_mandatory_locking (guestfs_h *g,
|
||||
members = json_object_get (v, "members");
|
||||
if (json_is_array (members)) {
|
||||
json_array_foreach (members, j, m) {
|
||||
- name = json_object_get (v, "name");
|
||||
+ name = json_object_get (m, "name");
|
||||
if (json_is_string (name) &&
|
||||
STREQ (json_string_value (name), "locking"))
|
||||
return 1;
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,4 +1,4 @@
|
||||
From f60a4cc89c5c06360b0bc5ebc6fab10b5ef24077 Mon Sep 17 00:00:00 2001
|
||||
From 4dd2f3f56a39411a255ad0a8f38081d46620dbd8 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 29 Jul 2013 14:47:56 +0100
|
||||
Subject: [PATCH] RHEL 8: Disable unsupported remote drive protocols
|
||||
@ -62,7 +62,7 @@ index f558964bf..8f264ed17 100644
|
||||
|
||||
Run L<virt-alignment-scan(1)> on guests or disk images:
|
||||
diff --git a/fish/guestfish.pod b/fish/guestfish.pod
|
||||
index bbf43aad5..f4762f929 100644
|
||||
index 9f086f110..bb4167b06 100644
|
||||
--- a/fish/guestfish.pod
|
||||
+++ b/fish/guestfish.pod
|
||||
@@ -131,9 +131,9 @@ To list what is available do:
|
||||
@ -77,7 +77,7 @@ index bbf43aad5..f4762f929 100644
|
||||
|
||||
=head2 Remote control
|
||||
|
||||
@@ -1127,12 +1127,12 @@ L<guestfs(3)/REMOTE STORAGE>>.
|
||||
@@ -1134,12 +1134,12 @@ L<guestfs(3)/REMOTE STORAGE>>.
|
||||
On the command line, you can use the I<-a> option to add network
|
||||
block devices using a URI-style format, for example:
|
||||
|
||||
@ -92,7 +92,7 @@ index bbf43aad5..f4762f929 100644
|
||||
|
||||
The possible I<-a URI> formats are described below.
|
||||
|
||||
@@ -1142,40 +1142,6 @@ The possible I<-a URI> formats are described below.
|
||||
@@ -1149,40 +1149,6 @@ The possible I<-a URI> formats are described below.
|
||||
|
||||
Add the local disk image (or device) called F<disk.img>.
|
||||
|
||||
@ -133,7 +133,7 @@ index bbf43aad5..f4762f929 100644
|
||||
=head2 B<-a nbd://example.com[:port]>
|
||||
|
||||
=head2 B<-a nbd://example.com[:port]/exportname>
|
||||
@@ -1210,35 +1176,13 @@ The equivalent API command would be:
|
||||
@@ -1217,35 +1183,13 @@ The equivalent API command would be:
|
||||
|
||||
><fs> add pool/disk protocol:rbd server:tcp:example.com:port
|
||||
|
||||
@ -171,7 +171,7 @@ index bbf43aad5..f4762f929 100644
|
||||
In this case, the password is C<pass@word>.
|
||||
|
||||
diff --git a/fish/test-add-uri.sh b/fish/test-add-uri.sh
|
||||
index 756df997b..8f84fd31b 100755
|
||||
index 21d424984..ddabeb639 100755
|
||||
--- a/fish/test-add-uri.sh
|
||||
+++ b/fish/test-add-uri.sh
|
||||
@@ -40,14 +40,6 @@ function fail ()
|
||||
@ -220,7 +220,7 @@ index 756df997b..8f84fd31b 100755
|
||||
rm test-add-uri.out
|
||||
rm test-add-uri.img
|
||||
diff --git a/generator/actions_core.ml b/generator/actions_core.ml
|
||||
index 237edafce..aca5b1f43 100644
|
||||
index 37476c93e..9f0402510 100644
|
||||
--- a/generator/actions_core.ml
|
||||
+++ b/generator/actions_core.ml
|
||||
@@ -297,29 +297,6 @@ F<filename> is interpreted as a local file or device.
|
||||
@ -305,10 +305,10 @@ index 237edafce..aca5b1f43 100644
|
||||
example if using the libvirt backend and if the libvirt backend is configured to
|
||||
start the qemu appliance as a special user such as C<qemu.qemu>. If in doubt,
|
||||
diff --git a/lib/drives.c b/lib/drives.c
|
||||
index 82ef30093..3d712c6e4 100644
|
||||
index 46af66db4..c81ded5d7 100644
|
||||
--- a/lib/drives.c
|
||||
+++ b/lib/drives.c
|
||||
@@ -165,6 +165,7 @@ create_drive_non_file (guestfs_h *g,
|
||||
@@ -168,6 +168,7 @@ create_drive_non_file (guestfs_h *g,
|
||||
return drv;
|
||||
}
|
||||
|
||||
@ -316,7 +316,7 @@ index 82ef30093..3d712c6e4 100644
|
||||
static struct drive *
|
||||
create_drive_curl (guestfs_h *g,
|
||||
const struct drive_create_data *data)
|
||||
@@ -223,6 +224,7 @@ create_drive_gluster (guestfs_h *g,
|
||||
@@ -226,6 +227,7 @@ create_drive_gluster (guestfs_h *g,
|
||||
|
||||
return create_drive_non_file (g, data);
|
||||
}
|
||||
@ -324,7 +324,7 @@ index 82ef30093..3d712c6e4 100644
|
||||
|
||||
static int
|
||||
nbd_port (void)
|
||||
@@ -291,6 +293,7 @@ create_drive_rbd (guestfs_h *g,
|
||||
@@ -294,6 +296,7 @@ create_drive_rbd (guestfs_h *g,
|
||||
return create_drive_non_file (g, data);
|
||||
}
|
||||
|
||||
@ -332,7 +332,7 @@ index 82ef30093..3d712c6e4 100644
|
||||
static struct drive *
|
||||
create_drive_sheepdog (guestfs_h *g,
|
||||
const struct drive_create_data *data)
|
||||
@@ -391,6 +394,7 @@ create_drive_iscsi (guestfs_h *g,
|
||||
@@ -394,6 +397,7 @@ create_drive_iscsi (guestfs_h *g,
|
||||
|
||||
return create_drive_non_file (g, data);
|
||||
}
|
||||
@ -340,7 +340,7 @@ index 82ef30093..3d712c6e4 100644
|
||||
|
||||
/**
|
||||
* Create the special F</dev/null> drive.
|
||||
@@ -826,6 +830,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
|
||||
@@ -856,6 +860,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
|
||||
drv = create_drive_file (g, &data);
|
||||
}
|
||||
}
|
||||
@ -348,7 +348,7 @@ index 82ef30093..3d712c6e4 100644
|
||||
else if (STREQ (protocol, "ftp")) {
|
||||
data.protocol = drive_protocol_ftp;
|
||||
drv = create_drive_curl (g, &data);
|
||||
@@ -850,6 +855,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
|
||||
@@ -880,6 +885,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
|
||||
data.protocol = drive_protocol_iscsi;
|
||||
drv = create_drive_iscsi (g, &data);
|
||||
}
|
||||
@ -356,7 +356,7 @@ index 82ef30093..3d712c6e4 100644
|
||||
else if (STREQ (protocol, "nbd")) {
|
||||
data.protocol = drive_protocol_nbd;
|
||||
drv = create_drive_nbd (g, &data);
|
||||
@@ -858,6 +864,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
|
||||
@@ -888,6 +894,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
|
||||
data.protocol = drive_protocol_rbd;
|
||||
drv = create_drive_rbd (g, &data);
|
||||
}
|
||||
@ -364,7 +364,7 @@ index 82ef30093..3d712c6e4 100644
|
||||
else if (STREQ (protocol, "sheepdog")) {
|
||||
data.protocol = drive_protocol_sheepdog;
|
||||
drv = create_drive_sheepdog (g, &data);
|
||||
@@ -870,6 +877,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
|
||||
@@ -900,6 +907,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
|
||||
data.protocol = drive_protocol_tftp;
|
||||
drv = create_drive_curl (g, &data);
|
||||
}
|
||||
@ -373,10 +373,10 @@ index 82ef30093..3d712c6e4 100644
|
||||
error (g, _("unknown protocol ‘%s’"), protocol);
|
||||
drv = NULL; /*FALLTHROUGH*/
|
||||
diff --git a/lib/guestfs.pod b/lib/guestfs.pod
|
||||
index c7fbeef03..18e336a1f 100644
|
||||
index bce9eb79f..2bb13b875 100644
|
||||
--- a/lib/guestfs.pod
|
||||
+++ b/lib/guestfs.pod
|
||||
@@ -714,70 +714,6 @@ servers. The server string is documented in
|
||||
@@ -715,70 +715,6 @@ servers. The server string is documented in
|
||||
L</guestfs_add_drive_opts>. The C<username> and C<secret> parameters are
|
||||
also optional, and if not given, then no authentication will be used.
|
||||
|
||||
@ -447,7 +447,7 @@ index c7fbeef03..18e336a1f 100644
|
||||
=head3 NETWORK BLOCK DEVICE
|
||||
|
||||
Libguestfs can access Network Block Device (NBD) disks remotely.
|
||||
@@ -840,42 +776,6 @@ L<https://bugs.launchpad.net/qemu/+bug/1155677>
|
||||
@@ -841,42 +777,6 @@ L<https://bugs.launchpad.net/qemu/+bug/1155677>
|
||||
|
||||
=back
|
||||
|
||||
@ -491,7 +491,7 @@ index c7fbeef03..18e336a1f 100644
|
||||
|
||||
Libguestfs has APIs for inspecting an unknown disk image to find out
|
||||
diff --git a/tests/disks/test-qemu-drive-libvirt.sh b/tests/disks/test-qemu-drive-libvirt.sh
|
||||
index ab8052de1..ad22b2fbb 100755
|
||||
index 3c5aa592e..f73827bd6 100755
|
||||
--- a/tests/disks/test-qemu-drive-libvirt.sh
|
||||
+++ b/tests/disks/test-qemu-drive-libvirt.sh
|
||||
@@ -64,34 +64,6 @@ check_output
|
||||
@ -605,5 +605,5 @@ index 19dd60a2f..583e031bd 100755
|
||||
-grep -sq -- '-drive file=ssh://rich@example.com/disk.img,' "$DEBUG_QEMU_FILE" || fail
|
||||
-rm "$DEBUG_QEMU_FILE"
|
||||
--
|
||||
2.21.0
|
||||
2.31.1
|
||||
|
@ -1,342 +0,0 @@
|
||||
From d330b210b7d62ccd9f73909215251f4ce68cd6c9 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Golembiovsk=C3=BD?= <tgolembi@redhat.com>
|
||||
Date: Thu, 22 Feb 2018 11:41:07 +0100
|
||||
Subject: [PATCH] v2v: ovf: Create OVF more aligned with the standard
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
For historical reasons the OVF used in RHV export domain contains some
|
||||
deviations from the OVF standard. The format used in -o rhv has to
|
||||
remain fixed but for -o vdsm and we could produce much nicer OVF. This
|
||||
patch serves as a preparatory step to this.
|
||||
|
||||
The main reason for creating different OVF is that it can be used to
|
||||
create VM by oVirt REST API. The RHV export domain flavor cannot be used
|
||||
that way.
|
||||
|
||||
For now the virt-v2v behavior is unchanged. The modified output will be
|
||||
enabled in some later patch.
|
||||
|
||||
Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
|
||||
(cherry picked from commit a52ed4b4454396eb13d2cdf5762292bff3104f66)
|
||||
---
|
||||
v2v/create_ovf.ml | 152 ++++++++++++++++++++++++++++++++-------------
|
||||
v2v/create_ovf.mli | 12 +++-
|
||||
v2v/output_rhv.ml | 3 +-
|
||||
v2v/output_vdsm.ml | 3 +-
|
||||
4 files changed, 121 insertions(+), 49 deletions(-)
|
||||
|
||||
diff --git a/v2v/create_ovf.ml b/v2v/create_ovf.ml
|
||||
index e9d569dc1..0ec0a088c 100644
|
||||
--- a/v2v/create_ovf.ml
|
||||
+++ b/v2v/create_ovf.ml
|
||||
@@ -29,6 +29,10 @@ open Types
|
||||
open Utils
|
||||
open DOM
|
||||
|
||||
+type ovf_flavour =
|
||||
+ | OVirt
|
||||
+ | RHVExportStorageDomain
|
||||
+
|
||||
(* We set the creation time to be the same for all dates in
|
||||
* all metadata files. All dates in OVF are UTC.
|
||||
*)
|
||||
@@ -295,7 +299,7 @@ let create_meta_files output_alloc sd_uuid image_uuids targets =
|
||||
|
||||
(* Create the OVF file. *)
|
||||
let rec create_ovf source targets guestcaps inspect
|
||||
- output_alloc sd_uuid image_uuids vol_uuids vm_uuid =
|
||||
+ output_alloc sd_uuid image_uuids vol_uuids vm_uuid ovf_flavour =
|
||||
assert (List.length targets = List.length vol_uuids);
|
||||
|
||||
let memsize_mb = source.s_memory /^ 1024L /^ 1024L in
|
||||
@@ -314,12 +318,26 @@ let rec create_ovf source targets guestcaps inspect
|
||||
] [
|
||||
Comment generated_by;
|
||||
e "References" [] [];
|
||||
- e "Section" ["xsi:type", "ovf:NetworkSection_Type"] [
|
||||
- e "Info" [] [PCData "List of networks"]
|
||||
- ];
|
||||
- e "Section" ["xsi:type", "ovf:DiskSection_Type"] [
|
||||
- e "Info" [] [PCData "List of Virtual Disks"]
|
||||
- ];
|
||||
+ (match ovf_flavour with
|
||||
+ | OVirt ->
|
||||
+ e "NetworkSection" [] [
|
||||
+ e "Info" [] [PCData "List of networks"]
|
||||
+ ]
|
||||
+ | RHVExportStorageDomain ->
|
||||
+ e "Section" ["xsi:type", "ovf:NetworkSection_Type"] [
|
||||
+ e "Info" [] [PCData "List of networks"]
|
||||
+ ]
|
||||
+ );
|
||||
+ (match ovf_flavour with
|
||||
+ | OVirt ->
|
||||
+ e "DiskSection" [] [
|
||||
+ e "Info" [] [PCData "List of Virtual Disks"]
|
||||
+ ]
|
||||
+ | RHVExportStorageDomain ->
|
||||
+ e "Section" ["xsi:type", "ovf:DiskSection_Type"] [
|
||||
+ e "Info" [] [PCData "List of Virtual Disks"]
|
||||
+ ]
|
||||
+ );
|
||||
|
||||
let content_subnodes = ref [
|
||||
e "Name" [] [PCData source.s_name];
|
||||
@@ -352,11 +370,20 @@ let rec create_ovf source targets guestcaps inspect
|
||||
);
|
||||
|
||||
List.push_back content_subnodes (
|
||||
- e "Section" ["ovf:id", vm_uuid; "ovf:required", "false";
|
||||
- "xsi:type", "ovf:OperatingSystemSection_Type"] [
|
||||
+ let osinfo_subnodes = [
|
||||
e "Info" [] [PCData inspect.i_product_name];
|
||||
e "Description" [] [PCData ostype];
|
||||
- ]
|
||||
+ ] in
|
||||
+ (match ovf_flavour with
|
||||
+ | OVirt ->
|
||||
+ e "OperatingSystemSection" ["ovf:id", vm_uuid;
|
||||
+ "ovf:required", "false"]
|
||||
+ osinfo_subnodes
|
||||
+ | RHVExportStorageDomain ->
|
||||
+ e "Section" ["ovf:id", vm_uuid; "ovf:required", "false";
|
||||
+ "xsi:type", "ovf:OperatingSystemSection_Type"]
|
||||
+ osinfo_subnodes
|
||||
+ )
|
||||
);
|
||||
|
||||
let virtual_hardware_section_items = ref [
|
||||
@@ -444,24 +471,34 @@ let rec create_ovf source targets guestcaps inspect
|
||||
);
|
||||
|
||||
List.push_back content_subnodes (
|
||||
- e "Section" ["xsi:type", "ovf:VirtualHardwareSection_Type"]
|
||||
- !virtual_hardware_section_items
|
||||
+ match ovf_flavour with
|
||||
+ | OVirt ->
|
||||
+ e "VirtualHardwareSection" [] !virtual_hardware_section_items
|
||||
+ | RHVExportStorageDomain ->
|
||||
+ e "Section" ["xsi:type", "ovf:VirtualHardwareSection_Type"]
|
||||
+ !virtual_hardware_section_items
|
||||
);
|
||||
|
||||
- e "Content" ["ovf:id", "out"; "xsi:type", "ovf:VirtualSystem_Type"]
|
||||
- !content_subnodes
|
||||
+ (match ovf_flavour with
|
||||
+ | OVirt ->
|
||||
+ e "VirtualSystem" ["ovf:id", "out"] !content_subnodes
|
||||
+ | RHVExportStorageDomain ->
|
||||
+ e "Content" ["ovf:id", "out"; "xsi:type", "ovf:VirtualSystem_Type"]
|
||||
+ !content_subnodes
|
||||
+ )
|
||||
] in
|
||||
|
||||
(* Add disks to the OVF XML. *)
|
||||
- add_disks targets guestcaps output_alloc sd_uuid image_uuids vol_uuids ovf;
|
||||
+ add_disks targets guestcaps output_alloc sd_uuid image_uuids vol_uuids
|
||||
+ ovf_flavour ovf;
|
||||
|
||||
(* Old virt-v2v ignored removable media. XXX *)
|
||||
|
||||
(* Add networks to the OVF XML. *)
|
||||
- add_networks source.s_nics guestcaps ovf;
|
||||
+ add_networks source.s_nics guestcaps ovf_flavour ovf;
|
||||
|
||||
(* Add sound card to the OVF XML. *)
|
||||
- add_sound_card source.s_sound ovf;
|
||||
+ add_sound_card source.s_sound ovf_flavour ovf;
|
||||
|
||||
(* Old virt-v2v didn't really look at the video and display
|
||||
* metadata, instead just adding a single standard display (see
|
||||
@@ -481,21 +518,42 @@ let rec create_ovf source targets guestcaps inspect
|
||||
(* Return the OVF document. *)
|
||||
ovf
|
||||
|
||||
+(* Find appropriate section depending on the OVF flavour being generated.
|
||||
+ *
|
||||
+ * For example normal disk section is in node <DiskSection> whereas in case of
|
||||
+ * RHV export storage domain it is <Section xsi:type="ovf:DiskSection_Type">.
|
||||
+ *)
|
||||
+and get_flavoured_section ovf ovf_flavour ovirt_path rhv_path rhv_path_attr =
|
||||
+ let nodes =
|
||||
+ match ovf_flavour with
|
||||
+ | OVirt ->
|
||||
+ let nodes = path_to_nodes ovf ovirt_path in
|
||||
+ (match nodes with
|
||||
+ | [node] -> node
|
||||
+ | [] | _::_::_ -> assert false)
|
||||
+ | RHVExportStorageDomain ->
|
||||
+ let nodes = path_to_nodes ovf rhv_path in
|
||||
+ try find_node_by_attr nodes rhv_path_attr
|
||||
+ with Not_found -> assert false
|
||||
+ in
|
||||
+ nodes
|
||||
+
|
||||
(* This modifies the OVF DOM, adding a section for each disk. *)
|
||||
-and add_disks targets guestcaps output_alloc sd_uuid image_uuids vol_uuids ovf =
|
||||
+and add_disks targets guestcaps output_alloc sd_uuid image_uuids vol_uuids
|
||||
+ ovf_flavour ovf =
|
||||
let references =
|
||||
let nodes = path_to_nodes ovf ["ovf:Envelope"; "References"] in
|
||||
match nodes with
|
||||
| [] | _::_::_ -> assert false
|
||||
| [node] -> node in
|
||||
- let disk_section =
|
||||
- let sections = path_to_nodes ovf ["ovf:Envelope"; "Section"] in
|
||||
- try find_node_by_attr sections ("xsi:type", "ovf:DiskSection_Type")
|
||||
- with Not_found -> assert false in
|
||||
- let virtualhardware_section =
|
||||
- let sections = path_to_nodes ovf ["ovf:Envelope"; "Content"; "Section"] in
|
||||
- try find_node_by_attr sections ("xsi:type", "ovf:VirtualHardwareSection_Type")
|
||||
- with Not_found -> assert false in
|
||||
+ let disk_section = get_flavoured_section ovf ovf_flavour
|
||||
+ ["ovf:Envelope"; "DiskSection"]
|
||||
+ ["ovf:Envelope"; "Section"]
|
||||
+ ("xsi:type", "ovf:DiskSection_Type") in
|
||||
+ let virtualhardware_section = get_flavoured_section ovf ovf_flavour
|
||||
+ ["ovf:Envelope"; "VirtualSystem"; "VirtualHardwareSection"]
|
||||
+ ["ovf:Envelope"; "Content"; "Section"]
|
||||
+ ("xsi:type", "ovf:VirtualHardwareSection_Type") in
|
||||
|
||||
(* Iterate over the disks, adding them to the OVF document. *)
|
||||
List.iteri (
|
||||
@@ -509,7 +567,12 @@ and add_disks targets guestcaps output_alloc sd_uuid image_uuids vol_uuids ovf =
|
||||
let is_bootable_drive = i == 0 in
|
||||
let boot_order = i+1 in
|
||||
|
||||
- let fileref = sprintf "%s/%s" image_uuid vol_uuid in
|
||||
+ let fileref =
|
||||
+ match ovf_flavour with
|
||||
+ | OVirt ->
|
||||
+ vol_uuid
|
||||
+ | RHVExportStorageDomain ->
|
||||
+ sprintf "%s/%s" image_uuid vol_uuid in
|
||||
|
||||
(* ovf:size and ovf:actual_size fields are integer GBs. If you
|
||||
* use floating point numbers then RHV will fail to parse them.
|
||||
@@ -560,7 +623,10 @@ and add_disks targets guestcaps output_alloc sd_uuid image_uuids vol_uuids ovf =
|
||||
(* Add disk to DiskSection. *)
|
||||
let disk =
|
||||
let attrs = ref [
|
||||
- "ovf:diskId", vol_uuid;
|
||||
+ "ovf:diskId",
|
||||
+ (match ovf_flavour with
|
||||
+ | OVirt -> image_uuid
|
||||
+ | RHVExportStorageDomain -> vol_uuid);
|
||||
"ovf:size", Int64.to_string size_gb;
|
||||
"ovf:capacity", Int64.to_string ov.ov_virtual_size;
|
||||
"ovf:fileRef", fileref;
|
||||
@@ -619,15 +685,15 @@ and add_disks targets guestcaps output_alloc sd_uuid image_uuids vol_uuids ovf =
|
||||
) (List.combine3 targets image_uuids vol_uuids)
|
||||
|
||||
(* This modifies the OVF DOM, adding a section for each NIC. *)
|
||||
-and add_networks nics guestcaps ovf =
|
||||
- let network_section =
|
||||
- let sections = path_to_nodes ovf ["ovf:Envelope"; "Section"] in
|
||||
- try find_node_by_attr sections ("xsi:type", "ovf:NetworkSection_Type")
|
||||
- with Not_found -> assert false in
|
||||
- let virtualhardware_section =
|
||||
- let sections = path_to_nodes ovf ["ovf:Envelope"; "Content"; "Section"] in
|
||||
- try find_node_by_attr sections ("xsi:type", "ovf:VirtualHardwareSection_Type")
|
||||
- with Not_found -> assert false in
|
||||
+and add_networks nics guestcaps ovf_flavour ovf =
|
||||
+ let network_section = get_flavoured_section ovf ovf_flavour
|
||||
+ ["ovf:Envelope"; "NetworkSection"]
|
||||
+ ["ovf:Envelope"; "Section"]
|
||||
+ ("xsi:type", "ovf:NetworkSection_Type") in
|
||||
+ let virtualhardware_section = get_flavoured_section ovf ovf_flavour
|
||||
+ ["ovf:Envelope"; "VirtualSystem"; "VirtualHardwareSection"]
|
||||
+ ["ovf:Envelope"; "Content"; "Section"]
|
||||
+ ("xsi:type", "ovf:VirtualHardwareSection_Type") in
|
||||
|
||||
(* Iterate over the NICs, adding them to the OVF document. *)
|
||||
List.iteri (
|
||||
@@ -675,7 +741,7 @@ and add_networks nics guestcaps ovf =
|
||||
) nics
|
||||
|
||||
(* This modifies the OVF DOM, adding a sound card, if oVirt can emulate it. *)
|
||||
-and add_sound_card sound ovf =
|
||||
+and add_sound_card sound ovf_flavour ovf =
|
||||
let device =
|
||||
match sound with
|
||||
| None -> None
|
||||
@@ -688,12 +754,10 @@ and add_sound_card sound ovf =
|
||||
|
||||
match device with
|
||||
| Some device ->
|
||||
- let virtualhardware_section =
|
||||
- let sections =
|
||||
- path_to_nodes ovf ["ovf:Envelope"; "Content"; "Section"] in
|
||||
- try find_node_by_attr sections
|
||||
- ("xsi:type", "ovf:VirtualHardwareSection_Type")
|
||||
- with Not_found -> assert false in
|
||||
+ let virtualhardware_section = get_flavoured_section ovf ovf_flavour
|
||||
+ ["ovf:Envelope"; "VirtualSystem"; "VirtualHardwareSection"]
|
||||
+ ["ovf:Envelope"; "Content"; "Section"]
|
||||
+ ("xsi:type", "ovf:VirtualHardwareSection_Type") in
|
||||
|
||||
let item =
|
||||
e "Item" [] [
|
||||
diff --git a/v2v/create_ovf.mli b/v2v/create_ovf.mli
|
||||
index 07e8af6a0..8a8c7dd12 100644
|
||||
--- a/v2v/create_ovf.mli
|
||||
+++ b/v2v/create_ovf.mli
|
||||
@@ -16,16 +16,22 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*)
|
||||
|
||||
+type ovf_flavour =
|
||||
+ | OVirt
|
||||
+ | RHVExportStorageDomain
|
||||
+
|
||||
(** Create OVF and related files for RHV.
|
||||
|
||||
- The format is described in
|
||||
- http://www.ovirt.org/images/8/86/Ovirt_ovf_format.odt
|
||||
+ The format for RHV export storage domain is described in:
|
||||
+ http://resources.ovirt.org/old-site-files/Ovirt_ovf_format.odt
|
||||
+
|
||||
+ The format understood by oVirt has no known documentation.
|
||||
|
||||
OVF isn't a real standard, so it's likely that if we ever had to
|
||||
create OVF for another target management system then we would need
|
||||
to heavily modify or even duplicate this code. *)
|
||||
|
||||
-val create_ovf : Types.source -> Types.target list -> Types.guestcaps -> Types.inspect -> Types.output_allocation -> string -> string list -> string list -> string -> DOM.doc
|
||||
+val create_ovf : Types.source -> Types.target list -> Types.guestcaps -> Types.inspect -> Types.output_allocation -> string -> string list -> string list -> string -> ovf_flavour -> DOM.doc
|
||||
(** Create the OVF file.
|
||||
|
||||
Actually a {!DOM} document is created, not a file. It can be written
|
||||
diff --git a/v2v/output_rhv.ml b/v2v/output_rhv.ml
|
||||
index 0b732e4cf..5260ab030 100644
|
||||
--- a/v2v/output_rhv.ml
|
||||
+++ b/v2v/output_rhv.ml
|
||||
@@ -275,7 +275,8 @@ object
|
||||
|
||||
(* Create the metadata. *)
|
||||
let ovf = Create_ovf.create_ovf source targets guestcaps inspect
|
||||
- output_alloc esd_uuid image_uuids vol_uuids vm_uuid in
|
||||
+ output_alloc esd_uuid image_uuids vol_uuids vm_uuid
|
||||
+ Create_ovf.RHVExportStorageDomain in
|
||||
|
||||
(* Write it to the metadata file. *)
|
||||
let dir = esd_mp // esd_uuid // "master" // "vms" // vm_uuid in
|
||||
diff --git a/v2v/output_vdsm.ml b/v2v/output_vdsm.ml
|
||||
index c5e904ba1..ce286d327 100644
|
||||
--- a/v2v/output_vdsm.ml
|
||||
+++ b/v2v/output_vdsm.ml
|
||||
@@ -175,7 +175,8 @@ object
|
||||
output_alloc dd_uuid
|
||||
vdsm_options.image_uuids
|
||||
vdsm_options.vol_uuids
|
||||
- vdsm_options.vm_uuid in
|
||||
+ vdsm_options.vm_uuid
|
||||
+ Create_ovf.RHVExportStorageDomain in
|
||||
|
||||
(* Write it to the metadata file. *)
|
||||
let file = vdsm_options.ovf_output // vdsm_options.vm_uuid ^ ".ovf" in
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,4 +1,4 @@
|
||||
From a981faec152d26fc98e6a6ed9bf0a338b7dda934 Mon Sep 17 00:00:00 2001
|
||||
From 34f8c6a5eb0eabfba4ab1831b45e2baa73a4b501 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 19 Sep 2014 13:38:20 +0100
|
||||
Subject: [PATCH] RHEL 8: Remove User-Mode Linux (RHBZ#1144197).
|
||||
@ -9,7 +9,7 @@ This isn't supported in RHEL 8.
|
||||
1 file changed, 13 insertions(+)
|
||||
|
||||
diff --git a/lib/launch-uml.c b/lib/launch-uml.c
|
||||
index b8825cf56..1acf8db27 100644
|
||||
index 5aec50a57..8b9fcd770 100644
|
||||
--- a/lib/launch-uml.c
|
||||
+++ b/lib/launch-uml.c
|
||||
@@ -44,7 +44,9 @@ struct backend_uml_data {
|
||||
@ -30,7 +30,7 @@ index b8825cf56..1acf8db27 100644
|
||||
/* Test for features which are not supported by the UML backend.
|
||||
* Possibly some of these should just be warnings, not errors.
|
||||
*/
|
||||
@@ -128,10 +131,17 @@ uml_supported (guestfs_h *g)
|
||||
@@ -133,10 +136,17 @@ uml_supported (guestfs_h *g)
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -48,7 +48,7 @@ index b8825cf56..1acf8db27 100644
|
||||
struct backend_uml_data *data = datav;
|
||||
CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (cmdline);
|
||||
int console_sock = -1, daemon_sock = -1;
|
||||
@@ -491,8 +501,10 @@ launch_uml (guestfs_h *g, void *datav, const char *arg)
|
||||
@@ -496,8 +506,10 @@ launch_uml (guestfs_h *g, void *datav, const char *arg)
|
||||
}
|
||||
g->state = CONFIG;
|
||||
return -1;
|
||||
@ -59,7 +59,7 @@ index b8825cf56..1acf8db27 100644
|
||||
/* This is called from the forked subprocess just before vmlinux runs,
|
||||
* so it can just print the message straight to stderr, where it will
|
||||
* be picked up and funnelled through the usual appliance event API.
|
||||
@@ -522,6 +534,7 @@ print_vmlinux_command_line (guestfs_h *g, char **argv)
|
||||
@@ -527,6 +539,7 @@ print_vmlinux_command_line (guestfs_h *g, char **argv)
|
||||
|
||||
fputc ('\n', stderr);
|
||||
}
|
||||
@ -68,5 +68,5 @@ index b8825cf56..1acf8db27 100644
|
||||
static int
|
||||
shutdown_uml (guestfs_h *g, void *datav, int check_for_errors)
|
||||
--
|
||||
2.21.0
|
||||
2.31.1
|
||||
|
@ -1,213 +0,0 @@
|
||||
From 14cfe80643a7df4ddf412aebdf39543344c1cf6e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Golembiovsk=C3=BD?= <tgolembi@redhat.com>
|
||||
Date: Thu, 22 Feb 2018 11:41:08 +0100
|
||||
Subject: [PATCH] v2v: vdsm: add --vdsm-fixed-ovf option
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Add option for -o vdsm that enables output of the modified OVF. oVirt
|
||||
engine should already be able to consume the OVF, but let's not take any
|
||||
chances and enable it only by command line argument. It can be made
|
||||
default later when it receives proper testing.
|
||||
|
||||
Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
|
||||
(cherry picked from commit 285014b290507865fd2020e44ea453af0262b624)
|
||||
---
|
||||
v2v/cmdline.ml | 10 ++++++++++
|
||||
v2v/create_ovf.ml | 7 +++++++
|
||||
v2v/create_ovf.mli | 9 +++++++++
|
||||
v2v/output_vdsm.ml | 9 +++++++--
|
||||
v2v/output_vdsm.mli | 1 +
|
||||
v2v/test-v2v-o-vdsm-options.sh | 3 ++-
|
||||
v2v/virt-v2v.pod | 20 ++++++++++++++++++++
|
||||
7 files changed, 56 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/v2v/cmdline.ml b/v2v/cmdline.ml
|
||||
index d88d0a579..75909ee77 100644
|
||||
--- a/v2v/cmdline.ml
|
||||
+++ b/v2v/cmdline.ml
|
||||
@@ -79,6 +79,11 @@ let parse_cmdline () =
|
||||
let vdsm_compat = ref "0.10" in
|
||||
let set_vdsm_compat s = vdsm_compat := s in
|
||||
|
||||
+ let vdsm_ovf_flavour = ref Create_ovf.RHVExportStorageDomain in
|
||||
+ let ovf_flavours_str = String.concat "|" Create_ovf.ovf_flavours in
|
||||
+ let set_vdsm_ovf_flavour arg =
|
||||
+ vdsm_ovf_flavour := Create_ovf.ovf_flavour_of_string arg in
|
||||
+
|
||||
let set_string_option_once optname optref arg =
|
||||
match !optref with
|
||||
| Some _ ->
|
||||
@@ -251,6 +256,8 @@ let parse_cmdline () =
|
||||
s_"Output VM UUID";
|
||||
[ L"vdsm-ovf-output" ], Getopt.String ("-", set_string_option_once "--vdsm-ovf-output" vdsm_ovf_output),
|
||||
s_"Output OVF file";
|
||||
+ [ L"vdsm-ovf-flavour" ], Getopt.Symbol (ovf_flavours_str, Create_ovf.ovf_flavours, set_vdsm_ovf_flavour),
|
||||
+ s_"Set the type of generated OVF (default rhvexp)";
|
||||
[ L"vmtype" ], Getopt.String ("-", vmtype_warning),
|
||||
s_"Ignored for backwards compatibility";
|
||||
] in
|
||||
@@ -327,6 +334,7 @@ read the man page virt-v2v(1).
|
||||
let vdsm_vol_uuids = List.rev !vdsm_vol_uuids in
|
||||
let vdsm_vm_uuid = !vdsm_vm_uuid in
|
||||
let vdsm_ovf_output = Option.default "." !vdsm_ovf_output in
|
||||
+ let vdsm_ovf_flavour = !vdsm_ovf_flavour in
|
||||
|
||||
(* No arguments and machine-readable mode? Print out some facts
|
||||
* about what this binary supports.
|
||||
@@ -343,6 +351,7 @@ read the man page virt-v2v(1).
|
||||
List.iter (printf "input:%s\n") (Modules_list.input_modules ());
|
||||
List.iter (printf "output:%s\n") (Modules_list.output_modules ());
|
||||
List.iter (printf "convert:%s\n") (Modules_list.convert_modules ());
|
||||
+ List.iter (printf "ovf:%s\n") Create_ovf.ovf_flavours;
|
||||
exit 0
|
||||
);
|
||||
|
||||
@@ -542,6 +551,7 @@ read the man page virt-v2v(1).
|
||||
vm_uuid = vdsm_vm_uuid;
|
||||
ovf_output = vdsm_ovf_output;
|
||||
compat = vdsm_compat;
|
||||
+ ovf_flavour = vdsm_ovf_flavour;
|
||||
} in
|
||||
Output_vdsm.output_vdsm os vdsm_options output_alloc,
|
||||
output_format, output_alloc in
|
||||
diff --git a/v2v/create_ovf.ml b/v2v/create_ovf.ml
|
||||
index 0ec0a088c..d0735afce 100644
|
||||
--- a/v2v/create_ovf.ml
|
||||
+++ b/v2v/create_ovf.ml
|
||||
@@ -33,6 +33,13 @@ type ovf_flavour =
|
||||
| OVirt
|
||||
| RHVExportStorageDomain
|
||||
|
||||
+let ovf_flavours = ["ovirt"; "rhvexp"]
|
||||
+
|
||||
+let ovf_flavour_of_string = function
|
||||
+ | "ovirt" -> OVirt
|
||||
+ | "rhvexp" -> RHVExportStorageDomain
|
||||
+ | flav -> invalid_arg flav
|
||||
+
|
||||
(* We set the creation time to be the same for all dates in
|
||||
* all metadata files. All dates in OVF are UTC.
|
||||
*)
|
||||
diff --git a/v2v/create_ovf.mli b/v2v/create_ovf.mli
|
||||
index 8a8c7dd12..2d80660e3 100644
|
||||
--- a/v2v/create_ovf.mli
|
||||
+++ b/v2v/create_ovf.mli
|
||||
@@ -20,6 +20,15 @@ type ovf_flavour =
|
||||
| OVirt
|
||||
| RHVExportStorageDomain
|
||||
|
||||
+(** The string representation of available OVF flavours. *)
|
||||
+val ovf_flavours : string list
|
||||
+
|
||||
+(** Convert from a string to the corresponding OVF flavour.
|
||||
+
|
||||
+ Throw [Invalid_argument] if the string does not match any
|
||||
+ valid flavour. *)
|
||||
+val ovf_flavour_of_string : string -> ovf_flavour
|
||||
+
|
||||
(** Create OVF and related files for RHV.
|
||||
|
||||
The format for RHV export storage domain is described in:
|
||||
diff --git a/v2v/output_vdsm.ml b/v2v/output_vdsm.ml
|
||||
index ce286d327..b76a2e930 100644
|
||||
--- a/v2v/output_vdsm.ml
|
||||
+++ b/v2v/output_vdsm.ml
|
||||
@@ -32,6 +32,7 @@ type vdsm_options = {
|
||||
vm_uuid : string;
|
||||
ovf_output : string;
|
||||
compat : string;
|
||||
+ ovf_flavour : Create_ovf.ovf_flavour;
|
||||
}
|
||||
|
||||
class output_vdsm os vdsm_options output_alloc =
|
||||
@@ -39,7 +40,7 @@ object
|
||||
inherit output
|
||||
|
||||
method as_options =
|
||||
- sprintf "-o vdsm -os %s%s%s --vdsm-vm-uuid %s --vdsm-ovf-output %s%s" os
|
||||
+ sprintf "-o vdsm -os %s%s%s --vdsm-vm-uuid %s --vdsm-ovf-output %s%s%s" os
|
||||
(String.concat ""
|
||||
(List.map (sprintf " --vdsm-image-uuid %s") vdsm_options.image_uuids))
|
||||
(String.concat ""
|
||||
@@ -49,6 +50,10 @@ object
|
||||
(match vdsm_options.compat with
|
||||
| "0.10" -> "" (* currently this is the default, so don't print it *)
|
||||
| s -> sprintf " --vdsm-compat=%s" s)
|
||||
+ (match vdsm_options.ovf_flavour with
|
||||
+ | Create_ovf.OVirt -> "--vdsm-ovf-flavour=ovf"
|
||||
+ (* currently this is the default, so don't print it *)
|
||||
+ | Create_ovf.RHVExportStorageDomain -> "")
|
||||
|
||||
method supported_firmware = [ TargetBIOS ]
|
||||
|
||||
@@ -176,7 +181,7 @@ object
|
||||
vdsm_options.image_uuids
|
||||
vdsm_options.vol_uuids
|
||||
vdsm_options.vm_uuid
|
||||
- Create_ovf.RHVExportStorageDomain in
|
||||
+ vdsm_options.ovf_flavour in
|
||||
|
||||
(* Write it to the metadata file. *)
|
||||
let file = vdsm_options.ovf_output // vdsm_options.vm_uuid ^ ".ovf" in
|
||||
diff --git a/v2v/output_vdsm.mli b/v2v/output_vdsm.mli
|
||||
index 401a71ec4..6ed684638 100644
|
||||
--- a/v2v/output_vdsm.mli
|
||||
+++ b/v2v/output_vdsm.mli
|
||||
@@ -24,6 +24,7 @@ type vdsm_options = {
|
||||
vm_uuid : string; (* --vdsm-vm-uuid *)
|
||||
ovf_output : string; (* --vdsm-ovf-output *)
|
||||
compat : string; (* --vdsm-compat=0.10|1.1 *)
|
||||
+ ovf_flavour : Create_ovf.ovf_flavour;
|
||||
}
|
||||
(** Miscellaneous extra command line parameters used by VDSM. *)
|
||||
|
||||
diff --git a/v2v/test-v2v-o-vdsm-options.sh b/v2v/test-v2v-o-vdsm-options.sh
|
||||
index 753efc4e7..4ad5d4aad 100755
|
||||
--- a/v2v/test-v2v-o-vdsm-options.sh
|
||||
+++ b/v2v/test-v2v-o-vdsm-options.sh
|
||||
@@ -55,7 +55,8 @@ $VG virt-v2v --debug-gc \
|
||||
--vdsm-vol-uuid VOL \
|
||||
--vdsm-vm-uuid VM \
|
||||
--vdsm-ovf-output $d/12345678-1234-1234-1234-123456789abc/master/vms/VM \
|
||||
- --vdsm-compat=1.1
|
||||
+ --vdsm-compat=1.1 \
|
||||
+ --vdsm-ovf-flavour=ovirt
|
||||
|
||||
# Test the OVF metadata was created.
|
||||
test -f $d/12345678-1234-1234-1234-123456789abc/master/vms/VM/VM.ovf
|
||||
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
|
||||
index cced114f3..0ea5fa97f 100644
|
||||
--- a/v2v/virt-v2v.pod
|
||||
+++ b/v2v/virt-v2v.pod
|
||||
@@ -759,6 +759,26 @@ hex digit can be C<0-9> or C<a-f>), conforming to S<OSF DCE 1.1>.
|
||||
|
||||
These options can only be used with I<-o vdsm>.
|
||||
|
||||
+=item B<--vdsm-ovf-flavour> flavour
|
||||
+
|
||||
+This option controls the format of the OVF generated at the end of conversion.
|
||||
+Currently there are two possible flavours:
|
||||
+
|
||||
+=over 4
|
||||
+
|
||||
+=item rhevexp
|
||||
+
|
||||
+The OVF format used in RHV export storage domain.
|
||||
+
|
||||
+=item ovirt
|
||||
+
|
||||
+The OVF format understood by oVirt REST API.
|
||||
+
|
||||
+=back
|
||||
+
|
||||
+For backward compatibility the default is I<rhevexp>, but this may change in
|
||||
+the future.
|
||||
+
|
||||
=item B<-v>
|
||||
|
||||
=item B<--verbose>
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,69 @@
|
||||
From cb2ac63562447e2780bd7103ed060fd6013b9054 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 7 Jul 2015 09:28:03 -0400
|
||||
Subject: [PATCH] RHEL 8: Reject use of libguestfs-winsupport features except
|
||||
for virt-* tools (RHBZ#1240276).
|
||||
|
||||
Fix the tests: it doesn't let us use guestfish for arbitrary Windows
|
||||
edits.
|
||||
---
|
||||
generator/c.ml | 16 ++++++++++++++++
|
||||
test-data/phony-guests/make-windows-img.sh | 1 +
|
||||
tests/charsets/test-charset-fidelity.c | 2 ++
|
||||
3 files changed, 19 insertions(+)
|
||||
|
||||
diff --git a/generator/c.ml b/generator/c.ml
|
||||
index 86d3b26f8..a625361a9 100644
|
||||
--- a/generator/c.ml
|
||||
+++ b/generator/c.ml
|
||||
@@ -1846,6 +1846,22 @@ and generate_client_actions actions () =
|
||||
check_args_validity c_name style;
|
||||
trace_call name c_name style;
|
||||
|
||||
+ (* RHEL 8 *)
|
||||
+ if name = "mount" || name = "mount_ro" || name = "mount_options" ||
|
||||
+ name = "mount_vfs" then (
|
||||
+ pr " if (g->program && !STRPREFIX (g->program, \"virt-\")) {\n";
|
||||
+ pr " CLEANUP_FREE char *vfs_type = guestfs_vfs_type (g, mountable);\n";
|
||||
+ pr " if (vfs_type && STREQ (vfs_type, \"ntfs\")) {\n";
|
||||
+ pr " error (g, \"mount: unsupported filesystem type\");\n";
|
||||
+ pr " if (trace_flag)\n";
|
||||
+ pr " guestfs_int_trace (g, \"%%s = %%s (error)\",\n";
|
||||
+ pr " \"%s\", \"-1\");\n" name;
|
||||
+ pr " return %s;\n" (string_of_errcode errcode);
|
||||
+ pr " }\n";
|
||||
+ pr " }\n";
|
||||
+ pr "\n";
|
||||
+ );
|
||||
+
|
||||
(* Calculate the total size of all FileIn arguments to pass
|
||||
* as a progress bar hint.
|
||||
*)
|
||||
diff --git a/test-data/phony-guests/make-windows-img.sh b/test-data/phony-guests/make-windows-img.sh
|
||||
index 30908a918..73cf5144e 100755
|
||||
--- a/test-data/phony-guests/make-windows-img.sh
|
||||
+++ b/test-data/phony-guests/make-windows-img.sh
|
||||
@@ -37,6 +37,7 @@ fi
|
||||
|
||||
# Create a disk image.
|
||||
guestfish <<EOF
|
||||
+set-program virt-testing
|
||||
sparse windows.img-t 512M
|
||||
run
|
||||
|
||||
diff --git a/tests/charsets/test-charset-fidelity.c b/tests/charsets/test-charset-fidelity.c
|
||||
index 39ccc2068..2b2e2d8a9 100644
|
||||
--- a/tests/charsets/test-charset-fidelity.c
|
||||
+++ b/tests/charsets/test-charset-fidelity.c
|
||||
@@ -94,6 +94,8 @@ main (int argc, char *argv[])
|
||||
if (g == NULL)
|
||||
error (EXIT_FAILURE, 0, "failed to create handle");
|
||||
|
||||
+ guestfs_set_program (g, "virt-testing");
|
||||
+
|
||||
if (guestfs_add_drive_scratch (g, 1024*1024*1024, -1) == -1)
|
||||
exit (EXIT_FAILURE);
|
||||
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,124 +0,0 @@
|
||||
From 00ed208050cdb2178ac58878cb126504ebc7b311 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 22 Feb 2018 14:22:12 +0000
|
||||
Subject: [PATCH] v2v: OVF: Code formatting.
|
||||
|
||||
Updates commit a52ed4b4454396eb13d2cdf5762292bff3104f66
|
||||
("v2v: ovf: Create OVF more aligned with the standard") with some
|
||||
small code refactoring and formatting.
|
||||
|
||||
(cherry picked from commit 9e83f3a2ccef4e91b0b3275b712df8b16e233cff)
|
||||
---
|
||||
v2v/create_ovf.ml | 73 ++++++++++++++++++++++++++---------------------
|
||||
1 file changed, 41 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/v2v/create_ovf.ml b/v2v/create_ovf.ml
|
||||
index d0735afce..0e07afea8 100644
|
||||
--- a/v2v/create_ovf.ml
|
||||
+++ b/v2v/create_ovf.ml
|
||||
@@ -530,20 +530,16 @@ let rec create_ovf source targets guestcaps inspect
|
||||
* For example normal disk section is in node <DiskSection> whereas in case of
|
||||
* RHV export storage domain it is <Section xsi:type="ovf:DiskSection_Type">.
|
||||
*)
|
||||
-and get_flavoured_section ovf ovf_flavour ovirt_path rhv_path rhv_path_attr =
|
||||
- let nodes =
|
||||
- match ovf_flavour with
|
||||
- | OVirt ->
|
||||
- let nodes = path_to_nodes ovf ovirt_path in
|
||||
- (match nodes with
|
||||
+and get_flavoured_section ovf ovirt_path rhv_path rhv_path_attr = function
|
||||
+ | OVirt ->
|
||||
+ let nodes = path_to_nodes ovf ovirt_path in
|
||||
+ (match nodes with
|
||||
| [node] -> node
|
||||
| [] | _::_::_ -> assert false)
|
||||
- | RHVExportStorageDomain ->
|
||||
- let nodes = path_to_nodes ovf rhv_path in
|
||||
- try find_node_by_attr nodes rhv_path_attr
|
||||
- with Not_found -> assert false
|
||||
- in
|
||||
- nodes
|
||||
+ | RHVExportStorageDomain ->
|
||||
+ let nodes = path_to_nodes ovf rhv_path in
|
||||
+ try find_node_by_attr nodes rhv_path_attr
|
||||
+ with Not_found -> assert false
|
||||
|
||||
(* This modifies the OVF DOM, adding a section for each disk. *)
|
||||
and add_disks targets guestcaps output_alloc sd_uuid image_uuids vol_uuids
|
||||
@@ -553,14 +549,19 @@ and add_disks targets guestcaps output_alloc sd_uuid image_uuids vol_uuids
|
||||
match nodes with
|
||||
| [] | _::_::_ -> assert false
|
||||
| [node] -> node in
|
||||
- let disk_section = get_flavoured_section ovf ovf_flavour
|
||||
- ["ovf:Envelope"; "DiskSection"]
|
||||
- ["ovf:Envelope"; "Section"]
|
||||
- ("xsi:type", "ovf:DiskSection_Type") in
|
||||
- let virtualhardware_section = get_flavoured_section ovf ovf_flavour
|
||||
- ["ovf:Envelope"; "VirtualSystem"; "VirtualHardwareSection"]
|
||||
- ["ovf:Envelope"; "Content"; "Section"]
|
||||
- ("xsi:type", "ovf:VirtualHardwareSection_Type") in
|
||||
+ let disk_section =
|
||||
+ get_flavoured_section ovf
|
||||
+ ["ovf:Envelope"; "DiskSection"]
|
||||
+ ["ovf:Envelope"; "Section"]
|
||||
+ ("xsi:type", "ovf:DiskSection_Type")
|
||||
+ ovf_flavour in
|
||||
+ let virtualhardware_section =
|
||||
+ get_flavoured_section ovf
|
||||
+ ["ovf:Envelope"; "VirtualSystem";
|
||||
+ "VirtualHardwareSection"]
|
||||
+ ["ovf:Envelope"; "Content"; "Section"]
|
||||
+ ("xsi:type", "ovf:VirtualHardwareSection_Type")
|
||||
+ ovf_flavour in
|
||||
|
||||
(* Iterate over the disks, adding them to the OVF document. *)
|
||||
List.iteri (
|
||||
@@ -693,14 +694,19 @@ and add_disks targets guestcaps output_alloc sd_uuid image_uuids vol_uuids
|
||||
|
||||
(* This modifies the OVF DOM, adding a section for each NIC. *)
|
||||
and add_networks nics guestcaps ovf_flavour ovf =
|
||||
- let network_section = get_flavoured_section ovf ovf_flavour
|
||||
- ["ovf:Envelope"; "NetworkSection"]
|
||||
- ["ovf:Envelope"; "Section"]
|
||||
- ("xsi:type", "ovf:NetworkSection_Type") in
|
||||
- let virtualhardware_section = get_flavoured_section ovf ovf_flavour
|
||||
- ["ovf:Envelope"; "VirtualSystem"; "VirtualHardwareSection"]
|
||||
- ["ovf:Envelope"; "Content"; "Section"]
|
||||
- ("xsi:type", "ovf:VirtualHardwareSection_Type") in
|
||||
+ let network_section =
|
||||
+ get_flavoured_section ovf
|
||||
+ ["ovf:Envelope"; "NetworkSection"]
|
||||
+ ["ovf:Envelope"; "Section"]
|
||||
+ ("xsi:type", "ovf:NetworkSection_Type")
|
||||
+ ovf_flavour in
|
||||
+ let virtualhardware_section =
|
||||
+ get_flavoured_section ovf
|
||||
+ ["ovf:Envelope"; "VirtualSystem";
|
||||
+ "VirtualHardwareSection"]
|
||||
+ ["ovf:Envelope"; "Content"; "Section"]
|
||||
+ ("xsi:type", "ovf:VirtualHardwareSection_Type")
|
||||
+ ovf_flavour in
|
||||
|
||||
(* Iterate over the NICs, adding them to the OVF document. *)
|
||||
List.iteri (
|
||||
@@ -761,10 +767,13 @@ and add_sound_card sound ovf_flavour ovf =
|
||||
|
||||
match device with
|
||||
| Some device ->
|
||||
- let virtualhardware_section = get_flavoured_section ovf ovf_flavour
|
||||
- ["ovf:Envelope"; "VirtualSystem"; "VirtualHardwareSection"]
|
||||
- ["ovf:Envelope"; "Content"; "Section"]
|
||||
- ("xsi:type", "ovf:VirtualHardwareSection_Type") in
|
||||
+ let virtualhardware_section =
|
||||
+ get_flavoured_section ovf
|
||||
+ ["ovf:Envelope"; "VirtualSystem";
|
||||
+ "VirtualHardwareSection"]
|
||||
+ ["ovf:Envelope"; "Content"; "Section"]
|
||||
+ ("xsi:type", "ovf:VirtualHardwareSection_Type")
|
||||
+ ovf_flavour in
|
||||
|
||||
let item =
|
||||
e "Item" [] [
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,37 @@
|
||||
From dbd1eaab6a478cf0c3ea093a56b3d04c29278615 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 12 Jan 2021 10:23:11 +0000
|
||||
Subject: [PATCH] build: Avoid warnings about unknown pragmas.
|
||||
|
||||
In commit 4bbbf03b8bc266ed2b63c461cd0945250bb134fe we started to
|
||||
ignore bogus GCC 11 warnings. Unfortunately earlier versions of GCC
|
||||
don't know about those pragmas so give warnings [hence errors in
|
||||
developer builds] like:
|
||||
|
||||
tsk.c:75:32: error: unknown option after '#pragma GCC diagnostic' kind [-Werror=pragmas]
|
||||
|
||||
Turn off these warnings.
|
||||
|
||||
Updates: commit 4bbbf03b8bc266ed2b63c461cd0945250bb134fe
|
||||
(cherry picked from commit 812f837c97f48ce0c26a0e02286fb9180c282923)
|
||||
---
|
||||
m4/guestfs-c.m4 | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/m4/guestfs-c.m4 b/m4/guestfs-c.m4
|
||||
index 25ffea0d9..bbb4db464 100644
|
||||
--- a/m4/guestfs-c.m4
|
||||
+++ b/m4/guestfs-c.m4
|
||||
@@ -108,6 +108,9 @@ gl_WARN_ADD([-Wformat-truncation=1])
|
||||
dnl GCC 9 at level 2 gives apparently bogus errors when %.*s is used.
|
||||
gl_WARN_ADD([-Wformat-overflow=1])
|
||||
|
||||
+dnl GCC < 11 gives warnings when disabling GCC 11 warnings.
|
||||
+gl_WARN_ADD([-Wno-pragmas])
|
||||
+
|
||||
AC_SUBST([WARN_CFLAGS])
|
||||
|
||||
NO_SNV_CFLAGS=
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,127 +0,0 @@
|
||||
From 83b5f589231da2ab6d04680f42c37dc6058cbe6e Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 20 Feb 2018 15:21:48 +0000
|
||||
Subject: [PATCH] v2v: DOM: Add doc_to_string function.
|
||||
|
||||
Convert a document to an in-memory string.
|
||||
|
||||
(cherry picked from commit 802c8635cc2537a7d4b7af8981c670e2fdbb2675)
|
||||
---
|
||||
v2v/DOM.ml | 61 +++++++++++++++++++++++++++++++++--------------------
|
||||
v2v/DOM.mli | 3 +++
|
||||
2 files changed, 41 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/v2v/DOM.ml b/v2v/DOM.ml
|
||||
index 7f66e0920..8b106224b 100644
|
||||
--- a/v2v/DOM.ml
|
||||
+++ b/v2v/DOM.ml
|
||||
@@ -46,43 +46,48 @@ let e name attrs children =
|
||||
* we will be writing, ie. libvirt XML and OVF metadata, where
|
||||
* whitespace is generally not significant, but readability is useful.
|
||||
*)
|
||||
-let rec node_to_chan ?(indent = 0) chan = function
|
||||
- | PCData str -> output_string chan (xml_quote_pcdata str)
|
||||
+let rec node_to_buf ?(indent = 0) buf = function
|
||||
+ | PCData str ->
|
||||
+ Buffer.add_string buf (xml_quote_pcdata str)
|
||||
| Comment str ->
|
||||
- output_spaces chan indent;
|
||||
- fprintf chan "<!-- %s -->" (xml_quote_pcdata str)
|
||||
- | Element e -> element_to_chan ~indent chan e
|
||||
-and element_to_chan ?(indent = 0) chan
|
||||
+ buffer_add_spaces buf indent;
|
||||
+ bprintf buf "<!-- %s -->" (xml_quote_pcdata str)
|
||||
+ | Element e ->
|
||||
+ element_to_buf ~indent buf e
|
||||
+and element_to_buf ?(indent = 0) buf
|
||||
{ e_name = name; e_attrs = attrs; e_children = children } =
|
||||
- output_spaces chan indent;
|
||||
- fprintf chan "<%s" name;
|
||||
- List.iter (fun (n, v) -> fprintf chan " %s='%s'" n (xml_quote_attr v)) attrs;
|
||||
+ buffer_add_spaces buf indent;
|
||||
+ bprintf buf "<%s" name;
|
||||
+ List.iter (fun (n, v) -> bprintf buf " %s='%s'" n (xml_quote_attr v)) attrs;
|
||||
if children <> [] then (
|
||||
- output_string chan ">";
|
||||
+ Buffer.add_string buf ">";
|
||||
let last_child_was_element = ref false in
|
||||
List.iter (
|
||||
function
|
||||
| Element _ as child ->
|
||||
last_child_was_element := true;
|
||||
- output_char chan '\n';
|
||||
- node_to_chan ~indent:(indent+2) chan child;
|
||||
+ Buffer.add_char buf '\n';
|
||||
+ node_to_buf ~indent:(indent+2) buf child;
|
||||
| PCData _ as child ->
|
||||
last_child_was_element := false;
|
||||
- node_to_chan ~indent:(indent+2) chan child;
|
||||
+ node_to_buf ~indent:(indent+2) buf child;
|
||||
| Comment _ as child ->
|
||||
last_child_was_element := true;
|
||||
- output_char chan '\n';
|
||||
- node_to_chan ~indent:(indent+2) chan child;
|
||||
+ Buffer.add_char buf '\n';
|
||||
+ node_to_buf ~indent:(indent+2) buf child;
|
||||
) children;
|
||||
if !last_child_was_element then (
|
||||
- output_char chan '\n';
|
||||
- output_spaces chan indent
|
||||
+ Buffer.add_char buf '\n';
|
||||
+ buffer_add_spaces buf indent
|
||||
);
|
||||
- fprintf chan "</%s>" name
|
||||
+ bprintf buf "</%s>" name
|
||||
) else (
|
||||
- output_string chan "/>"
|
||||
+ Buffer.add_string buf "/>"
|
||||
)
|
||||
|
||||
+and buffer_add_spaces buf n =
|
||||
+ Buffer.add_string buf (String.spaces n)
|
||||
+
|
||||
(* Quote XML <element attr='...'> content. Note you must use single
|
||||
* quotes around the attribute.
|
||||
*)
|
||||
@@ -99,10 +104,20 @@ and xml_quote_pcdata str =
|
||||
let str = String.replace str ">" ">" in
|
||||
str
|
||||
|
||||
-let doc_to_chan chan (Doc doc) =
|
||||
- fprintf chan "<?xml version='1.0' encoding='utf-8'?>\n";
|
||||
- element_to_chan chan doc;
|
||||
- fprintf chan "\n"
|
||||
+let doc_to_buf buf (Doc doc) =
|
||||
+ bprintf buf "<?xml version='1.0' encoding='utf-8'?>\n";
|
||||
+ element_to_buf buf doc;
|
||||
+ bprintf buf "\n"
|
||||
+
|
||||
+let doc_to_string doc =
|
||||
+ let buf = Buffer.create 4096 in
|
||||
+ doc_to_buf buf doc;
|
||||
+ Buffer.contents buf
|
||||
+
|
||||
+let doc_to_chan chan doc =
|
||||
+ let buf = Buffer.create 4096 in
|
||||
+ doc_to_buf buf doc;
|
||||
+ Buffer.output_buffer chan buf
|
||||
|
||||
let path_to_nodes (Doc doc) path =
|
||||
match path with
|
||||
diff --git a/v2v/DOM.mli b/v2v/DOM.mli
|
||||
index 1aa89b7e7..99223c389 100644
|
||||
--- a/v2v/DOM.mli
|
||||
+++ b/v2v/DOM.mli
|
||||
@@ -60,6 +60,9 @@ v}
|
||||
v}
|
||||
*)
|
||||
|
||||
+val doc_to_string : doc -> string
|
||||
+(** Convert a document to a string representation. *)
|
||||
+
|
||||
val doc_to_chan : out_channel -> doc -> unit
|
||||
(** Write the XML document to an output channel. *)
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,94 @@
|
||||
From 22416a2329ec531b9608c21b11ff3d53275fe7a0 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 22 Feb 2021 10:18:45 +0000
|
||||
Subject: [PATCH] daemon: lvm: Use lvcreate --yes to avoid interactive prompts.
|
||||
|
||||
See https://bugzilla.redhat.com/show_bug.cgi?id=1930996#c1
|
||||
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1930996
|
||||
(cherry picked from commit 21cd97732c4973db835b8b6540c8ad582ebd2bda)
|
||||
---
|
||||
daemon/lvm.c | 2 +-
|
||||
tests/regressions/Makefile.am | 2 ++
|
||||
tests/regressions/rhbz1930996.sh | 36 ++++++++++++++++++++++++++++++++
|
||||
3 files changed, 39 insertions(+), 1 deletion(-)
|
||||
create mode 100755 tests/regressions/rhbz1930996.sh
|
||||
|
||||
diff --git a/daemon/lvm.c b/daemon/lvm.c
|
||||
index 841dc4b6b..72c59c3a1 100644
|
||||
--- a/daemon/lvm.c
|
||||
+++ b/daemon/lvm.c
|
||||
@@ -219,7 +219,7 @@ do_lvcreate (const char *logvol, const char *volgroup, int mbytes)
|
||||
snprintf (size, sizeof size, "%d", mbytes);
|
||||
|
||||
r = command (NULL, &err,
|
||||
- "lvm", "lvcreate",
|
||||
+ "lvm", "lvcreate", "--yes",
|
||||
"-L", size, "-n", logvol, volgroup, NULL);
|
||||
if (r == -1) {
|
||||
reply_with_error ("%s", err);
|
||||
diff --git a/tests/regressions/Makefile.am b/tests/regressions/Makefile.am
|
||||
index ecb0d68a7..c1e0ee8a9 100644
|
||||
--- a/tests/regressions/Makefile.am
|
||||
+++ b/tests/regressions/Makefile.am
|
||||
@@ -49,6 +49,7 @@ EXTRA_DIST = \
|
||||
rhbz1370424.sh \
|
||||
rhbz1370424.xml \
|
||||
rhbz1477623.sh \
|
||||
+ rhbz1930996.sh \
|
||||
test-noexec-stack.pl
|
||||
|
||||
TESTS = \
|
||||
@@ -79,6 +80,7 @@ TESTS = \
|
||||
rhbz1285847.sh \
|
||||
rhbz1370424.sh \
|
||||
rhbz1477623.sh \
|
||||
+ rhbz1930996.sh \
|
||||
test-big-heap \
|
||||
test-noexec-stack.pl \
|
||||
$(SLOW_TESTS)
|
||||
diff --git a/tests/regressions/rhbz1930996.sh b/tests/regressions/rhbz1930996.sh
|
||||
new file mode 100755
|
||||
index 000000000..27089beaa
|
||||
--- /dev/null
|
||||
+++ b/tests/regressions/rhbz1930996.sh
|
||||
@@ -0,0 +1,36 @@
|
||||
+#!/bin/bash -
|
||||
+# libguestfs
|
||||
+# Copyright (C) 2017-2021 Red Hat Inc.
|
||||
+#
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more 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.
|
||||
+
|
||||
+# Regression test for:
|
||||
+# https://bugzilla.redhat.com/show_bug.cgi?id=1930996#c1
|
||||
+#
|
||||
+# Actually a bug/change in LVM, previously we failed to create an LV
|
||||
+# if the underlying disk contained a filesystem signature.
|
||||
+
|
||||
+set -e
|
||||
+
|
||||
+$TEST_FUNCTIONS
|
||||
+skip_if_skipped
|
||||
+skip_unless_phony_guest fedora.img
|
||||
+
|
||||
+f=rhbz1930996.img
|
||||
+rm -f $f
|
||||
+
|
||||
+guestfish -N $f=lvfs vgremove VG : vgcreate VG /dev/sda1 : lvcreate LV2 VG 100
|
||||
+
|
||||
+rm $f
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,138 +0,0 @@
|
||||
From ae2d0a507af53563d0b70d28654c9c60a857fd10 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 22 Feb 2018 11:43:33 +0000
|
||||
Subject: [PATCH] v2v: Add -op (output password file) option.
|
||||
|
||||
Currently unused, in a future commit this will allow you to pass in a
|
||||
password to be used when connecting to the target hypervisor.
|
||||
|
||||
(cherry picked from commit a4e181137a38f5767dd1bf05dc482959cb7283be)
|
||||
---
|
||||
v2v/cmdline.ml | 18 ++++++++++++++++++
|
||||
v2v/test-v2v-docs.sh | 2 +-
|
||||
v2v/virt-v2v.pod | 7 +++++++
|
||||
3 files changed, 26 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/v2v/cmdline.ml b/v2v/cmdline.ml
|
||||
index 75909ee77..2a067741e 100644
|
||||
--- a/v2v/cmdline.ml
|
||||
+++ b/v2v/cmdline.ml
|
||||
@@ -62,6 +62,7 @@ let parse_cmdline () =
|
||||
let output_conn = ref None in
|
||||
let output_format = ref None in
|
||||
let output_name = ref None in
|
||||
+ let output_password = ref None in
|
||||
let output_storage = ref None in
|
||||
let password_file = ref None in
|
||||
let vddk_config = ref None in
|
||||
@@ -219,6 +220,8 @@ let parse_cmdline () =
|
||||
s_"Set output format";
|
||||
[ M"on" ], Getopt.String ("name", set_string_option_once "-on" output_name),
|
||||
s_"Rename guest when converting";
|
||||
+ [ M"op" ], Getopt.String ("filename", set_string_option_once "-op" output_password),
|
||||
+ s_"Use password from file to connect to output hypervisor";
|
||||
[ M"os" ], Getopt.String ("storage", set_string_option_once "-os" output_storage),
|
||||
s_"Set output storage location";
|
||||
[ L"password-file" ], Getopt.String ("file", set_string_option_once "--password-file" password_file),
|
||||
@@ -314,6 +317,7 @@ read the man page virt-v2v(1).
|
||||
let output_format = !output_format in
|
||||
let output_mode = !output_mode in
|
||||
let output_name = !output_name in
|
||||
+ let output_password = !output_password in
|
||||
let output_storage = !output_storage in
|
||||
let password_file = !password_file in
|
||||
let print_source = !print_source in
|
||||
@@ -461,6 +465,8 @@ read the man page virt-v2v(1).
|
||||
| `Glance ->
|
||||
if output_conn <> None then
|
||||
error_option_cannot_be_used_in_output_mode "glance" "-oc";
|
||||
+ if output_password <> None then
|
||||
+ error_option_cannot_be_used_in_output_mode "glance" "-op";
|
||||
if output_storage <> None then
|
||||
error_option_cannot_be_used_in_output_mode "glance" "-os";
|
||||
if qemu_boot then
|
||||
@@ -472,6 +478,8 @@ read the man page virt-v2v(1).
|
||||
|
||||
| `Not_set
|
||||
| `Libvirt ->
|
||||
+ if output_password <> None then
|
||||
+ error_option_cannot_be_used_in_output_mode "libvirt" "-op";
|
||||
let output_storage = Option.default "default" output_storage in
|
||||
if qemu_boot then
|
||||
error_option_cannot_be_used_in_output_mode "libvirt" "--qemu-boot";
|
||||
@@ -481,6 +489,8 @@ read the man page virt-v2v(1).
|
||||
output_format, output_alloc
|
||||
|
||||
| `Local ->
|
||||
+ if output_password <> None then
|
||||
+ error_option_cannot_be_used_in_output_mode "local" "-op";
|
||||
let os =
|
||||
match output_storage with
|
||||
| None ->
|
||||
@@ -500,6 +510,8 @@ read the man page virt-v2v(1).
|
||||
error_option_cannot_be_used_in_output_mode "null" "-oc";
|
||||
if output_format <> None then
|
||||
error_option_cannot_be_used_in_output_mode "null" "-of";
|
||||
+ if output_password <> None then
|
||||
+ error_option_cannot_be_used_in_output_mode "null" "-op";
|
||||
if output_storage <> None then
|
||||
error_option_cannot_be_used_in_output_mode "null" "-os";
|
||||
if qemu_boot then
|
||||
@@ -509,6 +521,8 @@ read the man page virt-v2v(1).
|
||||
Some "raw", Sparse
|
||||
|
||||
| `QEmu ->
|
||||
+ if output_password <> None then
|
||||
+ error_option_cannot_be_used_in_output_mode "qemu" "-op";
|
||||
let os =
|
||||
match output_storage with
|
||||
| None ->
|
||||
@@ -520,6 +534,8 @@ read the man page virt-v2v(1).
|
||||
output_format, output_alloc
|
||||
|
||||
| `RHV ->
|
||||
+ if output_password <> None then
|
||||
+ error_option_cannot_be_used_in_output_mode "rhv" "-op";
|
||||
let os =
|
||||
match output_storage with
|
||||
| None ->
|
||||
@@ -531,6 +547,8 @@ read the man page virt-v2v(1).
|
||||
output_format, output_alloc
|
||||
|
||||
| `VDSM ->
|
||||
+ if output_password <> None then
|
||||
+ error_option_cannot_be_used_in_output_mode "vdsm" "-op";
|
||||
let os =
|
||||
match output_storage with
|
||||
| None ->
|
||||
diff --git a/v2v/test-v2v-docs.sh b/v2v/test-v2v-docs.sh
|
||||
index 5d034c465..0e3bd916a 100755
|
||||
--- a/v2v/test-v2v-docs.sh
|
||||
+++ b/v2v/test-v2v-docs.sh
|
||||
@@ -22,4 +22,4 @@ $TEST_FUNCTIONS
|
||||
skip_if_skipped
|
||||
|
||||
$top_srcdir/podcheck.pl virt-v2v.pod virt-v2v \
|
||||
- --ignore=--debug-overlay,--ic,--if,--it,--no-trim,--oa,--oc,--of,--on,--os,--vmtype
|
||||
+ --ignore=--debug-overlay,--ic,--if,--it,--no-trim,--oa,--oc,--of,--on,--op,--os,--vmtype
|
||||
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
|
||||
index 0ea5fa97f..00ba45555 100644
|
||||
--- a/v2v/virt-v2v.pod
|
||||
+++ b/v2v/virt-v2v.pod
|
||||
@@ -569,6 +569,13 @@ If not specified, then the input format is used.
|
||||
Rename the guest when converting it. If this option is not used then
|
||||
the output name is the same as the input name.
|
||||
|
||||
+=item B<-op> file
|
||||
+
|
||||
+Supply a file containing a password to be used when connecting to the
|
||||
+target hypervisor. Note the file should contain the whole password,
|
||||
+B<without any trailing newline>, and for security the file should have
|
||||
+mode C<0600> so that others cannot read it.
|
||||
+
|
||||
=item B<-os> storage
|
||||
|
||||
The location of the storage for the converted guest.
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,113 @@
|
||||
From e1b339688e5f8f2a14fe0c7e9d02ad68004e4655 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 15 Apr 2021 09:18:22 +0100
|
||||
Subject: [PATCH] inspection: More reliable detection of Linux split /usr
|
||||
configurations
|
||||
|
||||
In RHEL 8+, /usr/etc no longer exists. Since we were looking for this
|
||||
directory in order to detect a separate /usr partition, those were no
|
||||
longer detected, so the merging of /usr data into the root was not
|
||||
being done. The result was incomplete inspection data and failure of
|
||||
virt-v2v.
|
||||
|
||||
All Linux systems since forever have had /usr/src but not /src, so
|
||||
detect this instead.
|
||||
|
||||
Furthermore the merging code didn't work, because we expected that the
|
||||
root filesystem had a distro assigned, but in this configuration we
|
||||
may need to look for that information in /usr/lib/os-release (not on
|
||||
the root filesystem). This change makes the merging work even if we
|
||||
have incomplete information about the root filesystem, so long as we
|
||||
have an /etc/fstab entry pointing to the /usr mountpoint.
|
||||
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1949683
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1930133
|
||||
Fixes: commit 394d11be49121884295e61964ed47f5a8488c252
|
||||
(cherry picked from commit 26427b9ecc64e7e5e53a1d577cef9dc080d08877)
|
||||
---
|
||||
daemon/inspect.ml | 33 +++++++++++++++------------------
|
||||
daemon/inspect_fs.ml | 6 +++---
|
||||
2 files changed, 18 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/daemon/inspect.ml b/daemon/inspect.ml
|
||||
index 945a476f6..fb75b4a6c 100644
|
||||
--- a/daemon/inspect.ml
|
||||
+++ b/daemon/inspect.ml
|
||||
@@ -182,11 +182,9 @@ and check_for_duplicated_bsd_root fses =
|
||||
and collect_linux_inspection_info fses =
|
||||
List.map (
|
||||
function
|
||||
- | { role = RoleRoot { distro = Some d } } as root ->
|
||||
- if d <> DISTRO_COREOS then
|
||||
- collect_linux_inspection_info_for fses root
|
||||
- else
|
||||
- root
|
||||
+ | { role = RoleRoot { distro = Some DISTRO_COREOS } } as root -> root
|
||||
+ | { role = RoleRoot _ } as root ->
|
||||
+ collect_linux_inspection_info_for fses root
|
||||
| fs -> fs
|
||||
) fses
|
||||
|
||||
@@ -196,29 +194,28 @@ and collect_linux_inspection_info fses =
|
||||
* or other ways to identify the OS).
|
||||
*)
|
||||
and collect_linux_inspection_info_for fses root =
|
||||
- let root_distro, root_fstab =
|
||||
+ let root_fstab =
|
||||
match root with
|
||||
- | { role = RoleRoot { distro = Some d; fstab = f } } -> d, f
|
||||
+ | { role = RoleRoot { fstab = f } } -> f
|
||||
| _ -> assert false in
|
||||
|
||||
try
|
||||
let usr =
|
||||
List.find (
|
||||
function
|
||||
- | { role = RoleUsr { distro = d } }
|
||||
- when d = Some root_distro || d = None -> true
|
||||
+ | { role = RoleUsr _; fs_location = usr_mp } ->
|
||||
+ (* This checks that this usr is found in the fstab of
|
||||
+ * the root filesystem.
|
||||
+ *)
|
||||
+ List.exists (
|
||||
+ fun (mountable, _) ->
|
||||
+ usr_mp.mountable = mountable
|
||||
+ ) root_fstab
|
||||
| _ -> false
|
||||
) fses in
|
||||
|
||||
- let usr_mountable = usr.fs_location.mountable in
|
||||
-
|
||||
- (* This checks that [usr] is found in the fstab of the root
|
||||
- * filesystem. If not, [Not_found] is thrown.
|
||||
- *)
|
||||
- ignore (
|
||||
- List.find (fun (mountable, _) -> usr_mountable = mountable) root_fstab
|
||||
- );
|
||||
-
|
||||
+ eprintf "collect_linux_inspection_info_for: merging:\n%sinto:\n%s"
|
||||
+ (string_of_fs usr) (string_of_fs root);
|
||||
merge usr root;
|
||||
root
|
||||
with
|
||||
diff --git a/daemon/inspect_fs.ml b/daemon/inspect_fs.ml
|
||||
index 6e00c7083..02b5a0470 100644
|
||||
--- a/daemon/inspect_fs.ml
|
||||
+++ b/daemon/inspect_fs.ml
|
||||
@@ -164,10 +164,10 @@ and check_filesystem mountable =
|
||||
()
|
||||
)
|
||||
(* Linux /usr? *)
|
||||
- else if Is.is_dir "/etc" &&
|
||||
- Is.is_dir "/bin" &&
|
||||
- Is.is_dir "/share" &&
|
||||
+ else if Is.is_dir "/bin" &&
|
||||
Is.is_dir "/local" &&
|
||||
+ Is.is_dir "/share" &&
|
||||
+ Is.is_dir "/src" &&
|
||||
not (Is.is_file "/etc/fstab") then (
|
||||
debug_matching "Linux /usr";
|
||||
role := `Usr;
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,35 +0,0 @@
|
||||
From 311d8dff12b8079b7eb9d6d2d917a9c6883928a4 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 22 Mar 2018 10:28:36 +0000
|
||||
Subject: [PATCH] v2v: cmdline: Move definition to before its only use.
|
||||
|
||||
(cherry picked from commit 3167ce1f91667de4c4fe1885bb33c06ee6fa38c5)
|
||||
---
|
||||
v2v/cmdline.ml | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/v2v/cmdline.ml b/v2v/cmdline.ml
|
||||
index 2a067741e..a83fcbae0 100644
|
||||
--- a/v2v/cmdline.ml
|
||||
+++ b/v2v/cmdline.ml
|
||||
@@ -81,7 +81,6 @@ let parse_cmdline () =
|
||||
let set_vdsm_compat s = vdsm_compat := s in
|
||||
|
||||
let vdsm_ovf_flavour = ref Create_ovf.RHVExportStorageDomain in
|
||||
- let ovf_flavours_str = String.concat "|" Create_ovf.ovf_flavours in
|
||||
let set_vdsm_ovf_flavour arg =
|
||||
vdsm_ovf_flavour := Create_ovf.ovf_flavour_of_string arg in
|
||||
|
||||
@@ -183,7 +182,8 @@ let parse_cmdline () =
|
||||
let i_options =
|
||||
String.concat "|" (Modules_list.input_modules ())
|
||||
and o_options =
|
||||
- String.concat "|" (Modules_list.output_modules ()) in
|
||||
+ String.concat "|" (Modules_list.output_modules ())
|
||||
+ and ovf_flavours_str = String.concat "|" Create_ovf.ovf_flavours in
|
||||
|
||||
let argspec = [
|
||||
[ S 'b'; L"bridge" ], Getopt.String ("in:out", add_bridge),
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,49 @@
|
||||
From 791a16b049ea1ce2c450acd367fce774d9aab5b1 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 31 Aug 2021 08:27:15 +0100
|
||||
Subject: [PATCH] lib: Autodetect backing format for qemu-img create -b
|
||||
|
||||
qemu 6.1 has decided to change qemu-img create so that a backing
|
||||
format (-F) is required if a backing file (-b) is specified. Since we
|
||||
don't want to change the libguestfs API to force callers to specify
|
||||
this because that would be an API break, autodetect it.
|
||||
|
||||
This is similar to commit c8c181e8d9 ("launch: libvirt: Autodetect
|
||||
backing format for readonly drive overlays").
|
||||
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1998820
|
||||
(cherry picked from commit 45de287447bb18d59749fbfc1ec5072413090109)
|
||||
---
|
||||
lib/create.c | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/lib/create.c b/lib/create.c
|
||||
index 44a7df25f..75a4d3a28 100644
|
||||
--- a/lib/create.c
|
||||
+++ b/lib/create.c
|
||||
@@ -255,6 +255,7 @@ disk_create_qcow2 (guestfs_h *g, const char *filename, int64_t size,
|
||||
const struct guestfs_disk_create_argv *optargs)
|
||||
{
|
||||
const char *backingformat = NULL;
|
||||
+ CLEANUP_FREE char *backingformat_free = NULL;
|
||||
const char *preallocation = NULL;
|
||||
const char *compat = NULL;
|
||||
int clustersize = -1;
|
||||
@@ -270,6 +271,14 @@ disk_create_qcow2 (guestfs_h *g, const char *filename, int64_t size,
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
+ else if (backingfile) {
|
||||
+ /* Since qemu 6.1, qemu-img create has requires a backing format (-F)
|
||||
+ * parameter if backing file (-b) is used (RHBZ#1998820).
|
||||
+ */
|
||||
+ backingformat = backingformat_free = guestfs_disk_format (g, backingfile);
|
||||
+ if (!backingformat)
|
||||
+ return -1;
|
||||
+ }
|
||||
if (optargs->bitmask & GUESTFS_DISK_CREATE_PREALLOCATION_BITMASK) {
|
||||
if (STREQ (optargs->preallocation, "off") ||
|
||||
STREQ (optargs->preallocation, "sparse"))
|
||||
--
|
||||
2.31.1
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,44 @@
|
||||
From 3435938f43ca3737ec1d73da4d8cad756b5c9508 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 26 Mar 2021 16:04:43 +0000
|
||||
Subject: [PATCH] daemon: chroot: Fix long-standing possible deadlock.
|
||||
|
||||
The child (chrooted) process wrote its answer on the pipe and then
|
||||
exited. Meanwhile the parent waiting for the child to exit before
|
||||
reading from the pipe. Thus if the output was larger than a Linux
|
||||
pipebuffer then the whole thing would deadlock.
|
||||
|
||||
(cherry picked from commit 94e64b28bee3b8dc7ed354a366d6a8f7ba5f245c)
|
||||
---
|
||||
daemon/chroot.ml | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/daemon/chroot.ml b/daemon/chroot.ml
|
||||
index 5e856c91f..7da8ae29e 100644
|
||||
--- a/daemon/chroot.ml
|
||||
+++ b/daemon/chroot.ml
|
||||
@@ -62,6 +62,10 @@ let f t func arg =
|
||||
(* Parent. *)
|
||||
close wfd;
|
||||
|
||||
+ let chan = in_channel_of_descr rfd in
|
||||
+ let ret = input_value chan in
|
||||
+ close_in chan;
|
||||
+
|
||||
let _, status = waitpid [] pid in
|
||||
(match status with
|
||||
| WEXITED 0 -> ()
|
||||
@@ -76,10 +80,6 @@ let f t func arg =
|
||||
failwithf "chroot ‘%s’ stopped by signal %d" t.name i
|
||||
);
|
||||
|
||||
- let chan = in_channel_of_descr rfd in
|
||||
- let ret = input_value chan in
|
||||
- close_in chan;
|
||||
-
|
||||
match ret with
|
||||
| Either ret -> ret
|
||||
| Or exn -> raise exn
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,247 +0,0 @@
|
||||
From 1b4c00a3ec7c0618e8557e1e71d5782527a94828 Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Wed, 4 Apr 2018 18:18:32 +0200
|
||||
Subject: [PATCH] v2v: OVF: write ovirt:id attribute for the OS in OVirt
|
||||
flavour
|
||||
|
||||
When writing the OVF in OVirt flavour, add a ovirt:id attribute to the
|
||||
OperatingSystemSection tag: this attribute represents the numeric value
|
||||
of the ostype ID, which is ignored by oVirt when parsing OVFs in API
|
||||
mode.
|
||||
|
||||
(cherry picked from commit 593a19cc86cfa8f24c66518c8ba21222550b066a)
|
||||
---
|
||||
v2v/create_ovf.ml | 202 +++++++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 201 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/v2v/create_ovf.ml b/v2v/create_ovf.ml
|
||||
index 0e07afea8..730ab64b4 100644
|
||||
--- a/v2v/create_ovf.ml
|
||||
+++ b/v2v/create_ovf.ml
|
||||
@@ -242,6 +242,203 @@ and get_ostype = function
|
||||
typ distro major minor arch product;
|
||||
"Unassigned"
|
||||
|
||||
+(* Determine the ovirt:id attribute from libguestfs inspection.
|
||||
+ * See ovirt-engine sources, file:
|
||||
+ * packaging/conf/osinfo-defaults.properties
|
||||
+ * and also:
|
||||
+ * https://bugzilla.redhat.com/show_bug.cgi?id=1219857#c9
|
||||
+ *)
|
||||
+and get_ovirt_osid = function
|
||||
+ | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = 3;
|
||||
+ i_arch = "i386" } ->
|
||||
+ 9
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = 3;
|
||||
+ i_arch = "x86_64" } ->
|
||||
+ 15
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = 4;
|
||||
+ i_arch = "i386" } ->
|
||||
+ 8
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = 4;
|
||||
+ i_arch = "x86_64" } ->
|
||||
+ 14
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = 5;
|
||||
+ i_arch = "i386" } ->
|
||||
+ 7
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = 5;
|
||||
+ i_arch = "x86_64" } ->
|
||||
+ 13
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = 6;
|
||||
+ i_arch = "i386" } ->
|
||||
+ 18
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = 6;
|
||||
+ i_arch = "x86_64" } ->
|
||||
+ 19
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = 6;
|
||||
+ i_minor_version = min; i_arch = ("ppc64"|"ppc64le") } when min >= 9 ->
|
||||
+ 1007
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = 6;
|
||||
+ i_arch = ("ppc64"|"ppc64le") } ->
|
||||
+ 1003
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = 7;
|
||||
+ i_arch = "x86_64" } ->
|
||||
+ 24
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = 7;
|
||||
+ i_arch = ("ppc64"|"ppc64le") } ->
|
||||
+ 1006
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = 7;
|
||||
+ i_arch = "s390x" } ->
|
||||
+ 2003
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = "sles"; i_major_version = maj;
|
||||
+ i_arch = "x86_64" } when maj >= 11 ->
|
||||
+ 1193
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = "sles"; i_major_version = maj;
|
||||
+ i_arch = ("ppc64"|"ppc64le") } when maj >= 11 ->
|
||||
+ 1004
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = "sles"; i_major_version = maj;
|
||||
+ i_arch = "s390x" } when maj >= 12 ->
|
||||
+ 2004
|
||||
+
|
||||
+ (* Only Debian 7 is available, so use it for any 7+ version. *)
|
||||
+ | { i_type = "linux"; i_distro = "debian"; i_major_version = v }
|
||||
+ when v >= 7 ->
|
||||
+ 1300
|
||||
+
|
||||
+ (* Only Ubuntu 12.04 to 14.04 are available, so use them starting
|
||||
+ * from 12.04, and 14.04 for anything after it.
|
||||
+ *)
|
||||
+ | { i_type = "linux"; i_distro = "ubuntu"; i_major_version = v;
|
||||
+ i_arch = ("ppc64"|"ppc64le") } when v >= 14 ->
|
||||
+ 1005
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = "ubuntu"; i_major_version = v;
|
||||
+ i_arch = "s390x" } when v >= 16 ->
|
||||
+ 2005
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = "ubuntu"; i_major_version = v }
|
||||
+ when v >= 14 ->
|
||||
+ 1256
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = "ubuntu"; i_major_version = 12;
|
||||
+ i_minor_version = 4 } ->
|
||||
+ 1252
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = "ubuntu"; i_major_version = 12;
|
||||
+ i_minor_version = 10 } ->
|
||||
+ 1253
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = "ubuntu"; i_major_version = 13;
|
||||
+ i_minor_version = 4 } ->
|
||||
+ 1254
|
||||
+
|
||||
+ | { i_type = "linux"; i_distro = "ubuntu"; i_major_version = 13;
|
||||
+ i_minor_version = 10 } ->
|
||||
+ 1255
|
||||
+
|
||||
+ | { i_type = "linux"; i_arch = ("ppc64"|"ppc64le") } ->
|
||||
+ 1002
|
||||
+
|
||||
+ | { i_type = "linux"; i_arch = "s390x" } ->
|
||||
+ 2002
|
||||
+
|
||||
+ | { i_type = "linux" } ->
|
||||
+ 5
|
||||
+
|
||||
+ | { i_type = "windows"; i_major_version = 5; i_minor_version = 1 } ->
|
||||
+ 1 (* no architecture differentiation of XP on RHV *)
|
||||
+
|
||||
+ | { i_type = "windows"; i_major_version = 5; i_minor_version = 2;
|
||||
+ i_product_name = product } when String.find product "XP" >= 0 ->
|
||||
+ 1 (* no architecture differentiation of XP on RHV *)
|
||||
+
|
||||
+ | { i_type = "windows"; i_major_version = 5; i_minor_version = 2;
|
||||
+ i_arch = "i386" } ->
|
||||
+ 3
|
||||
+
|
||||
+ | { i_type = "windows"; i_major_version = 5; i_minor_version = 2;
|
||||
+ i_arch = "x86_64" } ->
|
||||
+ 10
|
||||
+
|
||||
+ | { i_type = "windows"; i_major_version = 6; i_minor_version = 0;
|
||||
+ i_arch = "i386" } ->
|
||||
+ 4
|
||||
+
|
||||
+ | { i_type = "windows"; i_major_version = 6; i_minor_version = 0;
|
||||
+ i_arch = "x86_64" } ->
|
||||
+ 16
|
||||
+
|
||||
+ | { i_type = "windows"; i_major_version = 6; i_minor_version = 1;
|
||||
+ i_arch = "i386" } ->
|
||||
+ 11
|
||||
+
|
||||
+ | { i_type = "windows"; i_major_version = 6; i_minor_version = 1;
|
||||
+ i_arch = "x86_64"; i_product_variant = "Client" } ->
|
||||
+ 12
|
||||
+
|
||||
+ | { i_type = "windows"; i_major_version = 6; i_minor_version = 1;
|
||||
+ i_arch = "x86_64" } ->
|
||||
+ 17
|
||||
+
|
||||
+ | { i_type = "windows"; i_major_version = 6; i_minor_version = 2;
|
||||
+ i_arch = "i386" } ->
|
||||
+ 20
|
||||
+
|
||||
+ | { i_type = "windows"; i_major_version = 6; i_minor_version = 2;
|
||||
+ i_arch = "x86_64"; i_product_variant = "Client" } ->
|
||||
+ 21
|
||||
+
|
||||
+ | { i_type = "windows"; i_major_version = 6; i_minor_version = 2;
|
||||
+ i_arch = "x86_64" } ->
|
||||
+ 23
|
||||
+
|
||||
+ (* Treat Windows 8.1 client like Windows 8. See:
|
||||
+ * https://bugzilla.redhat.com/show_bug.cgi?id=1309580#c4
|
||||
+ *)
|
||||
+ | { i_type = "windows"; i_major_version = 6; i_minor_version = 3;
|
||||
+ i_arch = "i386"; i_product_variant = "Client" } ->
|
||||
+ 20
|
||||
+
|
||||
+ | { i_type = "windows"; i_major_version = 6; i_minor_version = 3;
|
||||
+ i_arch = "x86_64"; i_product_variant = "Client" } ->
|
||||
+ 21
|
||||
+
|
||||
+ | { i_type = "windows"; i_major_version = 6; i_minor_version = 3;
|
||||
+ i_arch = "x86_64" } ->
|
||||
+ 23
|
||||
+
|
||||
+ | { i_type = "windows"; i_major_version = 10; i_minor_version = 0;
|
||||
+ i_arch = "i386" } ->
|
||||
+ 26
|
||||
+
|
||||
+ | { i_type = "windows"; i_major_version = 10; i_minor_version = 0;
|
||||
+ i_arch = "x86_64"; i_product_variant = "Client" } ->
|
||||
+ 27
|
||||
+
|
||||
+ | { i_type = "windows"; i_major_version = 10; i_minor_version = 0;
|
||||
+ i_arch = "x86_64" } ->
|
||||
+ 29
|
||||
+
|
||||
+ | { i_type = typ; i_distro = distro;
|
||||
+ i_major_version = major; i_minor_version = minor; i_arch = arch;
|
||||
+ i_product_name = product } ->
|
||||
+ warning (f_"unknown guest operating system: %s %s %d.%d %s (%s)")
|
||||
+ typ distro major minor arch product;
|
||||
+ 0
|
||||
+
|
||||
(* Set the <Origin/> element based on the source hypervisor.
|
||||
* https://bugzilla.redhat.com/show_bug.cgi?id=1342398#c6
|
||||
* https://gerrit.ovirt.org/#/c/59147/
|
||||
@@ -321,6 +518,7 @@ let rec create_ovf source targets guestcaps inspect
|
||||
"xmlns:vssd", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData";
|
||||
"xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance";
|
||||
"xmlns:ovf", "http://schemas.dmtf.org/ovf/envelope/1/";
|
||||
+ "xmlns:ovirt", "http://www.ovirt.org/ovf";
|
||||
"ovf:version", "0.9"
|
||||
] [
|
||||
Comment generated_by;
|
||||
@@ -383,8 +581,10 @@ let rec create_ovf source targets guestcaps inspect
|
||||
] in
|
||||
(match ovf_flavour with
|
||||
| OVirt ->
|
||||
+ let ovirt_osid = get_ovirt_osid inspect in
|
||||
e "OperatingSystemSection" ["ovf:id", vm_uuid;
|
||||
- "ovf:required", "false"]
|
||||
+ "ovf:required", "false";
|
||||
+ "ovirt:id", string_of_int ovirt_osid]
|
||||
osinfo_subnodes
|
||||
| RHVExportStorageDomain ->
|
||||
e "Section" ["ovf:id", vm_uuid; "ovf:required", "false";
|
||||
--
|
||||
2.21.0
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,32 +0,0 @@
|
||||
From b96a2119b20f204661fa2165aea3c6c2b84e23de Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Thu, 5 Apr 2018 10:28:17 +0200
|
||||
Subject: [PATCH] v2v: OVF: fix ovf:id for VirtualSystem in OVirt flavour
|
||||
|
||||
When writing the OVF in OVirt flavour, write the actual UUID of the
|
||||
VM as ovf:id attribute for <VirtualSystem>, instead of a dummy value.
|
||||
|
||||
Suggested by Arik Hadas in
|
||||
https://www.redhat.com/archives/libguestfs/2018-April/msg00005.html
|
||||
|
||||
(cherry picked from commit 9dce43931a19510be1b6d21ce67d14a4136ce241)
|
||||
---
|
||||
v2v/create_ovf.ml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/v2v/create_ovf.ml b/v2v/create_ovf.ml
|
||||
index 730ab64b4..b1ab8df3f 100644
|
||||
--- a/v2v/create_ovf.ml
|
||||
+++ b/v2v/create_ovf.ml
|
||||
@@ -688,7 +688,7 @@ let rec create_ovf source targets guestcaps inspect
|
||||
|
||||
(match ovf_flavour with
|
||||
| OVirt ->
|
||||
- e "VirtualSystem" ["ovf:id", "out"] !content_subnodes
|
||||
+ e "VirtualSystem" ["ovf:id", vm_uuid] !content_subnodes
|
||||
| RHVExportStorageDomain ->
|
||||
e "Content" ["ovf:id", "out"; "xsi:type", "ovf:VirtualSystem_Type"]
|
||||
!content_subnodes
|
||||
--
|
||||
2.21.0
|
||||
|
36
SOURCES/0012-inspection-Return-RPM-epoch.patch
Normal file
36
SOURCES/0012-inspection-Return-RPM-epoch.patch
Normal file
@ -0,0 +1,36 @@
|
||||
From 3ce392c9870a589cc50d2270fcf07b4d129c3dc3 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Sat, 27 Mar 2021 09:31:00 +0000
|
||||
Subject: [PATCH] inspection: Return RPM epoch.
|
||||
|
||||
Fixes: commit c9ee831affed55abe0f928134cbbd2ed83b2f510
|
||||
(cherry picked from commit fef73bce7eec0ce0753a2e150e4e088020d38643)
|
||||
---
|
||||
daemon/rpm-c.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/daemon/rpm-c.c b/daemon/rpm-c.c
|
||||
index 92a3abf58..be0e81e22 100644
|
||||
--- a/daemon/rpm-c.c
|
||||
+++ b/daemon/rpm-c.c
|
||||
@@ -108,13 +108,16 @@ guestfs_int_daemon_rpm_next_application (value unitv)
|
||||
|
||||
h = headerLink (h);
|
||||
app.app2_name = headerFormat (h, "%{NAME}", NULL);
|
||||
- // XXXapp.app2_epoch = headerFormat (h, "%{NAME}", NULL);
|
||||
app.app2_version = headerFormat (h, "%{VERSION}", NULL);
|
||||
app.app2_release = headerFormat (h, "%{RELEASE}", NULL);
|
||||
app.app2_arch = headerFormat (h, "%{ARCH}", NULL);
|
||||
app.app2_url = headerFormat (h, "%{URL}", NULL);
|
||||
app.app2_summary = headerFormat (h, "%{SUMMARY}", NULL);
|
||||
app.app2_description = headerFormat (h, "%{DESCRIPTION}", NULL);
|
||||
+
|
||||
+ /* epoch is special as the only int field. */
|
||||
+ app.app2_epoch = headerGetNumber (h, RPMTAG_EPOCH);
|
||||
+
|
||||
headerFree (h);
|
||||
|
||||
/* Convert this to an OCaml struct. Any NULL fields must be turned
|
||||
--
|
||||
2.31.1
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,28 +0,0 @@
|
||||
From 2648e807faaa94c080c33b8a0d70c078339c59f8 Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Fri, 20 Apr 2018 13:00:56 +0200
|
||||
Subject: [PATCH] v2v: refer to the right embed script in EXTRA_DIST
|
||||
|
||||
Fixes commit cc04573927cca97de60d544d37467e67c25867a7.
|
||||
|
||||
(cherry picked from commit cf49fe100338aeac281c7cbcdfe743177ceb0606)
|
||||
---
|
||||
v2v/Makefile.am | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/v2v/Makefile.am b/v2v/Makefile.am
|
||||
index 694a64573..3a0c80f44 100644
|
||||
--- a/v2v/Makefile.am
|
||||
+++ b/v2v/Makefile.am
|
||||
@@ -31,7 +31,7 @@ EXTRA_DIST = \
|
||||
$(SOURCES_MLI) $(SOURCES_ML) $(SOURCES_C) \
|
||||
copy_to_local.ml \
|
||||
copy_to_local.mli \
|
||||
- embed-code.sh \
|
||||
+ embed.sh \
|
||||
rhv-upload-createvm.py \
|
||||
rhv-upload-plugin.py \
|
||||
rhv-upload-precheck.py \
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,34 @@
|
||||
From 9664527c107d04aab416be87cc4fcd76dcbe5927 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 29 Mar 2021 18:25:13 +0100
|
||||
Subject: [PATCH] po/POTFILES: Fix list of files for translation.
|
||||
|
||||
Fixes: commit c9ee831affed55abe0f928134cbbd2ed83b2f510
|
||||
(cherry picked from commit df983200d76bac37c811fbd2fb67e7ebe830e759)
|
||||
---
|
||||
po/POTFILES | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/po/POTFILES b/po/POTFILES
|
||||
index 0782e8ceb..fdc6e8062 100644
|
||||
--- a/po/POTFILES
|
||||
+++ b/po/POTFILES
|
||||
@@ -128,6 +128,7 @@ daemon/pingdaemon.c
|
||||
daemon/proto.c
|
||||
daemon/readdir.c
|
||||
daemon/rename.c
|
||||
+daemon/rpm-c.c
|
||||
daemon/rsync.c
|
||||
daemon/scrub.c
|
||||
daemon/selinux-relabel.c
|
||||
@@ -353,7 +354,6 @@ lib/command.c
|
||||
lib/conn-socket.c
|
||||
lib/copy-in-out.c
|
||||
lib/create.c
|
||||
-lib/dbdump.c
|
||||
lib/drives.c
|
||||
lib/errors.c
|
||||
lib/event-string.c
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,84 +0,0 @@
|
||||
From 2e9cc6b2307668f330d11384bba63b70160d3e42 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 20 Apr 2018 11:48:47 +0100
|
||||
Subject: [PATCH] =?UTF-8?q?v2v:=20-o=20rhv-upload:=20Don't=20require=20?=
|
||||
=?UTF-8?q?=E2=80=98-of=20raw=E2=80=99=20parameter.?=
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Because we checked the limitation of raw+sparse during command line
|
||||
processing, it had the effect of forcing you to use ‘-of raw’ even if
|
||||
the input was already in raw format. Move the checking to the output
|
||||
mode to avoid this.
|
||||
|
||||
Fixes commit cc04573927cca97de60d544d37467e67c25867a7.
|
||||
|
||||
(cherry picked from commit b3769afaece360b8a2095e3d8a7a934d351c3ade)
|
||||
---
|
||||
v2v/cmdline.ml | 5 -----
|
||||
v2v/output_rhv_upload.ml | 18 +++++++++++++++++-
|
||||
2 files changed, 17 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/v2v/cmdline.ml b/v2v/cmdline.ml
|
||||
index 9b1348c37..97d4f4377 100644
|
||||
--- a/v2v/cmdline.ml
|
||||
+++ b/v2v/cmdline.ml
|
||||
@@ -586,11 +586,6 @@ read the man page virt-v2v(1).
|
||||
| None ->
|
||||
error (f_"-o rhv-upload: use ‘-oc’ to point to the oVirt or RHV server REST API URL, which is usually https://servername/ovirt-engine/api")
|
||||
| Some oc -> oc in
|
||||
- (* Output format / sparse must currently be raw+sparse. We can
|
||||
- * change this in future. See TODO file for details. XXX
|
||||
- *)
|
||||
- if output_alloc <> Sparse || output_format <> Some "raw" then
|
||||
- error (f_"-o rhv-upload: currently you must use ‘-of raw’ and you cannot use ‘-oa preallocated’ with this output mode. These restrictions will be loosened in a future version.");
|
||||
(* In theory we could make the password optional in future. *)
|
||||
let output_password =
|
||||
match output_password with
|
||||
diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml
|
||||
index 129461242..dc0d96d53 100644
|
||||
--- a/v2v/output_rhv_upload.ml
|
||||
+++ b/v2v/output_rhv_upload.ml
|
||||
@@ -169,6 +169,19 @@ See also \"OUTPUT TO RHV\" in the virt-v2v(1) manual.")
|
||||
error (f_"nbdkit was compiled without SELinux support. You will have to recompile nbdkit with libselinux-devel installed, or else set SELinux to Permissive mode while doing the conversion.")
|
||||
in
|
||||
|
||||
+ (* Output format/sparse must be raw/sparse. We may be able to
|
||||
+ * lift this limitation in future, but it requires changes on the
|
||||
+ * RHV side. See TODO file for details. XXX
|
||||
+ *)
|
||||
+ let error_current_limitation required_param =
|
||||
+ error (f_"rhv-upload: currently you must use ‘%s’. This restriction will be loosened in a future version.") required_param
|
||||
+ in
|
||||
+
|
||||
+ let error_unless_output_alloc_sparse () =
|
||||
+ if output_alloc <> Sparse then
|
||||
+ error_current_limitation "-oa sparse"
|
||||
+ in
|
||||
+
|
||||
(* JSON parameters which are invariant between disks. *)
|
||||
let json_params = [
|
||||
"verbose", JSON.Bool (verbose ());
|
||||
@@ -220,6 +233,7 @@ object
|
||||
error_unless_python_binary_on_path ();
|
||||
error_unless_nbdkit_working ();
|
||||
error_unless_nbdkit_python3_working ();
|
||||
+ error_unless_output_alloc_sparse ();
|
||||
if have_selinux then
|
||||
error_unless_nbdkit_compiled_with_selinux ()
|
||||
|
||||
@@ -260,7 +274,9 @@ object
|
||||
|
||||
let disk_format =
|
||||
match t.target_format with
|
||||
- | ("raw" | "qcow2") as fmt -> fmt
|
||||
+ | "raw" as fmt -> fmt
|
||||
+ | "qcow2" ->
|
||||
+ error_current_limitation "-of raw"
|
||||
| _ ->
|
||||
error (f_"rhv-upload: -of %s: Only output format ‘raw’ or ‘qcow2’ is supported. If the input is in a different format then force one of these output formats by adding either ‘-of raw’ or ‘-of qcow2’ on the command line.")
|
||||
t.target_format in
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,64 @@
|
||||
From 083856d9f9c8fccc629bf0f3a5237d26434c8940 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 29 Mar 2021 18:35:48 +0100
|
||||
Subject: [PATCH] m4/guestfs-find-db-tool.m4: Remove unused file.
|
||||
|
||||
Fixes: commit 42e5e7cfdbca01b2e9bd50c63a9fc65b6da9192f
|
||||
(cherry picked from commit 8317279c3539562ebad9de13c7ac515dded74e4d)
|
||||
---
|
||||
m4/guestfs-find-db-tool.m4 | 43 --------------------------------------
|
||||
1 file changed, 43 deletions(-)
|
||||
delete mode 100644 m4/guestfs-find-db-tool.m4
|
||||
|
||||
diff --git a/m4/guestfs-find-db-tool.m4 b/m4/guestfs-find-db-tool.m4
|
||||
deleted file mode 100644
|
||||
index b404148c6..000000000
|
||||
--- a/m4/guestfs-find-db-tool.m4
|
||||
+++ /dev/null
|
||||
@@ -1,43 +0,0 @@
|
||||
-# libguestfs
|
||||
-# Copyright (C) 2014 Red Hat Inc.
|
||||
-#
|
||||
-# This program is free software; you can redistribute it and/or modify
|
||||
-# it under the terms of the GNU General Public License as published by
|
||||
-# the Free Software Foundation; either version 2 of the License, or
|
||||
-# (at your option) any later version.
|
||||
-#
|
||||
-# This program is distributed in the hope that it will be useful,
|
||||
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-# GNU General Public License for more 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.
|
||||
-
|
||||
-AC_DEFUN([GUESTFS_FIND_DB_TOOL],[
|
||||
- pushdef([VARIABLE],$1)
|
||||
- TOOL=$2
|
||||
-
|
||||
- db_tool_name="db_$TOOL"
|
||||
- db_versions="53 5.3 5.2 5.1 4.8 4.7 4.6"
|
||||
- db_tool_patterns="dbX_$TOOL dbX.Y_$TOOL"
|
||||
- db_tool_patterns="dbX_$TOOL db_$TOOL-X dbX.Y_$TOOL db_$TOOL-X.Y"
|
||||
-
|
||||
- AC_ARG_VAR(VARIABLE, [Absolute path to $db_tool_name executable])
|
||||
-
|
||||
- AS_IF(test -z "$VARIABLE", [
|
||||
- exe_list="db_$TOOL"
|
||||
- for ver in $db_versions ; do
|
||||
- ver_maj=`echo $ver | cut -d. -f1`
|
||||
- ver_min=`echo $ver | cut -d. -f2`
|
||||
- for pattern in $db_tool_patterns ; do
|
||||
- exe=`echo "$pattern" | sed -e "s/X/$ver_maj/g;s/Y/$ver_min/g"`
|
||||
- exe_list="$exe_list $exe"
|
||||
- done
|
||||
- done
|
||||
- AC_PATH_PROGS([]VARIABLE[], [$exe_list], [no])
|
||||
- ])
|
||||
-
|
||||
- popdef([VARIABLE])
|
||||
-])
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,31 +0,0 @@
|
||||
From 1ddbe89dbc3877e6135e13413f97ee30a12c8e72 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Golembiovsk=C3=BD?= <tgolembi@redhat.com>
|
||||
Date: Sun, 22 Apr 2018 22:57:55 +0200
|
||||
Subject: [PATCH] v2v: -o rhv-upload: install RHV tools (RHBZ#1561828).
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
|
||||
(cherry picked from commit f3f00d3f9c6464aa31e3091bdee1191ef15512c6)
|
||||
---
|
||||
v2v/output_rhv_upload.ml | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml
|
||||
index dc0d96d53..0152b8d5a 100644
|
||||
--- a/v2v/output_rhv_upload.ml
|
||||
+++ b/v2v/output_rhv_upload.ml
|
||||
@@ -247,6 +247,9 @@ object
|
||||
|
||||
method supported_firmware = [ TargetBIOS ]
|
||||
|
||||
+ (* rhev-apt.exe will be installed (if available). *)
|
||||
+ method install_rhev_apt = true
|
||||
+
|
||||
method prepare_targets source targets =
|
||||
let output_name = source.s_name in
|
||||
let json_params =
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,474 @@
|
||||
From f8ccce2c7a0c1323e0721f503322df525dd5b139 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 29 Mar 2021 12:22:12 +0100
|
||||
Subject: [PATCH] test-data/phony-guests: Fix phony RPM database, fix
|
||||
virt-inspector test.
|
||||
|
||||
libguestfs 1.45.3 now reads the RPM database using librpm, which means
|
||||
our old phony database created by db_dump can no longer work. Instead
|
||||
provide a real (but very minimal) sqlite database.
|
||||
|
||||
This commit also fixes the virt-inspector test since the RPM database
|
||||
contents are now different.
|
||||
|
||||
(cherry picked from commit 46bf6fb473889ed28bd7220476120edcda47ae07)
|
||||
---
|
||||
inspector/expected-fedora-luks.img.xml | 208 +++++++++++++++++++++++--
|
||||
inspector/expected-fedora.img.xml | 208 +++++++++++++++++++++++--
|
||||
2 files changed, 398 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/inspector/expected-fedora-luks.img.xml b/inspector/expected-fedora-luks.img.xml
|
||||
index df6060a73..72cddaf88 100644
|
||||
--- a/inspector/expected-fedora-luks.img.xml
|
||||
+++ b/inspector/expected-fedora-luks.img.xml
|
||||
@@ -30,22 +30,212 @@
|
||||
</filesystems>
|
||||
<applications>
|
||||
<application>
|
||||
- <name>test1</name>
|
||||
- <version>1.0</version>
|
||||
- <release>1.fc14</release>
|
||||
+ <name>basesystem</name>
|
||||
+ <version>11</version>
|
||||
+ <release>10.fc33</release>
|
||||
+ <arch>noarch</arch>
|
||||
+ <url>(none)</url>
|
||||
+ <summary>The skeleton package which defines a simple Fedora system</summary>
|
||||
+ <description>Basesystem defines the components of a basic Fedora system
|
||||
+(for example, the package installation order to use during bootstrapping).
|
||||
+Basesystem should be in every installation of a system, and it
|
||||
+should never be removed.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>bash</name>
|
||||
+ <version>5.0.17</version>
|
||||
+ <release>2.fc33</release>
|
||||
+ <arch>x86_64</arch>
|
||||
+ <url>https://www.gnu.org/software/bash</url>
|
||||
+ <summary>The GNU Bourne Again shell</summary>
|
||||
+ <description>The GNU Bourne Again shell (Bash) is a shell or command language
|
||||
+interpreter that is compatible with the Bourne shell (sh). Bash
|
||||
+incorporates useful features from the Korn shell (ksh) and the C shell
|
||||
+(csh). Most sh scripts can be run by bash without modification.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>fedora-gpg-keys</name>
|
||||
+ <version>33</version>
|
||||
+ <release>3</release>
|
||||
+ <arch>noarch</arch>
|
||||
+ <url>https://fedoraproject.org/</url>
|
||||
+ <summary>Fedora RPM keys</summary>
|
||||
+ <description>This package provides the RPM signature keys.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>fedora-release</name>
|
||||
+ <version>33</version>
|
||||
+ <release>3</release>
|
||||
+ <arch>noarch</arch>
|
||||
+ <url>https://fedoraproject.org/</url>
|
||||
+ <summary>Fedora release files</summary>
|
||||
+ <description>Fedora release files such as various /etc/ files that define the release
|
||||
+and systemd preset files that determine which services are enabled by default.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>fedora-release-common</name>
|
||||
+ <version>33</version>
|
||||
+ <release>3</release>
|
||||
+ <arch>noarch</arch>
|
||||
+ <url>https://fedoraproject.org/</url>
|
||||
+ <summary>Fedora release files</summary>
|
||||
+ <description>Release files common to all Editions and Spins of Fedora</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>fedora-release-identity-basic</name>
|
||||
+ <version>33</version>
|
||||
+ <release>3</release>
|
||||
+ <arch>noarch</arch>
|
||||
+ <url>https://fedoraproject.org/</url>
|
||||
+ <summary>Package providing the basic Fedora identity</summary>
|
||||
+ <description>Provides the necessary files for a Fedora installation that is not identifying
|
||||
+itself as a particular Edition or Spin.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>fedora-repos</name>
|
||||
+ <version>33</version>
|
||||
+ <release>3</release>
|
||||
+ <arch>noarch</arch>
|
||||
+ <url>https://fedoraproject.org/</url>
|
||||
+ <summary>Fedora package repositories</summary>
|
||||
+ <description>Fedora package repository files for yum and dnf along with gpg public keys.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>filesystem</name>
|
||||
+ <version>3.14</version>
|
||||
+ <release>3.fc33</release>
|
||||
+ <arch>x86_64</arch>
|
||||
+ <url>https://pagure.io/filesystem</url>
|
||||
+ <summary>The basic directory layout for a Linux system</summary>
|
||||
+ <description>The filesystem package is one of the basic packages that is installed
|
||||
+on a Linux system. Filesystem contains the basic directory layout
|
||||
+for a Linux operating system, including the correct permissions for
|
||||
+the directories.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>glibc</name>
|
||||
+ <version>2.32</version>
|
||||
+ <release>4.fc33</release>
|
||||
+ <arch>x86_64</arch>
|
||||
+ <url>http://www.gnu.org/software/glibc/</url>
|
||||
+ <summary>The GNU libc libraries</summary>
|
||||
+ <description>The glibc package contains standard libraries which are used by
|
||||
+multiple programs on the system. In order to save disk space and
|
||||
+memory, as well as to make upgrading easier, common system code is
|
||||
+kept in one place and shared between programs. This particular package
|
||||
+contains the most important sets of shared libraries: the standard C
|
||||
+library and the standard math library. Without these two libraries, a
|
||||
+Linux system will not function.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>glibc-all-langpacks</name>
|
||||
+ <version>2.32</version>
|
||||
+ <release>4.fc33</release>
|
||||
+ <arch>x86_64</arch>
|
||||
+ <url>http://www.gnu.org/software/glibc/</url>
|
||||
+ <summary>All language packs for glibc.</summary>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>glibc-common</name>
|
||||
+ <version>2.32</version>
|
||||
+ <release>4.fc33</release>
|
||||
<arch>x86_64</arch>
|
||||
+ <url>http://www.gnu.org/software/glibc/</url>
|
||||
+ <summary>Common binaries and locale data for glibc</summary>
|
||||
+ <description>The glibc-common package includes common binaries for the GNU libc
|
||||
+libraries, as well as national language (locale) support.</description>
|
||||
</application>
|
||||
<application>
|
||||
- <name>test2</name>
|
||||
- <version>2.0</version>
|
||||
- <release>2.fc14</release>
|
||||
+ <name>gpg-pubkey</name>
|
||||
+ <version>9570ff31</version>
|
||||
+ <release>5e3006fb</release>
|
||||
+ <arch>(none)</arch>
|
||||
+ <url>(none)</url>
|
||||
+ <summary>Fedora (33) <fedora-33-primary@fedoraproject.org> public key</summary>
|
||||
+ <description>-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
+Version: rpm-4.16.1.2 (NSS-3)
|
||||
+
|
||||
+mQINBF4wBvsBEADQmcGbVUbDRUoXADReRmOOEMeydHghtKC9uRs9YNpGYZIB+bie
|
||||
+bGYZmflQayfh/wEpO2W/IZfGpHPL42V7SbyvqMjwNls/fnXsCtf4LRofNK8Qd9fN
|
||||
+kYargc9R7BEz/mwXKMiRQVx+DzkmqGWy2gq4iD0/mCyf5FdJCE40fOWoIGJXaOI1
|
||||
+Tz1vWqKwLS5T0dfmi9U4Tp/XsKOZGvN8oi5h0KmqFk7LEZr1MXarhi2Va86sgxsF
|
||||
+QcZEKfu5tgD0r00vXzikoSjn3qA5JW5FW07F1pGP4bF5f9J3CZbQyOjTSWMmmfTm
|
||||
+2d2BURWzaDiJN9twY2yjzkoOMuPdXXvovg7KxLcQerKT+FbKbq8DySJX2rnOA77k
|
||||
+UG4c9BGf/L1uBkAT8dpHLk6Uf5BfmypxUkydSWT1xfTDnw1MqxO0MsLlAHOR3J7c
|
||||
+oW9kLcOLuCQn1hBEwfZv7VSWBkGXSmKfp0LLIxAFgRtv+Dh+rcMMRdJgKr1V3FU+
|
||||
+rZ1+ZAfYiBpQJFPjv70vx+rGEgS801D3PJxBZUEy4Ic4ZYaKNhK9x9PRQuWcIBuW
|
||||
+6eTe/6lKWZeyxCumLLdiS75mF2oTcBaWeoc3QxrPRV15eDKeYJMbhnUai/7lSrhs
|
||||
+EWCkKR1RivgF4slYmtNE5ZPGZ/d61zjwn2xi4xNJVs8q9WRPMpHp0vCyMwARAQAB
|
||||
+tDFGZWRvcmEgKDMzKSA8ZmVkb3JhLTMzLXByaW1hcnlAZmVkb3JhcHJvamVjdC5v
|
||||
+cmc+iQI4BBMBAgAiBQJeMAb7AhsPBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAK
|
||||
+CRBJ/XdJlXD/MZm2D/9kriL43vd3+0DNMeA82n2v9mSR2PQqKny39xNlYPyy/1yZ
|
||||
+P/KXoa4NYSCA971LSd7lv4n/h5bEKgGHxZfttfOzOnWMVSSTfjRyM/df/NNzTUEV
|
||||
+7ORA5GW18g8PEtS7uRxVBf3cLvWu5q+8jmqES5HqTAdGVcuIFQeBXFN8Gy1Jinuz
|
||||
+AH8rJSdkUeZ0cehWbERq80BWM9dhad5dW+/+Gv0foFBvP15viwhWqajr8V0B8es+
|
||||
+2/tHI0k86FAujV5i0rrXl5UOoLilO57QQNDZH/qW9GsHwVI+2yecLstpUNLq+EZC
|
||||
+GqTZCYoxYRpl0gAMbDLztSL/8Bc0tJrCRG3tavJotFYlgUK60XnXlQzRkh9rgsfT
|
||||
+EXbQifWdQMMogzjCJr0hzJ+V1d0iozdUxB2ZEgTjukOvatkB77DY1FPZRkSFIQs+
|
||||
+fdcjazDIBLIxwJu5QwvTNW8lOLnJ46g4sf1WJoUdNTbR0BaC7HHj1inVWi0p7IuN
|
||||
+66EPGzJOSjLK+vW+J0ncPDEgLCV74RF/0nR5fVTdrmiopPrzFuguHf9S9gYI3Zun
|
||||
+Yl8FJUu4kRO6JPPTicUXWX+8XZmE94aK14RCJL23nOSi8T1eW8JLW43dCBRO8QUE
|
||||
+Aso1t2pypm/1zZexJdOV8yGME3g5l2W6PLgpz58DBECgqc/kda+VWgEAp7rO2A==
|
||||
+=EPL3
|
||||
+-----END PGP PUBLIC KEY BLOCK-----
|
||||
+</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>libgcc</name>
|
||||
+ <version>10.2.1</version>
|
||||
+ <release>9.fc33</release>
|
||||
<arch>x86_64</arch>
|
||||
+ <url>http://gcc.gnu.org</url>
|
||||
+ <summary>GCC version 10 shared support library</summary>
|
||||
+ <description>This package contains GCC shared support library which is needed
|
||||
+e.g. for exception handling support.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>ncurses-base</name>
|
||||
+ <version>6.2</version>
|
||||
+ <release>3.20200222.fc33</release>
|
||||
+ <arch>noarch</arch>
|
||||
+ <url>https://invisible-island.net/ncurses/ncurses.html</url>
|
||||
+ <summary>Descriptions of common terminals</summary>
|
||||
+ <description>This package contains descriptions of common terminals. Other terminal
|
||||
+descriptions are included in the ncurses-term package.</description>
|
||||
</application>
|
||||
<application>
|
||||
- <name>test3</name>
|
||||
- <version>3.0</version>
|
||||
- <release>3.fc14</release>
|
||||
+ <name>ncurses-libs</name>
|
||||
+ <version>6.2</version>
|
||||
+ <release>3.20200222.fc33</release>
|
||||
<arch>x86_64</arch>
|
||||
+ <url>https://invisible-island.net/ncurses/ncurses.html</url>
|
||||
+ <summary>Ncurses libraries</summary>
|
||||
+ <description>The curses library routines are a terminal-independent method of
|
||||
+updating character screens with reasonable optimization. The ncurses
|
||||
+(new curses) library is a freely distributable replacement for the
|
||||
+discontinued 4.4 BSD classic curses library.
|
||||
+
|
||||
+This package contains the ncurses libraries.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>setup</name>
|
||||
+ <version>2.13.7</version>
|
||||
+ <release>2.fc33</release>
|
||||
+ <arch>noarch</arch>
|
||||
+ <url>https://pagure.io/setup/</url>
|
||||
+ <summary>A set of system configuration and setup files</summary>
|
||||
+ <description>The setup package contains a set of important system configuration and
|
||||
+setup files, such as passwd, group, and profile.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>tzdata</name>
|
||||
+ <version>2021a</version>
|
||||
+ <release>1.fc33</release>
|
||||
+ <arch>noarch</arch>
|
||||
+ <url>https://www.iana.org/time-zones</url>
|
||||
+ <summary>Timezone data</summary>
|
||||
+ <description>This package contains data files with rules for various timezones around
|
||||
+the world.</description>
|
||||
</application>
|
||||
</applications>
|
||||
</operatingsystem>
|
||||
diff --git a/inspector/expected-fedora.img.xml b/inspector/expected-fedora.img.xml
|
||||
index df6060a73..72cddaf88 100644
|
||||
--- a/inspector/expected-fedora.img.xml
|
||||
+++ b/inspector/expected-fedora.img.xml
|
||||
@@ -30,22 +30,212 @@
|
||||
</filesystems>
|
||||
<applications>
|
||||
<application>
|
||||
- <name>test1</name>
|
||||
- <version>1.0</version>
|
||||
- <release>1.fc14</release>
|
||||
+ <name>basesystem</name>
|
||||
+ <version>11</version>
|
||||
+ <release>10.fc33</release>
|
||||
+ <arch>noarch</arch>
|
||||
+ <url>(none)</url>
|
||||
+ <summary>The skeleton package which defines a simple Fedora system</summary>
|
||||
+ <description>Basesystem defines the components of a basic Fedora system
|
||||
+(for example, the package installation order to use during bootstrapping).
|
||||
+Basesystem should be in every installation of a system, and it
|
||||
+should never be removed.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>bash</name>
|
||||
+ <version>5.0.17</version>
|
||||
+ <release>2.fc33</release>
|
||||
+ <arch>x86_64</arch>
|
||||
+ <url>https://www.gnu.org/software/bash</url>
|
||||
+ <summary>The GNU Bourne Again shell</summary>
|
||||
+ <description>The GNU Bourne Again shell (Bash) is a shell or command language
|
||||
+interpreter that is compatible with the Bourne shell (sh). Bash
|
||||
+incorporates useful features from the Korn shell (ksh) and the C shell
|
||||
+(csh). Most sh scripts can be run by bash without modification.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>fedora-gpg-keys</name>
|
||||
+ <version>33</version>
|
||||
+ <release>3</release>
|
||||
+ <arch>noarch</arch>
|
||||
+ <url>https://fedoraproject.org/</url>
|
||||
+ <summary>Fedora RPM keys</summary>
|
||||
+ <description>This package provides the RPM signature keys.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>fedora-release</name>
|
||||
+ <version>33</version>
|
||||
+ <release>3</release>
|
||||
+ <arch>noarch</arch>
|
||||
+ <url>https://fedoraproject.org/</url>
|
||||
+ <summary>Fedora release files</summary>
|
||||
+ <description>Fedora release files such as various /etc/ files that define the release
|
||||
+and systemd preset files that determine which services are enabled by default.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>fedora-release-common</name>
|
||||
+ <version>33</version>
|
||||
+ <release>3</release>
|
||||
+ <arch>noarch</arch>
|
||||
+ <url>https://fedoraproject.org/</url>
|
||||
+ <summary>Fedora release files</summary>
|
||||
+ <description>Release files common to all Editions and Spins of Fedora</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>fedora-release-identity-basic</name>
|
||||
+ <version>33</version>
|
||||
+ <release>3</release>
|
||||
+ <arch>noarch</arch>
|
||||
+ <url>https://fedoraproject.org/</url>
|
||||
+ <summary>Package providing the basic Fedora identity</summary>
|
||||
+ <description>Provides the necessary files for a Fedora installation that is not identifying
|
||||
+itself as a particular Edition or Spin.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>fedora-repos</name>
|
||||
+ <version>33</version>
|
||||
+ <release>3</release>
|
||||
+ <arch>noarch</arch>
|
||||
+ <url>https://fedoraproject.org/</url>
|
||||
+ <summary>Fedora package repositories</summary>
|
||||
+ <description>Fedora package repository files for yum and dnf along with gpg public keys.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>filesystem</name>
|
||||
+ <version>3.14</version>
|
||||
+ <release>3.fc33</release>
|
||||
+ <arch>x86_64</arch>
|
||||
+ <url>https://pagure.io/filesystem</url>
|
||||
+ <summary>The basic directory layout for a Linux system</summary>
|
||||
+ <description>The filesystem package is one of the basic packages that is installed
|
||||
+on a Linux system. Filesystem contains the basic directory layout
|
||||
+for a Linux operating system, including the correct permissions for
|
||||
+the directories.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>glibc</name>
|
||||
+ <version>2.32</version>
|
||||
+ <release>4.fc33</release>
|
||||
+ <arch>x86_64</arch>
|
||||
+ <url>http://www.gnu.org/software/glibc/</url>
|
||||
+ <summary>The GNU libc libraries</summary>
|
||||
+ <description>The glibc package contains standard libraries which are used by
|
||||
+multiple programs on the system. In order to save disk space and
|
||||
+memory, as well as to make upgrading easier, common system code is
|
||||
+kept in one place and shared between programs. This particular package
|
||||
+contains the most important sets of shared libraries: the standard C
|
||||
+library and the standard math library. Without these two libraries, a
|
||||
+Linux system will not function.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>glibc-all-langpacks</name>
|
||||
+ <version>2.32</version>
|
||||
+ <release>4.fc33</release>
|
||||
+ <arch>x86_64</arch>
|
||||
+ <url>http://www.gnu.org/software/glibc/</url>
|
||||
+ <summary>All language packs for glibc.</summary>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>glibc-common</name>
|
||||
+ <version>2.32</version>
|
||||
+ <release>4.fc33</release>
|
||||
<arch>x86_64</arch>
|
||||
+ <url>http://www.gnu.org/software/glibc/</url>
|
||||
+ <summary>Common binaries and locale data for glibc</summary>
|
||||
+ <description>The glibc-common package includes common binaries for the GNU libc
|
||||
+libraries, as well as national language (locale) support.</description>
|
||||
</application>
|
||||
<application>
|
||||
- <name>test2</name>
|
||||
- <version>2.0</version>
|
||||
- <release>2.fc14</release>
|
||||
+ <name>gpg-pubkey</name>
|
||||
+ <version>9570ff31</version>
|
||||
+ <release>5e3006fb</release>
|
||||
+ <arch>(none)</arch>
|
||||
+ <url>(none)</url>
|
||||
+ <summary>Fedora (33) <fedora-33-primary@fedoraproject.org> public key</summary>
|
||||
+ <description>-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
+Version: rpm-4.16.1.2 (NSS-3)
|
||||
+
|
||||
+mQINBF4wBvsBEADQmcGbVUbDRUoXADReRmOOEMeydHghtKC9uRs9YNpGYZIB+bie
|
||||
+bGYZmflQayfh/wEpO2W/IZfGpHPL42V7SbyvqMjwNls/fnXsCtf4LRofNK8Qd9fN
|
||||
+kYargc9R7BEz/mwXKMiRQVx+DzkmqGWy2gq4iD0/mCyf5FdJCE40fOWoIGJXaOI1
|
||||
+Tz1vWqKwLS5T0dfmi9U4Tp/XsKOZGvN8oi5h0KmqFk7LEZr1MXarhi2Va86sgxsF
|
||||
+QcZEKfu5tgD0r00vXzikoSjn3qA5JW5FW07F1pGP4bF5f9J3CZbQyOjTSWMmmfTm
|
||||
+2d2BURWzaDiJN9twY2yjzkoOMuPdXXvovg7KxLcQerKT+FbKbq8DySJX2rnOA77k
|
||||
+UG4c9BGf/L1uBkAT8dpHLk6Uf5BfmypxUkydSWT1xfTDnw1MqxO0MsLlAHOR3J7c
|
||||
+oW9kLcOLuCQn1hBEwfZv7VSWBkGXSmKfp0LLIxAFgRtv+Dh+rcMMRdJgKr1V3FU+
|
||||
+rZ1+ZAfYiBpQJFPjv70vx+rGEgS801D3PJxBZUEy4Ic4ZYaKNhK9x9PRQuWcIBuW
|
||||
+6eTe/6lKWZeyxCumLLdiS75mF2oTcBaWeoc3QxrPRV15eDKeYJMbhnUai/7lSrhs
|
||||
+EWCkKR1RivgF4slYmtNE5ZPGZ/d61zjwn2xi4xNJVs8q9WRPMpHp0vCyMwARAQAB
|
||||
+tDFGZWRvcmEgKDMzKSA8ZmVkb3JhLTMzLXByaW1hcnlAZmVkb3JhcHJvamVjdC5v
|
||||
+cmc+iQI4BBMBAgAiBQJeMAb7AhsPBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAK
|
||||
+CRBJ/XdJlXD/MZm2D/9kriL43vd3+0DNMeA82n2v9mSR2PQqKny39xNlYPyy/1yZ
|
||||
+P/KXoa4NYSCA971LSd7lv4n/h5bEKgGHxZfttfOzOnWMVSSTfjRyM/df/NNzTUEV
|
||||
+7ORA5GW18g8PEtS7uRxVBf3cLvWu5q+8jmqES5HqTAdGVcuIFQeBXFN8Gy1Jinuz
|
||||
+AH8rJSdkUeZ0cehWbERq80BWM9dhad5dW+/+Gv0foFBvP15viwhWqajr8V0B8es+
|
||||
+2/tHI0k86FAujV5i0rrXl5UOoLilO57QQNDZH/qW9GsHwVI+2yecLstpUNLq+EZC
|
||||
+GqTZCYoxYRpl0gAMbDLztSL/8Bc0tJrCRG3tavJotFYlgUK60XnXlQzRkh9rgsfT
|
||||
+EXbQifWdQMMogzjCJr0hzJ+V1d0iozdUxB2ZEgTjukOvatkB77DY1FPZRkSFIQs+
|
||||
+fdcjazDIBLIxwJu5QwvTNW8lOLnJ46g4sf1WJoUdNTbR0BaC7HHj1inVWi0p7IuN
|
||||
+66EPGzJOSjLK+vW+J0ncPDEgLCV74RF/0nR5fVTdrmiopPrzFuguHf9S9gYI3Zun
|
||||
+Yl8FJUu4kRO6JPPTicUXWX+8XZmE94aK14RCJL23nOSi8T1eW8JLW43dCBRO8QUE
|
||||
+Aso1t2pypm/1zZexJdOV8yGME3g5l2W6PLgpz58DBECgqc/kda+VWgEAp7rO2A==
|
||||
+=EPL3
|
||||
+-----END PGP PUBLIC KEY BLOCK-----
|
||||
+</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>libgcc</name>
|
||||
+ <version>10.2.1</version>
|
||||
+ <release>9.fc33</release>
|
||||
<arch>x86_64</arch>
|
||||
+ <url>http://gcc.gnu.org</url>
|
||||
+ <summary>GCC version 10 shared support library</summary>
|
||||
+ <description>This package contains GCC shared support library which is needed
|
||||
+e.g. for exception handling support.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>ncurses-base</name>
|
||||
+ <version>6.2</version>
|
||||
+ <release>3.20200222.fc33</release>
|
||||
+ <arch>noarch</arch>
|
||||
+ <url>https://invisible-island.net/ncurses/ncurses.html</url>
|
||||
+ <summary>Descriptions of common terminals</summary>
|
||||
+ <description>This package contains descriptions of common terminals. Other terminal
|
||||
+descriptions are included in the ncurses-term package.</description>
|
||||
</application>
|
||||
<application>
|
||||
- <name>test3</name>
|
||||
- <version>3.0</version>
|
||||
- <release>3.fc14</release>
|
||||
+ <name>ncurses-libs</name>
|
||||
+ <version>6.2</version>
|
||||
+ <release>3.20200222.fc33</release>
|
||||
<arch>x86_64</arch>
|
||||
+ <url>https://invisible-island.net/ncurses/ncurses.html</url>
|
||||
+ <summary>Ncurses libraries</summary>
|
||||
+ <description>The curses library routines are a terminal-independent method of
|
||||
+updating character screens with reasonable optimization. The ncurses
|
||||
+(new curses) library is a freely distributable replacement for the
|
||||
+discontinued 4.4 BSD classic curses library.
|
||||
+
|
||||
+This package contains the ncurses libraries.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>setup</name>
|
||||
+ <version>2.13.7</version>
|
||||
+ <release>2.fc33</release>
|
||||
+ <arch>noarch</arch>
|
||||
+ <url>https://pagure.io/setup/</url>
|
||||
+ <summary>A set of system configuration and setup files</summary>
|
||||
+ <description>The setup package contains a set of important system configuration and
|
||||
+setup files, such as passwd, group, and profile.</description>
|
||||
+ </application>
|
||||
+ <application>
|
||||
+ <name>tzdata</name>
|
||||
+ <version>2021a</version>
|
||||
+ <release>1.fc33</release>
|
||||
+ <arch>noarch</arch>
|
||||
+ <url>https://www.iana.org/time-zones</url>
|
||||
+ <summary>Timezone data</summary>
|
||||
+ <description>This package contains data files with rules for various timezones around
|
||||
+the world.</description>
|
||||
</application>
|
||||
</applications>
|
||||
</operatingsystem>
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,30 +0,0 @@
|
||||
From c2570c81e8c3dffadbcfa5c857a38ae858745f9e Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 1 May 2018 11:30:11 +0100
|
||||
Subject: [PATCH] v2v: Map Windows Server 2012 R2 x86-64 to ovirt ID 25.
|
||||
|
||||
Thanks: Michal Skrivanek
|
||||
|
||||
Fixes commit 593a19cc86cfa8f24c66518c8ba21222550b066a.
|
||||
|
||||
(cherry picked from commit c6e89299299f1f620437ac3d05a1f0f12de0f208)
|
||||
---
|
||||
v2v/create_ovf.ml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/v2v/create_ovf.ml b/v2v/create_ovf.ml
|
||||
index b1ab8df3f..b3beb1eba 100644
|
||||
--- a/v2v/create_ovf.ml
|
||||
+++ b/v2v/create_ovf.ml
|
||||
@@ -418,7 +418,7 @@ and get_ovirt_osid = function
|
||||
|
||||
| { i_type = "windows"; i_major_version = 6; i_minor_version = 3;
|
||||
i_arch = "x86_64" } ->
|
||||
- 23
|
||||
+ 25
|
||||
|
||||
| { i_type = "windows"; i_major_version = 10; i_minor_version = 0;
|
||||
i_arch = "i386" } ->
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,65 @@
|
||||
From 6657d0c1018ab44ae680376463ac3f0421548fb4 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Thu, 23 Dec 2021 11:36:59 +0100
|
||||
Subject: [PATCH] launch-libvirt: place our virtio-net-pci device in slot 0x1e
|
||||
|
||||
The <qemu:commandline> trick we use for adding our virtio-net-pci device
|
||||
in the libvirt backend can conflict with libvirtd's and QEMU's PCI address
|
||||
assignment. Try to mitigate that by placing our device in slot 0x1e on the
|
||||
root bus. In practice this could only conflict with a "dmi-to-pci-bridge"
|
||||
device model, which libvirtd itself places in slot 0x1e. However, given
|
||||
the XMLs we generate, and modern QEMU versions, libvirtd has no reason to
|
||||
auto-add "dmi-to-pci-bridge". Refer to
|
||||
<https://libvirt.org/formatdomain.html#controllers>.
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2034160
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20211223103701.12702-2-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
Tested-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit 5ce5ef6a97a58c5e906083ad4e944545712b3f3f)
|
||||
---
|
||||
lib/guestfs-internal.h | 11 +++++++++++
|
||||
lib/launch-libvirt.c | 4 +++-
|
||||
2 files changed, 14 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h
|
||||
index 4799ee0a1..0b46f0070 100644
|
||||
--- a/lib/guestfs-internal.h
|
||||
+++ b/lib/guestfs-internal.h
|
||||
@@ -147,6 +147,17 @@
|
||||
#define VIRTIO_DEVICE_NAME(type) type "-pci"
|
||||
#endif
|
||||
|
||||
+/* Place the virtio-net controller in slot 0x1e on the root bus, on normal
|
||||
+ * hardware with PCI. Refer to RHBZ#2034160.
|
||||
+ */
|
||||
+#ifdef HAVE_LIBVIRT_BACKEND
|
||||
+#if defined(__arm__) || defined(__s390x__)
|
||||
+#define VIRTIO_NET_PCI_ADDR ""
|
||||
+#else
|
||||
+#define VIRTIO_NET_PCI_ADDR ",addr=1e.0"
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
/* Guestfs handle and associated structures. */
|
||||
|
||||
/* State. */
|
||||
diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
|
||||
index 026dc6b26..5842319df 100644
|
||||
--- a/lib/launch-libvirt.c
|
||||
+++ b/lib/launch-libvirt.c
|
||||
@@ -1834,7 +1834,9 @@ construct_libvirt_xml_qemu_cmdline (guestfs_h *g,
|
||||
} end_element ();
|
||||
|
||||
start_element ("qemu:arg") {
|
||||
- attribute ("value", VIRTIO_DEVICE_NAME ("virtio-net") ",netdev=usernet");
|
||||
+ attribute ("value", (VIRTIO_DEVICE_NAME ("virtio-net")
|
||||
+ ",netdev=usernet"
|
||||
+ VIRTIO_NET_PCI_ADDR));
|
||||
} end_element ();
|
||||
}
|
||||
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,54 +0,0 @@
|
||||
From b31fcaf9879b9f4fe36a19e439895a867a1fbc72 Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Tue, 22 May 2018 17:24:18 +0200
|
||||
Subject: [PATCH] v2v: fix build rules for output_rhv_upload_*_source.ml files
|
||||
|
||||
Use the $(srcdir) variable where needed, to make sure it builds also
|
||||
with srcdir != builddir.
|
||||
|
||||
Furthermore, make sure that the OCaml dependencies calculation depend on
|
||||
the generated output_rhv_upload_*_source.ml files, otherwise there will
|
||||
be incomplete OCaml rules for them in the generated .depend.
|
||||
|
||||
Fixes commit cc04573927cca97de60d544d37467e67c25867a7.
|
||||
|
||||
(cherry picked from commit a4e3b7c0598370d8d068b21909da95b6031eb688)
|
||||
---
|
||||
v2v/Makefile.am | 14 +++++++-------
|
||||
1 file changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/v2v/Makefile.am b/v2v/Makefile.am
|
||||
index 3a0c80f44..7de050b06 100644
|
||||
--- a/v2v/Makefile.am
|
||||
+++ b/v2v/Makefile.am
|
||||
@@ -143,12 +143,12 @@ SOURCES_C = \
|
||||
|
||||
# These files are generated and contain rhv-upload-*.py embedded as an
|
||||
# OCaml string.
|
||||
-output_rhv_upload_createvm_source.ml: rhv-upload-createvm.py
|
||||
- ./embed.sh code $^ $@
|
||||
-output_rhv_upload_plugin_source.ml: rhv-upload-plugin.py
|
||||
- ./embed.sh code $^ $@
|
||||
-output_rhv_upload_precheck_source.ml: rhv-upload-precheck.py
|
||||
- ./embed.sh code $^ $@
|
||||
+output_rhv_upload_createvm_source.ml: $(srcdir)/rhv-upload-createvm.py
|
||||
+ $(srcdir)/embed.sh code $^ $@
|
||||
+output_rhv_upload_plugin_source.ml: $(srcdir)/rhv-upload-plugin.py
|
||||
+ $(srcdir)/embed.sh code $^ $@
|
||||
+output_rhv_upload_precheck_source.ml: $(srcdir)/rhv-upload-precheck.py
|
||||
+ $(srcdir)/embed.sh code $^ $@
|
||||
|
||||
if HAVE_OCAML
|
||||
|
||||
@@ -575,7 +575,7 @@ v2v_unit_tests_LINK = \
|
||||
$(v2v_unit_tests_THEOBJECTS) -o $@
|
||||
|
||||
# Dependencies.
|
||||
-.depend: $(srcdir)/*.mli $(srcdir)/*.ml
|
||||
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml output_rhv_upload_createvm_source.ml output_rhv_upload_plugin_source.ml output_rhv_upload_precheck_source.ml
|
||||
$(top_builddir)/ocaml-dep.sh $^
|
||||
-include .depend
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,70 @@
|
||||
From 4b9eac11db3e2cc9ace397ed4c804356a7d9adbf Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Thu, 23 Dec 2021 11:37:00 +0100
|
||||
Subject: [PATCH] lib: extract NETWORK_ADDRESS and NETWORK_PREFIX as macros
|
||||
|
||||
The 169.254.0.0/16 network specification (for the appliance) is currently
|
||||
duplicated between the direct backend and the libvirt backend. In a
|
||||
subsequent patch, we're going to need the network specification in yet
|
||||
another spot; extract it now to the NETWORK_ADDRESS and NETWORK_PREFIX
|
||||
macros (simply as strings).
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2034160
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20211223103701.12702-3-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
Tested-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit 216de164e091a5c36403f24901698044a43ae0d9)
|
||||
---
|
||||
lib/guestfs-internal.h | 6 ++++++
|
||||
lib/launch-direct.c | 2 +-
|
||||
lib/launch-libvirt.c | 3 ++-
|
||||
3 files changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h
|
||||
index 0b46f0070..97a13ff2c 100644
|
||||
--- a/lib/guestfs-internal.h
|
||||
+++ b/lib/guestfs-internal.h
|
||||
@@ -158,6 +158,12 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+/* Network address and network mask (expressed as address prefix) that the
|
||||
+ * appliance will see (if networking is enabled).
|
||||
+ */
|
||||
+#define NETWORK_ADDRESS "169.254.0.0"
|
||||
+#define NETWORK_PREFIX "16"
|
||||
+
|
||||
/* Guestfs handle and associated structures. */
|
||||
|
||||
/* State. */
|
||||
diff --git a/lib/launch-direct.c b/lib/launch-direct.c
|
||||
index b6ed9766f..de17d2167 100644
|
||||
--- a/lib/launch-direct.c
|
||||
+++ b/lib/launch-direct.c
|
||||
@@ -681,7 +681,7 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
|
||||
start_list ("-netdev") {
|
||||
append_list ("user");
|
||||
append_list ("id=usernet");
|
||||
- append_list ("net=169.254.0.0/16");
|
||||
+ append_list ("net=" NETWORK_ADDRESS "/" NETWORK_PREFIX);
|
||||
} end_list ();
|
||||
start_list ("-device") {
|
||||
append_list (VIRTIO_DEVICE_NAME ("virtio-net"));
|
||||
diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
|
||||
index 5842319df..0f38f0aec 100644
|
||||
--- a/lib/launch-libvirt.c
|
||||
+++ b/lib/launch-libvirt.c
|
||||
@@ -1826,7 +1826,8 @@ construct_libvirt_xml_qemu_cmdline (guestfs_h *g,
|
||||
} end_element ();
|
||||
|
||||
start_element ("qemu:arg") {
|
||||
- attribute ("value", "user,id=usernet,net=169.254.0.0/16");
|
||||
+ attribute ("value",
|
||||
+ "user,id=usernet,net=" NETWORK_ADDRESS "/" NETWORK_PREFIX);
|
||||
} end_element ();
|
||||
|
||||
start_element ("qemu:arg") {
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,37 +0,0 @@
|
||||
From bd2afb6e11b107aa7f158136ff6d4fb24732b2bf Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Tue, 29 May 2018 06:49:23 +0200
|
||||
Subject: [PATCH] v2v: fix "rhevexp" typo in documentation
|
||||
|
||||
Spotted by Ming Xie.
|
||||
|
||||
(cherry picked from commit c021ac5e64053052a392762aaff9c8ed73fc2082)
|
||||
---
|
||||
v2v/virt-v2v.pod | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
|
||||
index 2d2f8cfd3..f012ea533 100644
|
||||
--- a/v2v/virt-v2v.pod
|
||||
+++ b/v2v/virt-v2v.pod
|
||||
@@ -728,7 +728,7 @@ Currently there are two possible flavours:
|
||||
|
||||
=over 4
|
||||
|
||||
-=item rhevexp
|
||||
+=item rhvexp
|
||||
|
||||
The OVF format used in RHV export storage domain.
|
||||
|
||||
@@ -738,7 +738,7 @@ The OVF format understood by oVirt REST API.
|
||||
|
||||
=back
|
||||
|
||||
-For backward compatibility the default is I<rhevexp>, but this may change in
|
||||
+For backward compatibility the default is I<rhvexp>, but this may change in
|
||||
the future.
|
||||
|
||||
=item B<-op> file
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,91 @@
|
||||
From 8570de6e766297e4c9feab1c54ae05037f33edeb Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Thu, 23 Dec 2021 11:37:01 +0100
|
||||
Subject: [PATCH] launch-libvirt: add virtio-net via the standard <interface>
|
||||
element
|
||||
|
||||
Starting with version 3.8.0, libvirt allows us to specify the network
|
||||
address and network mask (as prefix) for SLIRP directly via the
|
||||
<interface> element in the domain XML:
|
||||
<https://libvirt.org/formatdomain.html#userspace-slirp-stack>. This means
|
||||
we don't need the <qemu:commandline> hack for virtio-net on such versions.
|
||||
|
||||
Restrict the hack in construct_libvirt_xml_qemu_cmdline() to
|
||||
libvirt<3.8.0, and generate the proper <interface> element in
|
||||
construct_libvirt_xml_devices() on libvirt>=3.8.0.
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2034160
|
||||
Suggested-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20211223103701.12702-4-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
Tested-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
(cherry picked from commit 5858c2cf6c24b3776e3867eafd9d86a1f4912d9c)
|
||||
---
|
||||
lib/guestfs-internal.h | 3 ++-
|
||||
lib/launch-libvirt.c | 27 +++++++++++++++++++++++++--
|
||||
2 files changed, 27 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h
|
||||
index 97a13ff2c..b11c945e9 100644
|
||||
--- a/lib/guestfs-internal.h
|
||||
+++ b/lib/guestfs-internal.h
|
||||
@@ -148,7 +148,8 @@
|
||||
#endif
|
||||
|
||||
/* Place the virtio-net controller in slot 0x1e on the root bus, on normal
|
||||
- * hardware with PCI. Refer to RHBZ#2034160.
|
||||
+ * hardware with PCI. Necessary only before libvirt 3.8.0. Refer to
|
||||
+ * RHBZ#2034160.
|
||||
*/
|
||||
#ifdef HAVE_LIBVIRT_BACKEND
|
||||
#if defined(__arm__) || defined(__s390x__)
|
||||
diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
|
||||
index 0f38f0aec..f6bb39d99 100644
|
||||
--- a/lib/launch-libvirt.c
|
||||
+++ b/lib/launch-libvirt.c
|
||||
@@ -1396,6 +1396,28 @@ construct_libvirt_xml_devices (guestfs_h *g,
|
||||
} end_element ();
|
||||
} end_element ();
|
||||
|
||||
+ /* Virtio-net NIC with SLIRP (= userspace) back-end, if networking is
|
||||
+ * enabled. Starting with libvirt 3.8.0, we can specify the network address
|
||||
+ * and prefix for SLIRP in the domain XML. Therefore, we can add the NIC
|
||||
+ * via the standard <interface> element rather than <qemu:commandline>, and
|
||||
+ * so libvirt can manage the PCI address of the virtio-net NIC like the PCI
|
||||
+ * addresses of all other devices. Refer to RHBZ#2034160.
|
||||
+ */
|
||||
+ if (g->enable_network &&
|
||||
+ guestfs_int_version_ge (¶ms->data->libvirt_version, 3, 8, 0)) {
|
||||
+ start_element ("interface") {
|
||||
+ attribute ("type", "user");
|
||||
+ start_element ("model") {
|
||||
+ attribute ("type", "virtio");
|
||||
+ } end_element ();
|
||||
+ start_element ("ip") {
|
||||
+ attribute ("family", "ipv4");
|
||||
+ attribute ("address", NETWORK_ADDRESS);
|
||||
+ attribute ("prefix", NETWORK_PREFIX);
|
||||
+ } end_element ();
|
||||
+ } end_element ();
|
||||
+ }
|
||||
+
|
||||
/* Libvirt adds some devices by default. Indicate to libvirt
|
||||
* that we don't want them.
|
||||
*/
|
||||
@@ -1818,9 +1840,10 @@ construct_libvirt_xml_qemu_cmdline (guestfs_h *g,
|
||||
} end_element ();
|
||||
|
||||
/* Workaround because libvirt user networking cannot specify "net="
|
||||
- * parameter.
|
||||
+ * parameter. Necessary only before libvirt 3.8.0; refer to RHBZ#2034160.
|
||||
*/
|
||||
- if (g->enable_network) {
|
||||
+ if (g->enable_network &&
|
||||
+ !guestfs_int_version_ge (¶ms->data->libvirt_version, 3, 8, 0)) {
|
||||
start_element ("qemu:arg") {
|
||||
attribute ("value", "-netdev");
|
||||
} end_element ();
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,66 +0,0 @@
|
||||
From 973810a232b2f2a33425d28287e0ec77c483279a Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Tue, 29 May 2018 07:04:50 +0200
|
||||
Subject: [PATCH] v2v: add and use Create_ovf.ovf_flavour_to_string
|
||||
|
||||
Add an helper to convert an OVF flavour to string, and use it in
|
||||
-o vdsm to print the actual value of the vdsm-ovf-flavour option.
|
||||
|
||||
Thanks to Ming Xie.
|
||||
|
||||
(cherry picked from commit c0da02f90d9b52413c24dd9dae61662ad033cc16)
|
||||
---
|
||||
v2v/create_ovf.ml | 4 ++++
|
||||
v2v/create_ovf.mli | 3 +++
|
||||
v2v/output_vdsm.ml | 5 +++--
|
||||
3 files changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/v2v/create_ovf.ml b/v2v/create_ovf.ml
|
||||
index b3beb1eba..9e0c772fd 100644
|
||||
--- a/v2v/create_ovf.ml
|
||||
+++ b/v2v/create_ovf.ml
|
||||
@@ -40,6 +40,10 @@ let ovf_flavour_of_string = function
|
||||
| "rhvexp" -> RHVExportStorageDomain
|
||||
| flav -> invalid_arg flav
|
||||
|
||||
+let ovf_flavour_to_string = function
|
||||
+ | OVirt -> "ovirt"
|
||||
+ | RHVExportStorageDomain -> "rhvexp"
|
||||
+
|
||||
(* We set the creation time to be the same for all dates in
|
||||
* all metadata files. All dates in OVF are UTC.
|
||||
*)
|
||||
diff --git a/v2v/create_ovf.mli b/v2v/create_ovf.mli
|
||||
index 2d80660e3..8200b76f9 100644
|
||||
--- a/v2v/create_ovf.mli
|
||||
+++ b/v2v/create_ovf.mli
|
||||
@@ -29,6 +29,9 @@ val ovf_flavours : string list
|
||||
valid flavour. *)
|
||||
val ovf_flavour_of_string : string -> ovf_flavour
|
||||
|
||||
+(** Convert an OVF flavour to its string representation. *)
|
||||
+val ovf_flavour_to_string : ovf_flavour -> string
|
||||
+
|
||||
(** Create OVF and related files for RHV.
|
||||
|
||||
The format for RHV export storage domain is described in:
|
||||
diff --git a/v2v/output_vdsm.ml b/v2v/output_vdsm.ml
|
||||
index 92b3fd122..9a1b748bc 100644
|
||||
--- a/v2v/output_vdsm.ml
|
||||
+++ b/v2v/output_vdsm.ml
|
||||
@@ -118,9 +118,10 @@ object
|
||||
| "0.10" -> "" (* currently this is the default, so don't print it *)
|
||||
| s -> sprintf " -oo vdsm-compat=%s" s)
|
||||
(match vdsm_options.ovf_flavour with
|
||||
- | Create_ovf.OVirt -> "-oo vdsm-ovf-flavour=ovf"
|
||||
(* currently this is the default, so don't print it *)
|
||||
- | Create_ovf.RHVExportStorageDomain -> "")
|
||||
+ | Create_ovf.RHVExportStorageDomain -> ""
|
||||
+ | flav -> sprintf "-oo vdsm-ovf-flavour=%s"
|
||||
+ (Create_ovf.ovf_flavour_to_string flav))
|
||||
|
||||
method supported_firmware = [ TargetBIOS ]
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
86
SOURCES/0020-appliance-Use-cpu-max.patch
Normal file
86
SOURCES/0020-appliance-Use-cpu-max.patch
Normal file
@ -0,0 +1,86 @@
|
||||
From fbb053fc71c0c072acb3fbf6e5fbbfc3b0667fd2 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 28 Jan 2021 12:20:49 +0000
|
||||
Subject: [PATCH] appliance: Use -cpu max.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
QEMU has a newish feature (from about 2017 / qemu 2.9) called -cpu max
|
||||
which is supposed to select the best CPU, ideal for libguestfs.
|
||||
|
||||
After this change, on x86-64:
|
||||
|
||||
KVM TCG
|
||||
|
||||
Direct -cpu max -cpu max
|
||||
(non-libvirt)
|
||||
|
||||
Libvirt <cpu mode="host-passthrough"> <cpu mode="host-model">
|
||||
<model fallback="allow"/> <model fallback="allow"/>
|
||||
</cpu> </cpu>
|
||||
|
||||
Thanks: Daniel Berrangé
|
||||
(cherry picked from commit 30f74f38bd6e42e783ba80895f4d6826abddd417)
|
||||
---
|
||||
lib/appliance-cpu.c | 16 ++++++++--------
|
||||
lib/launch-libvirt.c | 9 +++++++++
|
||||
2 files changed, 17 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/lib/appliance-cpu.c b/lib/appliance-cpu.c
|
||||
index 5ef9f5c72..54ac6e2e3 100644
|
||||
--- a/lib/appliance-cpu.c
|
||||
+++ b/lib/appliance-cpu.c
|
||||
@@ -38,6 +38,11 @@
|
||||
*
|
||||
* The literal string C<"host"> means use C<-cpu host>.
|
||||
*
|
||||
+ * =item C<"max">
|
||||
+ *
|
||||
+ * The literal string C<"max"> means use C<-cpu max> (the best
|
||||
+ * possible). This requires awkward translation for libvirt.
|
||||
+ *
|
||||
* =item some string
|
||||
*
|
||||
* Some string such as C<"cortex-a57"> means use C<-cpu cortex-a57>.
|
||||
@@ -80,14 +85,9 @@ guestfs_int_get_cpu_model (int kvm)
|
||||
/* See discussion in https://bugzilla.redhat.com/show_bug.cgi?id=1605071 */
|
||||
return NULL;
|
||||
#else
|
||||
- /* On most architectures, it is faster to pass the CPU host model to
|
||||
- * the appliance, allowing maximum speed for things like checksums
|
||||
- * and encryption. Only do this with KVM. It is broken in subtle
|
||||
- * ways on TCG, and fairly pointless when you're emulating anyway.
|
||||
+ /* On most architectures we can use "max" to get the best possible CPU.
|
||||
+ * For recent qemu this should work even on TCG.
|
||||
*/
|
||||
- if (kvm)
|
||||
- return "host";
|
||||
- else
|
||||
- return NULL;
|
||||
+ return "max";
|
||||
#endif
|
||||
}
|
||||
diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
|
||||
index f6bb39d99..e3ff1ffe0 100644
|
||||
--- a/lib/launch-libvirt.c
|
||||
+++ b/lib/launch-libvirt.c
|
||||
@@ -1169,6 +1169,15 @@ construct_libvirt_xml_cpu (guestfs_h *g,
|
||||
attribute ("fallback", "allow");
|
||||
} end_element ();
|
||||
}
|
||||
+ else if (STREQ (cpu_model, "max")) {
|
||||
+ if (params->data->is_kvm)
|
||||
+ attribute ("mode", "host-passthrough");
|
||||
+ else
|
||||
+ attribute ("mode", "host-model");
|
||||
+ start_element ("model") {
|
||||
+ attribute ("fallback", "allow");
|
||||
+ } end_element ();
|
||||
+ }
|
||||
else
|
||||
single_element ("model", cpu_model);
|
||||
} end_element ();
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,42 +0,0 @@
|
||||
From e61cbd740b84eb78a1ffc52223e4f1cc3202c978 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 5 Jun 2018 19:09:43 +0100
|
||||
Subject: [PATCH] v2v: -o rhv-upload: Set inactivity timeout (RHBZ#1586198).
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This increases the inactivity timeout for transfers from the default
|
||||
(60 seconds in oVirt < 4.2.3, 600 seconds in >= 4.2.3), up to 1 hour,
|
||||
so that we should never hit it for ordinary transfers.
|
||||
|
||||
Note this requires oVirt >= 4.2.3. The corresponding oVirt fix was
|
||||
https://bugzilla.redhat.com/1563278
|
||||
|
||||
I also replaced the deprecated ‘image’ parameter with ‘disk’.
|
||||
|
||||
Thanks: Nir Soffer, Daniel Erez.
|
||||
(cherry picked from commit f25404c65f8e078a3ca5bd5a1ab91343edd22506)
|
||||
---
|
||||
v2v/rhv-upload-plugin.py | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
|
||||
index 791c9e7d2..b4557b83c 100644
|
||||
--- a/v2v/rhv-upload-plugin.py
|
||||
+++ b/v2v/rhv-upload-plugin.py
|
||||
@@ -123,9 +123,8 @@ def open(readonly):
|
||||
# Create a new image transfer.
|
||||
transfer = transfers_service.add(
|
||||
types.ImageTransfer(
|
||||
- image = types.Image(
|
||||
- id = disk.id
|
||||
- )
|
||||
+ disk = types.Disk(id = disk.id),
|
||||
+ inactivity_timeout = 3600,
|
||||
)
|
||||
)
|
||||
debug("transfer.id = %r" % transfer.id)
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,136 +0,0 @@
|
||||
From 24aef5baa9725e26efd37fa78b83f98629d77eba Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Wed, 21 Feb 2018 17:33:28 +0100
|
||||
Subject: [PATCH] New API: inspect_get_osinfo
|
||||
|
||||
Try to guess the possible osinfo-db short ID for the specified OS.
|
||||
|
||||
Related to: https://bugzilla.redhat.com/show_bug.cgi?id=1544842
|
||||
|
||||
(cherry picked from commit 286b88891c2288fb7f64c9538296599ece04bcb1)
|
||||
---
|
||||
generator/actions_inspection.ml | 14 ++++++
|
||||
lib/Makefile.am | 1 +
|
||||
lib/inspect-osinfo.c | 75 +++++++++++++++++++++++++++++++++
|
||||
3 files changed, 90 insertions(+)
|
||||
create mode 100644 lib/inspect-osinfo.c
|
||||
|
||||
diff --git a/generator/actions_inspection.ml b/generator/actions_inspection.ml
|
||||
index 0ac282435..ff5083114 100644
|
||||
--- a/generator/actions_inspection.ml
|
||||
+++ b/generator/actions_inspection.ml
|
||||
@@ -770,4 +770,18 @@ advice before using trademarks in applications.
|
||||
|
||||
=back" };
|
||||
|
||||
+ { defaults with
|
||||
+ name = "inspect_get_osinfo"; added = (1, 39, 1);
|
||||
+ style = RString (RPlainString, "id"), [String (Mountable, "root")], [];
|
||||
+ shortdesc = "get a possible osinfo short ID corresponding to this operating system";
|
||||
+ longdesc = "\
|
||||
+This function returns a possible short ID for libosinfo corresponding
|
||||
+to the guest.
|
||||
+
|
||||
+I<Note:> The returned ID is only a guess by libguestfs, and nothing
|
||||
+ensures that it actually exists in osinfo-db.
|
||||
+
|
||||
+If no ID could not be determined, then the string C<unknown> is
|
||||
+returned." };
|
||||
+
|
||||
]
|
||||
diff --git a/lib/Makefile.am b/lib/Makefile.am
|
||||
index d075174d9..742b182cc 100644
|
||||
--- a/lib/Makefile.am
|
||||
+++ b/lib/Makefile.am
|
||||
@@ -95,6 +95,7 @@ libguestfs_la_SOURCES = \
|
||||
info.c \
|
||||
inspect-apps.c \
|
||||
inspect-icon.c \
|
||||
+ inspect-osinfo.c \
|
||||
journal.c \
|
||||
launch.c \
|
||||
launch-direct.c \
|
||||
diff --git a/lib/inspect-osinfo.c b/lib/inspect-osinfo.c
|
||||
new file mode 100644
|
||||
index 000000000..816d317f1
|
||||
--- /dev/null
|
||||
+++ b/lib/inspect-osinfo.c
|
||||
@@ -0,0 +1,75 @@
|
||||
+/* libguestfs
|
||||
+ * Copyright (C) 2018 Red Hat Inc.
|
||||
+ *
|
||||
+ * This library is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU Lesser General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Lesser General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Lesser General Public
|
||||
+ * License along with this library; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
+ */
|
||||
+
|
||||
+#include <config.h>
|
||||
+
|
||||
+#include "guestfs.h"
|
||||
+#include "guestfs-internal.h"
|
||||
+#include "guestfs-internal-actions.h"
|
||||
+
|
||||
+char *
|
||||
+guestfs_impl_inspect_get_osinfo (guestfs_h *g, const char *root)
|
||||
+{
|
||||
+ CLEANUP_FREE char *type = NULL;
|
||||
+ CLEANUP_FREE char *distro = NULL;
|
||||
+ int major, minor;
|
||||
+
|
||||
+ type = guestfs_inspect_get_type (g, root);
|
||||
+ if (!type)
|
||||
+ return NULL;
|
||||
+ distro = guestfs_inspect_get_distro (g, root);
|
||||
+ if (!distro)
|
||||
+ return NULL;
|
||||
+ major = guestfs_inspect_get_major_version (g, root);
|
||||
+ minor = guestfs_inspect_get_minor_version (g, root);
|
||||
+
|
||||
+ if (STREQ (type, "linux")) {
|
||||
+ if (STREQ (distro, "centos")) {
|
||||
+ if (major >= 7)
|
||||
+ return safe_asprintf (g, "%s%d.0", distro, major);
|
||||
+ else if (major == 6)
|
||||
+ return safe_asprintf (g, "%s%d.%d", distro, major, minor);
|
||||
+ }
|
||||
+ else if (STREQ (distro, "debian")) {
|
||||
+ if (major >= 4)
|
||||
+ return safe_asprintf (g, "%s%d", distro, major);
|
||||
+ }
|
||||
+ else if (STREQ (distro, "fedora") || STREQ (distro, "mageia"))
|
||||
+ return safe_asprintf (g, "%s%d", distro, major);
|
||||
+ else if (STREQ (distro, "sles")) {
|
||||
+ if (minor == 0)
|
||||
+ return safe_asprintf (g, "%s%d", distro, major);
|
||||
+ else
|
||||
+ return safe_asprintf (g, "%s%dsp%d", distro, major, minor);
|
||||
+ }
|
||||
+ else if (STREQ (distro, "ubuntu"))
|
||||
+ return safe_asprintf (g, "%s%d.%02d", distro, major, minor);
|
||||
+
|
||||
+ if (major > 0 || minor > 0)
|
||||
+ return safe_asprintf (g, "%s%d.%d", distro, major, minor);
|
||||
+ }
|
||||
+ else if (STREQ (type, "freebsd") || STREQ (type, "netbsd") || STREQ (type, "openbsd"))
|
||||
+ return safe_asprintf (g, "%s%d.%d", distro, major, minor);
|
||||
+ else if (STREQ (type, "dos")) {
|
||||
+ if (STREQ (distro, "msdos"))
|
||||
+ return safe_strdup (g, "msdos6.22");
|
||||
+ }
|
||||
+
|
||||
+ /* No ID could be guessed, return "unknown". */
|
||||
+ return safe_strdup (g, "unknown");
|
||||
+}
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,48 @@
|
||||
From 7dde1007525ec235e769351be15ca5de34eeda4a Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 18 Mar 2021 12:32:26 +0000
|
||||
Subject: [PATCH] appliance: Use <cpu mode="maximum"/> for -cpu max on libvirt.
|
||||
|
||||
Note this requires libvirt >= 7.1.0 which was only released in March 2021.
|
||||
|
||||
With an older libvirt you will see this error:
|
||||
|
||||
Original error from libvirt: unsupported configuration: Invalid mode attribute 'maximum' [code=67 int1=-1]
|
||||
|
||||
In theory we could check if this is supported by looking at the
|
||||
libvirt capabilities and fall back, but this commit does not do that,
|
||||
in the expectation that most people will be using the default backend
|
||||
(direct) and on Fedora/RHEL we will add an explicit minimum version
|
||||
dependency to the package.
|
||||
|
||||
qemu support has been around quite a bit longer (at least since 2017).
|
||||
|
||||
Fixes: commit 30f74f38bd6e42e783ba80895f4d6826abddd417
|
||||
(cherry picked from commit 13ceb6a87b2869909a6a0e3c8caa962b72e4cb0e)
|
||||
---
|
||||
lib/launch-libvirt.c | 9 ++-------
|
||||
1 file changed, 2 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
|
||||
index e3ff1ffe0..db619910f 100644
|
||||
--- a/lib/launch-libvirt.c
|
||||
+++ b/lib/launch-libvirt.c
|
||||
@@ -1170,13 +1170,8 @@ construct_libvirt_xml_cpu (guestfs_h *g,
|
||||
} end_element ();
|
||||
}
|
||||
else if (STREQ (cpu_model, "max")) {
|
||||
- if (params->data->is_kvm)
|
||||
- attribute ("mode", "host-passthrough");
|
||||
- else
|
||||
- attribute ("mode", "host-model");
|
||||
- start_element ("model") {
|
||||
- attribute ("fallback", "allow");
|
||||
- } end_element ();
|
||||
+ /* https://bugzilla.redhat.com/show_bug.cgi?id=1935572#c11 */
|
||||
+ attribute ("mode", "maximum");
|
||||
}
|
||||
else
|
||||
single_element ("model", cpu_model);
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,99 +0,0 @@
|
||||
From ee00f39eea1c97c5fcb9948b30586c9c106356d7 Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Wed, 21 Feb 2018 17:37:30 +0100
|
||||
Subject: [PATCH] inspector: show the per-OS osinfo guess (RHBZ#1544842)
|
||||
|
||||
Output also the osinfo guess for each OS in the generated XML output;
|
||||
adapt the RNG schema, and the test data to it.
|
||||
|
||||
(cherry picked from commit 2f8ec91fc1f3e81c8fb81d45849bc7462ee13642)
|
||||
---
|
||||
inspector/expected-coreos.img.xml | 1 +
|
||||
inspector/expected-debian.img.xml | 1 +
|
||||
inspector/expected-fedora.img.xml | 1 +
|
||||
inspector/expected-ubuntu.img.xml | 1 +
|
||||
inspector/inspector.c | 7 +++++++
|
||||
inspector/virt-inspector.rng | 1 +
|
||||
6 files changed, 12 insertions(+)
|
||||
|
||||
diff --git a/inspector/expected-coreos.img.xml b/inspector/expected-coreos.img.xml
|
||||
index e4a5d1134..0cdfba6e6 100644
|
||||
--- a/inspector/expected-coreos.img.xml
|
||||
+++ b/inspector/expected-coreos.img.xml
|
||||
@@ -8,6 +8,7 @@
|
||||
<major_version>899</major_version>
|
||||
<minor_version>13</minor_version>
|
||||
<hostname>coreos.invalid</hostname>
|
||||
+ <osinfo>coreos899.13</osinfo>
|
||||
<mountpoints>
|
||||
<mountpoint dev="/dev/sda5">/</mountpoint>
|
||||
<mountpoint dev="/dev/sda3">/usr</mountpoint>
|
||||
diff --git a/inspector/expected-debian.img.xml b/inspector/expected-debian.img.xml
|
||||
index 37ecfa049..6583dc262 100644
|
||||
--- a/inspector/expected-debian.img.xml
|
||||
+++ b/inspector/expected-debian.img.xml
|
||||
@@ -11,6 +11,7 @@
|
||||
<package_format>deb</package_format>
|
||||
<package_management>apt</package_management>
|
||||
<hostname>debian.invalid</hostname>
|
||||
+ <osinfo>debian5</osinfo>
|
||||
<mountpoints>
|
||||
<mountpoint dev="/dev/debian/root">/</mountpoint>
|
||||
<mountpoint dev="/dev/debian/usr">/usr</mountpoint>
|
||||
diff --git a/inspector/expected-fedora.img.xml b/inspector/expected-fedora.img.xml
|
||||
index 8d40e8cb7..df6060a73 100644
|
||||
--- a/inspector/expected-fedora.img.xml
|
||||
+++ b/inspector/expected-fedora.img.xml
|
||||
@@ -11,6 +11,7 @@
|
||||
<package_format>rpm</package_format>
|
||||
<package_management>yum</package_management>
|
||||
<hostname>fedora.invalid</hostname>
|
||||
+ <osinfo>fedora14</osinfo>
|
||||
<mountpoints>
|
||||
<mountpoint dev="/dev/VG/Root">/</mountpoint>
|
||||
<mountpoint dev="/dev/sda1">/boot</mountpoint>
|
||||
diff --git a/inspector/expected-ubuntu.img.xml b/inspector/expected-ubuntu.img.xml
|
||||
index c19c14cd5..4ebcd76d6 100644
|
||||
--- a/inspector/expected-ubuntu.img.xml
|
||||
+++ b/inspector/expected-ubuntu.img.xml
|
||||
@@ -11,6 +11,7 @@
|
||||
<package_format>deb</package_format>
|
||||
<package_management>apt</package_management>
|
||||
<hostname>ubuntu.invalid</hostname>
|
||||
+ <osinfo>ubuntu10.10</osinfo>
|
||||
<mountpoints>
|
||||
<mountpoint dev="/dev/sda2">/</mountpoint>
|
||||
<mountpoint dev="/dev/sda1">/boot</mountpoint>
|
||||
diff --git a/inspector/inspector.c b/inspector/inspector.c
|
||||
index d608b1b63..5075a8f04 100644
|
||||
--- a/inspector/inspector.c
|
||||
+++ b/inspector/inspector.c
|
||||
@@ -443,6 +443,13 @@ output_root (xmlTextWriterPtr xo, char *root)
|
||||
BAD_CAST str));
|
||||
free (str);
|
||||
|
||||
+ str = guestfs_inspect_get_osinfo (g, root);
|
||||
+ if (!str) exit (EXIT_FAILURE);
|
||||
+ if (STRNEQ (str, "unknown"))
|
||||
+ XMLERROR (-1,
|
||||
+ xmlTextWriterWriteElement (xo, BAD_CAST "osinfo", BAD_CAST str));
|
||||
+ free (str);
|
||||
+
|
||||
output_mountpoints (xo, root);
|
||||
|
||||
output_filesystems (xo, root);
|
||||
diff --git a/inspector/virt-inspector.rng b/inspector/virt-inspector.rng
|
||||
index 314785202..1e3a58af8 100644
|
||||
--- a/inspector/virt-inspector.rng
|
||||
+++ b/inspector/virt-inspector.rng
|
||||
@@ -38,6 +38,7 @@
|
||||
<optional><ref name="ospackageformat"/></optional>
|
||||
<optional><ref name="ospackagemanagement"/></optional>
|
||||
<optional><element name="hostname"><text/></element></optional>
|
||||
+ <optional><element name="osinfo"><text/></element></optional>
|
||||
|
||||
<ref name="mountpoints"/>
|
||||
<ref name="filesystems"/>
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,92 @@
|
||||
From bb19cc0cdd43619ccf830e1e608f79e46f8ddf86 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 12 May 2022 08:36:37 +0100
|
||||
Subject: [PATCH] lib: Disable 5-level page tables when using -cpu max
|
||||
|
||||
In https://bugzilla.redhat.com/show_bug.cgi?id=2082806 we've been
|
||||
tracking an insidious qemu bug which intermittently prevents the
|
||||
libguestfs appliance from starting. The symptoms are that SeaBIOS
|
||||
starts and displays its messages, but the kernel isn't reached. We
|
||||
found that the kernel does in fact start, but when it tries to set up
|
||||
page tables and jump to protected mode it gets a triple fault which
|
||||
causes the emulated CPU in qemu to reset (qemu exits).
|
||||
|
||||
This seems to only affect TCG (not KVM).
|
||||
|
||||
Yesterday I found that this is caused by using -cpu max which enables
|
||||
the "la57" feature (5-level page tables[0]), and that we can make the
|
||||
problem go away using -cpu max,la57=off. Note that I still don't
|
||||
fully understand the qemu bug, so this is only a workaround.
|
||||
|
||||
I chose to disable 5-level page tables for both TCG and KVM, partly to
|
||||
make the patch simpler, and partly because I guess it's not a feature
|
||||
(ie. 57 bit linear addresses) that is useful for the libguestfs
|
||||
appliance case, where we have limited physical memory and no need to
|
||||
run any programs with huge address spaces.
|
||||
|
||||
I tested this by running both the direct & libvirt paths overnight. I
|
||||
expect that this patch will fail with old qemu/libvirt which doesn't
|
||||
understand the "la57" feature, but this is only intended as a
|
||||
temporary workaround.
|
||||
|
||||
[0] Article about 5-level page tables as background:
|
||||
https://lwn.net/Articles/717293/
|
||||
|
||||
Thanks: Laszlo Ersek
|
||||
Fixes: https://answers.launchpad.net/ubuntu/+source/libguestfs/+question/701625
|
||||
|
||||
[RHEL 8.7: Patch is not upstream. This is the initial patch as posted
|
||||
to the mailing list here:
|
||||
https://listman.redhat.com/archives/libguestfs/2022-May/028853.html]
|
||||
---
|
||||
lib/launch-direct.c | 15 +++++++++++++--
|
||||
lib/launch-libvirt.c | 7 +++++++
|
||||
2 files changed, 20 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/launch-direct.c b/lib/launch-direct.c
|
||||
index de17d2167..6b28e4724 100644
|
||||
--- a/lib/launch-direct.c
|
||||
+++ b/lib/launch-direct.c
|
||||
@@ -534,8 +534,19 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
|
||||
} end_list ();
|
||||
|
||||
cpu_model = guestfs_int_get_cpu_model (has_kvm && !force_tcg);
|
||||
- if (cpu_model)
|
||||
- arg ("-cpu", cpu_model);
|
||||
+ if (cpu_model) {
|
||||
+#if defined(__x86_64__)
|
||||
+ /* Temporary workaround for RHBZ#2082806 */
|
||||
+ if (STREQ (cpu_model, "max")) {
|
||||
+ start_list ("-cpu") {
|
||||
+ append_list (cpu_model);
|
||||
+ append_list ("la57=off");
|
||||
+ } end_list ();
|
||||
+ }
|
||||
+ else
|
||||
+#endif
|
||||
+ arg ("-cpu", cpu_model);
|
||||
+ }
|
||||
|
||||
if (g->smp > 1)
|
||||
arg_format ("-smp", "%d", g->smp);
|
||||
diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
|
||||
index db619910f..bad4a54ea 100644
|
||||
--- a/lib/launch-libvirt.c
|
||||
+++ b/lib/launch-libvirt.c
|
||||
@@ -1172,6 +1172,13 @@ construct_libvirt_xml_cpu (guestfs_h *g,
|
||||
else if (STREQ (cpu_model, "max")) {
|
||||
/* https://bugzilla.redhat.com/show_bug.cgi?id=1935572#c11 */
|
||||
attribute ("mode", "maximum");
|
||||
+#if defined(__x86_64__)
|
||||
+ /* Temporary workaround for RHBZ#2082806 */
|
||||
+ start_element ("feature") {
|
||||
+ attribute ("policy", "disable");
|
||||
+ attribute ("name", "la57");
|
||||
+ } end_element ();
|
||||
+#endif
|
||||
}
|
||||
else
|
||||
single_element ("model", cpu_model);
|
||||
--
|
||||
2.31.1
|
||||
|
103
SOURCES/0023-docs-guestfs-security-document-CVE-2022-2211.patch
Normal file
103
SOURCES/0023-docs-guestfs-security-document-CVE-2022-2211.patch
Normal file
@ -0,0 +1,103 @@
|
||||
From 22d779d5982dc82d629710d41973ed6545707bd9 Mon Sep 17 00:00:00 2001
|
||||
From: Laszlo Ersek <lersek@redhat.com>
|
||||
Date: Tue, 28 Jun 2022 13:54:16 +0200
|
||||
Subject: [PATCH] docs/guestfs-security: document CVE-2022-2211
|
||||
|
||||
Short log for the common submodule, commit range
|
||||
f8de5508fe75..35467027f657:
|
||||
|
||||
Laszlo Ersek (2):
|
||||
mlcustomize: factor out pkg install/update/uninstall from guestfs-tools
|
||||
options: fix buffer overflow in get_keys() [CVE-2022-2211]
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1809453
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2100862
|
||||
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
||||
Message-Id: <20220628115418.5376-2-lersek@redhat.com>
|
||||
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
|
||||
Cherry picked from commit 99844660b48ed809e37378262c65d63df6ce4a53.
|
||||
For the cherry pick I only added one submodule commit:
|
||||
|
||||
options: fix buffer overflow in get_keys() [CVE-2022-2211]
|
||||
---
|
||||
common | 2 +-
|
||||
docs/guestfs-security.pod | 28 ++++++++++++++++++++++++++++
|
||||
2 files changed, 29 insertions(+), 1 deletion(-)
|
||||
|
||||
Submodule common be09523d6..1174b443a:
|
||||
diff --git a/common/options/keys.c b/common/options/keys.c
|
||||
index 798315c..d27a712 100644
|
||||
--- a/common/options/keys.c
|
||||
+++ b/common/options/keys.c
|
||||
@@ -128,17 +128,23 @@ read_first_line_from_file (const char *filename)
|
||||
char **
|
||||
get_keys (struct key_store *ks, const char *device, const char *uuid)
|
||||
{
|
||||
- size_t i, j, len;
|
||||
+ size_t i, j, nmemb;
|
||||
char **r;
|
||||
char *s;
|
||||
|
||||
/* We know the returned list must have at least one element and not
|
||||
* more than ks->nr_keys.
|
||||
*/
|
||||
- len = 1;
|
||||
- if (ks)
|
||||
- len = MIN (1, ks->nr_keys);
|
||||
- r = calloc (len+1, sizeof (char *));
|
||||
+ nmemb = 1;
|
||||
+ if (ks && ks->nr_keys > nmemb)
|
||||
+ nmemb = ks->nr_keys;
|
||||
+
|
||||
+ /* make room for the terminating NULL */
|
||||
+ if (nmemb == (size_t)-1)
|
||||
+ error (EXIT_FAILURE, 0, _("size_t overflow"));
|
||||
+ nmemb++;
|
||||
+
|
||||
+ r = calloc (nmemb, sizeof (char *));
|
||||
if (r == NULL)
|
||||
error (EXIT_FAILURE, errno, "calloc");
|
||||
|
||||
diff --git a/docs/guestfs-security.pod b/docs/guestfs-security.pod
|
||||
index 9ceef5623..efa35b29d 100644
|
||||
--- a/docs/guestfs-security.pod
|
||||
+++ b/docs/guestfs-security.pod
|
||||
@@ -406,6 +406,34 @@ The libvirt backend is not affected.
|
||||
The solution is to update qemu to a version containing the fix (see
|
||||
L<https://lists.gnu.org/archive/html/qemu-devel/2018-06/msg01012.html>).
|
||||
|
||||
+=head2 CVE-2022-2211
|
||||
+
|
||||
+L<https://bugzilla.redhat.com/CVE-2022-2211>
|
||||
+
|
||||
+The C<get_keys> function in F<libguestfs-common/options/keys.c> collects
|
||||
+those I<--key> options from the command line into a new array that match
|
||||
+a particular block device that's being decrypted for inspection. The
|
||||
+function intends to size the result array such that potentially all
|
||||
+I<--key> options, plus a terminating C<NULL> element, fit into it. The
|
||||
+code mistakenly uses the C<MIN> macro instead of C<MAX>, and therefore
|
||||
+only one element is allocated before the C<NULL> terminator.
|
||||
+
|
||||
+Passing precisely two I<--key ID:...> options on the command line for
|
||||
+the encrypted block device C<ID> causes C<get_keys> to overwrite the
|
||||
+terminating C<NULL>, leading to an out-of-bounds read in
|
||||
+C<decrypt_mountables>, file F<libguestfs-common/options/decrypt.c>.
|
||||
+
|
||||
+Passing more than two I<--key ID:...> options on the command line for
|
||||
+the encrypted block device C<ID> causes C<get_keys> itself to perform
|
||||
+out-of-bounds writes. The most common symptom is a crash with C<SIGSEGV>
|
||||
+later on.
|
||||
+
|
||||
+This issue affects -- broadly speaking -- all libguestfs-based utilities
|
||||
+that accept I<--key>, namely: C<guestfish>, C<guestmount>, C<virt-cat>,
|
||||
+C<virt-customize>, C<virt-diff>, C<virt-edit>, C<virt-get-kernel>,
|
||||
+C<virt-inspector>, C<virt-log>, C<virt-ls>, C<virt-sparsify>,
|
||||
+C<virt-sysprep>, C<virt-tail>, C<virt-v2v>.
|
||||
+
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<guestfs(3)>,
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,90 +0,0 @@
|
||||
From 5917bdc15f3b2e0c96ba5a9860cd36f968a28ec2 Mon Sep 17 00:00:00 2001
|
||||
From: Nir Soffer <nirsof@gmail.com>
|
||||
Date: Thu, 14 Jun 2018 21:16:01 +0300
|
||||
Subject: [PATCH] v2v: -o rhv-upload: Optimize http request sending
|
||||
|
||||
When sending request with small or no payload, it is simpler and
|
||||
possibly more efficient to use the high level HTTPSConnection.request(),
|
||||
instead of the lower level APIs.
|
||||
|
||||
The only reason to use the lower level APIs is to avoid copying the
|
||||
payload, or on python 2, to use a bigger buffer size when streaming a
|
||||
file-like object.
|
||||
|
||||
(cherry picked from commit 77a412c0a1cd0e303a072fc5088c8f3bfed36583)
|
||||
---
|
||||
v2v/rhv-upload-plugin.py | 35 ++++++++++++++++-------------------
|
||||
1 file changed, 16 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
|
||||
index b4557b83c..9ad354b84 100644
|
||||
--- a/v2v/rhv-upload-plugin.py
|
||||
+++ b/v2v/rhv-upload-plugin.py
|
||||
@@ -237,12 +237,12 @@ def pread(h, count, offset):
|
||||
transfer = h['transfer']
|
||||
transfer_service = h['transfer_service']
|
||||
|
||||
- http.putrequest("GET", h['path'])
|
||||
+ headers = {"Range", "bytes=%d-%d" % (offset, offset+count-1)}
|
||||
# Authorization is only needed for old imageio.
|
||||
if h['needs_auth']:
|
||||
- http.putheader("Authorization", transfer.signed_ticket)
|
||||
- http.putheader("Range", "bytes=%d-%d" % (offset, offset+count-1))
|
||||
- http.endheaders()
|
||||
+ headers["Authorization"] = transfer.signed_ticket
|
||||
+
|
||||
+ http.request("GET", h['path'], headers=headers)
|
||||
|
||||
r = http.getresponse()
|
||||
# 206 = HTTP Partial Content.
|
||||
@@ -297,11 +297,10 @@ def zero(h, count, offset, may_trim):
|
||||
'size': count,
|
||||
'flush': False}).encode()
|
||||
|
||||
- http.putrequest("PATCH", h['path'])
|
||||
- http.putheader("Content-Type", "application/json")
|
||||
- http.putheader("Content-Length", len(buf))
|
||||
- http.endheaders()
|
||||
- http.send(buf)
|
||||
+ headers = {"Content-Type": "application/json",
|
||||
+ "Content-Length": str(len(buf))}
|
||||
+
|
||||
+ http.request("PATCH", h['path'], body=buf, headers=headers)
|
||||
|
||||
r = http.getresponse()
|
||||
if r.status != 200:
|
||||
@@ -349,11 +348,10 @@ def trim(h, count, offset):
|
||||
'size': count,
|
||||
'flush': False}).encode()
|
||||
|
||||
- http.putrequest("PATCH", h['path'])
|
||||
- http.putheader("Content-Type", "application/json")
|
||||
- http.putheader("Content-Length", len(buf))
|
||||
- http.endheaders()
|
||||
- http.send(buf)
|
||||
+ headers = {"Content-Type": "application/json",
|
||||
+ "Content-Length": str(len(buf))}
|
||||
+
|
||||
+ http.request("PATCH", h['path'], body=buf, headers=headers)
|
||||
|
||||
r = http.getresponse()
|
||||
if r.status != 200:
|
||||
@@ -370,11 +368,10 @@ def flush(h):
|
||||
# Construct the JSON request for flushing.
|
||||
buf = json.dumps({'op': "flush"}).encode()
|
||||
|
||||
- http.putrequest("PATCH", h['path'])
|
||||
- http.putheader("Content-Type", "application/json")
|
||||
- http.putheader("Content-Length", len(buf))
|
||||
- http.endheaders()
|
||||
- http.send(buf)
|
||||
+ headers = {"Content-Type": "application/json",
|
||||
+ "Content-Length": str(len(buf))}
|
||||
+
|
||||
+ http.request("PATCH", h['path'], body=buf, headers=headers)
|
||||
|
||||
r = http.getresponse()
|
||||
if r.status != 200:
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,153 +0,0 @@
|
||||
From c2ed35e2bc17bcacf333626b21cd6796d4d8d6cf Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 5 Jun 2018 13:27:43 +0100
|
||||
Subject: [PATCH] v2v: -o rhv-upload: Log full imageio response on failure.
|
||||
|
||||
Thanks: Nir Soffer
|
||||
(cherry picked from commit 831a75cd11c5a87e40fccdadcb62353f6a4d5a72)
|
||||
---
|
||||
v2v/rhv-upload-plugin.py | 69 ++++++++++++++++++++++++----------------
|
||||
1 file changed, 42 insertions(+), 27 deletions(-)
|
||||
|
||||
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
|
||||
index 9ad354b84..7c5084efd 100644
|
||||
--- a/v2v/rhv-upload-plugin.py
|
||||
+++ b/v2v/rhv-upload-plugin.py
|
||||
@@ -227,6 +227,32 @@ def can_flush(h):
|
||||
def get_size(h):
|
||||
return params['disk_size']
|
||||
|
||||
+# Any unexpected HTTP response status from the server will end up
|
||||
+# calling this function which logs the full error, pauses the
|
||||
+# transfer, sets the failed state, and raises a RuntimeError
|
||||
+# exception.
|
||||
+def request_failed(h, r, msg):
|
||||
+ # Setting the failed flag in the handle causes the disk to be
|
||||
+ # cleaned up on close.
|
||||
+ h['failed'] = True
|
||||
+ h['transfer_service'].pause()
|
||||
+
|
||||
+ status = r.status
|
||||
+ reason = r.reason
|
||||
+ try:
|
||||
+ body = r.read()
|
||||
+ except EnvironmentError as e:
|
||||
+ body = "(Unable to read response body: %s)" % e
|
||||
+
|
||||
+ # Log the full error if we're verbose.
|
||||
+ debug("unexpected response from imageio server:")
|
||||
+ debug(msg)
|
||||
+ debug("%d: %s" % (status, reason))
|
||||
+ debug(body)
|
||||
+
|
||||
+ # Only a short error is included in the exception.
|
||||
+ raise RuntimeError("%s: %d %s: %r", msg, status, reason, body[:200])
|
||||
+
|
||||
# For documentation see:
|
||||
# https://github.com/oVirt/ovirt-imageio/blob/master/docs/random-io.md
|
||||
# For examples of working code to read/write from the server, see:
|
||||
@@ -247,16 +273,14 @@ def pread(h, count, offset):
|
||||
r = http.getresponse()
|
||||
# 206 = HTTP Partial Content.
|
||||
if r.status != 206:
|
||||
- h['transfer_service'].pause()
|
||||
- h['failed'] = True
|
||||
- raise RuntimeError("could not read sector (%d, %d): %d: %s" %
|
||||
- (offset, count, r.status, r.reason))
|
||||
+ request_failed(h, r,
|
||||
+ "could not read sector offset %d size %d" %
|
||||
+ (offset, count))
|
||||
return r.read()
|
||||
|
||||
def pwrite(h, buf, offset):
|
||||
http = h['http']
|
||||
transfer = h['transfer']
|
||||
- transfer_service = h['transfer_service']
|
||||
|
||||
count = len(buf)
|
||||
h['highestwrite'] = max(h['highestwrite'], offset+count)
|
||||
@@ -274,15 +298,13 @@ def pwrite(h, buf, offset):
|
||||
|
||||
r = http.getresponse()
|
||||
if r.status != 200:
|
||||
- transfer_service.pause()
|
||||
- h['failed'] = True
|
||||
- raise RuntimeError("could not write sector (%d, %d): %d: %s" %
|
||||
- (offset, count, r.status, r.reason))
|
||||
+ request_failed(h, r,
|
||||
+ "could not write sector offset %d size %d" %
|
||||
+ (offset, count))
|
||||
|
||||
def zero(h, count, offset, may_trim):
|
||||
http = h['http']
|
||||
transfer = h['transfer']
|
||||
- transfer_service = h['transfer_service']
|
||||
|
||||
# Unlike the trim and flush calls, there is no 'can_zero' method
|
||||
# so nbdkit could call this even if the server doesn't support
|
||||
@@ -304,10 +326,9 @@ def zero(h, count, offset, may_trim):
|
||||
|
||||
r = http.getresponse()
|
||||
if r.status != 200:
|
||||
- transfer_service.pause()
|
||||
- h['failed'] = True
|
||||
- raise RuntimeError("could not zero sector (%d, %d): %d: %s" %
|
||||
- (offset, count, r.status, r.reason))
|
||||
+ request_failed(h, r,
|
||||
+ "could not zero sector offset %d size %d" %
|
||||
+ (offset, count))
|
||||
|
||||
def emulate_zero(h, count, offset):
|
||||
# qemu-img convert starts by trying to zero/trim the whole device.
|
||||
@@ -332,15 +353,13 @@ def emulate_zero(h, count, offset):
|
||||
|
||||
r = http.getresponse()
|
||||
if r.status != 200:
|
||||
- transfer_service.pause()
|
||||
- h['failed'] = True
|
||||
- raise RuntimeError("could not write zeroes (%d, %d): %d: %s" %
|
||||
- (offset, count, r.status, r.reason))
|
||||
+ request_failed(h, r,
|
||||
+ "could not write zeroes offset %d size %d" %
|
||||
+ (offset, count))
|
||||
|
||||
def trim(h, count, offset):
|
||||
http = h['http']
|
||||
transfer = h['transfer']
|
||||
- transfer_service = h['transfer_service']
|
||||
|
||||
# Construct the JSON request for trimming.
|
||||
buf = json.dumps({'op': "trim",
|
||||
@@ -355,15 +374,13 @@ def trim(h, count, offset):
|
||||
|
||||
r = http.getresponse()
|
||||
if r.status != 200:
|
||||
- transfer_service.pause()
|
||||
- h['failed'] = True
|
||||
- raise RuntimeError("could not trim sector (%d, %d): %d: %s" %
|
||||
- (offset, count, r.status, r.reason))
|
||||
+ request_failed(h, r,
|
||||
+ "could not trim sector offset %d size %d" %
|
||||
+ (offset, count))
|
||||
|
||||
def flush(h):
|
||||
http = h['http']
|
||||
transfer = h['transfer']
|
||||
- transfer_service = h['transfer_service']
|
||||
|
||||
# Construct the JSON request for flushing.
|
||||
buf = json.dumps({'op': "flush"}).encode()
|
||||
@@ -375,9 +392,7 @@ def flush(h):
|
||||
|
||||
r = http.getresponse()
|
||||
if r.status != 200:
|
||||
- transfer_service.pause()
|
||||
- h['failed'] = True
|
||||
- raise RuntimeError("could not flush: %d: %s" % (r.status, r.reason))
|
||||
+ request_failed(h, r, "could not flush")
|
||||
|
||||
def delete_disk_on_failure(h):
|
||||
disk_service = h['disk_service']
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,112 +0,0 @@
|
||||
From 6cd873ff9a6ba6fed0534a253148b4daf48f0190 Mon Sep 17 00:00:00 2001
|
||||
From: Nir Soffer <nirsof@gmail.com>
|
||||
Date: Mon, 25 Jun 2018 19:22:13 +0300
|
||||
Subject: [PATCH] v2v: rvh-upload-plugin: Always read the response
|
||||
|
||||
Python manual warns[1]:
|
||||
|
||||
Note that you must have read the whole response before you can send
|
||||
a new request to the server.
|
||||
|
||||
The reason for this warning is exposed only when the server is using
|
||||
keep alive connections. When the response is not read, sending a new
|
||||
request will fail with:
|
||||
|
||||
httplib.ResponseNotReady
|
||||
|
||||
Even if Content-Length was 0 or the request has no content. The failure
|
||||
looks like this when using --verbose:
|
||||
|
||||
nbdkit: python[1]: debug: zero count=33554432 offset=0 may_trim=1 fua=0
|
||||
nbdkit: python[1]: debug: zero count=33554432 offset=33554432 may_trim=1 fua=0
|
||||
nbdkit: python[1]: error: /home/nsoffer/src/libguestfs/tmp/rhvupload.Au2B5I/rhv-upload-plugin.py: zero: error: Request-sent
|
||||
nbdkit: python[1]: debug: sending error reply: Input/output error
|
||||
qemu-img: error writing zeroes at offset 0: Input/output error
|
||||
|
||||
Change all requests to read the whole response.
|
||||
|
||||
Tested with imageio patch supporting keep alive connections:
|
||||
https://gerrit.ovirt.org/#/c/92296/
|
||||
|
||||
[1] https://docs.python.org/3.8/library/http.client.html#http.client.HTTPConnection.getresponse
|
||||
|
||||
(cherry picked from commit f4e0a8342dbeb2c779c76e1807a37b24a0c96feb)
|
||||
---
|
||||
v2v/rhv-upload-plugin.py | 15 ++++++++++++++-
|
||||
1 file changed, 14 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
|
||||
index 7c5084efd..2eec375f7 100644
|
||||
--- a/v2v/rhv-upload-plugin.py
|
||||
+++ b/v2v/rhv-upload-plugin.py
|
||||
@@ -197,11 +197,13 @@ def get_options(h):
|
||||
http.endheaders()
|
||||
|
||||
r = http.getresponse()
|
||||
+ data = r.read()
|
||||
+
|
||||
if r.status == 200:
|
||||
# New imageio never needs authentication.
|
||||
h['needs_auth'] = False
|
||||
|
||||
- j = json.loads(r.read())
|
||||
+ j = json.loads(data)
|
||||
h['can_zero'] = "zero" in j['features']
|
||||
h['can_trim'] = "trim" in j['features']
|
||||
h['can_flush'] = "flush" in j['features']
|
||||
@@ -276,6 +278,7 @@ def pread(h, count, offset):
|
||||
request_failed(h, r,
|
||||
"could not read sector offset %d size %d" %
|
||||
(offset, count))
|
||||
+
|
||||
return r.read()
|
||||
|
||||
def pwrite(h, buf, offset):
|
||||
@@ -302,6 +305,8 @@ def pwrite(h, buf, offset):
|
||||
"could not write sector offset %d size %d" %
|
||||
(offset, count))
|
||||
|
||||
+ r.read()
|
||||
+
|
||||
def zero(h, count, offset, may_trim):
|
||||
http = h['http']
|
||||
transfer = h['transfer']
|
||||
@@ -330,6 +335,8 @@ def zero(h, count, offset, may_trim):
|
||||
"could not zero sector offset %d size %d" %
|
||||
(offset, count))
|
||||
|
||||
+ r.read()
|
||||
+
|
||||
def emulate_zero(h, count, offset):
|
||||
# qemu-img convert starts by trying to zero/trim the whole device.
|
||||
# Since we've just created a new disk it's safe to ignore these
|
||||
@@ -357,6 +364,8 @@ def emulate_zero(h, count, offset):
|
||||
"could not write zeroes offset %d size %d" %
|
||||
(offset, count))
|
||||
|
||||
+ r.read()
|
||||
+
|
||||
def trim(h, count, offset):
|
||||
http = h['http']
|
||||
transfer = h['transfer']
|
||||
@@ -378,6 +387,8 @@ def trim(h, count, offset):
|
||||
"could not trim sector offset %d size %d" %
|
||||
(offset, count))
|
||||
|
||||
+ r.read()
|
||||
+
|
||||
def flush(h):
|
||||
http = h['http']
|
||||
transfer = h['transfer']
|
||||
@@ -394,6 +405,8 @@ def flush(h):
|
||||
if r.status != 200:
|
||||
request_failed(h, r, "could not flush")
|
||||
|
||||
+ r.read()
|
||||
+
|
||||
def delete_disk_on_failure(h):
|
||||
disk_service = h['disk_service']
|
||||
disk_service.remove()
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,35 +0,0 @@
|
||||
From 47fd85a883892e2070a2287cc9411896645ab3bf Mon Sep 17 00:00:00 2001
|
||||
From: Nir Soffer <nirsof@gmail.com>
|
||||
Date: Mon, 25 Jun 2018 20:56:52 +0300
|
||||
Subject: [PATCH] v2v: rhv-upload-plugin: Fix name error
|
||||
|
||||
"http" and "transfer" variables were missing in emulate_zero, so the
|
||||
code would fail with NameError. This can happen only when communicating
|
||||
with old imageio versions not supporting the "zero" feature.
|
||||
|
||||
Testing with qemu-img 2.12 show that we never send emulated zero request
|
||||
because of the highestwrite mechanism, but it can break with older
|
||||
qemu-img-rhev used on RHEL.
|
||||
|
||||
(cherry picked from commit 0ae61ce99c351f9cda598016fb55ccc50313df67)
|
||||
---
|
||||
v2v/rhv-upload-plugin.py | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
|
||||
index 2eec375f7..10887c031 100644
|
||||
--- a/v2v/rhv-upload-plugin.py
|
||||
+++ b/v2v/rhv-upload-plugin.py
|
||||
@@ -338,6 +338,9 @@ def zero(h, count, offset, may_trim):
|
||||
r.read()
|
||||
|
||||
def emulate_zero(h, count, offset):
|
||||
+ http = h['http']
|
||||
+ transfer = h['transfer']
|
||||
+
|
||||
# qemu-img convert starts by trying to zero/trim the whole device.
|
||||
# Since we've just created a new disk it's safe to ignore these
|
||||
# requests as long as they are smaller than the highest write seen.
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,52 +0,0 @@
|
||||
From 6e683fa651864a04a1c4e2a326d84cfc9330d706 Mon Sep 17 00:00:00 2001
|
||||
From: Nir Soffer <nirsof@gmail.com>
|
||||
Date: Tue, 26 Jun 2018 01:43:01 +0300
|
||||
Subject: [PATCH] v2v: rhv-upload-plugin: Remove unused variables
|
||||
|
||||
Remove some instances of "transfer" and "transfer_service" that are not
|
||||
used in current code.
|
||||
|
||||
(cherry picked from commit 32ab53cecd78ee5c140f17e5792710698627d265)
|
||||
---
|
||||
v2v/rhv-upload-plugin.py | 4 ----
|
||||
1 file changed, 4 deletions(-)
|
||||
|
||||
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
|
||||
index 10887c031..5c036c46a 100644
|
||||
--- a/v2v/rhv-upload-plugin.py
|
||||
+++ b/v2v/rhv-upload-plugin.py
|
||||
@@ -263,7 +263,6 @@ def request_failed(h, r, msg):
|
||||
def pread(h, count, offset):
|
||||
http = h['http']
|
||||
transfer = h['transfer']
|
||||
- transfer_service = h['transfer_service']
|
||||
|
||||
headers = {"Range", "bytes=%d-%d" % (offset, offset+count-1)}
|
||||
# Authorization is only needed for old imageio.
|
||||
@@ -309,7 +308,6 @@ def pwrite(h, buf, offset):
|
||||
|
||||
def zero(h, count, offset, may_trim):
|
||||
http = h['http']
|
||||
- transfer = h['transfer']
|
||||
|
||||
# Unlike the trim and flush calls, there is no 'can_zero' method
|
||||
# so nbdkit could call this even if the server doesn't support
|
||||
@@ -371,7 +369,6 @@ def emulate_zero(h, count, offset):
|
||||
|
||||
def trim(h, count, offset):
|
||||
http = h['http']
|
||||
- transfer = h['transfer']
|
||||
|
||||
# Construct the JSON request for trimming.
|
||||
buf = json.dumps({'op': "trim",
|
||||
@@ -394,7 +391,6 @@ def trim(h, count, offset):
|
||||
|
||||
def flush(h):
|
||||
http = h['http']
|
||||
- transfer = h['transfer']
|
||||
|
||||
# Construct the JSON request for flushing.
|
||||
buf = json.dumps({'op': "flush"}).encode()
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,122 +0,0 @@
|
||||
From 1d2058c08b9eff607127d199b574273100e9ba55 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 19 Jun 2018 18:02:21 +0100
|
||||
Subject: [PATCH] v2v: -o rhv-upload: Always fetch server options when opening
|
||||
the connection.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Previously we lazily requested the server options in the can_*
|
||||
callbacks. The can_* callbacks are always called by nbdkit straight
|
||||
after open, so this just adds complexity for no benefit. This change
|
||||
simply makes the code always fetch the server options during the open
|
||||
callback.
|
||||
|
||||
This is — functionally at least — mostly just refactoring. However I
|
||||
also added a useful debug message so we can see what features the
|
||||
imageio server is offering.
|
||||
|
||||
(cherry picked from commit a1e1f6ec887c2a7973612d2edf7066fd3194ba0b)
|
||||
---
|
||||
v2v/rhv-upload-plugin.py | 63 +++++++++++++++++++---------------------
|
||||
1 file changed, 30 insertions(+), 33 deletions(-)
|
||||
|
||||
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
|
||||
index 5c036c46a..f215eaecf 100644
|
||||
--- a/v2v/rhv-upload-plugin.py
|
||||
+++ b/v2v/rhv-upload-plugin.py
|
||||
@@ -165,34 +165,13 @@ def open(readonly):
|
||||
context = context
|
||||
)
|
||||
|
||||
- # Save everything we need to make requests in the handle.
|
||||
- return {
|
||||
- 'can_flush': False,
|
||||
- 'can_trim': False,
|
||||
- 'can_zero': False,
|
||||
- 'connection': connection,
|
||||
- 'disk': disk,
|
||||
- 'disk_service': disk_service,
|
||||
- 'failed': False,
|
||||
- 'got_options': False,
|
||||
- 'highestwrite': 0,
|
||||
- 'http': http,
|
||||
- 'needs_auth': not params['rhv_direct'],
|
||||
- 'path': destination_url.path,
|
||||
- 'transfer': transfer,
|
||||
- 'transfer_service': transfer_service,
|
||||
- }
|
||||
+ # The first request is to fetch the features of the server.
|
||||
+ needs_auth = not params['rhv_direct']
|
||||
+ can_flush = False
|
||||
+ can_trim = False
|
||||
+ can_zero = False
|
||||
|
||||
-# Can we issue zero, trim or flush requests?
|
||||
-def get_options(h):
|
||||
- if h['got_options']:
|
||||
- return
|
||||
- h['got_options'] = True
|
||||
-
|
||||
- http = h['http']
|
||||
- transfer = h['transfer']
|
||||
-
|
||||
- http.putrequest("OPTIONS", h['path'])
|
||||
+ http.putrequest("OPTIONS", destination_url.path)
|
||||
http.putheader("Authorization", transfer.signed_ticket)
|
||||
http.endheaders()
|
||||
|
||||
@@ -201,12 +180,12 @@ def get_options(h):
|
||||
|
||||
if r.status == 200:
|
||||
# New imageio never needs authentication.
|
||||
- h['needs_auth'] = False
|
||||
+ needs_auth = False
|
||||
|
||||
j = json.loads(data)
|
||||
- h['can_zero'] = "zero" in j['features']
|
||||
- h['can_trim'] = "trim" in j['features']
|
||||
- h['can_flush'] = "flush" in j['features']
|
||||
+ can_flush = "flush" in j['features']
|
||||
+ can_trim = "trim" in j['features']
|
||||
+ can_zero = "zero" in j['features']
|
||||
|
||||
# Old imageio servers returned either 405 Method Not Allowed or
|
||||
# 204 No Content (with an empty body). If we see that we leave
|
||||
@@ -218,12 +197,30 @@ def get_options(h):
|
||||
raise RuntimeError("could not use OPTIONS request: %d: %s" %
|
||||
(r.status, r.reason))
|
||||
|
||||
+ debug("imageio features: flush=%r trim=%r zero=%r" %
|
||||
+ (can_flush, can_trim, can_zero))
|
||||
+
|
||||
+ # Save everything we need to make requests in the handle.
|
||||
+ return {
|
||||
+ 'can_flush': can_flush,
|
||||
+ 'can_trim': can_trim,
|
||||
+ 'can_zero': can_zero,
|
||||
+ 'connection': connection,
|
||||
+ 'disk': disk,
|
||||
+ 'disk_service': disk_service,
|
||||
+ 'failed': False,
|
||||
+ 'highestwrite': 0,
|
||||
+ 'http': http,
|
||||
+ 'needs_auth': needs_auth,
|
||||
+ 'path': destination_url.path,
|
||||
+ 'transfer': transfer,
|
||||
+ 'transfer_service': transfer_service,
|
||||
+ }
|
||||
+
|
||||
def can_trim(h):
|
||||
- get_options(h)
|
||||
return h['can_trim']
|
||||
|
||||
def can_flush(h):
|
||||
- get_options(h)
|
||||
return h['can_flush']
|
||||
|
||||
def get_size(h):
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,141 +0,0 @@
|
||||
From db7e06935bfd20e02110549371a5174e68a45cf0 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 18 Jun 2018 15:34:37 +0100
|
||||
Subject: [PATCH] v2v: -o rhv-upload: Use Unix domain socket to access imageio
|
||||
(RHBZ#1588088).
|
||||
|
||||
In the case where virt-v2v runs on the same server as the imageio
|
||||
daemon that we are talking to, it may be possible to optimize access
|
||||
using a Unix domain socket.
|
||||
|
||||
This is only an optimization. If it fails or if we're not running on
|
||||
the same server it will fall back to the usual HTTPS over TCP
|
||||
connection.
|
||||
|
||||
Thanks: Nir Soffer, Daniel Erez.
|
||||
(cherry picked from commit b7a2e6270d53200d2df471c36a1fb2b46db8bbac)
|
||||
---
|
||||
v2v/rhv-upload-plugin.py | 61 ++++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 58 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
|
||||
index f215eaecf..8805e3552 100644
|
||||
--- a/v2v/rhv-upload-plugin.py
|
||||
+++ b/v2v/rhv-upload-plugin.py
|
||||
@@ -19,11 +19,12 @@
|
||||
import builtins
|
||||
import json
|
||||
import logging
|
||||
+import socket
|
||||
import ssl
|
||||
import sys
|
||||
import time
|
||||
|
||||
-from http.client import HTTPSConnection
|
||||
+from http.client import HTTPSConnection, HTTPConnection
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import ovirtsdk4 as sdk
|
||||
@@ -56,6 +57,28 @@ def debug(s):
|
||||
print(s, file=sys.stderr)
|
||||
sys.stderr.flush()
|
||||
|
||||
+def find_host(connection):
|
||||
+ """Return the current host object or None."""
|
||||
+ try:
|
||||
+ with builtins.open("/etc/vdsm/vdsm.id") as f:
|
||||
+ vdsm_id = f.readline().strip()
|
||||
+ except Exception as e:
|
||||
+ return None
|
||||
+ debug("hw_id = %r" % vdsm_id)
|
||||
+
|
||||
+ hosts_service = connection.system_service().hosts_service()
|
||||
+ hosts = hosts_service.list(
|
||||
+ search="hw_id=%s" % vdsm_id,
|
||||
+ case_sensitive=False,
|
||||
+ )
|
||||
+ if len(hosts) == 0:
|
||||
+ return None
|
||||
+
|
||||
+ host = hosts[0]
|
||||
+ debug("host.id = %r" % host.id)
|
||||
+
|
||||
+ return types.Host(id = host.id)
|
||||
+
|
||||
def open(readonly):
|
||||
# Parse out the username from the output_conn URL.
|
||||
parsed = urlparse(params['output_conn'])
|
||||
@@ -121,9 +144,11 @@ def open(readonly):
|
||||
transfers_service = system_service.image_transfers_service()
|
||||
|
||||
# Create a new image transfer.
|
||||
+ host = find_host(connection)
|
||||
transfer = transfers_service.add(
|
||||
types.ImageTransfer(
|
||||
disk = types.Disk(id = disk.id),
|
||||
+ host = host,
|
||||
inactivity_timeout = 3600,
|
||||
)
|
||||
)
|
||||
@@ -170,6 +195,7 @@ def open(readonly):
|
||||
can_flush = False
|
||||
can_trim = False
|
||||
can_zero = False
|
||||
+ unix_socket = None
|
||||
|
||||
http.putrequest("OPTIONS", destination_url.path)
|
||||
http.putheader("Authorization", transfer.signed_ticket)
|
||||
@@ -186,6 +212,7 @@ def open(readonly):
|
||||
can_flush = "flush" in j['features']
|
||||
can_trim = "trim" in j['features']
|
||||
can_zero = "zero" in j['features']
|
||||
+ unix_socket = j.get('unix_socket')
|
||||
|
||||
# Old imageio servers returned either 405 Method Not Allowed or
|
||||
# 204 No Content (with an empty body). If we see that we leave
|
||||
@@ -197,8 +224,17 @@ def open(readonly):
|
||||
raise RuntimeError("could not use OPTIONS request: %d: %s" %
|
||||
(r.status, r.reason))
|
||||
|
||||
- debug("imageio features: flush=%r trim=%r zero=%r" %
|
||||
- (can_flush, can_trim, can_zero))
|
||||
+ debug("imageio features: flush=%r trim=%r zero=%r unix_socket=%r" %
|
||||
+ (can_flush, can_trim, can_zero, unix_socket))
|
||||
+
|
||||
+ # If we are connected to imageio on the local host and the
|
||||
+ # transfer features a unix_socket then we can reconnect to that.
|
||||
+ if host is not None and unix_socket is not None:
|
||||
+ try:
|
||||
+ http = UnixHTTPConnection(unix_socket)
|
||||
+ debug("optimizing connection using unix socket %r" % unix_socket)
|
||||
+ except:
|
||||
+ pass
|
||||
|
||||
# Save everything we need to make requests in the handle.
|
||||
return {
|
||||
@@ -463,3 +499,22 @@ def close(h):
|
||||
raise
|
||||
|
||||
connection.close()
|
||||
+
|
||||
+# Modify http.client.HTTPConnection to work over a Unix domain socket.
|
||||
+# Derived from uhttplib written by Erik van Zijst under an MIT license.
|
||||
+# (https://pypi.org/project/uhttplib/)
|
||||
+# Ported to Python 3 by Irit Goihman.
|
||||
+
|
||||
+class UnsupportedError(Exception):
|
||||
+ pass
|
||||
+
|
||||
+class UnixHTTPConnection(HTTPConnection):
|
||||
+ def __init__(self, path, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
|
||||
+ self.path = path
|
||||
+ HTTPConnection.__init__(self, "localhost", timeout=timeout)
|
||||
+
|
||||
+ def connect(self):
|
||||
+ self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
+ if self.timeout is not socket._GLOBAL_DEFAULT_TIMEOUT:
|
||||
+ self.sock.settimeout(timeout)
|
||||
+ self.sock.connect(self.path)
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,29 +0,0 @@
|
||||
From da504873e18fc1414d670f318c10d5fb512e05dd Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Fri, 29 Jun 2018 12:58:33 +0200
|
||||
Subject: [PATCH] v2v: improve -os documentation for rhv-upload
|
||||
|
||||
Thanks to: Ming Xie
|
||||
|
||||
(cherry picked from commit 8d33ff8ba415180dee8f1f91f3b4d16d72ec094e)
|
||||
---
|
||||
v2v/virt-v2v.pod | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
|
||||
index f012ea533..893e47fb9 100644
|
||||
--- a/v2v/virt-v2v.pod
|
||||
+++ b/v2v/virt-v2v.pod
|
||||
@@ -758,6 +758,9 @@ For I<-o libvirt>, this is a libvirt directory pool
|
||||
For I<-o local> and I<-o qemu>, this is a directory name. The
|
||||
directory must exist.
|
||||
|
||||
+For I<-o rhv-upload>, this is the name of the destination Storage
|
||||
+Domain.
|
||||
+
|
||||
For I<-o rhv>, this can be an NFS path of the Export Storage Domain
|
||||
of the form C<E<lt>hostE<gt>:E<lt>pathE<gt>>, eg:
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,69 +0,0 @@
|
||||
From a3e99c84e1aed2fc275be00292f86414c8d4432a Mon Sep 17 00:00:00 2001
|
||||
From: Nir Soffer <nirsof@gmail.com>
|
||||
Date: Fri, 29 Jun 2018 17:41:10 +0300
|
||||
Subject: [PATCH] v2v: rhv-upload-plugin: Remove unneeded auth
|
||||
|
||||
Old imageio proxy was using Authorization header for GET and PUT
|
||||
requests. Remove unneeded authorization when sending OPTIONS request.
|
||||
|
||||
Remove unneeded duplicated comments about authorization for old
|
||||
imageio, and replace them with a comment when we set needs_auth.
|
||||
|
||||
(cherry picked from commit d5f36bacf9bb6d4d244184551792989906f60896)
|
||||
---
|
||||
v2v/rhv-upload-plugin.py | 12 +++++-------
|
||||
1 file changed, 5 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
|
||||
index 8805e3552..f404bd758 100644
|
||||
--- a/v2v/rhv-upload-plugin.py
|
||||
+++ b/v2v/rhv-upload-plugin.py
|
||||
@@ -191,16 +191,17 @@ def open(readonly):
|
||||
)
|
||||
|
||||
# The first request is to fetch the features of the server.
|
||||
+
|
||||
+ # Authentication was needed only for GET and PUT requests when
|
||||
+ # communicating with old imageio-proxy.
|
||||
needs_auth = not params['rhv_direct']
|
||||
+
|
||||
can_flush = False
|
||||
can_trim = False
|
||||
can_zero = False
|
||||
unix_socket = None
|
||||
|
||||
- http.putrequest("OPTIONS", destination_url.path)
|
||||
- http.putheader("Authorization", transfer.signed_ticket)
|
||||
- http.endheaders()
|
||||
-
|
||||
+ http.request("OPTIONS", destination_url.path)
|
||||
r = http.getresponse()
|
||||
data = r.read()
|
||||
|
||||
@@ -298,7 +299,6 @@ def pread(h, count, offset):
|
||||
transfer = h['transfer']
|
||||
|
||||
headers = {"Range", "bytes=%d-%d" % (offset, offset+count-1)}
|
||||
- # Authorization is only needed for old imageio.
|
||||
if h['needs_auth']:
|
||||
headers["Authorization"] = transfer.signed_ticket
|
||||
|
||||
@@ -321,7 +321,6 @@ def pwrite(h, buf, offset):
|
||||
h['highestwrite'] = max(h['highestwrite'], offset+count)
|
||||
|
||||
http.putrequest("PUT", h['path'] + "?flush=n")
|
||||
- # Authorization is only needed for old imageio.
|
||||
if h['needs_auth']:
|
||||
http.putheader("Authorization", transfer.signed_ticket)
|
||||
# The oVirt server only uses the first part of the range, and the
|
||||
@@ -378,7 +377,6 @@ def emulate_zero(h, count, offset):
|
||||
# After that we must emulate them with writes.
|
||||
if offset+count < h['highestwrite']:
|
||||
http.putrequest("PUT", h['path'])
|
||||
- # Authorization is only needed for old imageio.
|
||||
if h['needs_auth']:
|
||||
http.putheader("Authorization", transfer.signed_ticket)
|
||||
http.putheader("Content-Range",
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,66 +0,0 @@
|
||||
From 8aaf7d89ef8b686840d3683fb27c4746624088a5 Mon Sep 17 00:00:00 2001
|
||||
From: Nir Soffer <nirsof@gmail.com>
|
||||
Date: Sat, 30 Jun 2018 01:21:50 +0300
|
||||
Subject: [PATCH] v2v: rhv-upload-plugin: Improve error handling
|
||||
|
||||
When optimizing the connection using unix socket, we handle these cases:
|
||||
|
||||
- The local host is not an oVirt host (no /etc/vdsm/vdsm.id).
|
||||
- The local host is an oVirt host, but is not registered with engine.
|
||||
- Creating UnixHTTPConnection() fails. Unlikely and probably a bug in
|
||||
the plugin, but we can recover by using the https connection.
|
||||
|
||||
The current code handle these cases silently, making it harder to
|
||||
understand why the unix socket optimization did no happen. Add debug
|
||||
message to make this clear.
|
||||
|
||||
Also comment in the error handler why we take this path instead of
|
||||
failing the operation.
|
||||
|
||||
(cherry picked from commit f5442d2f044b398efc992fb4d56c8d3096c781e6)
|
||||
---
|
||||
v2v/rhv-upload-plugin.py | 12 ++++++++++--
|
||||
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
|
||||
index f404bd758..8e4052048 100644
|
||||
--- a/v2v/rhv-upload-plugin.py
|
||||
+++ b/v2v/rhv-upload-plugin.py
|
||||
@@ -63,7 +63,10 @@ def find_host(connection):
|
||||
with builtins.open("/etc/vdsm/vdsm.id") as f:
|
||||
vdsm_id = f.readline().strip()
|
||||
except Exception as e:
|
||||
+ # This is most likely not an oVirt host.
|
||||
+ debug("cannot read /etc/vdsm/vdsm.id, using any host: %s" % e)
|
||||
return None
|
||||
+
|
||||
debug("hw_id = %r" % vdsm_id)
|
||||
|
||||
hosts_service = connection.system_service().hosts_service()
|
||||
@@ -72,6 +75,8 @@ def find_host(connection):
|
||||
case_sensitive=False,
|
||||
)
|
||||
if len(hosts) == 0:
|
||||
+ # This oVirt host is not registered with engine.
|
||||
+ debug("cannot find host with hw_id=%r, using any host" % vdsm_id)
|
||||
return None
|
||||
|
||||
host = hosts[0]
|
||||
@@ -233,9 +238,12 @@ def open(readonly):
|
||||
if host is not None and unix_socket is not None:
|
||||
try:
|
||||
http = UnixHTTPConnection(unix_socket)
|
||||
+ except Exception as e:
|
||||
+ # Very unlikely failure, but we can recover by using the https
|
||||
+ # connection.
|
||||
+ debug("cannot create unix socket connection, using https: %s" % e)
|
||||
+ else:
|
||||
debug("optimizing connection using unix socket %r" % unix_socket)
|
||||
- except:
|
||||
- pass
|
||||
|
||||
# Save everything we need to make requests in the handle.
|
||||
return {
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,32 +0,0 @@
|
||||
From 7b5ec5a6478276cec587c7d6a64b9a1ab26447b2 Mon Sep 17 00:00:00 2001
|
||||
From: Nir Soffer <nirsof@gmail.com>
|
||||
Date: Sat, 30 Jun 2018 01:39:03 +0300
|
||||
Subject: [PATCH] v2v: rhv-upload-plugin: Optimize only direct upload
|
||||
|
||||
The optimization to start the transfer on the local host makes sense
|
||||
only when using the rhv-direct=true option. When using a proxy, let the
|
||||
engine choose a host.
|
||||
|
||||
(cherry picked from commit 891b5a0ec0f320acec0f06b64159eaf3dfbbfeaf)
|
||||
---
|
||||
v2v/rhv-upload-plugin.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
|
||||
index 8e4052048..da309e288 100644
|
||||
--- a/v2v/rhv-upload-plugin.py
|
||||
+++ b/v2v/rhv-upload-plugin.py
|
||||
@@ -148,8 +148,8 @@ def open(readonly):
|
||||
# Get a reference to the transfer service.
|
||||
transfers_service = system_service.image_transfers_service()
|
||||
|
||||
- # Create a new image transfer.
|
||||
- host = find_host(connection)
|
||||
+ # Create a new image transfer, using the local host is possible.
|
||||
+ host = find_host(connection) if params['rhv_direct'] else None
|
||||
transfer = transfers_service.add(
|
||||
types.ImageTransfer(
|
||||
disk = types.Disk(id = disk.id),
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,61 +0,0 @@
|
||||
From e1401de974b6ac6d3e6e94e774f24a9b74f806f2 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Erez <derez@redhat.com>
|
||||
Date: Thu, 5 Jul 2018 20:23:35 +0300
|
||||
Subject: [PATCH] v2v: rhv plugin - find suitable host (RHBZ#1596810)
|
||||
(RHBZ#1596851)
|
||||
|
||||
For direct upload, a suitable host must be in status 'Up'
|
||||
and belong to the same datacenter as the created disk.
|
||||
Added these criteria to the host search query.
|
||||
|
||||
(cherry picked from commit 4ed1bc5a79a77ad3a620b339f9ac2ecc8df6fd03)
|
||||
---
|
||||
v2v/rhv-upload-plugin.py | 28 ++++++++++++++++++++++++----
|
||||
1 file changed, 24 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
|
||||
index da309e288..931fcfaa2 100644
|
||||
--- a/v2v/rhv-upload-plugin.py
|
||||
+++ b/v2v/rhv-upload-plugin.py
|
||||
@@ -69,14 +69,34 @@ def find_host(connection):
|
||||
|
||||
debug("hw_id = %r" % vdsm_id)
|
||||
|
||||
- hosts_service = connection.system_service().hosts_service()
|
||||
+ system_service = connection.system_service()
|
||||
+ storage_name = params['output_storage']
|
||||
+ data_centers = system_service.data_centers_service().list(
|
||||
+ search='storage=%s' % storage_name,
|
||||
+ case_sensitive=False,
|
||||
+ )
|
||||
+ if len(data_centers) == 0:
|
||||
+ # The storage domain is not attached to a datacenter
|
||||
+ # (shouldn't happen, would fail on disk creation).
|
||||
+ debug("storange domain (%s) is not attached to a DC" % storage_name)
|
||||
+ return None
|
||||
+
|
||||
+ datacenter = data_centers[0]
|
||||
+ debug("datacenter = %s" % datacenter.name)
|
||||
+
|
||||
+ hosts_service = system_service.hosts_service()
|
||||
hosts = hosts_service.list(
|
||||
- search="hw_id=%s" % vdsm_id,
|
||||
+ search="hw_id=%s and datacenter=%s and status=Up" % (vdsm_id, datacenter.name),
|
||||
case_sensitive=False,
|
||||
)
|
||||
if len(hosts) == 0:
|
||||
- # This oVirt host is not registered with engine.
|
||||
- debug("cannot find host with hw_id=%r, using any host" % vdsm_id)
|
||||
+ # Couldn't find a host that's fulfilling the following criteria:
|
||||
+ # - 'hw_id' equals to 'vdsm_id'
|
||||
+ # - Its status is 'Up'
|
||||
+ # - Belongs to the storage domain's datacenter
|
||||
+ debug("cannot find a running host with hw_id=%r, " \
|
||||
+ "that belongs to datacenter '%s', " \
|
||||
+ "using any host" % (vdsm_id, datacenter.name))
|
||||
return None
|
||||
|
||||
host = hosts[0]
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,41 +0,0 @@
|
||||
From 77604b91ec01ddd7961e69b70727b8e8c6e4c50b Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Fri, 13 Jul 2018 13:24:07 +0200
|
||||
Subject: [PATCH] v2v: change QXL ResourceType in OVirt flavour (RHBZ#1598715)
|
||||
|
||||
Due to a conflict with the IDs of the OVF standard, and the existing
|
||||
implementation in ovirt-engine, the ID of QXL devices changed to a
|
||||
different value.
|
||||
|
||||
As a consequence, change the ResourceType of QXL devices, but only in
|
||||
OVirt flavour to avoid breaking vdsm mode.
|
||||
|
||||
See: https://bugzilla.redhat.com/show_bug.cgi?id=1598715#c5
|
||||
(cherry picked from commit aa9e18f6d1fd503822dfd2124b92a2c67704c4c1)
|
||||
---
|
||||
v2v/create_ovf.ml | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/v2v/create_ovf.ml b/v2v/create_ovf.ml
|
||||
index 9e0c772fd..5db239d66 100644
|
||||
--- a/v2v/create_ovf.ml
|
||||
+++ b/v2v/create_ovf.ml
|
||||
@@ -643,10 +643,14 @@ let rec create_ovf source targets guestcaps inspect
|
||||
* See RHBZ#1213701 and RHBZ#1211231 for the reasoning
|
||||
* behind that.
|
||||
*)
|
||||
+ let qxl_resourcetype =
|
||||
+ match ovf_flavour with
|
||||
+ | OVirt -> 32768 (* RHBZ#1598715 *)
|
||||
+ | RHVExportStorageDomain -> 20 in
|
||||
e "Item" [] [
|
||||
e "rasd:Caption" [] [PCData "Graphical Controller"];
|
||||
e "rasd:InstanceId" [] [PCData (uuidgen ())];
|
||||
- e "rasd:ResourceType" [] [PCData "20"];
|
||||
+ e "rasd:ResourceType" [] [PCData (string_of_int qxl_resourcetype)];
|
||||
e "Type" [] [PCData "video"];
|
||||
e "rasd:VirtualQuantity" [] [PCData "1"];
|
||||
e "rasd:Device" [] [PCData "qxl"];
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,40 +0,0 @@
|
||||
From bb6b81861e72535f57bdc8e9a3457807f21ad28c Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Tue, 17 Jul 2018 17:12:38 +0200
|
||||
Subject: [PATCH] v2v: -o rhv-upload: check for ovirtsdk4 (RHBZ#1601943)
|
||||
|
||||
Check earlier whether the ovirtsdk4 Python can be imported correctly,
|
||||
to avoid errors later on during the migration.
|
||||
---
|
||||
v2v/output_rhv_upload.ml | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml
|
||||
index 0152b8d5a..63fa2411a 100644
|
||||
--- a/v2v/output_rhv_upload.ml
|
||||
+++ b/v2v/output_rhv_upload.ml
|
||||
@@ -126,6 +126,13 @@ class output_rhv_upload output_alloc output_conn
|
||||
python3
|
||||
in
|
||||
|
||||
+ (* Check that the 'ovirtsdk4' Python module is available. *)
|
||||
+ let error_unless_ovirtsdk4_module_available () =
|
||||
+ let res = run_command [ python3; "-c"; "import ovirtsdk4" ] in
|
||||
+ if res <> 0 then
|
||||
+ error (f_"the Python module ‘ovirtsdk4’ could not be loaded, is it installed? See previous messages for problems.")
|
||||
+ in
|
||||
+
|
||||
(* Check that nbdkit is available and new enough. *)
|
||||
let error_unless_nbdkit_working () =
|
||||
if 0 <> Sys.command "nbdkit --version >/dev/null" then
|
||||
@@ -231,6 +238,7 @@ object
|
||||
|
||||
method precheck () =
|
||||
error_unless_python_binary_on_path ();
|
||||
+ error_unless_ovirtsdk4_module_available ();
|
||||
error_unless_nbdkit_working ();
|
||||
error_unless_nbdkit_python3_working ();
|
||||
error_unless_output_alloc_sparse ();
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,29 +0,0 @@
|
||||
From c0f9ab66655ec5ca3f065357d6797d0061f04fe0 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Erez <derez@redhat.com>
|
||||
Date: Tue, 24 Jul 2018 19:16:10 +0300
|
||||
Subject: [PATCH] v2v: rhv plugin - fix DC search string
|
||||
|
||||
Search for DC by 'storage.name=' to make it explicit.
|
||||
I.e. "storage=" uses regex, so similar names can be
|
||||
found in the search query. For example, searching for
|
||||
a domain named FCSD, will find FCSD1 as well.
|
||||
---
|
||||
v2v/rhv-upload-plugin.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
|
||||
index 931fcfaa2..8274f1ee1 100644
|
||||
--- a/v2v/rhv-upload-plugin.py
|
||||
+++ b/v2v/rhv-upload-plugin.py
|
||||
@@ -72,7 +72,7 @@ def find_host(connection):
|
||||
system_service = connection.system_service()
|
||||
storage_name = params['output_storage']
|
||||
data_centers = system_service.data_centers_service().list(
|
||||
- search='storage=%s' % storage_name,
|
||||
+ search='storage.name=%s' % storage_name,
|
||||
case_sensitive=False,
|
||||
)
|
||||
if len(data_centers) == 0:
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,35 +0,0 @@
|
||||
From bc2ba2f47ba8a1f88ea6f3c14addd60e84423adf Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Erez <derez@redhat.com>
|
||||
Date: Wed, 25 Jul 2018 11:24:33 +0300
|
||||
Subject: [PATCH] v2v: rhv plugin - case-sensitive search queries
|
||||
|
||||
Changed both search queries to case-sensitive (to ensure an exact match).
|
||||
---
|
||||
v2v/rhv-upload-plugin.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
|
||||
index 8274f1ee1..4fad27fb8 100644
|
||||
--- a/v2v/rhv-upload-plugin.py
|
||||
+++ b/v2v/rhv-upload-plugin.py
|
||||
@@ -73,7 +73,7 @@ def find_host(connection):
|
||||
storage_name = params['output_storage']
|
||||
data_centers = system_service.data_centers_service().list(
|
||||
search='storage.name=%s' % storage_name,
|
||||
- case_sensitive=False,
|
||||
+ case_sensitive=True,
|
||||
)
|
||||
if len(data_centers) == 0:
|
||||
# The storage domain is not attached to a datacenter
|
||||
@@ -87,7 +87,7 @@ def find_host(connection):
|
||||
hosts_service = system_service.hosts_service()
|
||||
hosts = hosts_service.list(
|
||||
search="hw_id=%s and datacenter=%s and status=Up" % (vdsm_id, datacenter.name),
|
||||
- case_sensitive=False,
|
||||
+ case_sensitive=True,
|
||||
)
|
||||
if len(hosts) == 0:
|
||||
# Couldn't find a host that's fulfilling the following criteria:
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,44 +0,0 @@
|
||||
From 21cf4aaafb6088168d2f5c679477644c19116f3d Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Fri, 20 Apr 2018 15:27:04 +0200
|
||||
Subject: [PATCH] uefi: remove last references to kraxel's old edk2 builds
|
||||
|
||||
Commit 889386f8c6088e57fd68f2bb6bf85f69ecfc6f6c removed most of them
|
||||
already, so remove the last ones, and the supporting code.
|
||||
---
|
||||
generator/UEFI.ml | 6 ------
|
||||
v2v/utils.ml | 1 -
|
||||
2 files changed, 7 deletions(-)
|
||||
|
||||
diff --git a/generator/UEFI.ml b/generator/UEFI.ml
|
||||
index daa78bdc9..bca3fa1ae 100644
|
||||
--- a/generator/UEFI.ml
|
||||
+++ b/generator/UEFI.ml
|
||||
@@ -30,12 +30,6 @@ open Docstrings
|
||||
|
||||
(* Order is significant *within architectures only*. *)
|
||||
let firmware = [
|
||||
- "i386",
|
||||
- "/usr/share/edk2.git/ovmf-ia32/OVMF_CODE-pure-efi.fd",
|
||||
- None,
|
||||
- "/usr/share/edk2.git/ovmf-ia32/OVMF_VARS-pure-efi.fd",
|
||||
- [];
|
||||
-
|
||||
"x86_64",
|
||||
"/usr/share/OVMF/OVMF_CODE.fd",
|
||||
None,
|
||||
diff --git a/v2v/utils.ml b/v2v/utils.ml
|
||||
index e880001eb..67e2028f3 100644
|
||||
--- a/v2v/utils.ml
|
||||
+++ b/v2v/utils.ml
|
||||
@@ -64,7 +64,6 @@ let find_uefi_firmware guest_arch =
|
||||
let files =
|
||||
(* The lists of firmware are actually defined in common/utils/uefi.c. *)
|
||||
match guest_arch with
|
||||
- | "i386" | "i486" | "i586" | "i686" -> Uefi.uefi_i386_firmware
|
||||
| "x86_64" -> Uefi.uefi_x86_64_firmware
|
||||
| "aarch64" -> Uefi.uefi_aarch64_firmware
|
||||
| arch ->
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,38 +0,0 @@
|
||||
From bb804081e9b5fc959b14d2e254d320cf5a658441 Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Thu, 9 Aug 2018 15:01:37 +0200
|
||||
Subject: [PATCH] v2v: parse_libvirt_xml: handle srN CDROM devices
|
||||
(RHBZ#1612785)
|
||||
|
||||
This device naming is mostly written by virt-p2v, so get the slot from
|
||||
it directly without using the drive_index "decoding" function.
|
||||
|
||||
(cherry picked from commit c9abaa3e96e7209595f0982c1f2f97e37f3369a6)
|
||||
---
|
||||
v2v/parse_libvirt_xml.ml | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/v2v/parse_libvirt_xml.ml b/v2v/parse_libvirt_xml.ml
|
||||
index 03a201e77..44723014c 100644
|
||||
--- a/v2v/parse_libvirt_xml.ml
|
||||
+++ b/v2v/parse_libvirt_xml.ml
|
||||
@@ -379,6 +379,16 @@ let parse_libvirt_xml ?conn xml =
|
||||
let target_dev = xpath_string "target/@dev" in
|
||||
match target_dev with
|
||||
| None -> None
|
||||
+ | Some dev when String.is_prefix dev "sr" ->
|
||||
+ (* "srN" devices are found mostly in the physical XML written by
|
||||
+ * virt-p2v.
|
||||
+ *)
|
||||
+ let name = String.sub dev 2 (String.length dev - 2) in
|
||||
+ (try Some (int_of_string name)
|
||||
+ with Failure _ ->
|
||||
+ warning (f_"could not parse device name ‘%s’ from the source libvirt XML") dev;
|
||||
+ None
|
||||
+ )
|
||||
| Some dev ->
|
||||
let rec loop = function
|
||||
| [] ->
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,43 +0,0 @@
|
||||
From 6f116349a2a02739e64a39ab2aeb23706fac188b Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 14 Aug 2018 12:50:07 +0100
|
||||
Subject: [PATCH] v2v: -o rhv-upload: Fix error message disk numbering
|
||||
(RHBZ#1615885).
|
||||
|
||||
The output method used the s_disk_id field assuming it was a unique,
|
||||
monotonically increasing number counting from 0. However this is not
|
||||
the case, the input method simply has to set s_disk_id to be unique
|
||||
for each disk.
|
||||
|
||||
Fixes commit cc04573927cca97de60d544d37467e67c25867a7.
|
||||
|
||||
Thanks: Xiaodai Wang
|
||||
(cherry picked from commit 90c9c12258fbb9a89d16f798725d16fe5bb3504c)
|
||||
---
|
||||
v2v/output_rhv_upload.ml | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml
|
||||
index 63fa2411a..7dbd98a0d 100644
|
||||
--- a/v2v/output_rhv_upload.ml
|
||||
+++ b/v2v/output_rhv_upload.ml
|
||||
@@ -383,13 +383,13 @@ If the messages above are not sufficient to diagnose the problem then add the
|
||||
*)
|
||||
let nr_disks = List.length targets in
|
||||
let image_uuids =
|
||||
- List.map (
|
||||
- fun t ->
|
||||
+ List.mapi (
|
||||
+ fun i t ->
|
||||
let id = t.target_overlay.ov_source.s_disk_id in
|
||||
let diskid_file = diskid_file_of_id id in
|
||||
if not (wait_for_file diskid_file finalization_timeout) then
|
||||
error (f_"transfer of disk %d/%d failed, see earlier error messages")
|
||||
- (id+1) nr_disks;
|
||||
+ (i+1) nr_disks;
|
||||
let diskid = read_whole_file diskid_file in
|
||||
diskid
|
||||
) targets in
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,30 +0,0 @@
|
||||
From 739ac1bc0f37c4bceb2e2eeed00f9320605aa641 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 7 Aug 2018 09:06:46 +0100
|
||||
Subject: [PATCH] v2v: -o rhv-upload: Properly replace SD_UUID in OVF
|
||||
(RHBZ#1612653).
|
||||
|
||||
The @SD_UUID@ pattern was not being replaced correctly.
|
||||
|
||||
Thanks: Daniel Erez.
|
||||
(cherry picked from commit 389e165519c33b5234db50ea26dcb267321ee152)
|
||||
---
|
||||
v2v/rhv-upload-createvm.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/v2v/rhv-upload-createvm.py b/v2v/rhv-upload-createvm.py
|
||||
index a34627ec8..1d0e8c95d 100644
|
||||
--- a/v2v/rhv-upload-createvm.py
|
||||
+++ b/v2v/rhv-upload-createvm.py
|
||||
@@ -70,7 +70,7 @@ sds_service = system_service.storage_domains_service()
|
||||
sd = sds_service.list(search=("name=%s" % params['output_storage']))[0]
|
||||
sd_uuid = sd.id
|
||||
|
||||
-ovf.replace("@SD_UUID@", sd_uuid)
|
||||
+ovf = ovf.replace("@SD_UUID@", sd_uuid)
|
||||
|
||||
vms_service = system_service.vms_service()
|
||||
vm = vms_service.add(
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,28 +0,0 @@
|
||||
From 8be6817e95dbdf826a6065751b4a3a000c78071c Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 28 Aug 2018 12:59:06 +0100
|
||||
Subject: [PATCH] ppc64le: Don't use -cpu parameter under any circumstances
|
||||
(RHBZ#1605071).
|
||||
|
||||
(cherry picked from commit 56318f0b5ffc287fed71cc7cdd2007dff2b8fb17)
|
||||
---
|
||||
lib/appliance-cpu.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/lib/appliance-cpu.c b/lib/appliance-cpu.c
|
||||
index a6c1b0faf..fa1bae3f9 100644
|
||||
--- a/lib/appliance-cpu.c
|
||||
+++ b/lib/appliance-cpu.c
|
||||
@@ -76,6 +76,9 @@ guestfs_int_get_cpu_model (int kvm)
|
||||
return "host";
|
||||
else
|
||||
return "cortex-a57";
|
||||
+#elif defined(__powerpc64__)
|
||||
+ /* See discussion in https://bugzilla.redhat.com/show_bug.cgi?id=1605071 */
|
||||
+ return NULL;
|
||||
#else
|
||||
/* On most architectures, it is faster to pass the CPU host model to
|
||||
* the appliance, allowing maximum speed for things like checksums
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,108 +0,0 @@
|
||||
From 81a9e4f428e9a2305a2ea8c576dadde60fa5a381 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 20 Sep 2018 12:42:59 +0100
|
||||
Subject: [PATCH] tools: Link OCaml programs with -runtime-variant _pic if
|
||||
available.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
OCaml has a small runtime which is statically linked into the virt
|
||||
tools (providing things like GC and primitives). Since OCaml 4.03 it
|
||||
has been possible to select variants of this runtime, one of which is
|
||||
compiled with -fPIC, using ‘ocamlopt -runtime-variant _pic’.
|
||||
|
||||
This has performance implications on i686, but is relatively free on
|
||||
other architectures. Since it (in theory) adds to the security of the
|
||||
final binary this commit enables it whenever it is available.
|
||||
|
||||
(cherry picked from commit 09abb9c990f6e07b3577088522b8ad9fb439a80e)
|
||||
---
|
||||
.gitignore | 1 +
|
||||
configure.ac | 2 ++
|
||||
m4/guestfs-ocaml.m4 | 18 ++++++++++++++++++
|
||||
ocaml-link.sh => ocaml-link.sh.in | 8 +++++++-
|
||||
4 files changed, 28 insertions(+), 1 deletion(-)
|
||||
rename ocaml-link.sh => ocaml-link.sh.in (88%)
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index af80e36d1..89b8baa17 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -410,6 +410,7 @@ Makefile.in
|
||||
/make-fs/virt-make-fs.1
|
||||
/missing
|
||||
/ocaml-dep.sh
|
||||
+/ocaml-link.sh
|
||||
/ocaml/bindtests.bc
|
||||
/ocaml/bindtests.opt
|
||||
/ocaml/bindtests.ml
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 4da3bd021..6c38406bb 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -198,6 +198,8 @@ AC_CONFIG_FILES([installcheck.sh],
|
||||
[chmod +x,-w installcheck.sh])
|
||||
AC_CONFIG_FILES([ocaml-dep.sh],
|
||||
[chmod +x,-w ocaml-dep.sh])
|
||||
+AC_CONFIG_FILES([ocaml-link.sh],
|
||||
+ [chmod +x,-w ocaml-link.sh])
|
||||
AC_CONFIG_FILES([p2v/virt-p2v-make-disk],
|
||||
[chmod +x,-w p2v/virt-p2v-make-disk])
|
||||
AC_CONFIG_FILES([p2v/virt-p2v-make-kickstart],
|
||||
diff --git a/m4/guestfs-ocaml.m4 b/m4/guestfs-ocaml.m4
|
||||
index e08f40a02..fea11a334 100644
|
||||
--- a/m4/guestfs-ocaml.m4
|
||||
+++ b/m4/guestfs-ocaml.m4
|
||||
@@ -59,6 +59,24 @@ AM_CONDITIONAL([HAVE_OCAMLOPT],
|
||||
AM_CONDITIONAL([HAVE_OCAMLDOC],
|
||||
[test "x$OCAMLDOC" != "xno"])
|
||||
|
||||
+dnl Check if ocamlc/ocamlopt -runtime-variant _pic works. It was
|
||||
+dnl added in OCaml >= 4.03, but in theory might be disabled by
|
||||
+dnl downstream distros.
|
||||
+OCAML_RUNTIME_VARIANT_PIC_OPTION=""
|
||||
+if test "x$OCAMLC" != "xno"; then
|
||||
+ AC_MSG_CHECKING([if OCaml ‘-runtime-variant _pic’ works])
|
||||
+ rm -f conftest.ml contest
|
||||
+ echo 'print_endline "hello world"' > conftest.ml
|
||||
+ if $OCAMLC conftest.ml -runtime-variant _pic -o conftest >&5 2>&5 ; then
|
||||
+ AC_MSG_RESULT([yes])
|
||||
+ OCAML_RUNTIME_VARIANT_PIC_OPTION="-runtime-variant _pic"
|
||||
+ else
|
||||
+ AC_MSG_RESULT([no])
|
||||
+ fi
|
||||
+ rm -f conftest.ml contest
|
||||
+fi
|
||||
+AC_SUBST([OCAML_RUNTIME_VARIANT_PIC_OPTION])
|
||||
+
|
||||
dnl Check if ocamldep has options -all and -one-line (not present in RHEL 6).
|
||||
AC_MSG_CHECKING([if ocamldep has the ‘-all’ option])
|
||||
if ocamldep -all >&AS_MESSAGE_LOG_FD 2>&1; then
|
||||
diff --git a/ocaml-link.sh b/ocaml-link.sh.in
|
||||
similarity index 88%
|
||||
rename from ocaml-link.sh
|
||||
rename to ocaml-link.sh.in
|
||||
index 855637534..fbcc07951 100755
|
||||
--- a/ocaml-link.sh
|
||||
+++ b/ocaml-link.sh.in
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/bin/bash -
|
||||
+# Script used to link OCaml programs.
|
||||
+# @configure_input@
|
||||
# (C) Copyright 2015-2018 Red Hat Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -41,4 +43,8 @@ while true ; do
|
||||
esac
|
||||
done
|
||||
|
||||
-exec "$@" -linkpkg -cclib "${cclib}"
|
||||
+# NB -cclib must come last.
|
||||
+exec "$@" \
|
||||
+ @OCAML_RUNTIME_VARIANT_PIC_OPTION@ \
|
||||
+ -linkpkg \
|
||||
+ -cclib "${cclib}"
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,328 +0,0 @@
|
||||
From 7423e43ec2cd27d52650a1caeb7c0576350e0a78 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 20 Sep 2018 12:59:44 +0100
|
||||
Subject: [PATCH] tools: Ensure CFLAGS and LDFLAGS are passed to all OCaml
|
||||
binaries (RHBZ#1624130).
|
||||
|
||||
After this commit, all annocheck errors are fixed except for:
|
||||
|
||||
Hardened: virt-get-kernel: MAYB: Gaps were detected in the annobin coverage. Run with -v to list.
|
||||
|
||||
After discussion with the annocheck maintainers this gap in coverage
|
||||
(which corresponds to the OCaml runtime) seems to be caused either by
|
||||
the runtime not being linked with the right flags, or might be a bug
|
||||
in annocheck itself. In any case it's not something that can be
|
||||
resolved within the scope of libguestfs.
|
||||
|
||||
(cherry picked from commit 34c23403c51a4d59d826c8045e06f9aabc2ceb16)
|
||||
---
|
||||
builder/Makefile.am | 2 +-
|
||||
common/mlaugeas/Makefile.am | 2 +-
|
||||
common/mlgettext/Makefile.am | 2 +-
|
||||
common/mlpcre/Makefile.am | 2 +-
|
||||
common/mlprogress/Makefile.am | 2 +-
|
||||
common/mlstdutils/Makefile.am | 2 +-
|
||||
common/mltools/Makefile.am | 2 +-
|
||||
common/mlutils/Makefile.am | 2 +-
|
||||
common/mlvisit/Makefile.am | 2 +-
|
||||
common/mlxml/Makefile.am | 2 +-
|
||||
customize/Makefile.am | 2 +-
|
||||
daemon/Makefile.am | 2 +-
|
||||
dib/Makefile.am | 2 +-
|
||||
generator/Makefile.am | 2 +-
|
||||
get-kernel/Makefile.am | 2 +-
|
||||
ocaml-link.sh.in | 2 +-
|
||||
ocaml/Makefile.am | 2 +-
|
||||
resize/Makefile.am | 2 +-
|
||||
sparsify/Makefile.am | 2 +-
|
||||
sysprep/Makefile.am | 2 +-
|
||||
v2v/Makefile.am | 2 +-
|
||||
v2v/test-harness/Makefile.am | 2 +-
|
||||
22 files changed, 22 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/builder/Makefile.am b/builder/Makefile.am
|
||||
index c7b50778a..a30a229b2 100644
|
||||
--- a/builder/Makefile.am
|
||||
+++ b/builder/Makefile.am
|
||||
@@ -215,7 +215,7 @@ OCAMLCLIBS = \
|
||||
$(LIBINTL) \
|
||||
-lgnu
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
if !HAVE_OCAMLOPT
|
||||
OBJECTS = $(BOBJECTS)
|
||||
diff --git a/common/mlaugeas/Makefile.am b/common/mlaugeas/Makefile.am
|
||||
index 8aa15b80e..2c1a6e0fd 100644
|
||||
--- a/common/mlaugeas/Makefile.am
|
||||
+++ b/common/mlaugeas/Makefile.am
|
||||
@@ -61,7 +61,7 @@ BOBJECTS = $(SOURCES_ML:.ml=.cmo)
|
||||
XOBJECTS = $(BOBJECTS:.cmo=.cmx)
|
||||
|
||||
OCAMLPACKAGES =
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
if !HAVE_OCAMLOPT
|
||||
OBJECTS = $(BOBJECTS)
|
||||
diff --git a/common/mlgettext/Makefile.am b/common/mlgettext/Makefile.am
|
||||
index cdcea33ec..b918f90c3 100644
|
||||
--- a/common/mlgettext/Makefile.am
|
||||
+++ b/common/mlgettext/Makefile.am
|
||||
@@ -60,7 +60,7 @@ if HAVE_OCAML_PKG_GETTEXT
|
||||
OCAMLPACKAGES += -package gettext-stub
|
||||
endif
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
if !HAVE_OCAMLOPT
|
||||
OBJECTS = $(BOBJECTS)
|
||||
diff --git a/common/mlpcre/Makefile.am b/common/mlpcre/Makefile.am
|
||||
index f9699f592..6f04256da 100644
|
||||
--- a/common/mlpcre/Makefile.am
|
||||
+++ b/common/mlpcre/Makefile.am
|
||||
@@ -70,7 +70,7 @@ OCAMLPACKAGES = \
|
||||
-I $(builddir)
|
||||
OCAMLPACKAGES_TESTS = $(MLPCRE_CMA)
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
if !HAVE_OCAMLOPT
|
||||
OBJECTS = $(BOBJECTS)
|
||||
diff --git a/common/mlprogress/Makefile.am b/common/mlprogress/Makefile.am
|
||||
index be88ef2de..af006d228 100644
|
||||
--- a/common/mlprogress/Makefile.am
|
||||
+++ b/common/mlprogress/Makefile.am
|
||||
@@ -76,7 +76,7 @@ OCAMLPACKAGES = \
|
||||
-I $(top_builddir)/ocaml \
|
||||
-I $(builddir)
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
if !HAVE_OCAMLOPT
|
||||
OBJECTS = $(BOBJECTS)
|
||||
diff --git a/common/mlstdutils/Makefile.am b/common/mlstdutils/Makefile.am
|
||||
index e38230db8..75252eb46 100644
|
||||
--- a/common/mlstdutils/Makefile.am
|
||||
+++ b/common/mlstdutils/Makefile.am
|
||||
@@ -79,7 +79,7 @@ if HAVE_OCAML_PKG_OUNIT
|
||||
OCAMLPACKAGES_TESTS += -package oUnit
|
||||
endif
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
if !HAVE_OCAMLOPT
|
||||
OBJECTS = $(BOBJECTS)
|
||||
diff --git a/common/mltools/Makefile.am b/common/mltools/Makefile.am
|
||||
index 66b18f5de..b326cf56a 100644
|
||||
--- a/common/mltools/Makefile.am
|
||||
+++ b/common/mltools/Makefile.am
|
||||
@@ -131,7 +131,7 @@ OCAMLCLIBS = \
|
||||
$(LIBINTL) \
|
||||
-lgnu
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
if !HAVE_OCAMLOPT
|
||||
OBJECTS = $(BOBJECTS)
|
||||
diff --git a/common/mlutils/Makefile.am b/common/mlutils/Makefile.am
|
||||
index 8627e5b10..77feafa56 100644
|
||||
--- a/common/mlutils/Makefile.am
|
||||
+++ b/common/mlutils/Makefile.am
|
||||
@@ -74,7 +74,7 @@ OCAMLPACKAGES = \
|
||||
-I $(top_builddir)/common/mlstdutils \
|
||||
-I $(builddir)
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
if !HAVE_OCAMLOPT
|
||||
OBJECTS = $(BOBJECTS)
|
||||
diff --git a/common/mlvisit/Makefile.am b/common/mlvisit/Makefile.am
|
||||
index add1fe56e..7230415e7 100644
|
||||
--- a/common/mlvisit/Makefile.am
|
||||
+++ b/common/mlvisit/Makefile.am
|
||||
@@ -80,7 +80,7 @@ OCAMLPACKAGES = \
|
||||
-I $(builddir)
|
||||
OCAMLPACKAGES_TESTS = $(MLVISIT_CMA)
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
if !HAVE_OCAMLOPT
|
||||
OBJECTS = $(BOBJECTS)
|
||||
diff --git a/common/mlxml/Makefile.am b/common/mlxml/Makefile.am
|
||||
index eab036b82..7f36b743a 100644
|
||||
--- a/common/mlxml/Makefile.am
|
||||
+++ b/common/mlxml/Makefile.am
|
||||
@@ -72,7 +72,7 @@ OCAMLPACKAGES = \
|
||||
-I $(top_builddir)/gnulib/lib/.libs \
|
||||
-I $(builddir)
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
if !HAVE_OCAMLOPT
|
||||
OBJECTS = $(BOBJECTS)
|
||||
diff --git a/customize/Makefile.am b/customize/Makefile.am
|
||||
index efdd27227..69cf6c13f 100644
|
||||
--- a/customize/Makefile.am
|
||||
+++ b/customize/Makefile.am
|
||||
@@ -173,7 +173,7 @@ OCAMLCLIBS = \
|
||||
$(LIBINTL) \
|
||||
-lgnu
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
virt_customize_DEPENDENCIES = \
|
||||
$(top_srcdir)/ocaml-link.sh \
|
||||
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
|
||||
index d9ed5625e..dcae1a66c 100644
|
||||
--- a/daemon/Makefile.am
|
||||
+++ b/daemon/Makefile.am
|
||||
@@ -347,7 +347,7 @@ OCAMLPACKAGES = \
|
||||
-I $(top_builddir)/common/mlpcre/.libs \
|
||||
-I $(top_builddir)/gnulib/lib/.libs
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
if !HAVE_OCAMLOPT
|
||||
OBJECTS = $(BOBJECTS)
|
||||
diff --git a/dib/Makefile.am b/dib/Makefile.am
|
||||
index 316f49903..7c2ab09d6 100644
|
||||
--- a/dib/Makefile.am
|
||||
+++ b/dib/Makefile.am
|
||||
@@ -99,7 +99,7 @@ OCAMLCLIBS = \
|
||||
$(LIBINTL) \
|
||||
-lgnu
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
if !HAVE_OCAMLOPT
|
||||
OBJECTS = $(BOBJECTS)
|
||||
diff --git a/generator/Makefile.am b/generator/Makefile.am
|
||||
index c2d10966a..056d01346 100644
|
||||
--- a/generator/Makefile.am
|
||||
+++ b/generator/Makefile.am
|
||||
@@ -175,7 +175,7 @@ OCAMLPACKAGES = \
|
||||
-I . \
|
||||
-I $(top_srcdir)/common/mlstdutils \
|
||||
-I $(top_builddir)/common/mlstdutils
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
noinst_PROGRAM = generator
|
||||
|
||||
diff --git a/get-kernel/Makefile.am b/get-kernel/Makefile.am
|
||||
index 81dfb48b4..75379e21f 100644
|
||||
--- a/get-kernel/Makefile.am
|
||||
+++ b/get-kernel/Makefile.am
|
||||
@@ -82,7 +82,7 @@ OCAMLCLIBS = \
|
||||
$(LIBINTL) \
|
||||
-lgnu
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
if !HAVE_OCAMLOPT
|
||||
OBJECTS = $(BOBJECTS)
|
||||
diff --git a/ocaml-link.sh.in b/ocaml-link.sh.in
|
||||
index fbcc07951..6819c641e 100755
|
||||
--- a/ocaml-link.sh.in
|
||||
+++ b/ocaml-link.sh.in
|
||||
@@ -47,4 +47,4 @@ done
|
||||
exec "$@" \
|
||||
@OCAML_RUNTIME_VARIANT_PIC_OPTION@ \
|
||||
-linkpkg \
|
||||
- -cclib "${cclib}"
|
||||
+ -cclib "@LDFLAGS@ $cclib"
|
||||
diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
|
||||
index b0f2900f2..752fc109c 100644
|
||||
--- a/ocaml/Makefile.am
|
||||
+++ b/ocaml/Makefile.am
|
||||
@@ -37,7 +37,7 @@ CLEANFILES += t/*.annot t/*.cmi t/*.cmo t/*.cmx t/*.o t/*.a t/*.so
|
||||
|
||||
if HAVE_OCAML
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
noinst_DATA = mlguestfs.cma META
|
||||
if HAVE_OCAMLOPT
|
||||
diff --git a/resize/Makefile.am b/resize/Makefile.am
|
||||
index 847fb313a..7a4367023 100644
|
||||
--- a/resize/Makefile.am
|
||||
+++ b/resize/Makefile.am
|
||||
@@ -80,7 +80,7 @@ OCAMLCLIBS = \
|
||||
$(LIBINTL) \
|
||||
-lgnu
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
if !HAVE_OCAMLOPT
|
||||
OBJECTS = $(BOBJECTS)
|
||||
diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am
|
||||
index 2ab357a68..2dce5e582 100644
|
||||
--- a/sparsify/Makefile.am
|
||||
+++ b/sparsify/Makefile.am
|
||||
@@ -88,7 +88,7 @@ OCAMLCLIBS = \
|
||||
$(LIBINTL) \
|
||||
-lgnu
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
if !HAVE_OCAMLOPT
|
||||
OBJECTS = $(BOBJECTS)
|
||||
diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am
|
||||
index 0cc9da80a..6ed4ac713 100644
|
||||
--- a/sysprep/Makefile.am
|
||||
+++ b/sysprep/Makefile.am
|
||||
@@ -136,7 +136,7 @@ OCAMLCLIBS = \
|
||||
$(LIBINTL) \
|
||||
-lgnu
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
if !HAVE_OCAMLOPT
|
||||
OBJECTS = $(BOBJECTS)
|
||||
diff --git a/v2v/Makefile.am b/v2v/Makefile.am
|
||||
index 7de050b06..7a1ac329e 100644
|
||||
--- a/v2v/Makefile.am
|
||||
+++ b/v2v/Makefile.am
|
||||
@@ -201,7 +201,7 @@ OCAMLCLIBS = \
|
||||
$(LIBINTL) \
|
||||
-lgnu
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
if !HAVE_OCAMLOPT
|
||||
OBJECTS = $(BOBJECTS)
|
||||
diff --git a/v2v/test-harness/Makefile.am b/v2v/test-harness/Makefile.am
|
||||
index d69188969..22c3b8c49 100644
|
||||
--- a/v2v/test-harness/Makefile.am
|
||||
+++ b/v2v/test-harness/Makefile.am
|
||||
@@ -47,7 +47,7 @@ OCAMLPACKAGES = \
|
||||
-I $(top_builddir)/common/mltools \
|
||||
-I $(top_builddir)/v2v
|
||||
|
||||
-OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
|
||||
+OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
|
||||
|
||||
BOBJECTS = \
|
||||
$(SOURCES_ML:.ml=.cmo) \
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,40 +0,0 @@
|
||||
From 57ed1fc4281462e02604b0e740c4ffa31cf93afb Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Thu, 27 Sep 2018 15:51:01 +0200
|
||||
Subject: [PATCH] ocaml: make sure to pass LDFLAGS to ocamlmklibs linker
|
||||
(RHBZ#1624130)
|
||||
|
||||
Pass the LDFLAGS properly as arguments for the C linker when using
|
||||
ocamlmklibs via the -ldopt option.
|
||||
|
||||
Followup of commit 34c23403c51a4d59d826c8045e06f9aabc2ceb16.
|
||||
|
||||
(cherry picked from commit 4ff573c352973036b722ec0c9bf79be958b83b2c)
|
||||
---
|
||||
ocaml/Makefile.am | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
|
||||
index 752fc109c..4d13eed97 100644
|
||||
--- a/ocaml/Makefile.am
|
||||
+++ b/ocaml/Makefile.am
|
||||
@@ -64,14 +64,14 @@ endif
|
||||
|
||||
stamp-mlguestfs: libguestfsocaml.a $(guestfs_cmm)
|
||||
$(OCAMLMKLIB) -o mlguestfs \
|
||||
+ -ldopt '$(LDFLAGS)' \
|
||||
$(libguestfsocaml_a_OBJECTS) guestfs.cmo \
|
||||
- $(LDFLAGS) \
|
||||
$(LTLIBINTL) \
|
||||
-L../lib/.libs -lguestfs
|
||||
if HAVE_OCAMLOPT
|
||||
$(OCAMLMKLIB) -o mlguestfs \
|
||||
+ -ldopt '$(LDFLAGS)' \
|
||||
$(libguestfsocaml_a_OBJECTS) guestfs.cmx \
|
||||
- $(LDFLAGS) \
|
||||
$(LTLIBINTL) \
|
||||
-L../lib/.libs -lguestfs
|
||||
endif
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,323 +0,0 @@
|
||||
From 81f35e441d06bff2bf60bff6354d53de137847d9 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 19 Jun 2018 10:44:57 +0100
|
||||
Subject: [PATCH] v2v: Model machine type explicitly.
|
||||
|
||||
QEMU for x86 supports two machine types, "pc" (emulating the ancient
|
||||
Intel i440FX chipset originally used by the Pentium Pro), and "q35"
|
||||
(https://wiki.qemu.org/Features/Q35).
|
||||
|
||||
Currently virt-v2v does not set any machine type, so libvirt or the
|
||||
target hypervisor will choose some default, probably i440fx. The
|
||||
latest advice from the QEMU and libvirt communities is not to rely on
|
||||
the default machine type but to specify what we need explicitly, but
|
||||
it may also be that the libvirt configuration file has been changed to
|
||||
set the default machine type to Q35 (either by the distro or the end
|
||||
user).
|
||||
|
||||
None of this matters for reasonably new guests since they can boot
|
||||
with either chipset. However there are some very old guests (notably
|
||||
Windows XP) which cannot handle Q35.
|
||||
|
||||
This commit changes virt-v2v so it always tries to specify the machine
|
||||
type explicitly (assuming the target supports that, and not all of
|
||||
them do). For x86_64 guests this patch always selects i440fx (pc).
|
||||
In future we hope to get the correct machine type for the guest from
|
||||
libosinfo but this is not available yet.
|
||||
|
||||
For non-x86 architectures we select the "virt" model which will
|
||||
probably only work for AArch64. More work is needed for POWER.
|
||||
|
||||
For secure boot we still have to force the machine type to Q35. In a
|
||||
future version this forcing can be removed since any guest which is
|
||||
using secure boot will be new enough that it'll be using Q35 anyway
|
||||
(on x86).
|
||||
|
||||
(cherry picked from commit 55879b2f2c5b205352f48f999e20efd9b455ea43)
|
||||
---
|
||||
v2v/convert_linux.ml | 7 +++++++
|
||||
v2v/convert_windows.ml | 7 +++++++
|
||||
v2v/create_libvirt_xml.ml | 37 +++++++++++++++++++++++++------------
|
||||
v2v/create_ovf.ml | 2 ++
|
||||
v2v/output_glance.ml | 5 +++++
|
||||
v2v/output_qemu.ml | 30 +++++++++++++++++++-----------
|
||||
v2v/test-v2v-i-ova.xml | 2 +-
|
||||
v2v/types.ml | 8 ++++++++
|
||||
v2v/types.mli | 6 ++++--
|
||||
9 files changed, 78 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml
|
||||
index 4a7447fe1..fd6b71ba4 100644
|
||||
--- a/v2v/convert_linux.ml
|
||||
+++ b/v2v/convert_linux.ml
|
||||
@@ -122,6 +122,12 @@ let convert (g : G.guestfs) inspect source output rcaps =
|
||||
|
||||
SELinux_relabel.relabel g;
|
||||
|
||||
+ (* XXX Look up this information in libosinfo in future. *)
|
||||
+ let machine =
|
||||
+ match inspect.i_arch with
|
||||
+ | "i386"|"x86_64" -> I440FX
|
||||
+ | _ -> Virt in
|
||||
+
|
||||
(* Return guest capabilities from the convert () function. *)
|
||||
let guestcaps = {
|
||||
gcaps_block_bus = block_type;
|
||||
@@ -130,6 +136,7 @@ let convert (g : G.guestfs) inspect source output rcaps =
|
||||
gcaps_virtio_rng = kernel.ki_supports_virtio_rng;
|
||||
gcaps_virtio_balloon = kernel.ki_supports_virtio_balloon;
|
||||
gcaps_isa_pvpanic = kernel.ki_supports_isa_pvpanic;
|
||||
+ gcaps_machine = machine;
|
||||
gcaps_arch = Utils.kvm_arch inspect.i_arch;
|
||||
gcaps_acpi = acpi;
|
||||
} in
|
||||
diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml
|
||||
index 163319545..1e058136e 100644
|
||||
--- a/v2v/convert_windows.ml
|
||||
+++ b/v2v/convert_windows.ml
|
||||
@@ -212,6 +212,12 @@ let convert (g : G.guestfs) inspect source output rcaps =
|
||||
warning (f_"this guest has Anti-Virus (AV) software and a new virtio block device driver was installed. In some circumstances, AV may prevent new drivers from working (resulting in a 7B boot error). If this happens, try disabling AV before doing the conversion.");
|
||||
);
|
||||
|
||||
+ (* XXX Look up this information in libosinfo in future. *)
|
||||
+ let machine =
|
||||
+ match inspect.i_arch with
|
||||
+ | "i386"|"x86_64" -> I440FX
|
||||
+ | _ -> Virt in
|
||||
+
|
||||
(* Return guest capabilities from the convert () function. *)
|
||||
let guestcaps = {
|
||||
gcaps_block_bus = block_driver;
|
||||
@@ -220,6 +226,7 @@ let convert (g : G.guestfs) inspect source output rcaps =
|
||||
gcaps_virtio_rng = virtio_rng_supported;
|
||||
gcaps_virtio_balloon = virtio_ballon_supported;
|
||||
gcaps_isa_pvpanic = isa_pvpanic_supported;
|
||||
+ gcaps_machine = machine;
|
||||
gcaps_arch = Utils.kvm_arch inspect.i_arch;
|
||||
gcaps_acpi = true;
|
||||
} in
|
||||
diff --git a/v2v/create_libvirt_xml.ml b/v2v/create_libvirt_xml.ml
|
||||
index fbe90eeaa..8a34c94b0 100644
|
||||
--- a/v2v/create_libvirt_xml.ml
|
||||
+++ b/v2v/create_libvirt_xml.ml
|
||||
@@ -81,15 +81,17 @@ let create_libvirt_xml ?pool source target_buses guestcaps
|
||||
match target_firmware with
|
||||
| TargetBIOS -> None
|
||||
| TargetUEFI -> Some (find_uefi_firmware guestcaps.gcaps_arch) in
|
||||
- let secure_boot_required =
|
||||
- match uefi_firmware with
|
||||
- | Some { Uefi.flags = flags }
|
||||
- when List.mem Uefi.UEFI_FLAG_SECURE_BOOT_REQUIRED flags -> true
|
||||
- | _ -> false in
|
||||
- (* Currently these are required by secure boot, but in theory they
|
||||
- * might be independent properties.
|
||||
- *)
|
||||
- let machine_q35 = secure_boot_required in
|
||||
+ let machine, secure_boot_required =
|
||||
+ match guestcaps.gcaps_machine, uefi_firmware with
|
||||
+ | _, Some { Uefi.flags = flags }
|
||||
+ when List.mem Uefi.UEFI_FLAG_SECURE_BOOT_REQUIRED flags ->
|
||||
+ (* Force machine type to Q35 because PC does not support
|
||||
+ * secure boot. We must remove this when we get the
|
||||
+ * correct machine type from libosinfo in future. XXX
|
||||
+ *)
|
||||
+ Q35, true
|
||||
+ | machine, _ ->
|
||||
+ machine, false in
|
||||
let smm = secure_boot_required in
|
||||
|
||||
(* We have the machine features of the guest when it was on the
|
||||
@@ -140,7 +142,18 @@ let create_libvirt_xml ?pool source target_buses guestcaps
|
||||
|
||||
(* The <os> section subelements. *)
|
||||
let os_section =
|
||||
- let machine = if machine_q35 then [ "machine", "q35" ] else [] in
|
||||
+ let os = ref [] in
|
||||
+
|
||||
+ let machine =
|
||||
+ match machine with
|
||||
+ | I440FX -> "pc"
|
||||
+ | Q35 -> "q35"
|
||||
+ | Virt -> "virt" in
|
||||
+
|
||||
+ List.push_back os
|
||||
+ (e "type" ["arch", guestcaps.gcaps_arch;
|
||||
+ "machine", machine]
|
||||
+ [PCData "hvm"]);
|
||||
|
||||
let loader =
|
||||
match uefi_firmware with
|
||||
@@ -152,8 +165,8 @@ let create_libvirt_xml ?pool source target_buses guestcaps
|
||||
[ PCData code ];
|
||||
e "nvram" ["template", vars_template] [] ] in
|
||||
|
||||
- (e "type" (["arch", guestcaps.gcaps_arch] @ machine) [PCData "hvm"])
|
||||
- :: loader in
|
||||
+ List.push_back_list os loader;
|
||||
+ !os in
|
||||
|
||||
List.push_back_list body [
|
||||
e "os" [] os_section;
|
||||
diff --git a/v2v/create_ovf.ml b/v2v/create_ovf.ml
|
||||
index 5db239d66..01970013e 100644
|
||||
--- a/v2v/create_ovf.ml
|
||||
+++ b/v2v/create_ovf.ml
|
||||
@@ -602,6 +602,8 @@ let rec create_ovf source targets guestcaps inspect
|
||||
source.s_vcpu memsize_mb)]
|
||||
] in
|
||||
|
||||
+ (* XXX How to set machine type for Q35? *)
|
||||
+
|
||||
List.push_back virtual_hardware_section_items (
|
||||
e "Item" [] ([
|
||||
e "rasd:Caption" [] [PCData (sprintf "%d virtual cpu" source.s_vcpu)];
|
||||
diff --git a/v2v/output_glance.ml b/v2v/output_glance.ml
|
||||
index c334def42..96c31da59 100644
|
||||
--- a/v2v/output_glance.ml
|
||||
+++ b/v2v/output_glance.ml
|
||||
@@ -86,6 +86,11 @@ object
|
||||
(match guestcaps.gcaps_video with
|
||||
| QXL -> "qxl"
|
||||
| Cirrus -> "cirrus");
|
||||
+ "hw_machine_type",
|
||||
+ (match guestcaps.gcaps_machine with
|
||||
+ | I440FX -> "pc"
|
||||
+ | Q35 -> "q35"
|
||||
+ | Virt -> "virt");
|
||||
"architecture", guestcaps.gcaps_arch;
|
||||
"hypervisor_type", "kvm";
|
||||
"vm_mode", "hvm";
|
||||
diff --git a/v2v/output_qemu.ml b/v2v/output_qemu.ml
|
||||
index 952660de2..e23f22e12 100644
|
||||
--- a/v2v/output_qemu.ml
|
||||
+++ b/v2v/output_qemu.ml
|
||||
@@ -56,17 +56,25 @@ object
|
||||
match target_firmware with
|
||||
| TargetBIOS -> None
|
||||
| TargetUEFI -> Some (find_uefi_firmware guestcaps.gcaps_arch) in
|
||||
- let secure_boot_required =
|
||||
- match uefi_firmware with
|
||||
- | Some { Uefi.flags }
|
||||
- when List.mem Uefi.UEFI_FLAG_SECURE_BOOT_REQUIRED flags -> true
|
||||
- | _ -> false in
|
||||
- (* Currently these are required by secure boot, but in theory they
|
||||
- * might be independent properties.
|
||||
- *)
|
||||
- let machine_q35 = secure_boot_required in
|
||||
+ let machine, secure_boot_required =
|
||||
+ match guestcaps.gcaps_machine, uefi_firmware with
|
||||
+ | _, Some { Uefi.flags }
|
||||
+ when List.mem Uefi.UEFI_FLAG_SECURE_BOOT_REQUIRED flags ->
|
||||
+ (* Force machine type to Q35 because PC does not support
|
||||
+ * secure boot. We must remove this when we get the
|
||||
+ * correct machine type from libosinfo in future. XXX
|
||||
+ *)
|
||||
+ Q35, true
|
||||
+ | machine, _ ->
|
||||
+ machine, false in
|
||||
let smm = secure_boot_required in
|
||||
|
||||
+ let machine =
|
||||
+ match machine with
|
||||
+ | I440FX -> "pc"
|
||||
+ | Q35 -> "q35"
|
||||
+ | Virt -> "virt" in
|
||||
+
|
||||
(* Construct the command line. Note that the [Qemuopts]
|
||||
* module deals with shell and qemu comma quoting.
|
||||
*)
|
||||
@@ -80,8 +88,8 @@ object
|
||||
|
||||
flag "-no-user-config"; flag "-nodefaults";
|
||||
arg "-name" source.s_name;
|
||||
- arg_list "-machine" (if machine_q35 then ["q35"] else [] @
|
||||
- if smm then ["smm=on"] else [] @
|
||||
+ arg_list "-machine" (machine ::
|
||||
+ (if smm then ["smm=on"] else []) @
|
||||
["accel=kvm:tcg"]);
|
||||
|
||||
(match uefi_firmware with
|
||||
diff --git a/v2v/test-v2v-i-ova.xml b/v2v/test-v2v-i-ova.xml
|
||||
index 5a303b80a..b277193a8 100644
|
||||
--- a/v2v/test-v2v-i-ova.xml
|
||||
+++ b/v2v/test-v2v-i-ova.xml
|
||||
@@ -10,7 +10,7 @@
|
||||
<apic/>
|
||||
</features>
|
||||
<os>
|
||||
- <type arch='x86_64'>hvm</type>
|
||||
+ <type arch='x86_64' machine='pc'>hvm</type>
|
||||
</os>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
diff --git a/v2v/types.ml b/v2v/types.ml
|
||||
index bb77e5669..9851386f7 100644
|
||||
--- a/v2v/types.ml
|
||||
+++ b/v2v/types.ml
|
||||
@@ -401,6 +401,7 @@ type guestcaps = {
|
||||
gcaps_virtio_rng : bool;
|
||||
gcaps_virtio_balloon : bool;
|
||||
gcaps_isa_pvpanic : bool;
|
||||
+ gcaps_machine : guestcaps_machine;
|
||||
gcaps_arch : string;
|
||||
gcaps_acpi : bool;
|
||||
}
|
||||
@@ -412,6 +413,7 @@ and requested_guestcaps = {
|
||||
and guestcaps_block_type = Virtio_blk | Virtio_SCSI | IDE
|
||||
and guestcaps_net_type = Virtio_net | E1000 | RTL8139
|
||||
and guestcaps_video_type = QXL | Cirrus
|
||||
+and guestcaps_machine = I440FX | Q35 | Virt
|
||||
|
||||
let string_of_block_type = function
|
||||
| Virtio_blk -> "virtio-blk"
|
||||
@@ -424,17 +426,23 @@ let string_of_net_type = function
|
||||
let string_of_video = function
|
||||
| QXL -> "qxl"
|
||||
| Cirrus -> "cirrus"
|
||||
+let string_of_machine = function
|
||||
+ | I440FX -> "i440fx"
|
||||
+ | Q35 -> "q35"
|
||||
+ | Virt -> "virt"
|
||||
|
||||
let string_of_guestcaps gcaps =
|
||||
sprintf "\
|
||||
gcaps_block_bus = %s
|
||||
gcaps_net_bus = %s
|
||||
gcaps_video = %s
|
||||
+gcaps_machine = %s
|
||||
gcaps_arch = %s
|
||||
gcaps_acpi = %b
|
||||
" (string_of_block_type gcaps.gcaps_block_bus)
|
||||
(string_of_net_type gcaps.gcaps_net_bus)
|
||||
(string_of_video gcaps.gcaps_video)
|
||||
+ (string_of_machine gcaps.gcaps_machine)
|
||||
gcaps.gcaps_arch
|
||||
gcaps.gcaps_acpi
|
||||
|
||||
diff --git a/v2v/types.mli b/v2v/types.mli
|
||||
index f60e5c98f..5e33b1de9 100644
|
||||
--- a/v2v/types.mli
|
||||
+++ b/v2v/types.mli
|
||||
@@ -240,8 +240,9 @@ type guestcaps = {
|
||||
gcaps_virtio_balloon : bool; (** Guest supports virtio balloon. *)
|
||||
gcaps_isa_pvpanic : bool; (** Guest supports ISA pvpanic device. *)
|
||||
|
||||
- gcaps_arch : string; (** Architecture that KVM must emulate. *)
|
||||
- gcaps_acpi : bool; (** True if guest supports acpi. *)
|
||||
+ gcaps_machine : guestcaps_machine; (** Machine model. *)
|
||||
+ gcaps_arch : string; (** Architecture that KVM must emulate. *)
|
||||
+ gcaps_acpi : bool; (** True if guest supports acpi. *)
|
||||
}
|
||||
(** Guest capabilities after conversion. eg. Was virtio found or installed? *)
|
||||
|
||||
@@ -257,6 +258,7 @@ and requested_guestcaps = {
|
||||
and guestcaps_block_type = Virtio_blk | Virtio_SCSI | IDE
|
||||
and guestcaps_net_type = Virtio_net | E1000 | RTL8139
|
||||
and guestcaps_video_type = QXL | Cirrus
|
||||
+and guestcaps_machine = I440FX | Q35 | Virt
|
||||
|
||||
val string_of_guestcaps : guestcaps -> string
|
||||
val string_of_requested_guestcaps : requested_guestcaps -> string
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,37 +0,0 @@
|
||||
From 8a4072c4b16e20c6ac55cbf350bfae2d0d1c7a0b Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 3 Sep 2018 15:24:05 +0100
|
||||
Subject: [PATCH] v2v: windows: Fix rhev-apt command line (RHBZ#1624902).
|
||||
|
||||
See:
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1584678#c15
|
||||
|
||||
Fixes commit bcdbe6405c10ecb7374ae47eee6385be17dbd49e. However this
|
||||
bug was copied directly from old virt-v2v which did the same thing
|
||||
(from lib/Sys/VirtConvert/Converter/Windows.pm):
|
||||
|
||||
echo installing rhev-apt >>log.txt
|
||||
"rhev-apt.exe" /S /v /qn >>log.txt
|
||||
|
||||
Thanks: Lev Veyde
|
||||
(cherry picked from commit e12c56176abcc2d970a35f83bffc95f7ad1b2aab)
|
||||
---
|
||||
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 1e058136e..0346ba4fe 100644
|
||||
--- a/v2v/convert_windows.ml
|
||||
+++ b/v2v/convert_windows.ml
|
||||
@@ -347,7 +347,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
|
||||
|
||||
echo starting rhev-apt
|
||||
net start rhev-apt
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,40 +0,0 @@
|
||||
From 4d78c436b15742c25288bcae441a9782ee316fe5 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 3 Sep 2018 14:30:21 +0100
|
||||
Subject: [PATCH] v2v: docs: Describe support for SHA-2 certs for Windows 7 /
|
||||
2008 R2 (RHBZ#1624878).
|
||||
|
||||
Thanks: Yan Vugenfirer.
|
||||
(cherry picked from commit 741ef228cd8d17bd1a8a60a2cfa83c3937120ede)
|
||||
---
|
||||
v2v/virt-v2v.pod | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
|
||||
index 893e47fb9..dc443b717 100644
|
||||
--- a/v2v/virt-v2v.pod
|
||||
+++ b/v2v/virt-v2v.pod
|
||||
@@ -1097,6 +1097,20 @@ This can also prevent booting with a 7B error [see previous section]
|
||||
if the guest has group policy containing
|
||||
C<Device Installation Restrictions>.
|
||||
|
||||
+=head2 Support for SHA-2 certificates in Windows 7 and Windows Server 2008 R2
|
||||
+
|
||||
+Later versions of the Windows virtio drivers are signed using SHA-2
|
||||
+certificates (instead of SHA-1). The original shipping Windows 7 and
|
||||
+Windows Server 2008 R2 did not understand SHA-2 certificates and so
|
||||
+the Windows virtio drivers will not install properly.
|
||||
+
|
||||
+To fix this you must apply SHA-2 Code Signing Support from:
|
||||
+L<https://docs.microsoft.com/en-us/security-updates/SecurityAdvisories/2015/3033929>
|
||||
+before converting the guest.
|
||||
+
|
||||
+For further information see:
|
||||
+L<https://bugzilla.redhat.com/show_bug.cgi?id=1624878>
|
||||
+
|
||||
=head1 UEFI
|
||||
|
||||
VMware allows you to present UEFI firmware to guests (instead of the
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,39 +0,0 @@
|
||||
From e4ba4ed8bbb033318e85407099a87912124e0040 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Wed, 21 Nov 2018 10:55:45 +0000
|
||||
Subject: [PATCH] v2v: docs: Remove sentence about supporting qemu-kvm-rhev in
|
||||
RHEL (RHBZ#1651977).
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The previous support documentation said that for UEFI guests, when
|
||||
using RHEL ≥ 7.3 host, you must use qemu-kvm-rhev. For RHEL 8 this is
|
||||
inaccurate since qemu-kvm-rhev no longer exists.
|
||||
|
||||
To fix this I've dropped the whole sentence. It only applies to the
|
||||
downstream product (RHEL) and so RHEL can add the right documentation
|
||||
if it needs to.
|
||||
|
||||
Thanks: Ming Xie, Pino Toscano.
|
||||
(cherry picked from commit 0e6bbcee7e30f6f1c3b92b77b5214c549d023044)
|
||||
---
|
||||
v2v/virt-v2v.pod | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
|
||||
index dc443b717..4b53cdc0e 100644
|
||||
--- a/v2v/virt-v2v.pod
|
||||
+++ b/v2v/virt-v2v.pod
|
||||
@@ -1132,8 +1132,6 @@ automatically, but note that the same version of OVMF must be
|
||||
installed on the conversion host as is installed on the target
|
||||
hypervisor, else you will have to adjust paths in the metadata.
|
||||
|
||||
-On RHEL E<ge> 7.3, only qemu-kvm-rhev (not qemu-kvm) is supported.
|
||||
-
|
||||
=item UEFI on OpenStack
|
||||
|
||||
Not supported.
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,33 +0,0 @@
|
||||
From e003f5b8e7fe673aa462199e6190ea58a0cef011 Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Tue, 4 Dec 2018 18:43:59 +0100
|
||||
Subject: [PATCH] v2v: linux: improve regex for resume= entries (RHBZ#1651987)
|
||||
|
||||
Add few more characters for the devices of resume= entries in the
|
||||
command line of grub: this way it is possible to match also /dev/mapper
|
||||
devices.
|
||||
|
||||
This should require no further processing, since the names of the
|
||||
/dev/mapper devices do not change after the conversion.
|
||||
|
||||
(cherry picked from commit 50b08fd84bc035ada9e7a3cdda6c36ab7e418e8c)
|
||||
---
|
||||
v2v/convert_linux.ml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml
|
||||
index fd6b71ba4..da06352a0 100644
|
||||
--- a/v2v/convert_linux.ml
|
||||
+++ b/v2v/convert_linux.ml
|
||||
@@ -983,7 +983,7 @@ let convert (g : G.guestfs) inspect source output rcaps =
|
||||
List.flatten (List.map Array.to_list (List.map g#aug_match paths)) in
|
||||
|
||||
(* Map device names for each entry. *)
|
||||
- let rex_resume = PCRE.compile "^resume=(/dev/[a-z\\d]+)(.*)$"
|
||||
+ let rex_resume = PCRE.compile "^resume=(/dev/[-a-z\\d/_]+)(.*)$"
|
||||
and rex_device_cciss = PCRE.compile "^/dev/(cciss/c\\d+d\\d+)(?:p(\\d+))?$"
|
||||
and rex_device = PCRE.compile "^/dev/([a-z]+)(\\d*)?$" in
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,27 +0,0 @@
|
||||
From 1e72a13be2bbe054f0a15cdf5cc08c58fe5c43ab Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 1 Oct 2018 09:51:15 +0100
|
||||
Subject: [PATCH] inspection: Parse os-release "opensuse-leap" as opensuse
|
||||
(RHBZ#1634248).
|
||||
|
||||
(cherry picked from commit 70407cd622dda6f088a0876e1e1ae669e9f8a281)
|
||||
---
|
||||
daemon/inspect_fs_unix.ml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/daemon/inspect_fs_unix.ml b/daemon/inspect_fs_unix.ml
|
||||
index f4b2fea14..33b93256f 100644
|
||||
--- a/daemon/inspect_fs_unix.ml
|
||||
+++ b/daemon/inspect_fs_unix.ml
|
||||
@@ -142,7 +142,7 @@ and distro_of_os_release_id = function
|
||||
| "frugalware" -> Some DISTRO_FRUGALWARE
|
||||
| "mageia" -> Some DISTRO_MAGEIA
|
||||
| "neokylin" -> Some DISTRO_NEOKYLIN
|
||||
- | "opensuse" -> Some DISTRO_OPENSUSE
|
||||
+ | "opensuse" | "opensuse-leap" -> Some DISTRO_OPENSUSE
|
||||
| "pld" -> Some DISTRO_PLD_LINUX
|
||||
| "rhel" -> Some DISTRO_RHEL
|
||||
| "sles" | "sled" -> Some DISTRO_SLES
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,30 +0,0 @@
|
||||
From c9b55904a06abaea5ee858b590c861caa705ad52 Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Fri, 30 Nov 2018 12:41:03 +0100
|
||||
Subject: [PATCH] inspect: handle os-release "opensuse-tumbleweed" as opensuse
|
||||
|
||||
Followup of commit 70407cd622dda6f088a0876e1e1ae669e9f8a281 for openSUSE
|
||||
Thumbleweed.
|
||||
|
||||
(cherry picked from commit 28bd06227b1633fa08c073fe8dbe65d013d7dc9e)
|
||||
---
|
||||
daemon/inspect_fs_unix.ml | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/daemon/inspect_fs_unix.ml b/daemon/inspect_fs_unix.ml
|
||||
index 33b93256f..6c3ab6e34 100644
|
||||
--- a/daemon/inspect_fs_unix.ml
|
||||
+++ b/daemon/inspect_fs_unix.ml
|
||||
@@ -142,7 +142,8 @@ and distro_of_os_release_id = function
|
||||
| "frugalware" -> Some DISTRO_FRUGALWARE
|
||||
| "mageia" -> Some DISTRO_MAGEIA
|
||||
| "neokylin" -> Some DISTRO_NEOKYLIN
|
||||
- | "opensuse" | "opensuse-leap" -> Some DISTRO_OPENSUSE
|
||||
+ | "opensuse" -> Some DISTRO_OPENSUSE
|
||||
+ | s when String.is_prefix s "opensuse-" -> Some DISTRO_OPENSUSE
|
||||
| "pld" -> Some DISTRO_PLD_LINUX
|
||||
| "rhel" -> Some DISTRO_RHEL
|
||||
| "sles" | "sled" -> Some DISTRO_SLES
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,43 +0,0 @@
|
||||
From 10bff3240c5593c6c2e3c03063b98c53bb1b963e Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Thu, 13 Dec 2018 11:49:48 +0100
|
||||
Subject: [PATCH] v2v: update docs for VMware roles (RHBZ#1530967)
|
||||
|
||||
Update the list of permissions needed for VMware vCenter 6.5.
|
||||
|
||||
(cherry picked from commit 37955f14aa628bedbe0c06bddb5f8fa4f508cc62)
|
||||
---
|
||||
v2v/virt-v2v.pod | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
|
||||
index 4b53cdc0e..d4d8578cb 100644
|
||||
--- a/v2v/virt-v2v.pod
|
||||
+++ b/v2v/virt-v2v.pod
|
||||
@@ -1331,7 +1331,8 @@ write to libvirt or any other supported target.
|
||||
|
||||
Instead of using the vCenter Administrator role, you can create a
|
||||
custom non-administrator role to perform the conversion. You will
|
||||
-however need to give it a minimum set of permissions as follows:
|
||||
+however need to give it a minimum set of permissions as follows
|
||||
+(using VMware vCenter 6.5):
|
||||
|
||||
=over 4
|
||||
|
||||
@@ -1351,10 +1352,12 @@ Enable (check) the following objects:
|
||||
- Validate session
|
||||
|
||||
Virtual Machine:
|
||||
+ Interaction:
|
||||
+ - Guest operating system management by VIX API
|
||||
Provisioning:
|
||||
- Allow disk access
|
||||
- Allow read-only disk access
|
||||
- - Guest Operating system management by VIX API
|
||||
+ - Allow virtual machine download
|
||||
|
||||
=back
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,50 +0,0 @@
|
||||
From 6e71dcc1c9c1d8dd37da3f0fd71fc97cc5cbe92f Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Thu, 13 Dec 2018 18:36:20 +0100
|
||||
Subject: [PATCH] v2v: -o rhv-upload: decouple name of nbdkit python plugin
|
||||
|
||||
Do not assume that the Python plugin of nbdkit has the same name of the
|
||||
Python interpreter.
|
||||
|
||||
Use the default upstream name of nbdkit to identify it; downstream
|
||||
distributions must adjust this variable, in case they rename the Python
|
||||
plugin of nbdkit.
|
||||
|
||||
(cherry picked from commit 6b80c5fb51f08d3e62393e6722655bbcd940f4e7)
|
||||
---
|
||||
v2v/output_rhv_upload.ml | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml
|
||||
index 7dbd98a0d..79a2fc8fd 100644
|
||||
--- a/v2v/output_rhv_upload.ml
|
||||
+++ b/v2v/output_rhv_upload.ml
|
||||
@@ -79,6 +79,7 @@ let parse_output_options options =
|
||||
{ rhv_cafile; rhv_cluster; rhv_direct; rhv_verifypeer }
|
||||
|
||||
let python3 = "python3" (* Defined by PEP 394 *)
|
||||
+let nbdkit_python_plugin = "python"
|
||||
let pidfile_timeout = 30
|
||||
let finalization_timeout = 5*60
|
||||
|
||||
@@ -155,7 +156,7 @@ class output_rhv_upload output_alloc output_conn
|
||||
*)
|
||||
let error_unless_nbdkit_python3_working () =
|
||||
let cmd = sprintf "nbdkit %s %s --dump-plugin >/dev/null"
|
||||
- python3 (quote plugin) in
|
||||
+ nbdkit_python_plugin (quote plugin) in
|
||||
if Sys.command cmd <> 0 then
|
||||
error (f_"nbdkit Python 3 plugin is not installed or not working. It is required if you want to use ‘-o rhv-upload’.
|
||||
|
||||
@@ -222,7 +223,7 @@ See also \"OUTPUT TO RHV\" in the virt-v2v(1) manual.")
|
||||
"--newstyle"; (* use newstyle NBD protocol *)
|
||||
"--exportname"; "/";
|
||||
|
||||
- "python3"; (* use the nbdkit Python 3 plugin *)
|
||||
+ nbdkit_python_plugin; (* use the nbdkit Python plugin *)
|
||||
plugin; (* Python plugin script *)
|
||||
] in
|
||||
let args = if verbose () then args @ ["--verbose"] else args in
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,30 +0,0 @@
|
||||
From c5460f73b805c754ad736dcacc7d6bf7a5f6cfb7 Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Mon, 7 Jan 2019 12:23:25 +0100
|
||||
Subject: [PATCH] v2v: further doc update for VMware roles
|
||||
|
||||
Remove "Allow virtual machine download", added with
|
||||
commit 37955f14aa628bedbe0c06bddb5f8fa4f508cc62, because it does not
|
||||
seem to be actually needed.
|
||||
|
||||
Related: RHBZ#1530967
|
||||
(cherry picked from commit 5e5896752ef06872696f1da05b414fc9eca94015)
|
||||
---
|
||||
v2v/virt-v2v.pod | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
|
||||
index d4d8578cb..f4d200e3d 100644
|
||||
--- a/v2v/virt-v2v.pod
|
||||
+++ b/v2v/virt-v2v.pod
|
||||
@@ -1357,7 +1357,6 @@ Enable (check) the following objects:
|
||||
Provisioning:
|
||||
- Allow disk access
|
||||
- Allow read-only disk access
|
||||
- - Allow virtual machine download
|
||||
|
||||
=back
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,40 +0,0 @@
|
||||
From da45c7c305a8ed03b7b1b11f6524e1321c5ad2b3 Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Tue, 22 Jan 2019 12:43:11 +0100
|
||||
Subject: [PATCH] python: fix call of Python handlers of events
|
||||
|
||||
Make sure to reference the arguments, to make sure they are kept alive
|
||||
during the function call; this is visible when setting an event handler
|
||||
for the CLOSE event, and testing it with Python 3.
|
||||
|
||||
This does not seem to create a memory leak e.g. with Python 2.
|
||||
|
||||
Also, switch away from the quasi-internal PyEval_CallObject to the
|
||||
public PyObject_CallObject, which takes care of doing safety checks.
|
||||
|
||||
(cherry picked from commit 85235aec837716f1ddb2926b9a59a02543195500)
|
||||
---
|
||||
python/handle.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/python/handle.c b/python/handle.c
|
||||
index 1ffa4588a..13a93ad8c 100644
|
||||
--- a/python/handle.c
|
||||
+++ b/python/handle.c
|
||||
@@ -136,11 +136,12 @@ guestfs_int_py_event_callback_wrapper (guestfs_h *g,
|
||||
args = Py_BuildValue ("(Kis#O)",
|
||||
(unsigned PY_LONG_LONG) event, event_handle,
|
||||
buf, buf_len, py_array);
|
||||
+ Py_INCREF (args);
|
||||
|
||||
if (PyEval_ThreadsInitialized ())
|
||||
py_save = PyGILState_Ensure ();
|
||||
|
||||
- py_r = PyEval_CallObject (py_callback, args);
|
||||
+ py_r = PyObject_CallObject (py_callback, args);
|
||||
|
||||
if (PyEval_ThreadsInitialized ())
|
||||
PyGILState_Release (py_save);
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,54 +0,0 @@
|
||||
From f4c25f88b1187bfd1ff73c8f824d9a020716ae79 Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Tue, 22 Jan 2019 13:04:59 +0100
|
||||
Subject: [PATCH] python: change types for RBufferOut/FBuffer with Python 3
|
||||
(RHBZ#1661871)
|
||||
|
||||
So far RBufferOut return values, and FBuffer struct fields are 'str' on
|
||||
all the versions of Python. Python 3 distinguishes between 'str'
|
||||
(unicode strings), and 'bytes', with 'str' no more able to hold
|
||||
arbitrary data.
|
||||
|
||||
For this reason, switch the return value of RBufferOut functions, and
|
||||
FBuffer struct fields to bytes on Python 3: while this is a potentially
|
||||
incompatibile change, this is the only way to handle safely sequences
|
||||
of arbitrary bytes.
|
||||
|
||||
(cherry picked from commit 0ee02e0117527b86a31b2a88a14994ce7f15571f)
|
||||
---
|
||||
generator/python.ml | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/generator/python.ml b/generator/python.ml
|
||||
index 8fa0b17c0..a75b5f375 100644
|
||||
--- a/generator/python.ml
|
||||
+++ b/generator/python.ml
|
||||
@@ -195,8 +195,13 @@ and generate_python_structs () =
|
||||
pr " goto err;\n";
|
||||
pr " PyDict_SetItemString (dict, \"%s\", value);\n" name;
|
||||
| name, FBuffer ->
|
||||
+ pr "#if PY_MAJOR_VERSION >= 3\n";
|
||||
+ pr " value = PyBytes_FromStringAndSize (%s->%s, %s->%s_len);\n"
|
||||
+ typ name typ name;
|
||||
+ pr "#else\n";
|
||||
pr " value = guestfs_int_py_fromstringsize (%s->%s, %s->%s_len);\n"
|
||||
typ name typ name;
|
||||
+ pr "#endif\n";
|
||||
pr " if (value == NULL)\n";
|
||||
pr " goto err;\n";
|
||||
pr " PyDict_SetItemString (dict, \"%s\", value);\n" name;
|
||||
@@ -511,7 +516,11 @@ and generate_python_actions actions () =
|
||||
pr " guestfs_int_free_string_list (r);\n";
|
||||
pr " if (py_r == NULL) goto out;\n";
|
||||
| RBufferOut _ ->
|
||||
+ pr "#if PY_MAJOR_VERSION >= 3\n";
|
||||
+ pr " py_r = PyBytes_FromStringAndSize (r, size);\n";
|
||||
+ pr "#else\n";
|
||||
pr " py_r = guestfs_int_py_fromstringsize (r, size);\n";
|
||||
+ pr "#endif\n";
|
||||
pr " free (r);\n";
|
||||
pr " if (py_r == NULL) goto out;\n";
|
||||
);
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,238 +0,0 @@
|
||||
From 66a40516a2696b7528803d7637c022659fa8c46e Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 2 Oct 2014 16:44:07 +0100
|
||||
Subject: [PATCH] Revert "launch: libvirt: Use qemu-bridge-helper to implement
|
||||
a full network (RHBZ#1148012)."
|
||||
|
||||
We've been carrying this exact patch in RHEL 7 for several years. It
|
||||
reverts the change made in 2014 where we switched to using the virbr0
|
||||
bridge for libguestfs networking instead of SLIRP. We thought SLIRP
|
||||
was going to become unsupported in qemu, but recently there have been
|
||||
more encouraging signs since it looks like SLIRP will be spun off as a
|
||||
separate project, running as a modular process and properly secured
|
||||
and supported.
|
||||
|
||||
This reverts commit 224de20b9a8d5ea56f6337f19b4ca237bb88eca0.
|
||||
|
||||
(cherry picked from commit 492a945791b43f80a769a53e60d0899b3d7c60ab)
|
||||
---
|
||||
lib/guestfs-internal.h | 11 +++++
|
||||
lib/guestfs.pod | 10 -----
|
||||
lib/launch-direct.c | 11 -----
|
||||
lib/launch-libvirt.c | 91 ++++++++++--------------------------------
|
||||
4 files changed, 32 insertions(+), 91 deletions(-)
|
||||
|
||||
diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h
|
||||
index adeb9478a..fe3a0e3b9 100644
|
||||
--- a/lib/guestfs-internal.h
|
||||
+++ b/lib/guestfs-internal.h
|
||||
@@ -147,6 +147,17 @@
|
||||
#define MACHINE_TYPE "pseries"
|
||||
#endif
|
||||
|
||||
+/* Differences in qemu device names on ARMv7 (virtio-mmio), s/390x
|
||||
+ * (CCW) vs normal hardware with PCI.
|
||||
+ */
|
||||
+#if defined(__arm__)
|
||||
+#define VIRTIO_DEVICE_NAME(type) type "-device"
|
||||
+#elif defined(__s390x__)
|
||||
+#define VIRTIO_DEVICE_NAME(type) type "-ccw"
|
||||
+#else
|
||||
+#define VIRTIO_DEVICE_NAME(type) type "-pci"
|
||||
+#endif
|
||||
+
|
||||
/* Guestfs handle and associated structures. */
|
||||
|
||||
/* State. */
|
||||
diff --git a/lib/guestfs.pod b/lib/guestfs.pod
|
||||
index 4b24006df..c7fbeef03 100644
|
||||
--- a/lib/guestfs.pod
|
||||
+++ b/lib/guestfs.pod
|
||||
@@ -1551,16 +1551,6 @@ On Fedora, install C<kernel-debuginfo> for the C<vmlinux> file
|
||||
(containing symbols). Make sure the symbols precisely match the
|
||||
kernel being used.
|
||||
|
||||
-=head3 network_bridge
|
||||
-
|
||||
-The libvirt backend supports:
|
||||
-
|
||||
- export LIBGUESTFS_BACKEND_SETTINGS=network_bridge=virbrX
|
||||
-
|
||||
-This allows you to override the bridge that is connected to when the
|
||||
-network is enabled. The default is C<virbr0>. See also
|
||||
-L</guestfs_set_network>.
|
||||
-
|
||||
=head2 ATTACHING TO RUNNING DAEMONS
|
||||
|
||||
I<Note (1):> This is B<highly experimental> and has a tendency to eat
|
||||
diff --git a/lib/launch-direct.c b/lib/launch-direct.c
|
||||
index 47e8f37de..f6c494d69 100644
|
||||
--- a/lib/launch-direct.c
|
||||
+++ b/lib/launch-direct.c
|
||||
@@ -49,17 +49,6 @@
|
||||
#include "guestfs_protocol.h"
|
||||
#include "qemuopts.h"
|
||||
|
||||
-/* Differences in qemu device names on ARMv7 (virtio-mmio), s/390x
|
||||
- * (CCW) vs normal hardware with PCI.
|
||||
- */
|
||||
-#if defined(__arm__)
|
||||
-#define VIRTIO_DEVICE_NAME(type) type "-device"
|
||||
-#elif defined(__s390x__)
|
||||
-#define VIRTIO_DEVICE_NAME(type) type "-ccw"
|
||||
-#else
|
||||
-#define VIRTIO_DEVICE_NAME(type) type "-pci"
|
||||
-#endif
|
||||
-
|
||||
/* Per-handle data. */
|
||||
struct backend_direct_data {
|
||||
pid_t pid; /* Qemu PID. */
|
||||
diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
|
||||
index 7121aee1b..4df26825a 100644
|
||||
--- a/lib/launch-libvirt.c
|
||||
+++ b/lib/launch-libvirt.c
|
||||
@@ -116,7 +116,6 @@ struct backend_libvirt_data {
|
||||
char *selinux_label;
|
||||
char *selinux_imagelabel;
|
||||
bool selinux_norelabel_disks;
|
||||
- char *network_bridge;
|
||||
char name[DOMAIN_NAME_LEN]; /* random name */
|
||||
bool is_kvm; /* false = qemu, true = kvm (from capabilities)*/
|
||||
struct version libvirt_version; /* libvirt version */
|
||||
@@ -157,7 +156,6 @@ static int is_blk (const char *path);
|
||||
static void ignore_errors (void *ignore, virErrorPtr ignore2);
|
||||
static void set_socket_create_context (guestfs_h *g);
|
||||
static void clear_socket_create_context (guestfs_h *g);
|
||||
-static int check_bridge_exists (guestfs_h *g, const char *brname);
|
||||
|
||||
#if HAVE_LIBSELINUX
|
||||
static void selinux_warning (guestfs_h *g, const char *func, const char *selinux_op, const char *data);
|
||||
@@ -438,17 +436,8 @@ launch_libvirt (guestfs_h *g, void *datav, const char *libvirt_uri)
|
||||
guestfs_get_backend_setting (g, "internal_libvirt_imagelabel");
|
||||
data->selinux_norelabel_disks =
|
||||
guestfs_int_get_backend_setting_bool (g, "internal_libvirt_norelabel_disks");
|
||||
- if (g->enable_network) {
|
||||
- data->network_bridge =
|
||||
- guestfs_get_backend_setting (g, "network_bridge");
|
||||
- if (!data->network_bridge)
|
||||
- data->network_bridge = safe_strdup (g, "virbr0");
|
||||
- }
|
||||
guestfs_pop_error_handler (g);
|
||||
|
||||
- if (g->enable_network && check_bridge_exists (g, data->network_bridge) == -1)
|
||||
- goto cleanup;
|
||||
-
|
||||
/* Locate and/or build the appliance. */
|
||||
TRACE0 (launch_build_libvirt_appliance_start);
|
||||
|
||||
@@ -1403,19 +1392,6 @@ construct_libvirt_xml_devices (guestfs_h *g,
|
||||
} end_element ();
|
||||
} end_element ();
|
||||
|
||||
- /* Connect to libvirt bridge (see: RHBZ#1148012). */
|
||||
- if (g->enable_network) {
|
||||
- start_element ("interface") {
|
||||
- attribute ("type", "bridge");
|
||||
- start_element ("source") {
|
||||
- attribute ("bridge", params->data->network_bridge);
|
||||
- } end_element ();
|
||||
- start_element ("model") {
|
||||
- attribute ("type", "virtio");
|
||||
- } end_element ();
|
||||
- } end_element ();
|
||||
- }
|
||||
-
|
||||
/* Libvirt adds some devices by default. Indicate to libvirt
|
||||
* that we don't want them.
|
||||
*/
|
||||
@@ -1823,6 +1799,27 @@ construct_libvirt_xml_qemu_cmdline (guestfs_h *g,
|
||||
attribute ("value", tmpdir);
|
||||
} end_element ();
|
||||
|
||||
+ /* Workaround because libvirt user networking cannot specify "net="
|
||||
+ * parameter.
|
||||
+ */
|
||||
+ if (g->enable_network) {
|
||||
+ start_element ("qemu:arg") {
|
||||
+ attribute ("value", "-netdev");
|
||||
+ } end_element ();
|
||||
+
|
||||
+ start_element ("qemu:arg") {
|
||||
+ attribute ("value", "user,id=usernet,net=169.254.0.0/16");
|
||||
+ } end_element ();
|
||||
+
|
||||
+ start_element ("qemu:arg") {
|
||||
+ attribute ("value", "-device");
|
||||
+ } end_element ();
|
||||
+
|
||||
+ start_element ("qemu:arg") {
|
||||
+ attribute ("value", VIRTIO_DEVICE_NAME ("virtio-net") ",netdev=usernet");
|
||||
+ } end_element ();
|
||||
+ }
|
||||
+
|
||||
/* The qemu command line arguments requested by the caller. */
|
||||
for (hp = g->hv_params; hp; hp = hp->next) {
|
||||
start_element ("qemu:arg") {
|
||||
@@ -2060,49 +2057,6 @@ is_blk (const char *path)
|
||||
return S_ISBLK (statbuf.st_mode);
|
||||
}
|
||||
|
||||
-static int
|
||||
-is_dir (const char *path)
|
||||
-{
|
||||
- struct stat statbuf;
|
||||
-
|
||||
- if (stat (path, &statbuf) == -1)
|
||||
- return 0;
|
||||
- return S_ISDIR (statbuf.st_mode);
|
||||
-}
|
||||
-
|
||||
-/* Used to check the network_bridge exists, or give a useful error
|
||||
- * message.
|
||||
- */
|
||||
-static int
|
||||
-check_bridge_exists (guestfs_h *g, const char *brname)
|
||||
-{
|
||||
- CLEANUP_FREE char *path = NULL;
|
||||
-
|
||||
- /* If this doesn't look like Linux, give up. */
|
||||
- if (!is_dir ("/sys/class/net"))
|
||||
- return 0;
|
||||
-
|
||||
- /* Does the interface exist and is it a bridge? */
|
||||
- path = safe_asprintf (g, "/sys/class/net/%s/bridge", brname);
|
||||
- if (is_dir (path))
|
||||
- return 0;
|
||||
-
|
||||
- error (g,
|
||||
- _("bridge ‘%s’ not found. Try running:\n"
|
||||
- "\n"
|
||||
- " brctl show\n"
|
||||
- "\n"
|
||||
- "to get a list of bridges on the host, and then selecting the\n"
|
||||
- "bridge you wish the appliance network to connect to using:\n"
|
||||
- "\n"
|
||||
- " export LIBGUESTFS_BACKEND_SETTINGS=network_bridge=<bridge name>\n"
|
||||
- "\n"
|
||||
- "You may also need to allow the bridge in /etc/qemu/bridge.conf.\n"
|
||||
- "For further information see guestfs(3)."),
|
||||
- brname);
|
||||
- return -1;
|
||||
-}
|
||||
-
|
||||
static void
|
||||
ignore_errors (void *ignore, virErrorPtr ignore2)
|
||||
{
|
||||
@@ -2148,9 +2102,6 @@ shutdown_libvirt (guestfs_h *g, void *datav, int check_for_errors)
|
||||
free (data->selinux_imagelabel);
|
||||
data->selinux_imagelabel = NULL;
|
||||
|
||||
- free (data->network_bridge);
|
||||
- data->network_bridge = NULL;
|
||||
-
|
||||
for (i = 0; i < data->nr_secrets; ++i)
|
||||
free (data->secrets[i].secret);
|
||||
free (data->secrets);
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,52 +0,0 @@
|
||||
From 02d16cdeada455e692a972b34cd86e18a6081c05 Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Mon, 14 Jan 2019 17:07:45 +0100
|
||||
Subject: [PATCH] inspect: fix inspection of partition-less devices
|
||||
(RHBZ#1661038)
|
||||
|
||||
When parsing "xdev"-kind devices, do not assume that the partition
|
||||
number can be converted to integer: re_xdev accepts an empty part of the
|
||||
partition number, so just handle as it is, as string.
|
||||
|
||||
This fixes a regression due to the conversion of the inspection code to
|
||||
OCaml, as the old C version did not have this issue.
|
||||
|
||||
(cherry picked from commit cf6b527824b2a8dc6e8bc65e38ebdceb227e6db1)
|
||||
---
|
||||
daemon/inspect_fs_unix_fstab.ml | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/daemon/inspect_fs_unix_fstab.ml b/daemon/inspect_fs_unix_fstab.ml
|
||||
index 170440d2c..3428ad75c 100644
|
||||
--- a/daemon/inspect_fs_unix_fstab.ml
|
||||
+++ b/daemon/inspect_fs_unix_fstab.ml
|
||||
@@ -347,7 +347,7 @@ and resolve_fstab_device spec md_map os_type =
|
||||
debug_matching "xdev";
|
||||
let typ = PCRE.sub 1
|
||||
and disk = PCRE.sub 2
|
||||
- and part = int_of_string (PCRE.sub 3) in
|
||||
+ and part = PCRE.sub 3 in
|
||||
resolve_xdev typ disk part default
|
||||
)
|
||||
|
||||
@@ -464,7 +464,7 @@ and resolve_fstab_device spec md_map os_type =
|
||||
debug_matching "Hurd";
|
||||
let typ = PCRE.sub 1
|
||||
and disk = int_of_string (PCRE.sub 2)
|
||||
- and part = int_of_string (PCRE.sub 3) in
|
||||
+ and part = PCRE.sub 3 in
|
||||
|
||||
(* Hurd disk devices are like /dev/hdNsM, where hdN is the
|
||||
* N-th disk and M is the M-th partition on that disk.
|
||||
@@ -501,7 +501,7 @@ and resolve_xdev typ disk part default =
|
||||
let i = drive_index disk in
|
||||
if i >= 0 && i < Array.length devices then (
|
||||
let dev = Array.get devices i in
|
||||
- let dev = dev ^ string_of_int part in
|
||||
+ let dev = dev ^ part in
|
||||
if is_partition dev then
|
||||
Mountable.of_device dev
|
||||
else
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,33 +0,0 @@
|
||||
From f0c89d705d1fe68b456ddadb5da10437c69f16ca Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Sun, 28 Sep 2014 19:14:43 +0100
|
||||
Subject: [PATCH] RHEL 8: v2v: Select correct qemu binary for -o qemu mode
|
||||
(RHBZ#1147313).
|
||||
|
||||
RHEL 8 does not have qemu-system-x86_64 (etc), and in addition the
|
||||
qemu binary is located in /usr/libexec. Encode the path to this
|
||||
binary directly in the script.
|
||||
|
||||
Note that we don't support people running qemu directly like this.
|
||||
It's just for quick testing of converted VMs, and to help us with
|
||||
support cases.
|
||||
---
|
||||
v2v/output_qemu.ml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/v2v/output_qemu.ml b/v2v/output_qemu.ml
|
||||
index e23f22e12..c2f43119a 100644
|
||||
--- a/v2v/output_qemu.ml
|
||||
+++ b/v2v/output_qemu.ml
|
||||
@@ -79,7 +79,7 @@ object
|
||||
* module deals with shell and qemu comma quoting.
|
||||
*)
|
||||
let cmd = Qemuopts.create () in
|
||||
- Qemuopts.set_binary_by_arch cmd (Some guestcaps.gcaps_arch);
|
||||
+ Qemuopts.set_binary cmd "/usr/libexec/qemu-kvm";
|
||||
|
||||
let flag = Qemuopts.flag cmd
|
||||
and arg = Qemuopts.arg cmd
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,77 +0,0 @@
|
||||
From adb584859d0f894b6e228b124ac6678f15b5a6b7 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 30 Sep 2014 10:50:27 +0100
|
||||
Subject: [PATCH] RHEL 8: v2v: Disable the --qemu-boot option (RHBZ#1147313).
|
||||
|
||||
This cannot work because there is no Gtk or SDL output mode
|
||||
in RHEL 8's qemu-kvm.
|
||||
|
||||
In addition you will have to edit the -display option in the
|
||||
qemu script.
|
||||
---
|
||||
v2v/cmdline.ml | 3 ++-
|
||||
v2v/virt-v2v.pod | 13 -------------
|
||||
2 files changed, 2 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/v2v/cmdline.ml b/v2v/cmdline.ml
|
||||
index 97d4f4377..6bca12ce3 100644
|
||||
--- a/v2v/cmdline.ml
|
||||
+++ b/v2v/cmdline.ml
|
||||
@@ -228,7 +228,6 @@ let parse_cmdline () =
|
||||
s_"Use password from file";
|
||||
[ L"print-source" ], Getopt.Set print_source,
|
||||
s_"Print source and stop";
|
||||
- [ L"qemu-boot" ], Getopt.Set qemu_boot, s_"Boot in qemu (-o qemu only)";
|
||||
[ L"root" ], Getopt.String ("ask|... ", set_root_choice),
|
||||
s_"How to choose root filesystem";
|
||||
[ L"vddk-config" ], Getopt.String ("filename", set_input_option_compat "vddk-config"),
|
||||
@@ -564,6 +563,8 @@ read the man page virt-v2v(1).
|
||||
| Some d when not (is_directory d) ->
|
||||
error (f_"-os %s: output directory does not exist or is not a directory") d
|
||||
| Some d -> d in
|
||||
+ if qemu_boot then
|
||||
+ error (f_"-o qemu: the --qemu-boot option cannot be used in RHEL");
|
||||
Output_qemu.output_qemu os qemu_boot,
|
||||
output_format, output_alloc
|
||||
|
||||
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
|
||||
index f4d200e3d..a5b1c218a 100644
|
||||
--- a/v2v/virt-v2v.pod
|
||||
+++ b/v2v/virt-v2v.pod
|
||||
@@ -115,11 +115,6 @@ Since F<guest-domain.xml> contains the path(s) to the guest disk
|
||||
image(s) you do not need to specify the name of the disk image on the
|
||||
command line.
|
||||
|
||||
-To convert a local disk image and immediately boot it in local
|
||||
-qemu, do:
|
||||
-
|
||||
- virt-v2v -i disk disk.img -o qemu -os /var/tmp --qemu-boot
|
||||
-
|
||||
=head1 INPUT AND OUTPUT MODES
|
||||
|
||||
┌────────────┐ ┌─────────▶ -o null
|
||||
@@ -564,9 +559,6 @@ This is similar to I<-o local>, except that a shell script is written
|
||||
which you can use to boot the guest in qemu. The converted disks and
|
||||
shell script are written to the directory specified by I<-os>.
|
||||
|
||||
-When using this output mode, you can also specify the I<--qemu-boot>
|
||||
-option which boots the guest under qemu immediately.
|
||||
-
|
||||
=item B<-o> B<rhev>
|
||||
|
||||
This is the same as I<-o rhv>.
|
||||
@@ -791,11 +783,6 @@ Print information about the source guest and stop. This option is
|
||||
useful when you are setting up network and bridge maps.
|
||||
See L</NETWORKS AND BRIDGES>.
|
||||
|
||||
-=item B<--qemu-boot>
|
||||
-
|
||||
-When using I<-o qemu> only, this boots the guest immediately after
|
||||
-virt-v2v finishes.
|
||||
-
|
||||
=item B<-q>
|
||||
|
||||
=item B<--quiet>
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,60 +0,0 @@
|
||||
From 45879864c06bc7e293302d1025a6cdc92af654ca Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Fri, 24 Oct 2014 16:33:50 +0100
|
||||
Subject: [PATCH] RHEL 8: Disable alternate Augeas lenses.
|
||||
|
||||
These are included in the RHEL augeas package, and therefore not
|
||||
required.
|
||||
|
||||
See:
|
||||
https://www.redhat.com/archives/libguestfs/2014-October/msg00220.html
|
||||
---
|
||||
appliance/Makefile.am | 1 -
|
||||
daemon/augeas.c | 5 ++++-
|
||||
2 files changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/appliance/Makefile.am b/appliance/Makefile.am
|
||||
index 6cba8d158..16714b197 100644
|
||||
--- a/appliance/Makefile.am
|
||||
+++ b/appliance/Makefile.am
|
||||
@@ -91,7 +91,6 @@ supermin.d/daemon.tar.gz: ../daemon/guestfsd guestfs_shadow.aug
|
||||
rm -rf tmp-d
|
||||
mkdir -p tmp-d$(DAEMON_SUPERMIN_DIR) tmp-d/etc tmp-d/usr/share/guestfs
|
||||
ln ../daemon/guestfsd tmp-d$(DAEMON_SUPERMIN_DIR)/guestfsd
|
||||
- ln $(srcdir)/guestfs_shadow.aug tmp-d/usr/share/guestfs/guestfs_shadow.aug
|
||||
( cd tmp-d && tar zcf - * ) > $@-t
|
||||
rm -r tmp-d
|
||||
mv $@-t $@
|
||||
diff --git a/daemon/augeas.c b/daemon/augeas.c
|
||||
index 453251337..5bbfffa2d 100644
|
||||
--- a/daemon/augeas.c
|
||||
+++ b/daemon/augeas.c
|
||||
@@ -134,7 +134,7 @@ do_aug_init (const char *root, int flags)
|
||||
}
|
||||
|
||||
/* Pass AUG_NO_ERR_CLOSE so we can display detailed errors. */
|
||||
- aug = aug_init (buf, "/usr/share/guestfs/", flags | AUG_NO_ERR_CLOSE);
|
||||
+ aug = aug_init (buf, NULL, flags | AUG_NO_ERR_CLOSE);
|
||||
|
||||
if (!aug) {
|
||||
reply_with_error ("augeas initialization failed");
|
||||
@@ -148,6 +148,8 @@ do_aug_init (const char *root, int flags)
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ /* We already have the needed lenses in RHEL 8 */
|
||||
+#if 0
|
||||
if (!augeas_is_version (1, 2, 1)) {
|
||||
int r = aug_transform (aug, "guestfs_shadow", "/etc/shadow",
|
||||
0 /* = included */);
|
||||
@@ -166,6 +168,7 @@ do_aug_init (const char *root, int flags)
|
||||
}
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,34 +0,0 @@
|
||||
From d7263adc656e8a23a9707984ae0fcc6761ef3ca0 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 24 Apr 2015 09:45:41 -0400
|
||||
Subject: [PATCH] RHEL 8: Fix list of supported sound cards to match RHEL qemu
|
||||
(RHBZ#1176493).
|
||||
|
||||
---
|
||||
v2v/utils.ml | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/v2v/utils.ml b/v2v/utils.ml
|
||||
index 67e2028f3..436acb5f1 100644
|
||||
--- a/v2v/utils.ml
|
||||
+++ b/v2v/utils.ml
|
||||
@@ -51,13 +51,14 @@ let kvm_arch = function
|
||||
(* Does qemu support the given sound card? *)
|
||||
let qemu_supports_sound_card = function
|
||||
| Types.AC97
|
||||
- | Types.ES1370
|
||||
| Types.ICH6
|
||||
| Types.ICH9
|
||||
| Types.PCSpeaker
|
||||
+ -> true
|
||||
+ | Types.ES1370
|
||||
| Types.SB16
|
||||
| Types.USBAudio
|
||||
- -> true
|
||||
+ -> false
|
||||
|
||||
(* Find the UEFI firmware. *)
|
||||
let find_uefi_firmware guest_arch =
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,40 +0,0 @@
|
||||
From 75c3b624fd9d86906363ae5a433458ce6e853a83 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 7 Jul 2015 09:28:03 -0400
|
||||
Subject: [PATCH] RHEL 8: Reject use of libguestfs-winsupport features except
|
||||
for virt-* tools (RHBZ#1240276).
|
||||
|
||||
---
|
||||
generator/c.ml | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
diff --git a/generator/c.ml b/generator/c.ml
|
||||
index 0366866e2..ded9685dc 100644
|
||||
--- a/generator/c.ml
|
||||
+++ b/generator/c.ml
|
||||
@@ -1832,6 +1832,22 @@ and generate_client_actions actions () =
|
||||
check_args_validity c_name style;
|
||||
trace_call name c_name style;
|
||||
|
||||
+ (* RHEL 8 *)
|
||||
+ if name = "mount" || name = "mount_ro" || name = "mount_options" ||
|
||||
+ name = "mount_vfs" then (
|
||||
+ pr " if (g->program && !STRPREFIX (g->program, \"virt-\")) {\n";
|
||||
+ pr " CLEANUP_FREE char *vfs_type = guestfs_vfs_type (g, mountable);\n";
|
||||
+ pr " if (vfs_type && STREQ (vfs_type, \"ntfs\")) {\n";
|
||||
+ pr " error (g, \"mount: unsupported filesystem type\");\n";
|
||||
+ pr " if (trace_flag)\n";
|
||||
+ pr " guestfs_int_trace (g, \"%%s = %%s (error)\",\n";
|
||||
+ pr " \"%s\", \"-1\");\n" name;
|
||||
+ pr " return %s;\n" (string_of_errcode errcode);
|
||||
+ pr " }\n";
|
||||
+ pr " }\n";
|
||||
+ pr "\n";
|
||||
+ );
|
||||
+
|
||||
(* Calculate the total size of all FileIn arguments to pass
|
||||
* as a progress bar hint.
|
||||
*)
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,93 +0,0 @@
|
||||
From 056a6a9d07619008622d4d0bd0594654b6c02e70 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Sun, 30 Aug 2015 03:21:57 -0400
|
||||
Subject: [PATCH] RHEL 8: Fix tests for libguestfs-winsupport.
|
||||
|
||||
It doesn't let us use guestfish for arbitrary Windows edits.
|
||||
---
|
||||
test-data/phony-guests/make-windows-img.sh | 1 +
|
||||
tests/charsets/test-charset-fidelity.c | 2 ++
|
||||
v2v/test-v2v-virtio-win-iso.sh | 8 +++++++-
|
||||
v2v/test-v2v-windows-conversion.sh | 8 +++++++-
|
||||
4 files changed, 17 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/test-data/phony-guests/make-windows-img.sh b/test-data/phony-guests/make-windows-img.sh
|
||||
index d7c3ec9cf..9e556215a 100755
|
||||
--- a/test-data/phony-guests/make-windows-img.sh
|
||||
+++ b/test-data/phony-guests/make-windows-img.sh
|
||||
@@ -37,6 +37,7 @@ fi
|
||||
|
||||
# Create a disk image.
|
||||
guestfish <<EOF
|
||||
+set-program virt-testing
|
||||
sparse windows.img-t 512M
|
||||
run
|
||||
|
||||
diff --git a/tests/charsets/test-charset-fidelity.c b/tests/charsets/test-charset-fidelity.c
|
||||
index 967afbc88..eb0491b13 100644
|
||||
--- a/tests/charsets/test-charset-fidelity.c
|
||||
+++ b/tests/charsets/test-charset-fidelity.c
|
||||
@@ -93,6 +93,8 @@ main (int argc, char *argv[])
|
||||
if (g == NULL)
|
||||
error (EXIT_FAILURE, 0, "failed to create handle");
|
||||
|
||||
+ guestfs_set_program (g, "virt-testing");
|
||||
+
|
||||
if (guestfs_add_drive_scratch (g, 1024*1024*1024, -1) == -1)
|
||||
exit (EXIT_FAILURE);
|
||||
|
||||
diff --git a/v2v/test-v2v-virtio-win-iso.sh b/v2v/test-v2v-virtio-win-iso.sh
|
||||
index 6e99f0f1d..a8e572c5f 100755
|
||||
--- a/v2v/test-v2v-virtio-win-iso.sh
|
||||
+++ b/v2v/test-v2v-virtio-win-iso.sh
|
||||
@@ -79,6 +79,12 @@ mktest ()
|
||||
:> "$script"
|
||||
:> "$expected"
|
||||
|
||||
+cat >> "$script" <<EOF
|
||||
+ set-program virt-testing
|
||||
+ run
|
||||
+ mount /dev/sda2 /
|
||||
+EOF
|
||||
+
|
||||
firstboot_dir="/Program Files/Guestfs/Firstboot"
|
||||
mktest "is-dir \"$firstboot_dir\"" true
|
||||
mktest "is-file \"$firstboot_dir/firstboot.bat\"" true
|
||||
@@ -91,7 +97,7 @@ for drv in netkvm vioscsi viostor; do
|
||||
done
|
||||
done
|
||||
|
||||
-guestfish --ro -a "$d/windows-sda" -i < "$script" > "$response"
|
||||
+guestfish --ro -a "$d/windows-sda" < "$script" > "$response"
|
||||
diff -u "$expected" "$response"
|
||||
|
||||
rm -r $d
|
||||
diff --git a/v2v/test-v2v-windows-conversion.sh b/v2v/test-v2v-windows-conversion.sh
|
||||
index f1da222a9..ff94fe39b 100755
|
||||
--- a/v2v/test-v2v-windows-conversion.sh
|
||||
+++ b/v2v/test-v2v-windows-conversion.sh
|
||||
@@ -73,6 +73,12 @@ mktest ()
|
||||
:> "$script"
|
||||
:> "$expected"
|
||||
|
||||
+cat >> "$script" <<EOF
|
||||
+ set-program virt-testing
|
||||
+ run
|
||||
+ mount /dev/sda2 /
|
||||
+EOF
|
||||
+
|
||||
firstboot_dir="/Program Files/Guestfs/Firstboot"
|
||||
mktest "is-dir \"$firstboot_dir\"" true
|
||||
mktest "is-file \"$firstboot_dir/firstboot.bat\"" true
|
||||
@@ -85,7 +91,7 @@ for drv in netkvm qxl vioscsi viostor; do
|
||||
done
|
||||
done
|
||||
|
||||
-guestfish --ro -a "$d/windows-sda" -i < "$script" > "$response"
|
||||
+guestfish --ro -a "$d/windows-sda" < "$script" > "$response"
|
||||
diff -u "$expected" "$response"
|
||||
|
||||
# We also update the Registry several times, for firstboot, and (ONLY
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,125 +0,0 @@
|
||||
From 97261c9b087afa7bc9b48a6bfd132fcf98f7897a Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 21 Sep 2015 15:49:17 +0100
|
||||
Subject: [PATCH] RHEL 8: Revert "v2v: Add a support matrix to the manual
|
||||
page."
|
||||
|
||||
This reverts commit a03bffa15a5357d5d0244595caf99607be1ec3ab.
|
||||
---
|
||||
v2v/virt-v2v.pod | 100 -----------------------------------------------
|
||||
1 file changed, 100 deletions(-)
|
||||
|
||||
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
|
||||
index a5b1c218a..86046f891 100644
|
||||
--- a/v2v/virt-v2v.pod
|
||||
+++ b/v2v/virt-v2v.pod
|
||||
@@ -167,106 +167,6 @@ only used when virt-v2v runs under VDSM control.
|
||||
I<--in-place> instructs virt-v2v to customize the guest OS in the input
|
||||
virtual machine, instead of creating a new VM in the target hypervisor.
|
||||
|
||||
-=head1 SUPPORT MATRIX
|
||||
-
|
||||
-=head2 Hypervisors (Input)
|
||||
-
|
||||
-=over 4
|
||||
-
|
||||
-=item VMware ESXi
|
||||
-
|
||||
-Must be managed by VMware vCenter E<ge> 5.0 unless VDDK is available.
|
||||
-
|
||||
-=item OVA exported from VMware
|
||||
-
|
||||
-OVAs from other hypervisors will not work.
|
||||
-
|
||||
-=item VMX from VMware
|
||||
-
|
||||
-VMX files generated by other hypervisors will not work.
|
||||
-
|
||||
-=item RHEL 5 Xen
|
||||
-
|
||||
-=item SUSE Xen
|
||||
-
|
||||
-=item Citrix Xen
|
||||
-
|
||||
-Citrix Xen has not been recently tested.
|
||||
-
|
||||
-=item Hyper-V
|
||||
-
|
||||
-Not recently tested. Requires that you export the disk or use
|
||||
-L<virt-p2v(1)> on Hyper-V.
|
||||
-
|
||||
-=item Direct from disk images
|
||||
-
|
||||
-Only disk images exported from supported hypervisors, and using
|
||||
-container formats supported by qemu.
|
||||
-
|
||||
-=item Physical machines
|
||||
-
|
||||
-Using the L<virt-p2v(1)> tool.
|
||||
-
|
||||
-=back
|
||||
-
|
||||
-=head2 Hypervisors (Output)
|
||||
-
|
||||
-QEMU and KVM only.
|
||||
-
|
||||
-=head2 Virtualization management systems (Output)
|
||||
-
|
||||
-=over 4
|
||||
-
|
||||
-=item OpenStack Glance
|
||||
-
|
||||
-=item Red Hat Virtualization (RHV) 4.1 and up
|
||||
-
|
||||
-=item Local libvirt
|
||||
-
|
||||
-And hence L<virsh(1)>, L<virt-manager(1)>, and similar tools.
|
||||
-
|
||||
-=item Local disk
|
||||
-
|
||||
-=back
|
||||
-
|
||||
-=head2 Guests
|
||||
-
|
||||
-=over 4
|
||||
-
|
||||
-=item Red Hat Enterprise Linux 3, 4, 5, 6, 7
|
||||
-
|
||||
-=item CentOS 3, 4, 5, 6, 7
|
||||
-
|
||||
-=item Scientific Linux 3, 4, 5, 6, 7
|
||||
-
|
||||
-=item Oracle Linux
|
||||
-
|
||||
-=item Fedora
|
||||
-
|
||||
-=item SLES 10 and up
|
||||
-
|
||||
-=item OpenSUSE 10 and up
|
||||
-
|
||||
-=item Debian 6 and up
|
||||
-
|
||||
-=item Ubuntu 10.04, 12.04, 14.04, 16.04, and up
|
||||
-
|
||||
-=item Windows XP to Windows 10 / Windows Server 2016
|
||||
-
|
||||
-We use Windows internal version numbers, see
|
||||
-L<https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions>
|
||||
-
|
||||
-Currently NT 5.2 to NT 6.3 are supported.
|
||||
-
|
||||
-See L</WINDOWS> below for additional notes on converting Windows
|
||||
-guests.
|
||||
-
|
||||
-=back
|
||||
-
|
||||
-=head2 Guest firmware
|
||||
-
|
||||
-BIOS or UEFI for all guest types (but see L</UEFI> below).
|
||||
-
|
||||
=head1 OPTIONS
|
||||
|
||||
=over 4
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,28 +0,0 @@
|
||||
From e9ba6411d8a2535db43f59e32cd4dd61acdadd6a Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 21 Sep 2015 13:12:43 -0400
|
||||
Subject: [PATCH] RHEL 8: tests: Disable daemon tests that require the 'unix'
|
||||
backend.
|
||||
|
||||
---
|
||||
tests/daemon/Makefile.am | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tests/daemon/Makefile.am b/tests/daemon/Makefile.am
|
||||
index 053cad3e1..0d723fee4 100644
|
||||
--- a/tests/daemon/Makefile.am
|
||||
+++ b/tests/daemon/Makefile.am
|
||||
@@ -23,9 +23,7 @@ include $(top_srcdir)/subdir-rules.mk
|
||||
|
||||
check_DATA = captive-daemon.pm
|
||||
|
||||
-TESTS = \
|
||||
- test-daemon-start.pl \
|
||||
- test-btrfs.pl
|
||||
+TESTS =
|
||||
|
||||
TESTS_ENVIRONMENT = $(top_builddir)/run --test
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,284 +0,0 @@
|
||||
From e62ba81a68c66cbe15f182c9baa3667c5646e348 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 14 Jan 2016 11:53:42 -0500
|
||||
Subject: [PATCH] RHEL 8: v2v: Disable the virt-v2v --in-place option.
|
||||
|
||||
This disables the virt-v2v --in-place option which we do not
|
||||
wish to support in RHEL.
|
||||
(See commit d0069559a939e47e5f29973ed9a69a13f0b58301).
|
||||
---
|
||||
v2v/Makefile.am | 2 -
|
||||
v2v/cmdline.ml | 8 +--
|
||||
v2v/test-v2v-docs.sh | 1 +
|
||||
v2v/test-v2v-in-place.sh | 108 ---------------------------------------
|
||||
v2v/virt-v2v.pod | 46 +----------------
|
||||
5 files changed, 7 insertions(+), 158 deletions(-)
|
||||
delete mode 100755 v2v/test-v2v-in-place.sh
|
||||
|
||||
diff --git a/v2v/Makefile.am b/v2v/Makefile.am
|
||||
index 7a1ac329e..156f8ad5b 100644
|
||||
--- a/v2v/Makefile.am
|
||||
+++ b/v2v/Makefile.am
|
||||
@@ -358,7 +358,6 @@ if HAVE_LIBVIRT
|
||||
TESTS += \
|
||||
test-v2v-cdrom.sh \
|
||||
test-v2v-floppy.sh \
|
||||
- test-v2v-in-place.sh \
|
||||
test-v2v-networks-and-bridges.sh \
|
||||
test-v2v-no-copy.sh \
|
||||
test-v2v-o-glance.sh \
|
||||
@@ -497,7 +496,6 @@ EXTRA_DIST += \
|
||||
test-v2v-i-vmx-3.vmx \
|
||||
test-v2v-i-vmx-4.vmx \
|
||||
test-v2v-i-vmx-5.vmx \
|
||||
- test-v2v-in-place.sh \
|
||||
test-v2v-it-vddk-io-query.sh \
|
||||
test-v2v-machine-readable.sh \
|
||||
test-v2v-networks-and-bridges-expected.xml \
|
||||
diff --git a/v2v/cmdline.ml b/v2v/cmdline.ml
|
||||
index 6bca12ce3..0efff4c1d 100644
|
||||
--- a/v2v/cmdline.ml
|
||||
+++ b/v2v/cmdline.ml
|
||||
@@ -198,8 +198,7 @@ let parse_cmdline () =
|
||||
s_"Set option for input mode";
|
||||
[ M"it" ], Getopt.String ("transport", set_string_option_once "-it" input_transport),
|
||||
s_"Input transport";
|
||||
- [ L"in-place" ], Getopt.Set in_place,
|
||||
- s_"Only tune the guest in the input VM";
|
||||
+ [ L"in-place" ], Getopt.Set in_place, Getopt.hidden_option_description;
|
||||
[ L"machine-readable" ], Getopt.Set machine_readable,
|
||||
s_"Make output machine readable";
|
||||
[ S 'n'; L"network" ], Getopt.String ("in:out", add_network),
|
||||
@@ -336,7 +335,6 @@ read the man page virt-v2v(1).
|
||||
printf "vddk\n";
|
||||
printf "colours-option\n";
|
||||
printf "vdsm-compat-option\n";
|
||||
- printf "in-place\n";
|
||||
printf "io/oo\n";
|
||||
List.iter (printf "input:%s\n") (Modules_list.input_modules ());
|
||||
List.iter (printf "output:%s\n") (Modules_list.output_modules ());
|
||||
@@ -485,6 +483,10 @@ read the man page virt-v2v(1).
|
||||
error (f_"only ‘-it ssh’ can be used here") in
|
||||
Input_vmx.input_vmx input_transport arg in
|
||||
|
||||
+ (* Prevent use of --in-place option in RHEL. *)
|
||||
+ if in_place then
|
||||
+ error (f_"--in-place cannot be used in RHEL");
|
||||
+
|
||||
(* Common error message. *)
|
||||
let error_option_cannot_be_used_in_output_mode mode opt =
|
||||
error (f_"-o %s: %s option cannot be used in this output mode") mode opt
|
||||
diff --git a/v2v/test-v2v-docs.sh b/v2v/test-v2v-docs.sh
|
||||
index e1e22b599..da98050ee 100755
|
||||
--- a/v2v/test-v2v-docs.sh
|
||||
+++ b/v2v/test-v2v-docs.sh
|
||||
@@ -26,6 +26,7 @@ $top_srcdir/podcheck.pl virt-v2v.pod virt-v2v \
|
||||
--debug-overlay,\
|
||||
--ic,\
|
||||
--if,\
|
||||
+--in-place,\
|
||||
--io,\
|
||||
--it,\
|
||||
--no-trim,\
|
||||
diff --git a/v2v/test-v2v-in-place.sh b/v2v/test-v2v-in-place.sh
|
||||
deleted file mode 100755
|
||||
index 6f7d78f39..000000000
|
||||
--- a/v2v/test-v2v-in-place.sh
|
||||
+++ /dev/null
|
||||
@@ -1,108 +0,0 @@
|
||||
-#!/bin/bash -
|
||||
-# libguestfs virt-v2v test script
|
||||
-# Copyright (C) 2014 Red Hat Inc.
|
||||
-# Copyright (C) 2015 Parallels IP Holdings GmbH.
|
||||
-#
|
||||
-# This program is free software; you can redistribute it and/or modify
|
||||
-# it under the terms of the GNU General Public License as published by
|
||||
-# the Free Software Foundation; either version 2 of the License, or
|
||||
-# (at your option) any later version.
|
||||
-#
|
||||
-# This program is distributed in the hope that it will be useful,
|
||||
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-# GNU General Public License for more 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.
|
||||
-
|
||||
-# Test --in-place.
|
||||
-
|
||||
-unset CDPATH
|
||||
-export LANG=C
|
||||
-set -e
|
||||
-
|
||||
-$TEST_FUNCTIONS
|
||||
-skip_if_skipped
|
||||
-skip_if_backend uml
|
||||
-skip_unless_phony_guest windows.img
|
||||
-
|
||||
-img_base="$abs_top_builddir/test-data/phony-guests/windows.img"
|
||||
-
|
||||
-export VIRT_TOOLS_DATA_DIR="$top_srcdir/test-data/fake-virt-tools"
|
||||
-export VIRTIO_WIN="$top_srcdir/test-data/fake-virtio-win"
|
||||
-
|
||||
-d=$PWD/test-v2v-in-place.d
|
||||
-rm -rf $d
|
||||
-mkdir $d
|
||||
-
|
||||
-img="$d/test.qcow2"
|
||||
-rm -f $img
|
||||
-qemu-img create -f qcow2 -b $img_base -o compat=1.1,backing_fmt=raw $img
|
||||
-md5="$(do_md5 $img_base)"
|
||||
-
|
||||
-libvirt_xml="$d/test.xml"
|
||||
-rm -f $libvirt_xml
|
||||
-n=windows-overlay
|
||||
-cat > $libvirt_xml <<EOF
|
||||
-<node>
|
||||
- <domain type='test'>
|
||||
- <name>$n</name>
|
||||
- <memory>1048576</memory>
|
||||
- <os>
|
||||
- <type>hvm</type>
|
||||
- <boot dev='hd'/>
|
||||
- </os>
|
||||
- <devices>
|
||||
- <disk type='file' device='disk'>
|
||||
- <driver name='qemu' type='qcow2'/>
|
||||
- <source file='$img'/>
|
||||
- <target dev='vda' bus='virtio'/>
|
||||
- </disk>
|
||||
- </devices>
|
||||
- </domain>
|
||||
-</node>
|
||||
-EOF
|
||||
-
|
||||
-$VG virt-v2v --debug-gc -i libvirt -ic "test://$libvirt_xml" $n --in-place
|
||||
-
|
||||
-# Test that the drivers have been copied over into the guest
|
||||
-script="$d/test.fish"
|
||||
-expected="$d/expected"
|
||||
-response="$d/response"
|
||||
-
|
||||
-mktest ()
|
||||
-{
|
||||
- local cmd="$1" exp="$2"
|
||||
-
|
||||
- echo "echo '$cmd'" >> "$script"
|
||||
- echo "$cmd" >> "$expected"
|
||||
-
|
||||
- echo "$cmd" >> "$script"
|
||||
- echo "$exp" >> "$expected"
|
||||
-}
|
||||
-
|
||||
-:> "$script"
|
||||
-:> "$expected"
|
||||
-
|
||||
-firstboot_dir="/Program Files/Guestfs/Firstboot"
|
||||
-mktest "is-dir \"$firstboot_dir\"" true
|
||||
-mktest "is-file \"$firstboot_dir/firstboot.bat\"" true
|
||||
-mktest "is-dir \"$firstboot_dir/scripts\"" true
|
||||
-virtio_dir="/Windows/Drivers/VirtIO"
|
||||
-mktest "is-dir \"$virtio_dir\"" true
|
||||
-for drv in netkvm qxl vioscsi viostor; do
|
||||
- for sfx in cat inf sys; do
|
||||
- mktest "is-file \"$virtio_dir/$drv.$sfx\"" true
|
||||
- done
|
||||
-done
|
||||
-
|
||||
-guestfish --ro -a "$img" -i < "$script" > "$response"
|
||||
-diff -u "$expected" "$response"
|
||||
-
|
||||
-# Test the base image remained untouched
|
||||
-test "$md5" = "$(do_md5 $img_base)"
|
||||
-
|
||||
-# Clean up.
|
||||
-rm -r $d
|
||||
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
|
||||
index 86046f891..e095a6f82 100644
|
||||
--- a/v2v/virt-v2v.pod
|
||||
+++ b/v2v/virt-v2v.pod
|
||||
@@ -18,8 +18,6 @@ virt-v2v - Convert a guest to use KVM
|
||||
-oo rhv-cafile=/tmp/ca.pem -oo rhv-direct \
|
||||
--bridge ovirtmgmt
|
||||
|
||||
- virt-v2v -ic qemu:///system qemu_guest --in-place
|
||||
-
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Virt-v2v converts guests from a foreign hypervisor to run on KVM. It
|
||||
@@ -164,9 +162,6 @@ I<-o rhv-upload> is used to write to a RHV / oVirt target. I<-o rhv>
|
||||
is a legacy method to write to RHV / oVirt E<lt> 4.2. I<-o vdsm> is
|
||||
only used when virt-v2v runs under VDSM control.
|
||||
|
||||
-I<--in-place> instructs virt-v2v to customize the guest OS in the input
|
||||
-virtual machine, instead of creating a new VM in the target hypervisor.
|
||||
-
|
||||
=head1 OPTIONS
|
||||
|
||||
=over 4
|
||||
@@ -280,20 +275,6 @@ For I<-i disk> only, this specifies the format of the input disk
|
||||
image. For other input methods you should specify the input
|
||||
format in the metadata.
|
||||
|
||||
-=item B<--in-place>
|
||||
-
|
||||
-Do not create an output virtual machine in the target hypervisor.
|
||||
-Instead, adjust the guest OS in the source VM to run in the input
|
||||
-hypervisor.
|
||||
-
|
||||
-This mode is meant for integration with other toolsets, which take the
|
||||
-responsibility of converting the VM configuration, providing for
|
||||
-rollback in case of errors, transforming the storage, etc.
|
||||
-
|
||||
-See L</IN PLACE CONVERSION> below.
|
||||
-
|
||||
-Conflicts with all I<-o *> options.
|
||||
-
|
||||
=item B<-io> OPTION=VALUE
|
||||
|
||||
Set input option(s) related to the current input mode or transport.
|
||||
@@ -2160,7 +2141,7 @@ Minimum free space: 10 MB
|
||||
=head2 Minimum free space check in the host
|
||||
|
||||
You must have sufficient free space in the host directory used to
|
||||
-store temporary overlays (except in I<--in-place> mode). To find out
|
||||
+store temporary overlays. To find out
|
||||
which directory this is, use:
|
||||
|
||||
$ df -h "`guestfish get-cachedir`"
|
||||
@@ -2292,31 +2273,6 @@ that instead.
|
||||
</devices>
|
||||
</domain>
|
||||
|
||||
-=head1 IN PLACE CONVERSION
|
||||
-
|
||||
-It is also possible to use virt-v2v in scenarios where a foreign VM
|
||||
-has already been imported into a KVM-based hypervisor, but still needs
|
||||
-adjustments in the guest to make it run in the new virtual hardware.
|
||||
-
|
||||
-In that case it is assumed that a third-party tool has created the
|
||||
-target VM in the supported KVM-based hypervisor based on the source VM
|
||||
-configuration and contents, but using virtual devices more appropriate
|
||||
-for KVM (e.g. virtio storage and network, etc.).
|
||||
-
|
||||
-Then, to make the guest OS boot and run in the changed environment,
|
||||
-one can use:
|
||||
-
|
||||
- virt-v2v -ic qemu:///system converted_vm --in-place
|
||||
-
|
||||
-Virt-v2v will analyze the configuration of C<converted_vm> in the
|
||||
-C<qemu:///system> libvirt instance, and apply various fixups to the
|
||||
-guest OS configuration to make it match the VM configuration. This
|
||||
-may include installing virtio drivers, configuring the bootloader, the
|
||||
-mountpoints, the network interfaces, and so on.
|
||||
-
|
||||
-Should an error occur during the operation, virt-v2v exits with an
|
||||
-error code leaving the VM in an undefined state.
|
||||
-
|
||||
=head1 MACHINE READABLE OUTPUT
|
||||
|
||||
The I<--machine-readable> option can be used to make the output more
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,26 +0,0 @@
|
||||
From 97a0e8b9a0e9da9c10f739e3234cb2442011dff3 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 2 Mar 2017 14:21:37 +0100
|
||||
Subject: [PATCH] RHEL 8: v2v: -i disk: force VNC as display (RHBZ#1372671)
|
||||
|
||||
The SDL output mode is not supported in RHEL 8's qemu-kvm.
|
||||
---
|
||||
v2v/input_disk.ml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/v2v/input_disk.ml b/v2v/input_disk.ml
|
||||
index 7ecd19fd3..e2b16cf70 100644
|
||||
--- a/v2v/input_disk.ml
|
||||
+++ b/v2v/input_disk.ml
|
||||
@@ -87,7 +87,7 @@ class input_disk input_format disk = object
|
||||
s_features = [ "acpi"; "apic"; "pae" ];
|
||||
s_firmware = UnknownFirmware; (* causes virt-v2v to autodetect *)
|
||||
s_display =
|
||||
- Some { s_display_type = Window; s_keymap = None; s_password = None;
|
||||
+ Some { s_display_type = VNC; s_keymap = None; s_password = None;
|
||||
s_listen = LNoListen; s_port = None };
|
||||
s_video = None;
|
||||
s_sound = None;
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,27 +0,0 @@
|
||||
From 8ac67cd2284a3ec92429aea7688a0467d6cffc3b Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Wed, 8 Mar 2017 11:03:40 +0100
|
||||
Subject: [PATCH] RHEL 8: v2v: do not mention SUSE Xen hosts (RHBZ#1430203)
|
||||
|
||||
They are not supported in RHEL 8.
|
||||
---
|
||||
v2v/virt-v2v.pod | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
|
||||
index e095a6f82..8e3a06434 100644
|
||||
--- a/v2v/virt-v2v.pod
|
||||
+++ b/v2v/virt-v2v.pod
|
||||
@@ -1639,8 +1639,7 @@ verbose messages.
|
||||
|
||||
=head1 INPUT FROM XEN
|
||||
|
||||
-Virt-v2v is able to import Xen guests from RHEL 5 Xen or SLES and
|
||||
-openSUSE Xen hosts.
|
||||
+Virt-v2v is able to import Xen guests from RHEL 5 Xen hosts.
|
||||
|
||||
Virt-v2v uses libvirt for access to the remote Xen host, and therefore
|
||||
the input mode should be I<-i libvirt>. As this is the default, you
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,36 +0,0 @@
|
||||
From aabd2d506e60d0b7bb69fb7582ae1b4ecb8f19e6 Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Mon, 14 Aug 2017 10:02:13 +0200
|
||||
Subject: [PATCH] RHEL 8: v2v: disable unconfig of manually installed VMware
|
||||
tools (RHBZ#1477905)
|
||||
|
||||
It looks like they may require connection to the VMware servers, which
|
||||
is not always available during conversion.
|
||||
---
|
||||
v2v/convert_linux.ml | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml
|
||||
index da06352a0..c9cf99570 100644
|
||||
--- a/v2v/convert_linux.ml
|
||||
+++ b/v2v/convert_linux.ml
|
||||
@@ -359,6 +359,7 @@ let convert (g : G.guestfs) inspect source output rcaps =
|
||||
let remove = !remove in
|
||||
Linux.remove g inspect remove;
|
||||
|
||||
+(*
|
||||
(* VMware Tools may have been installed from a tarball, so the
|
||||
* above code won't remove it. Look for the uninstall tool and run
|
||||
* if present.
|
||||
@@ -380,6 +381,8 @@ let convert (g : G.guestfs) inspect source output rcaps =
|
||||
warning (f_"VMware tools was detected, but uninstallation failed. The error message was: %s (ignored)")
|
||||
msg
|
||||
)
|
||||
+*)
|
||||
+ ()
|
||||
|
||||
and unconfigure_citrix () =
|
||||
let pkgs =
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,82 +0,0 @@
|
||||
From 8f6c76fcf64ee5adcdce7ea3808c0d776079f228 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 14 May 2018 10:16:58 +0100
|
||||
Subject: [PATCH] RHEL 8: v2v: rhv-upload: Remove restriction on -oa sparse.
|
||||
|
||||
See: https://bugzilla.redhat.com/show_bug.cgi?id=1565681
|
||||
and the v2v-devel private thread "Do we already support migration using FC?"
|
||||
---
|
||||
v2v/output_rhv_upload.ml | 11 +----------
|
||||
v2v/rhv-upload-plugin.py | 4 +---
|
||||
v2v/virt-v2v.pod | 6 ------
|
||||
3 files changed, 2 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml
|
||||
index 79a2fc8fd..59911f32c 100644
|
||||
--- a/v2v/output_rhv_upload.ml
|
||||
+++ b/v2v/output_rhv_upload.ml
|
||||
@@ -177,19 +177,11 @@ See also \"OUTPUT TO RHV\" in the virt-v2v(1) manual.")
|
||||
error (f_"nbdkit was compiled without SELinux support. You will have to recompile nbdkit with libselinux-devel installed, or else set SELinux to Permissive mode while doing the conversion.")
|
||||
in
|
||||
|
||||
- (* Output format/sparse must be raw/sparse. We may be able to
|
||||
- * lift this limitation in future, but it requires changes on the
|
||||
- * RHV side. See TODO file for details. XXX
|
||||
- *)
|
||||
+ (* Output format must be raw. *)
|
||||
let error_current_limitation required_param =
|
||||
error (f_"rhv-upload: currently you must use ‘%s’. This restriction will be loosened in a future version.") required_param
|
||||
in
|
||||
|
||||
- let error_unless_output_alloc_sparse () =
|
||||
- if output_alloc <> Sparse then
|
||||
- error_current_limitation "-oa sparse"
|
||||
- in
|
||||
-
|
||||
(* JSON parameters which are invariant between disks. *)
|
||||
let json_params = [
|
||||
"verbose", JSON.Bool (verbose ());
|
||||
@@ -242,7 +234,6 @@ object
|
||||
error_unless_ovirtsdk4_module_available ();
|
||||
error_unless_nbdkit_working ();
|
||||
error_unless_nbdkit_python3_working ();
|
||||
- error_unless_output_alloc_sparse ();
|
||||
if have_selinux then
|
||||
error_unless_nbdkit_compiled_with_selinux ()
|
||||
|
||||
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
|
||||
index 4fad27fb8..41cb29992 100644
|
||||
--- a/v2v/rhv-upload-plugin.py
|
||||
+++ b/v2v/rhv-upload-plugin.py
|
||||
@@ -139,10 +139,8 @@ def open(readonly):
|
||||
format = disk_format,
|
||||
initial_size = params['disk_size'],
|
||||
provisioned_size = params['disk_size'],
|
||||
- # XXX Ignores params['output_sparse'].
|
||||
- # Handling this properly will be complex, see:
|
||||
# https://www.redhat.com/archives/libguestfs/2018-March/msg00177.html
|
||||
- sparse = True,
|
||||
+ sparse = params['output_sparse'],
|
||||
storage_domains = [
|
||||
types.StorageDomain(
|
||||
name = params['output_storage'],
|
||||
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
|
||||
index 8e3a06434..944b0fade 100644
|
||||
--- a/v2v/virt-v2v.pod
|
||||
+++ b/v2v/virt-v2v.pod
|
||||
@@ -1846,12 +1846,6 @@ username is not specified then virt-v2v defaults to using
|
||||
C<admin@internal> which is the typical superuser account for oVirt
|
||||
instances.
|
||||
|
||||
-=item I<-of raw>
|
||||
-
|
||||
-Currently you must use I<-of raw> and you cannot use I<-oa preallocated>.
|
||||
-
|
||||
-These restrictions will be loosened in a future version.
|
||||
-
|
||||
=item I<-op> F<password-file>
|
||||
|
||||
A file containing a password to be used when connecting to the oVirt
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,33 +0,0 @@
|
||||
From 03a9d67f1c101b883838a8f20f7173d12d6b715e Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Thu, 19 Jul 2018 13:30:17 +0200
|
||||
Subject: [PATCH] RHEL 8: p2v: ignore 'rhv-upload' driver (RHBZ#1590220)
|
||||
|
||||
The 'rhv-upload' output mode requires few options, and virt-p2v does not
|
||||
have the GUI bits for specifying them.
|
||||
---
|
||||
p2v/ssh.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/p2v/ssh.c b/p2v/ssh.c
|
||||
index 15f53b692..654121a22 100644
|
||||
--- a/p2v/ssh.c
|
||||
+++ b/p2v/ssh.c
|
||||
@@ -1021,8 +1021,12 @@ add_input_driver (const char *name, size_t len)
|
||||
static void
|
||||
add_output_driver (const char *name, size_t len)
|
||||
{
|
||||
- /* Ignore the 'vdsm' driver, since that should only be used by VDSM. */
|
||||
- if (len != 4 || memcmp (name, "vdsm", 4) != 0)
|
||||
+ /* Ignore the 'vdsm' driver, since that should only be used by VDSM.
|
||||
+ * Ignore the 'rhv-upload' driver, since we do not support passing all the
|
||||
+ * options for it.
|
||||
+ */
|
||||
+ if ((len != 4 || memcmp (name, "vdsm", 4) != 0) &&
|
||||
+ (len != 10 || memcmp (name, "rhv-upload", 10) != 0))
|
||||
add_option ("output", &output_drivers, name, len);
|
||||
}
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,26 +0,0 @@
|
||||
From 30a1bab00d15a5502b16c018a7bbba26ff983c81 Mon Sep 17 00:00:00 2001
|
||||
From: Pino Toscano <ptoscano@redhat.com>
|
||||
Date: Sun, 16 Dec 2018 16:32:46 +0100
|
||||
Subject: [PATCH] RHEL 8: use "python3" as nbdkit plugin
|
||||
|
||||
RHEL uses "python3" as name for the nbdkit Python plugin.
|
||||
---
|
||||
v2v/output_rhv_upload.ml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml
|
||||
index 59911f32c..1c102dc24 100644
|
||||
--- a/v2v/output_rhv_upload.ml
|
||||
+++ b/v2v/output_rhv_upload.ml
|
||||
@@ -79,7 +79,7 @@ let parse_output_options options =
|
||||
{ rhv_cafile; rhv_cluster; rhv_direct; rhv_verifypeer }
|
||||
|
||||
let python3 = "python3" (* Defined by PEP 394 *)
|
||||
-let nbdkit_python_plugin = "python"
|
||||
+let nbdkit_python_plugin = "python3"
|
||||
let pidfile_timeout = 30
|
||||
let finalization_timeout = 5*60
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user