[pve-devel] [PATCH 2/3] is_template : return 1 if template option == 1
Alexandre Derumier
aderumier at odiso.com
Thu Apr 18 17:05:30 CEST 2013
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/QemuServer.pm | 19 +------------------
1 file changed, 1 insertion(+), 18 deletions(-)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index e72b2c9..7c20f55 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -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;
--
1.7.10.4
More information about the pve-devel
mailing list