[Pkg-libvirt-commits] [libguestfs] 10/35: v2v: If virtio is enabled, map device names to vd* (RHBZ#1142004).
Hilko Bengen
bengen at moszumanska.debian.org
Fri Oct 3 14:46:40 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag debian/1%1.27.49-1
in repository libguestfs.
commit 7739a6d3570efa2fee32b7210de40c73eca5b988
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Wed Sep 17 12:13:42 2014 +0100
v2v: If virtio is enabled, map device names to vd* (RHBZ#1142004).
The old virt-v2v code had:
my $prefix;
if ($virtio) {
$prefix = 'vd';
} elsif ($libata) {
$prefix = 'sd';
} else {
$prefix = 'hd'
}
The translated code dropped the test for virtio by accident, which
meant that device names would be mapped to sd* or hd* even if the
virtio-blk driver was enabled for the guest.
Thanks: Tingting Zheng
---
v2v/convert_linux.ml | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml
index 03cf406..29dafde 100644
--- a/v2v/convert_linux.ml
+++ b/v2v/convert_linux.ml
@@ -1086,15 +1086,17 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source =
* added to the target in the order they appear in the libvirt XML.
*)
let block_prefix =
- match family, inspect.i_major_version with
- | `RHEL_family, v when v < 5 ->
- (* RHEL < 5 used old ide driver *) "hd"
- | `RHEL_family, 5 ->
- (* RHEL 5 uses libata, but udev still uses: *) "hd"
- | `SUSE_family, _ ->
- (* SUSE uses libata, but still presents IDE disks as: *) "hd"
- | _, _ ->
- (* All modern distros use libata: *) "sd" in
+ if virtio then "vd"
+ else
+ match family, inspect.i_major_version with
+ | `RHEL_family, v when v < 5 ->
+ (* RHEL < 5 used old ide driver *) "hd"
+ | `RHEL_family, 5 ->
+ (* RHEL 5 uses libata, but udev still uses: *) "hd"
+ | `SUSE_family, _ ->
+ (* SUSE uses libata, but still presents IDE disks as: *) "hd"
+ | _, _ ->
+ (* All modern distros use libata: *) "sd" in
let map =
mapi (
fun i disk ->
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list