From 1104bc50ca8d36fcb7972b1314b027eadfa9fcbc Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 6 Mar 2012 20:00:09 +0000 Subject: [PATCH] Feed UUID little-endian style into libvirt so that it emerges on the other end consistent with SMBIOS 2.6/MS behavior git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11770 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/kvm.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index d0c0e5419..793e0d332 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -526,8 +526,11 @@ sub build_diskstruct { } sub getNodeUUID { my $node = shift; + my $uuid; if ($confdata->{vpd}->{$node}->[0] and $confdata->{vpd}->{$node}->[0]->{uuid}) { - return $confdata->{vpd}->{$node}->[0]->{uuid}; + $uuid = $confdata->{vpd}->{$node}->[0]->{uuid}; + $uuid =~ s/^(..)(..)(..)(..)-(..)(..)-(..)(..)/$4$3$2$1-$6$5-$8$7/; + return $uuid; } if ($confdata->{mac}->{$node}->[0]->{mac}) { #a uuidv1 is possible, generate that for absolute uniqueness guarantee my $mac = $confdata->{mac}->{$node}->[0]->{mac}; @@ -537,7 +540,9 @@ sub getNodeUUID { } else { $updatetable->{vpd}->{$node}={uuid=>xCAT::Utils::genUUID()}; } - return $updatetable->{vpd}->{$node}->{uuid}; + $uuid = $updatetable->{vpd}->{$node}->{uuid}; + $uuid =~ s/^(..)(..)(..)(..)-(..)(..)-(..)(..)/$4$3$2$1-$6$5-$8$7/; + return $uuid; } sub build_nicstruct { @@ -1262,6 +1267,7 @@ sub rinv { } my $domain=$parser->parse_string($currxml); my $uuid = $domain->findnodes('/domain/uuid')->[0]->to_literal; + $uuid =~ s/^(..)(..)(..)(..)-(..)(..)-(..)(..)/$4$3$2$1-$6$5-$8$7/; xCAT::SvrUtils::sendmsg("UUID/GUID: $uuid", $callback,$node); my $cpus = $domain->findnodes('/domain/vcpu')->[0]->to_literal; xCAT::SvrUtils::sendmsg("CPUs: $cpus", $callback,$node);