Revision 3a697f69 arch_init.c

b/arch_init.c
44 44
#include "exec-memory.h"
45 45
#include "hw/pcspk.h"
46 46

  
47
#ifdef DEBUG_ARCH_INIT
48
#define DPRINTF(fmt, ...) \
49
    do { fprintf(stdout, "arch_init: " fmt, ## __VA_ARGS__); } while (0)
50
#else
51
#define DPRINTF(fmt, ...) \
52
    do { } while (0)
53
#endif
54

  
47 55
#ifdef TARGET_SPARC
48 56
int graphic_width = 1024;
49 57
int graphic_height = 768;
......
380 388

  
381 389
    expected_time = ram_save_remaining() * TARGET_PAGE_SIZE / bwidth;
382 390

  
391
    DPRINTF("ram_save_live: expected(" PRIu64 ") <= max(" PRIu64 ")?\n",
392
            expected_time, migrate_max_downtime());
393

  
383 394
    return (stage == 2) && (expected_time <= migrate_max_downtime());
384 395
}
385 396

  
......
416 427
int ram_load(QEMUFile *f, void *opaque, int version_id)
417 428
{
418 429
    ram_addr_t addr;
419
    int flags;
430
    int flags, ret = 0;
420 431
    int error;
432
    static uint64_t seq_iter;
433

  
434
    seq_iter++;
421 435

  
422 436
    if (version_id < 4 || version_id > 4) {
423 437
        return -EINVAL;
......
447 461

  
448 462
                    QLIST_FOREACH(block, &ram_list.blocks, next) {
449 463
                        if (!strncmp(id, block->idstr, sizeof(id))) {
450
                            if (block->length != length)
451
                                return -EINVAL;
464
                            if (block->length != length) {
465
                                ret =  -EINVAL;
466
                                goto done;
467
                            }
452 468
                            break;
453 469
                        }
454 470
                    }
......
456 472
                    if (!block) {
457 473
                        fprintf(stderr, "Unknown ramblock \"%s\", cannot "
458 474
                                "accept migration\n", id);
459
                        return -EINVAL;
475
                        ret = -EINVAL;
476
                        goto done;
460 477
                    }
461 478

  
462 479
                    total_ram_bytes -= length;
......
493 510
        }
494 511
        error = qemu_file_get_error(f);
495 512
        if (error) {
496
            return error;
513
            ret = error;
514
            goto done;
497 515
        }
498 516
    } while (!(flags & RAM_SAVE_FLAG_EOS));
499 517

  
500
    return 0;
518
done:
519
    DPRINTF("Completed load of VM with exit code %d seq iteration " PRIu64 "\n",
520
            ret, seq_iter);
521
    return ret;
501 522
}
502 523

  
503 524
#ifdef HAS_AUDIO

Also available in: Unified diff