[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 04/13] Add debugging infrastructure
From: |
Blue Swirl |
Subject: |
Re: [Qemu-devel] [PATCH 04/13] Add debugging infrastructure |
Date: |
Fri, 29 Jun 2012 20:28:21 +0000 |
On Fri, Jun 29, 2012 at 4:43 PM, Juan Quintela <address@hidden> wrote:
> From: Orit Wasserman <address@hidden>
>
> Signed-off-by: Orit Wasserman <address@hidden>
> Signed-off-by: Juan Quintela <address@hidden>
> ---
> arch_init.c | 33 +++++++++++++++++++++++++++------
> 1 file changed, 27 insertions(+), 6 deletions(-)
>
> diff --git a/arch_init.c b/arch_init.c
> index cfa1af2..78b3c0c 100644
> --- a/arch_init.c
> +++ b/arch_init.c
> @@ -44,6 +44,14 @@
> #include "exec-memory.h"
> #include "hw/pcspk.h"
>
> +#ifdef DEBUG_ARCH_INIT
> +#define DPRINTF(fmt, ...) \
> + do { fprintf(stdout, "arch_init: " fmt, ## __VA_ARGS__); } while (0)
> +#else
> +#define DPRINTF(fmt, ...) \
> + do { } while (0)
> +#endif
Please use tracepoints instead as with other patches.
> +
> #ifdef TARGET_SPARC
> int graphic_width = 1024;
> int graphic_height = 768;
> @@ -380,6 +388,9 @@ int ram_save_live(QEMUFile *f, int stage, void *opaque)
>
> expected_time = ram_save_remaining() * TARGET_PAGE_SIZE / bwidth;
>
> + DPRINTF("ram_save_live: expected(" PRIu64 ") <= max(" PRIu64 ")?\n",
> + expected_time, migrate_max_downtime());
> +
> return (stage == 2) && (expected_time <= migrate_max_downtime());
> }
>
> @@ -416,8 +427,11 @@ static inline void *host_from_stream_offset(QEMUFile *f,
> int ram_load(QEMUFile *f, void *opaque, int version_id)
> {
> ram_addr_t addr;
> - int flags;
> + int flags, ret = 0;
> int error;
> + static uint64_t seq_iter;
> +
> + seq_iter++;
>
> if (version_id < 4 || version_id > 4) {
> return -EINVAL;
> @@ -447,8 +461,10 @@ int ram_load(QEMUFile *f, void *opaque, int version_id)
>
> QLIST_FOREACH(block, &ram_list.blocks, next) {
> if (!strncmp(id, block->idstr, sizeof(id))) {
> - if (block->length != length)
> - return -EINVAL;
> + if (block->length != length) {
> + ret = -EINVAL;
> + goto done;
> + }
> break;
> }
> }
> @@ -456,7 +472,8 @@ int ram_load(QEMUFile *f, void *opaque, int version_id)
> if (!block) {
> fprintf(stderr, "Unknown ramblock \"%s\", cannot "
> "accept migration\n", id);
> - return -EINVAL;
> + ret = -EINVAL;
> + goto done;
> }
>
> total_ram_bytes -= length;
> @@ -493,11 +510,15 @@ int ram_load(QEMUFile *f, void *opaque, int version_id)
> }
> error = qemu_file_get_error(f);
> if (error) {
> - return error;
> + ret = error;
> + goto done;
> }
> } while (!(flags & RAM_SAVE_FLAG_EOS));
>
> - return 0;
> +done:
> + DPRINTF("Completed load of VM with exit code %d seq iteration " PRIu64
> "\n",
> + ret, seq_iter);
> + return ret;
> }
>
> #ifdef HAS_AUDIO
> --
> 1.7.10.4
>
>
- [Qemu-devel] [PATCH v3 00/13] Migration tree, Juan Quintela, 2012/06/29
- [Qemu-devel] [PATCH 02/13] Add MigrationParams structure, Juan Quintela, 2012/06/29
- [Qemu-devel] [PATCH 01/13] Add missing check for host_from_stream_offset return value for RAM_SAVE_FLAG_PAGE, Juan Quintela, 2012/06/29
- [Qemu-devel] [PATCH 05/13] Add migration_end function, Juan Quintela, 2012/06/29
- [Qemu-devel] [PATCH 07/13] Add tracepoints for savevm section start/end, Juan Quintela, 2012/06/29
- [Qemu-devel] [PATCH 04/13] Add debugging infrastructure, Juan Quintela, 2012/06/29
- Re: [Qemu-devel] [PATCH 04/13] Add debugging infrastructure,
Blue Swirl <=
- [Qemu-devel] [PATCH 11/13] Exit loop if we have been there too long, Juan Quintela, 2012/06/29
- [Qemu-devel] [PATCH 06/13] Add spent time for migration, Juan Quintela, 2012/06/29
- [Qemu-devel] [PATCH 03/13] Add save_block_hdr function, Juan Quintela, 2012/06/29
- [Qemu-devel] [PATCH 08/13] No need to iterate if we already are over the limit, Juan Quintela, 2012/06/29
- [Qemu-devel] [PATCH 12/13] dirty bitmap: abstract its use, Juan Quintela, 2012/06/29
- [Qemu-devel] [PATCH 10/13] Only calculate expected_time for stage 2, Juan Quintela, 2012/06/29
- [Qemu-devel] [PATCH 13/13] Maintain the number of dirty pages, Juan Quintela, 2012/06/29
- [Qemu-devel] [PATCH 09/13] Only TCG needs TLB handling, Juan Quintela, 2012/06/29