[pve-devel] [PATCH manager] Use methods from PVE::QemuConfig

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Mar 7 12:43:07 CET 2016


use config_file and load_config from PVE::QemuConfig
---
Note: depends on the patch series refactoring qemu-server

 PVE/API2/Nodes.pm | 3 ++-
 bin/ocf/pvevm     | 7 ++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index 4b5af73..68496d7 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -25,6 +25,7 @@ use PVE::APLInfo;
 use PVE::Report;
 use PVE::HA::Env::PVE2;
 use PVE::HA::Config;
+use PVE::QemuConfig;
 use PVE::QemuServer;
 use PVE::API2::Subscription;
 use PVE::API2::Services;
@@ -1193,7 +1194,7 @@ my $get_start_stop_list = sub {
 	    if ($d->{type} eq 'lxc') {
 		$conf = PVE::LXC::Config->load_config($vmid);
 	    } elsif ($d->{type} eq 'qemu') {
-		$conf = PVE::QemuServer::load_config($vmid);
+		$conf = PVE::QemuConfig->load_config($vmid);
 	    } else {
 		die "unknown VM type '$d->{type}'\n";
 	    }
diff --git a/bin/ocf/pvevm b/bin/ocf/pvevm
index 5752932..a47ce76 100755
--- a/bin/ocf/pvevm
+++ b/bin/ocf/pvevm
@@ -15,6 +15,7 @@ use PVE::INotify;
 use PVE::RPCEnvironment;
 use PVE::OpenVZ;
 use PVE::API2::OpenVZ;
+use PVE::QemuConfig;
 use PVE::QemuServer;
 use PVE::API2::Qemu;
 
@@ -209,8 +210,8 @@ if ($cmd eq 'start') {
 	ocf_log('info', "Move config for $status->{name} to local node");
 	my ($oldconfig, $newconfig, $oldfiles, $newfiles);
 	if ($status->{type} eq 'qemu') {
-	    $oldconfig = PVE::QemuServer::config_file($status->{vmid}, $status->{node});
-	    $newconfig = PVE::QemuServer::config_file($status->{vmid}, $nodename);
+	    $oldconfig = PVE::QemuConfig->config_file($status->{vmid}, $status->{node});
+	    $newconfig = PVE::QemuConfig->config_file($status->{vmid}, $nodename);
 	} else {
 	    $oldconfig = PVE::OpenVZ::config_file($status->{vmid}, $status->{node});
 	    $newconfig = PVE::OpenVZ::config_file($status->{vmid}, $nodename);
@@ -349,7 +350,7 @@ if ($cmd eq 'start') {
 
     my $oldconfig;
     if ($status->{type} eq 'qemu') {
-	$oldconfig = PVE::QemuServer::config_file($status->{vmid}, $status->{node});
+	$oldconfig = PVE::QemuConfig->config_file($status->{vmid}, $status->{node});
 	$upid = PVE::API2::Qemu->migrate_vm($params);
     } else {
 	$oldconfig = PVE::OpenVZ::config_file($status->{vmid}, $status->{node});
-- 
2.1.4





More information about the pve-devel mailing list