From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPYnW-0000ZK-6x for qemu-devel@nongnu.org; Tue, 09 Apr 2013 09:41:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPYnU-0005iG-Qw for qemu-devel@nongnu.org; Tue, 09 Apr 2013 09:41:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPYnU-0005i9-EH for qemu-devel@nongnu.org; Tue, 09 Apr 2013 09:41:16 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r39DfFNh014180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 9 Apr 2013 09:41:15 -0400 From: Markus Armbruster References: <4f8753c0e4f07511d20648df7340180de1a9e7f1.1364565637.git.phrdina@redhat.com> Date: Tue, 09 Apr 2013 15:41:13 +0200 In-Reply-To: <4f8753c0e4f07511d20648df7340180de1a9e7f1.1364565637.git.phrdina@redhat.com> (Pavel Hrdina's message of "Fri, 29 Mar 2013 15:12:31 +0100") Message-ID: <87hajfbz46.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v4 04/11] savevm: add error parameter to qemu_savevm_state_iterate() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Hrdina Cc: qemu-devel@nongnu.org, lcapitulino@redhat.com Pavel Hrdina writes: > Signed-off-by: Pavel Hrdina > Reviewed-by: Eric Blake > --- > include/sysemu/sysemu.h | 2 +- > migration.c | 2 +- > savevm.c | 4 ++-- > 3 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h > index 2f35a05..af4f699 100644 > --- a/include/sysemu/sysemu.h > +++ b/include/sysemu/sysemu.h > @@ -76,7 +76,7 @@ bool qemu_savevm_state_blocked(Error **errp); > void qemu_savevm_state_begin(QEMUFile *f, > const MigrationParams *params, > Error **errp); > -int qemu_savevm_state_iterate(QEMUFile *f); > +int qemu_savevm_state_iterate(QEMUFile *f, Error **errp); > void qemu_savevm_state_complete(QEMUFile *f); > void qemu_savevm_state_cancel(void); > uint64_t qemu_savevm_state_pending(QEMUFile *f, uint64_t max_size); > diff --git a/migration.c b/migration.c > index d517dd6..e9d2f40 100644 > --- a/migration.c > +++ b/migration.c > @@ -516,7 +516,7 @@ static void *migration_thread(void *opaque) > pending_size = qemu_savevm_state_pending(s->file, max_size); > DPRINTF("pending size %lu max %lu\n", pending_size, max_size); > if (pending_size && pending_size >= max_size) { > - qemu_savevm_state_iterate(s->file); > + qemu_savevm_state_iterate(s->file, NULL); > } else { > DPRINTF("done iterating\n"); > qemu_mutex_lock_iothread(); > diff --git a/savevm.c b/savevm.c > index 56da096..575f1b2 100644 > --- a/savevm.c > +++ b/savevm.c > @@ -1784,7 +1784,7 @@ void qemu_savevm_state_begin(QEMUFile *f, > * 0 : We haven't finished, caller have to go again > * 1 : We have finished, we can go to complete phase > */ > -int qemu_savevm_state_iterate(QEMUFile *f) > +int qemu_savevm_state_iterate(QEMUFile *f, Error **errp) > { > SaveStateEntry *se; > int ret = 1; QTAILQ_FOREACH(se, &savevm_handlers, entry) { if (!se->ops || !se->ops->save_live_iterate) { continue; } if (se->ops && se->ops->is_active) { if (!se->ops->is_active(se->opaque)) { continue; } } if (qemu_file_rate_limit(f)) { return 0; } trace_savevm_section_start(); /* Section type */ qemu_put_byte(f, QEMU_VM_SECTION_PART); qemu_put_be32(f, se->section_id); ret = se->ops->save_live_iterate(f, se->opaque); trace_savevm_section_end(se->section_id); if (ret < 0) { qemu_file_set_error(f, ret); } if (ret <= 0) { /* Do not proceed to the next vmstate before this one reported completion of the current stage. This serializes the migration and reduces the probability that a faster changing state is synchronized over and over again. */ break; Returns an error without setting the Error parameter. Evil :) } } return ret; } > @@ -1926,7 +1926,7 @@ static int qemu_savevm_state(QEMUFile *f) > qemu_mutex_lock_iothread(); > > while (qemu_file_get_error(f) == 0) { > - if (qemu_savevm_state_iterate(f) > 0) { > + if (qemu_savevm_state_iterate(f, NULL) > 0) { > break; > } > }