[pve-devel] [PATCH] migration : enable auto-converge capability

Dietmar Maurer dietmar at proxmox.com
Wed Jan 8 06:38:03 CET 2014


Hi Alexandre,

first, sorry for the delay.

Comments inline:

> diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index
> d980f0b..a6c0ada 100644
> --- a/PVE/QemuMigrate.pm
> +++ b/PVE/QemuMigrate.pm
> @@ -385,12 +385,16 @@ sub phase2 {
>  	$self->log('info', "migrate_set_downtime error: $@") if $@;
>      }
> 
> -    my $capabilities = {};
> -    $capabilities->{capability} =  "xbzrle";
> -    $capabilities->{state} = JSON::false;
> +    my $capability = {};
> +    my $capability2 = {};
> +
> +    $capability->{capability} =  "xbzrle";
> +    $capability->{state} = JSON::false;
> +    $capability2->{capability} =  "auto-converge";
> +    $capability2->{state} = JSON::true;

We use the same code at two locations, so it is maybe worth to factor out:

sub get_migrate_caps {

	return [....];
}

or maybe:

sub PVE::QemuServer::set_migration_caps {
	my ($vmid) = @_;

	my $capability = {};
	my $capability2 = {};

	...

	PVE::QemuServer::vm_mon_cmd_nocheck($vmid, "migrate-set-capabilities",
	capabilities => [ $capability, $capability2 ]);
}

> 
>      eval {
> -	PVE::QemuServer::vm_mon_cmd_nocheck($vmid, "migrate-set-
> capabilities", capabilities => [$capabilities]);
> +	PVE::QemuServer::vm_mon_cmd_nocheck($vmid, "migrate-set-
> capabilities",
> +capabilities => [ $capability, $capability2 ]);
>      };

Does this break migration if VM is started with older KVM?
 
>      #set cachesize 10% of the total memory diff --git a/PVE/QemuServer.pm
> b/PVE/QemuServer.pm index a5576a6..ffad5f2 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -3160,10 +3160,17 @@ sub vm_start {
>  	}
> 
>  	if ($migratedfrom) {
> -	    my $capabilities = {};
> -	    $capabilities->{capability} =  "xbzrle";
> -	    $capabilities->{state} = JSON::true;
> -	    eval { vm_mon_cmd_nocheck($vmid, "migrate-set-capabilities",
> capabilities => [$capabilities]); };
> +	    my $capability = {};
> +	    my $capability2 = {};
> +
> +	    $capability->{capability} =  "xbzrle";
> +	    $capability->{state} = JSON::false;
> +	    $capability2->{capability} =  "auto-converge";
> +	    $capability2->{state} = JSON::true;
> +
> +	    eval {
> +	        PVE::QemuServer::vm_mon_cmd_nocheck($vmid, "migrate-set-
> capabilities", capabilities => [ $capability, $capability2 ]);
> +	    };
>  	    warn $@ if $@;
> 
>  	    if ($spice_port) {
> --
> 1.7.10.4
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel





More information about the pve-devel mailing list