]> git.proxmox.com Git - qemu-server.git/commitdiff
migrate: pass --machine parameter to remote 'qm start' command
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 5 Jun 2013 08:24:39 +0000 (10:24 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 5 Jun 2013 08:24:39 +0000 (10:24 +0200)
PVE/QemuMigrate.pm

index 085aa16fc4e27037d61a89152a59801d2dd5f2b5..dd48f78e1e294bd142e17e807739be41360cb448 100644 (file)
@@ -139,6 +139,7 @@ sub prepare {
     if (my $pid = PVE::QemuServer::check_running($vmid)) {
        die "cant migrate running VM without --online\n" if !$online;
        $running = $pid;
+       $self->{forcemachine} = PVE::QemuServer::get_current_qemu_machine($vmid);
     }
 
     if (my $loc_res = PVE::QemuServer::check_local_resources($conf, 1)) {
@@ -313,6 +314,10 @@ sub phase2 {
     my $cmd = [@{$self->{rem_ssh}}, 'qm', 'start',
                $vmid, '--stateuri', 'tcp', '--skiplock', '--migratedfrom', $nodename];
 
+    if ($self->{forcemachine}) {
+       push @$cmd, '--machine', $self->{forcemachine};
+    }
+
     PVE::Tools::run_command($cmd, outfunc => sub {
        my $line = shift;