<div dir="ltr">Hi Fabian,<div><br></div><div>Thank you for clarifying, i missed the refactoring as i created the patches a while back. I'm rather new to git so excuse me for that.</div><div>I hope you'll get the idea what i'm trying to achieve here. Right now the start-all button also starts templates and throws an error for each VM/CT template because it cannot start, obviously.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">Kind regards,<br>Caspar Smit<br></div><div dir="ltr"><br></div></div></div><div class="gmail_quote">2016-03-11 13:15 GMT+01:00 Fabian Grünbichler <span dir="ltr"><<a href="mailto:f.gruenbichler@proxmox.com" target="_blank">f.gruenbichler@proxmox.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> Caspar Smit <<a href="mailto:casparsmit@supernas.eu">casparsmit@supernas.eu</a>> hat am 11. März 2016 um 12:59<br>
> geschrieben:<br>
<div><div class="h5">><br>
><br>
> Signed-off-by: Caspar Smit <<a href="mailto:casparsmit@supernas.eu">casparsmit@supernas.eu</a>><br>
> ---<br>
> PVE/API2/Nodes.pm | 12 ++++++++++++<br>
> 1 file changed, 12 insertions(+)<br>
><br>
> diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm<br>
> index d4af788..6f639d2 100644<br>
> --- a/PVE/API2/Nodes.pm<br>
> +++ b/PVE/API2/Nodes.pm<br>
> @@ -1274,6 +1274,18 @@ __PACKAGE__->register_method ({<br>
> foreach my $vmid (sort {$a <=> $b} keys %$vmlist) {<br>
> my $d = $vmlist->{$vmid};<br>
><br>
> + # skip templates<br>
> + my $conf;<br>
> + if ($d->{type} eq 'lxc') {<br>
> + $conf = PVE::LXC::load_config($vmid);<br>
> + } elsif ($d->{type} eq 'qemu') {<br>
> + $conf = PVE::QemuServer::load_config($vmid);<br>
> + } else {<br>
> + die "unknown VM type '$d->{type}'\n";<br>
> + }<br>
> + next if PVE::QemuServer::is_template($conf);<br>
> + next if PVE::LXC::is_template($conf);<br>
> +<br>
> PVE::Cluster::check_cfs_quorum(); # abort when we loose quorum<br>
><br>
> eval {<br>
> --<br>
> 2.1.4<br>
><br>
<br>
</div></div>PVE::LXC::load_config and PVE::QemuServer::load:config were refactored to<br>
pve-common/src/pve/AbstractConfig.pm (PVE::AbstractConfig, implemented/extended<br>
in PVE::LXC::Config and PVE::QemuConfig), so these should be called via the<br>
respective subclasses PVE::LXC::Config->load_config and<br>
PVE::QemuConfig->load_config. The same applies for is_template.<br>
<br>
The is_template check should move into the if branches, it doesn't make sense to<br>
check this twice, especially since both subclasses use the implementation in<br>
AbstractConfig.pm anyway.<br>
<br>
I'll leave the general review to the others - thanks for you contribution in any<br>
case!<br>
<br>
Regards,<br>
Fabian<br>
<br>
_______________________________________________<br>
pve-devel mailing list<br>
<a href="mailto:pve-devel@pve.proxmox.com">pve-devel@pve.proxmox.com</a><br>
<a href="http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel" rel="noreferrer" target="_blank">http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel</a><br>
</blockquote></div><br></div></div>