[PATCH] vCenter: pass user name to nbdkit curl plugin
by Tomáš Golembiovský
Signed-off-by: Tomáš Golembiovský <tgolembi(a)redhat.com>
---
v2v/vCenter.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/v2v/vCenter.ml b/v2v/vCenter.ml
index 89c5579b..d9bf12c1 100644
--- a/v2v/vCenter.ml
+++ b/v2v/vCenter.ml
@@ -79,7 +79,7 @@ let rec map_source ?bandwidth ?password_file dcPath uri server path =
let nbdkit =
Nbdkit.create_curl ?bandwidth ?cookie:session_cookie ~password ~sslverify
- https_url in
+ ?user:uri.uri_user https_url in
let qemu_uri = Nbdkit.run nbdkit in
(* Return the struct. *)
--
2.24.1
4 years, 8 months
[v2v PATCH] -o libvirt: read pool name from object
by Pino Toscano
Now that we have a Libvirt.Pool object for the output storage pool,
query it to get its name instead of reading it from the XML.
The result is unchanged.
---
v2v/output_libvirt.ml | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/v2v/output_libvirt.ml b/v2v/output_libvirt.ml
index 0247e5ad..dfd5d1a3 100644
--- a/v2v/output_libvirt.ml
+++ b/v2v/output_libvirt.ml
@@ -105,9 +105,8 @@ object (self)
(* Connect to output libvirt instance and check that the pool exists
* and dump out its XML.
*)
- let xml =
- let pool = Libvirt_utils.get_pool self#conn output_pool in
- Libvirt.Pool.get_xml_desc (Libvirt.Pool.const pool) in
+ let pool = Libvirt_utils.get_pool self#conn output_pool in
+ let xml = Libvirt.Pool.get_xml_desc (Libvirt.Pool.const pool) in
let doc = Xml.parse_memory xml in
let xpathctx = Xml.xpath_new_context doc in
let xpath_string = xpath_string xpathctx in
@@ -125,12 +124,7 @@ object (self)
(* Get the name of the pool, since we have to use that
* (and not the UUID) in the XML of the guest.
*)
- let name =
- match xpath_string "/pool/name/text()" with
- | None ->
- error (f_"-o libvirt: output pool ‘%s’ does not have /pool/name element. See virt-v2v-output-local(1)") output_pool
- | Some name -> name in
- pool_name <- Some name;
+ pool_name <- Some (Libvirt.Pool.get_name (Libvirt.Pool.const pool));
(* Set up the targets. *)
List.map (
--
2.24.1
4 years, 8 months
[v2v PATCH] -i ova: use Xml.parse_file for the OVF
by Pino Toscano
No need to read the whole OVF file in memory and parse that -- let
libxml2 parse it directly.
---
v2v/parse_ovf_from_ova.ml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/v2v/parse_ovf_from_ova.ml b/v2v/parse_ovf_from_ova.ml
index 27761d23..5acf7070 100644
--- a/v2v/parse_ovf_from_ova.ml
+++ b/v2v/parse_ovf_from_ova.ml
@@ -36,8 +36,7 @@ type ovf_disk = {
}
let xpathctx_of_ovf ovf_filename =
- let xml = read_whole_file ovf_filename in
- let doc = Xml.parse_memory xml in
+ let doc = Xml.parse_file ovf_filename in
(* Handle namespaces. *)
let xpathctx = Xml.xpath_new_context doc in
--
2.24.1
4 years, 8 months
[PATCH nbdkit] Add cainfo and capath options to curl plugin
by Wiktor Gołgowski
This change adds cainfo and capath options to the curl plugin.
They refer directly to CURLOPT_CAINFO and CURLOPT_CAPATH, as documented
in libcurl.
Signed-off-by: Wiktor Gołgowski <wiktor.golgowski(a)linux.intel.com>
---
plugins/curl/curl.c | 16 ++++++++++++++++
plugins/curl/nbdkit-curl-plugin.pod | 9 +++++++++
2 files changed, 25 insertions(+)
diff --git a/plugins/curl/curl.c b/plugins/curl/curl.c
index 007449b..1381832 100644
--- a/plugins/curl/curl.c
+++ b/plugins/curl/curl.c
@@ -66,6 +66,8 @@ static bool sslverify = true;
static uint32_t timeout = 0;
static const char *unix_socket_path = NULL;
static long protocols = CURLPROTO_ALL;
+static const char *cainfo = NULL;
+static const char *capath = NULL;
/* Use '-D curl.verbose=1' to set. */
int curl_debug_verbose = 0;
@@ -231,6 +233,14 @@ curl_config (const char *key, const char *value)
return -1;
}
+ else if (strcmp (key, "cainfo") == 0) {
+ cainfo = value;
+ }
+
+ else if (strcmp (key, "capath") == 0) {
+ capath = value;
+ }
+
else {
nbdkit_error ("unknown parameter '%s'", key);
return -1;
@@ -253,6 +263,8 @@ curl_config_complete (void)
}
#define curl_config_help \
+ "cainfo=<CAINFO> Path to Certificate Authority file.\n" \
+ "capath=<CAPATH> Path to directory with CA certificates.\n" \
"cookie=<COOKIE> Set HTTP/HTTPS cookies.\n" \
"password=<PASSWORD> The password for the user account.\n" \
"protocols=PROTO,PROTO,.. Limit protocols allowed.\n" \
@@ -369,6 +381,10 @@ curl_open (int readonly)
curl_easy_setopt (h->c, CURLOPT_PROXYPASSWORD, proxy_password);
if (cookie)
curl_easy_setopt (h->c, CURLOPT_COOKIE, cookie);
+ if (cainfo)
+ curl_easy_setopt (h->c, CURLOPT_CAINFO, cainfo);
+ if (capath)
+ curl_easy_setopt (h->c, CURLOPT_CAPATH, capath);
/* Get the file size and also whether the remote HTTP server
* supports byte ranges.
diff --git a/plugins/curl/nbdkit-curl-plugin.pod b/plugins/curl/nbdkit-curl-plugin.pod
index 827e0bd..f9156af 100644
--- a/plugins/curl/nbdkit-curl-plugin.pod
+++ b/plugins/curl/nbdkit-curl-plugin.pod
@@ -34,6 +34,15 @@ ports and protocols used to serve NBD see L<nbdkit(1)>).
=over 4
+=item B<cainfo=>FILENAME
+
+Configure CA bundle for libcurl. See L<CURLOPT_CAINFO> for details.
+
+=item B<capath=>PATH
+
+Set CA certificates directory location for libcurl. See
+L<CURLOPT_CAPATH> for more information.
+
=item B<cookie=>COOKIE
=item B<cookie=+>FILENAME
--
2.20.1
4 years, 8 months
[PATCH v2v] v2v: -o rhv-upload: Make -oo rhv-cafile optional in all cases (RHBZ#1791240).
by Richard W.M. Jones
This is actually not required, because ovirtsdk4 will use the system's
global trust store if necessary. Therefore we can make it optional in
all cases.
---
docs/virt-v2v-output-rhv.pod | 5 ++++-
v2v/output_rhv_upload.ml | 2 --
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/docs/virt-v2v-output-rhv.pod b/docs/virt-v2v-output-rhv.pod
index 04a894268..4520c9184 100644
--- a/docs/virt-v2v-output-rhv.pod
+++ b/docs/virt-v2v-output-rhv.pod
@@ -101,7 +101,10 @@ The storage domain.
The F<ca.pem> file (Certificate Authority), copied from
F</etc/pki/ovirt-engine/ca.pem> on the oVirt engine.
-This option must be specified if I<-oo rhv-verifypeer> is enabled.
+If I<-oo rhv-verifypeer> is enabled then this option can
+be used to control which CA is used to verify the client’s
+identity. If this option is not used then the system’s
+global trust store is used.
=item I<-oo rhv-cluster=>C<CLUSTERNAME>
diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml
index 7b5ad7a86..14153db36 100644
--- a/v2v/output_rhv_upload.ml
+++ b/v2v/output_rhv_upload.ml
@@ -81,8 +81,6 @@ let parse_output_options options =
let rhv_direct = !rhv_direct in
let rhv_verifypeer = !rhv_verifypeer in
let rhv_disk_uuids = Option.map List.rev !rhv_disk_uuids in
- if rhv_verifypeer && rhv_cafile = None then
- error (f_"-o rhv-upload: must use ‘-oo rhv-cafile’ to supply the path to the oVirt or RHV user’s ‘ca.pem’ file");
{ rhv_cafile; rhv_cluster; rhv_direct; rhv_verifypeer; rhv_disk_uuids }
--
2.24.1
4 years, 8 months
[PATCH] launch: libvirt: use machine type when querying for domcaps
by Pino Toscano
On some architectures a certain machine type is used, so use it when
querying the libvirt domain capabilities.
---
lib/launch-libvirt.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
index 864eae314..f2cad9300 100644
--- a/lib/launch-libvirt.c
+++ b/lib/launch-libvirt.c
@@ -431,7 +431,12 @@ launch_libvirt (guestfs_h *g, void *datav, const char *libvirt_uri)
if (parse_capabilities (g, capabilities_xml, data) == -1)
goto cleanup;
- domcapabilities_xml = virConnectGetDomainCapabilities (conn, NULL, NULL, NULL,
+ domcapabilities_xml = virConnectGetDomainCapabilities (conn, NULL, NULL,
+#ifdef MACHINE_TYPE
+ MACHINE_TYPE,
+#else
+ NULL,
+#endif
NULL, 0);
if (!domcapabilities_xml) {
libvirt_error (g, _("could not get libvirt domain capabilities"));
--
2.24.1
4 years, 8 months
[PATCH] add default (unversioned) directory for guest agent on EL
by Tomáš Golembiovský
There was no source directory for EL8 guest agent (only EL6 and EL7).
RHBZ#1791802
Signed-off-by: Tomáš Golembiovský <tgolembi(a)redhat.com>
---
v2v/windows_virtio.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/v2v/windows_virtio.ml b/v2v/windows_virtio.ml
index 5ec7664b..6ddc488a 100644
--- a/v2v/windows_virtio.ml
+++ b/v2v/windows_virtio.ml
@@ -192,7 +192,7 @@ and install_linux_tools g inspect =
(match inspect.i_major_version with
| 6 -> Some "el6"
| 7 -> Some "el7"
- | _ -> None)
+ | _ -> Some "el")
| "sles" | "suse-based" | "opensuse" -> Some "lp151"
| _ -> None in
--
2.24.1
4 years, 8 months
[PATCH 0/4] Use libvirt firmware autoselection
by Pino Toscano
Starting with 5.2.0, libvirt has a way to select the firmware by
specifying its type, provided configuration files for the firmware are
shipped. Currently we start the appliance as UEFI if any of the firmware
are found, so instead we can try to just set the firmware type iff:
- the libvirt autoselection works
- the 'efi' firmware is available
The only behaviour change is that the default firmware may be a
non-debug version, so we get no debug messages even when running in
verbose mode. This most probably will need an addition in libvirt to
select this feature among the available firmwares.
Pino Toscano (4):
launch: libvirt: parse firmware autoselection
lib: uefi: reset out parameters earlier
lib: allow to use libvirt firmware autoselection
lib: uefi: use the efi libvirt firmware if available
lib/appliance-uefi.c | 32 ++++++++++++++++++++++++++------
lib/guestfs-internal.h | 2 +-
lib/launch-direct.c | 3 ++-
lib/launch-libvirt.c | 40 +++++++++++++++++++++++++++++++++++++++-
4 files changed, 68 insertions(+), 9 deletions(-)
--
2.24.1
4 years, 8 months
[PATCH 2/2] Win::Hivex::Regedit: Ignore comments
by Vladimir Panteleev
---
perl/lib/Win/Hivex/Regedit.pm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/perl/lib/Win/Hivex/Regedit.pm b/perl/lib/Win/Hivex/Regedit.pm
index 2b17036..f0dbb50 100644
--- a/perl/lib/Win/Hivex/Regedit.pm
+++ b/perl/lib/Win/Hivex/Regedit.pm
@@ -153,8 +153,8 @@ sub reg_import
#print STDERR "reg_import: parsing <<<$_>>>\n";
if ($state eq "outer") {
- # Ignore blank lines, headers.
- next if /^\s*$/;
+ # Ignore blank lines, headers, comments.
+ next if /^\s*(;.*)?$/;
# .* is needed before Windows Registry Editor Version.. in
# order to eat a possible Unicode BOM which regedit writes
@@ -193,7 +193,7 @@ sub reg_import
my $value = _parse_value ("", $1, $encoding);
croak (_parse_error ($_, $lineno)) unless defined $value;
push @newvalues, $value;
- } elsif (/^\s*$/) { # blank line after values
+ } elsif (/^\s*(;.*)?$/) { # blank line after values
_merge_node ($hmap, \%params, $newnode, \@newvalues, \@delvalues);
$state = "outer";
} else {
--
2.25.0
4 years, 8 months
[PATCH 1/2] Win::Hivex::Regedit: Accept CRLF line endings
by Vladimir Panteleev
---
perl/lib/Win/Hivex/Regedit.pm | 1 +
1 file changed, 1 insertion(+)
diff --git a/perl/lib/Win/Hivex/Regedit.pm b/perl/lib/Win/Hivex/Regedit.pm
index 34426f1..2b17036 100644
--- a/perl/lib/Win/Hivex/Regedit.pm
+++ b/perl/lib/Win/Hivex/Regedit.pm
@@ -144,6 +144,7 @@ sub reg_import
# this is fairly common in pasted regedit files.
$lineno++;
chomp;
+ s/\r$//;
if (s/\\\s*$//) {
$_ .= <$fh>;
redo unless eof ($fh);
--
2.25.0
4 years, 8 months