diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm
index 01f762106..6b5844596 100644
--- a/xCAT-server/lib/xcat/plugins/kvm.pm
+++ b/xCAT-server/lib/xcat/plugins/kvm.pm
@@ -110,6 +110,16 @@ sub get_path_for_pool {
}
sub build_pool_xml {
my $url = shift;
+ my $pooldesc;
+ my $name=$url;
+ $name=~ s!nfs://!nfs_!;
+ $name=~ s!dir://!dir_!;
+ $name =~ s/\//_/g; #though libvirt considers / kosher, sometimes it wants to create a local xml file using name for filename...
+ if ($url =~ /^dir:/) { #directory style..
+ my $path=$url;
+ $path =~ s/dir:\/\///g;
+ return "$name$path";
+ }
my $mounthost = shift;
unless ($mounthost) { $mounthost = $hyp; }
my $pool;
@@ -119,10 +129,7 @@ sub build_pool_xml {
my $srcpath = $1;
my $uuid = xCAT::Utils::genUUID(url=>$url);
#first, we make a pool desc that won't have slashes in them
- my $pooldesc = '';
- my $name=$url;
- $name=~ s!nfs://!nfs_!;
- $name =~ s/\//_/g; #though libvirt considers / kosher, sometimes it wants to create a local xml file using name for filename...
+ $pooldesc = '';
$pooldesc .= ''.$name.'';
$pooldesc .= ''.$uuid.'>';
$pooldesc .= '