]> git.proxmox.com Git - qemu-server.git/commitdiff
is_template : return 1 if template option == 1
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 18 Apr 2013 15:05:30 +0000 (17:05 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 19 Apr 2013 04:56:30 +0000 (06:56 +0200)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/QemuServer.pm

index e72b2c9be8862e3927b3ce34990a1f79bfea612e..7c20f555a58ad85d2bfa9500b9d173fb8d33339a 100644 (file)
@@ -4476,24 +4476,7 @@ sub template_create {
 sub is_template {
     my ($conf) = @_;
 
-    my $baseimagecount = 0;
-    my $totalvolumecount = 0;
-    my $storecfg = PVE::Storage::config();
-
-    foreach_drive($conf, sub {
-       my ($ds, $drive) = @_;
-       return if drive_is_cdrom($drive);
-       $totalvolumecount++;
-       my $volid = $drive->{file};
-       if (PVE::Storage::volume_is_base($storecfg, $volid)){
-           $baseimagecount++;
-       }
-
-    });
-
-    return 0 if $baseimagecount == 0;
-    return 1 if $baseimagecount == $totalvolumecount; #full template
-    return 2 if $baseimagecount < $totalvolumecount; #semi-template
+    return 1 if defined $conf->{template} && $conf->{template} == 1;
 }
 
 1;