[pve-devel] [PATCH 2/3] allow to pass spiceticket as ENVVAR to vm_start
Alexandre Derumier
aderumier at odiso.com
Wed Jul 24 09:52:32 CEST 2013
we need it add spiceticket to target vm for migration
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/API2/Qemu.pm | 4 +++-
PVE/QemuServer.pm | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 29e7647..d90574e 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -1524,6 +1524,8 @@ __PACKAGE__->register_method({
my $machine = extract_param($param, 'machine');
+ my $spiceticket = $ENV{SPICETICKET};
+
my $stateuri = extract_param($param, 'stateuri');
raise_param_exc({ stateuri => "Only root may use this option." })
if $stateuri && $authuser ne 'root at pam';
@@ -1564,7 +1566,7 @@ __PACKAGE__->register_method({
syslog('info', "start VM $vmid: $upid\n");
- PVE::QemuServer::vm_start($storecfg, $vmid, $stateuri, $skiplock, $migratedfrom, undef, $machine);
+ PVE::QemuServer::vm_start($storecfg, $vmid, $stateuri, $skiplock, $migratedfrom, undef, $machine, $spiceticket);
return;
};
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 0f2d245..4053efe 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3027,7 +3027,7 @@ sub qga_unfreezefs {
}
sub vm_start {
- my ($storecfg, $vmid, $statefile, $skiplock, $migratedfrom, $paused, $forcemachine) = @_;
+ my ($storecfg, $vmid, $statefile, $skiplock, $migratedfrom, $paused, $forcemachine, $spiceticket) = @_;
lock_config($vmid, sub {
my $conf = load_config($vmid, $migratedfrom);
--
1.7.10.4
More information about the pve-devel
mailing list