qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 4/5] Disable XBZRLE during migrate to file if it


From: Orit Wasserman
Subject: Re: [Qemu-devel] [PATCH 4/5] Disable XBZRLE during migrate to file if it is active
Date: Wed, 30 Jan 2013 12:57:32 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 01/30/2013 12:49 PM, Paolo Bonzini wrote:
> 
>> XBZRLE is not effective when migrating to file.
>>
>> Disabling it automatically will remove the need to update the
>> command line to allow loading a guest from a file that was in XBZRLE
>> format.
> 
> What about savevm?
I think a user that activate the XBZRLE capability before doing savevm
can do that also before doing loadvm so I leave it up to him.
The problem with exec is that we load the file from command line and
than the user can't activate XBZRLE from the monitor or QMP.
So he gets an error at the moment.
> 
> Paolo
> 
>> Signed-off-by: Orit Wasserman <address@hidden>
>> ---
>>  include/migration/migration.h | 1 +
>>  migration-exec.c              | 6 ++++++
>>  migration.c                   | 9 +++++++++
>>  3 files changed, 16 insertions(+)
>>
>> diff --git a/include/migration/migration.h
>> b/include/migration/migration.h
>> index a8c9639..8577a0f 100644
>> --- a/include/migration/migration.h
>> +++ b/include/migration/migration.h
>> @@ -129,6 +129,7 @@ int xbzrle_encode_buffer(uint8_t *old_buf,
>> uint8_t *new_buf, int slen,
>>  int xbzrle_decode_buffer(uint8_t *src, int slen, uint8_t *dst, int
>>  dlen);
>>  
>>  int migrate_use_xbzrle(void);
>> +void migrate_disable_xbzrle(void);
>>  int64_t migrate_xbzrle_cache_size(void);
>>  
>>  int64_t xbzrle_cache_resize(int64_t new_size);
>> diff --git a/migration-exec.c b/migration-exec.c
>> index a051a6e..98ba41a 100644
>> --- a/migration-exec.c
>> +++ b/migration-exec.c
>> @@ -61,6 +61,12 @@ void exec_start_outgoing_migration(MigrationState
>> *s, const char *command, Error
>>  {
>>      FILE *f;
>>  
>> +    /* there is no point in using XBZRLE when migrating to file */
>> +    if (migrate_use_xbzrle()) {
>> +        DPRINTF("XBZRLE active during migrate to file -
>> disabling\n");
>> +        migrate_disable_xbzrle();
>> +    }
>> +
>>      f = popen(command, "w");
>>      if (f == NULL) {
>>          error_setg_errno(errp, errno, "failed to popen the migration
>>          target");
>> diff --git a/migration.c b/migration.c
>> index 77c1971..e32635e 100644
>> --- a/migration.c
>> +++ b/migration.c
>> @@ -510,6 +510,15 @@ int migrate_use_xbzrle(void)
>>      return s->enabled_capabilities[MIGRATION_CAPABILITY_XBZRLE];
>>  }
>>  
>> +void migrate_disable_xbzrle(void)
>> +{
>> +    MigrationState *s;
>> +
>> +    s = migrate_get_current();
>> +
>> +    s->enabled_capabilities[MIGRATION_CAPABILITY_XBZRLE] = false;
>> +}
>> +
>>  int64_t migrate_xbzrle_cache_size(void)
>>  {
>>      MigrationState *s;
>> --
>> 1.7.11.7
>>
>>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]