diff --git a/perl-xCAT/xCAT/KVMUtils.pm b/perl-xCAT/xCAT/KVMUtils.pm index 12835999c6..16cec5280f 100644 --- a/perl-xCAT/xCAT/KVMUtils.pm +++ b/perl-xCAT/xCAT/KVMUtils.pm @@ -522,11 +522,11 @@ sub guest_os { vpd.uuid holds the UUID that the guest reports. QEMU stores the domain UUID as SMBIOS 2.6 specifies, so the guest reports it - unchanged. Machine type pc-i440fx-2.1 and its RHEL counterpart pc-i440fx-rhel7.1.0 - are the exception: they store the UUID bytes in text order behind an SMBIOS 2.8 entry - point, so the guest reports the first three fields swapped. Older machine types store - the same bytes in SMBIOS 2.4 tables, which the guest reads unswapped. The swap is its - own inverse, so one sub converts both ways. + unchanged. Machine types pc-i440fx-2.1, pc-q35-2.1, the RHEL pc-i440fx-rhel7.1.0 and + the Ubuntu pc-i440fx-utopic are the exception: they store the UUID bytes in text order + behind an SMBIOS 2.8 entry point, so the guest reports the first three fields swapped. + Older machine types store the same bytes in SMBIOS 2.4 tables, which the guest reads + unswapped. The swap is its own inverse, so one sub converts both ways. Arguments: $uuid - a domain UUID or a guest UUID, or undef $machine - the machine type of the domain, or undef for the libvirt default @@ -538,7 +538,8 @@ sub guest_os { #------------------------------------------------------- sub guest_uuid { my ($uuid, $machine) = @_; - return $uuid unless defined($uuid) and defined($machine) and $machine =~ /\Apc-i440fx-(?:2\.1|rhel7\.1\.0)\z/; + return $uuid + unless defined($uuid) and defined($machine) and $machine =~ /\A(?:pc-(?:i440fx|q35)-2\.1|pc-i440fx-(?:rhel7\.1\.0|utopic))\z/; $uuid =~ s/^(..)(..)(..)(..)-(..)(..)-(..)(..)/$4$3$2$1-$6$5-$8$7/; return $uuid; }