From b76e9a425a25d9165a13010f1af8434378bd010b Mon Sep 17 00:00:00 2001 From: ligc Date: Tue, 23 Jun 2015 02:40:52 -0400 Subject: [PATCH] fix for bug 4650: check if the kvm hypervisor hostname could be resolved --- xCAT-server/lib/xcat/plugins/kvm.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 399694f7e..9ecf3ae7b 100755 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -341,6 +341,10 @@ sub nodesockopen { unless ($node) { return 0; } my $socket; my $addr = gethostbyname($node); + if (!$addr) { + xCAT::SvrUtils::sendmsg([1,"Cannot not resolve host $node"], $callback); + return 0; + } my $sin = sockaddr_in($port,$addr); my $proto = getprotobyname('tcp'); socket($socket,PF_INET,SOCK_STREAM,$proto) || return 0;