mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
Libvirt >= 2.1.0 now allows you to open files which have a "json:" QEMU pseudo-URL as backingfile, whereas previously it would fail hard in this case (RHBZ#1134878). When virt-v2v performs conversions from Xen (over SSH) or vCenter (over HTTPS) it uses these pseudo-URLs as backingfiles. We had to tell people to use LIBGUESTFS_BACKEND=direct to avoid libvirt in this situation. This commit narrows the check so it will now only print the error if libvirt < 2.1.0 and LIBGUESTFS_BACKEND=direct is not set. Also the error is modified to tell users they can either upgrade libvirt or set LIBGUESTFS_BACKEND=direct to work around the problem. Note there is not an easy way apart from checking the version number of libvirt to tell if the json pseudo-URL is supported. As a side-effect, this commit also prints the libvirt version number in debugging output when virt-v2v starts up, which is sometimes useful information for narrowing down bugs (it is in fact already printed by libguestfs, so this is duplicate information, but it's a bit easier to find when it's at the top of the debug). Thanks: Peter Krempa.
32 lines
1.3 KiB
OCaml
32 lines
1.3 KiB
OCaml
(* virt-v2v
|
|
* Copyright (C) 2009-2016 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.
|
|
*)
|
|
|
|
(* This module implements various [virsh]-like commands, but with
|
|
non-broken authentication handling. *)
|
|
|
|
external dumpxml : ?password:string -> ?conn:string -> string -> string = "v2v_dumpxml"
|
|
external pool_dumpxml : ?conn:string -> string -> string = "v2v_pool_dumpxml"
|
|
external vol_dumpxml : ?conn:string -> string -> string -> string = "v2v_vol_dumpxml"
|
|
|
|
external capabilities : ?conn:string -> unit -> string = "v2v_capabilities"
|
|
|
|
external domain_exists : ?conn:string -> string -> bool = "v2v_domain_exists"
|
|
|
|
external libvirt_get_version : unit -> int * int * int
|
|
= "v2v_libvirt_get_version"
|