<minor_version>0</minor_version>
<mountpoints>
<mountpoint dev="/dev/vg_f13x64/lv_root">/</mountpoint>
- <mountpoint dev="/dev/vda1">/boot</mountpoint>
+ <mountpoint dev="/dev/sda1">/boot</mountpoint>
</mountpoints>
<filesystems>
<filesystem dev="/dev/vg_f13x64/lv_root">
<label>Fedora-13-x86_64</label>
<uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>
</filesystem>
- <filesystem dev="/dev/vda1">
+ <filesystem dev="/dev/sda1">
<type>ext4</type>
<uuid>59336587-da50-4b87-ad47-577a0fd95498</uuid>
</filesystem>
<operatingsystems>
<operatingsystem>
- <root>/dev/vda2</root>
+ <root>/dev/sda2</root>
<name>linux</name>
<arch>x86_64</arch>
<distro>rhel</distro>
<major_version>3</major_version>
<minor_version>9</minor_version>
<mountpoints>
- <mountpoint dev="/dev/vda2">/</mountpoint>
- <mountpoint dev="/dev/vda1">/boot</mountpoint>
+ <mountpoint dev="/dev/sda2">/</mountpoint>
+ <mountpoint dev="/dev/sda1">/boot</mountpoint>
</mountpoints>
<filesystems>
- <filesystem dev="/dev/vda2">
+ <filesystem dev="/dev/sda2">
<type>ext3</type>
<label>/</label>
<uuid>a3dde7db-0e74-4545-9f4b-a0fe7d853702</uuid>
</filesystem>
- <filesystem dev="/dev/vda1">
+ <filesystem dev="/dev/sda1">
<type>ext3</type>
<label>/boot</label>
<uuid>690b600c-201f-4e16-9c11-06e73e248746</uuid>
</filesystem>
- <filesystem dev="/dev/vda3">
+ <filesystem dev="/dev/sda3">
<type>swap</type>
<uuid>c53d3294-9465-456c-a9ee-1b08d270b1b6</uuid>
</filesystem>
<minor_version>0</minor_version>
<mountpoints>
<mountpoint dev="/dev/vg_rhel6brewx64/lv_root">/</mountpoint>
- <mountpoint dev="/dev/vda1">/boot</mountpoint>
+ <mountpoint dev="/dev/sda1">/boot</mountpoint>
</mountpoints>
<filesystems>
<filesystem dev="/dev/vg_rhel6brewx64/lv_root">
<type>ext4</type>
<uuid>acffb3a7-ace7-4398-8233-d554d4b01174</uuid>
</filesystem>
- <filesystem dev="/dev/vda1">
+ <filesystem dev="/dev/sda1">
<type>ext4</type>
<uuid>1267df04-7310-4f0e-bd53-f4c30ff2fff7</uuid>
</filesystem>
<operatingsystems>
<operatingsystem>
- <root>/dev/vda2</root>
+ <root>/dev/sda2</root>
<name>windows</name>
<arch>i386</arch>
<distro>windows</distro>
<minor_version>1</minor_version>
<windows_systemroot>/Windows</windows_systemroot>
<mountpoints>
- <mountpoint dev="/dev/vda2">/</mountpoint>
+ <mountpoint dev="/dev/sda2">/</mountpoint>
</mountpoints>
<filesystems>
- <filesystem dev="/dev/vda2">
+ <filesystem dev="/dev/sda2">
<type>ntfs</type>
<uuid>F2E8996AE8992E3B</uuid>
</filesystem>
<mountpoint dev="/dev/debian5x64.home.annexia.org/var">/var</mountpoint>
<mountpoint dev="/dev/debian5x64.home.annexia.org/tmp">/tmp</mountpoint>
<mountpoint dev="/dev/debian5x64.home.annexia.org/home">/home</mountpoint>
- <mountpoint dev="/dev/vda1">/boot</mountpoint>
+ <mountpoint dev="/dev/sda1">/boot</mountpoint>
</mountpoints>
<filesystems>
<filesystem dev="/dev/debian5x64.home.annexia.org/root">
<type>ext3</type>
<uuid>e15bda18-deca-40d1-beb4-ff31e4068741</uuid>
</filesystem>
- <filesystem dev="/dev/vda1">
+ <filesystem dev="/dev/sda1">
<type>ext2</type>
<uuid>b6590940-dc13-4fc5-b306-7c7bdf075f17</uuid>
</filesystem>
<operatingsystems>
<operatingsystem>
- <root>/dev/vda1</root>
+ <root>/dev/sda1</root>
<name>linux</name>
<arch>x86_64</arch>
<distro>debian</distro>
<major_version>0</major_version>
<minor_version>0</minor_version>
<mountpoints>
- <mountpoint dev="/dev/vda1">/</mountpoint>
+ <mountpoint dev="/dev/sda1">/</mountpoint>
</mountpoints>
<filesystems>
- <filesystem dev="/dev/vda1">
+ <filesystem dev="/dev/sda1">
<type>ext4</type>
<uuid>09384d4f-df19-479b-85fc-6451e56d41aa</uuid>
</filesystem>
- <filesystem dev="/dev/vda5">
+ <filesystem dev="/dev/sda5">
<type>swap</type>
<uuid>c0d1b68f-c0f9-4497-a366-938b37532613</uuid>
</filesystem>
$xml->startTag ("operatingsystem");
# Basic OS fields.
- $xml->dataElement (root => $root);
+ $xml->dataElement (root => canonicalize ($root));
my ($s, $distro, $major_version);
$s = $g->inspect_get_type ($root);
$xml->startTag ("mountpoints");
foreach (@$fskeys) {
- $xml->dataElement ("mountpoint", $_, dev => $fshash->{$_});
+ $xml->dataElement ("mountpoint", $_,
+ dev => canonicalize ($fshash->{$_}));
}
$xml->endTag ("mountpoints");
}
my @fses = $g->inspect_get_filesystems ($root);
foreach (@fses) {
- $xml->startTag ("filesystem", dev => $_);
+ $xml->startTag ("filesystem",
+ dev => canonicalize ($_));
eval {
my $type = $g->vfs_type ($_);
}
}
+# The reverse of device name translation, see
+# BLOCK DEVICE NAMING in guestfs(3).
+sub canonicalize
+{
+ local $_ = shift;
+
+ if (m{^/dev/[hv]d([a-z]\d)$}) {
+ return "/dev/sd$1";
+ }
+ $_;
+}
+
=head1 SHELL QUOTING
Libvirt guest names can contain arbitrary characters, some of which