qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH 2/3 v5] Block live migration


From: Jan Kiszka
Subject: [Qemu-devel] Re: [PATCH 2/3 v5] Block live migration
Date: Thu, 26 Nov 2009 14:53:49 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

address@hidden wrote:
> +static int block_load(QEMUFile *f, void *opaque, int version_id)
> +{
> +    int len, flags;
> +    char device_name[256];
> +    int64_t addr;
> +    BlockDriverState *bs;
> +    uint8_t *buf;
> +    
> +    block_mig_state->sectors_per_block = bdrv_get_sectors_per_chunk();
> +    buf = qemu_malloc(BLOCK_SIZE);
> +    
> +    do {
> +    
> +        addr = qemu_get_be64(f);
> +    
> +        flags = addr & ~SECTOR_MASK;
> +        addr &= SECTOR_MASK;
> +    
> +        if(flags & BLK_MIG_FLAG_DEVICE_BLOCK) {
> +         
> +            /* get device name */
> +            len = qemu_get_byte(f);
> +      
> +            qemu_get_buffer(f, (uint8_t *)device_name, len);
> +            device_name[len] = '\0';
> +      
> +            bs = bdrv_find(device_name);
> +      
> +            qemu_get_buffer(f, buf, 
> +                            BLOCK_SIZE);
> +            if(bs != NULL) {
> +     
> +                bdrv_write(bs, (addr >> SECTOR_BITS), 
> +                           buf, block_mig_state->sectors_per_block);

This synchronous write-back translates appears to be the reason for an
unusable migration (or restore from snapshot) speed: about 100 KB/s here
(ie. 22h for a rather small 8G guest :( ). Did you already try to
improve this situation?

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux




reply via email to

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