Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NIg7v-00089q-Vc for qemu-devel@nongnu.org; Thu, 10 Dec 2009 05:20:04 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NIg7q-00088h-HX for qemu-devel@nongnu.org; Thu, 10 Dec 2009 05:20:02 -0500 Received: from [199.232.76.173] (port=49675 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIg7q-00088a-CZ for qemu-devel@nongnu.org; Thu, 10 Dec 2009 05:19:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50161) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NIg7p-0008R8-SU for qemu-devel@nongnu.org; Thu, 10 Dec 2009 05:19:58 -0500 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH 14/19] migration: Convert do_info_migrate() to QObject References: <1260376078-8694-1-git-send-email-lcapitulino@redhat.com> <1260376078-8694-15-git-send-email-lcapitulino@redhat.com> Date: Thu, 10 Dec 2009 11:19:54 +0100 In-Reply-To: <1260376078-8694-15-git-send-email-lcapitulino@redhat.com> (Luiz Capitulino's message of "Wed, 9 Dec 2009 14:27:53 -0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org Luiz Capitulino writes: > Return a QDict, which may contain more two QDicts, depending on s/more two/up to two more/ > the type of migration we're performing. > > IMPORTANT: as a QInt stores a int64_t integer, RAM values are going > to be stored as int64_t and not as uint64_t as they are today. If > this is a problem QInt will have to be changed. > > This commit should not change user output. > > Signed-off-by: Luiz Capitulino > --- > migration.c | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++-------- > migration.h | 4 ++- > monitor.c | 3 +- > 3 files changed, 107 insertions(+), 17 deletions(-) > > diff --git a/migration.c b/migration.c > index d6a3e26..44e37e2 100644 > --- a/migration.c > +++ b/migration.c [...] > +/** > + * do_info_migrate(): Migration status > + * > + * Return a QDict. If migration is active there will be another > + * QDict with RAM migration status and if block migration is active > + * another one with block migration status. > + * > + * The main QDict contains the following: > + * > + * - "status": migration status > + * - "ram": only present if "status" is "active", it is a QDict with the > + * following RAM information (in bytes): > + * - "transferred": amount transferred > + * - "remaining": amount remaining > + * - "total": total > + * - "disk": only present if it is a block migration, it is a QDict with ... if "status" is "active" and it is a block migration ... > + * the following disk information (in bytes): > + * - "transferred": amount transferred > + * - "remaining": amount remaining > + * - "total": total > + * > + * Examples: > + * > + * 1. Migration is "completed": > + * > + * { "status": "completed" } > + * > + * 2. Migration is "active" and it is not a block migration: > + * > + * { "status": "active", > + * "ram": { "transferred": 123, "remaining": 123, "total": 246 } } > + * > + * 3. Migration is "active" and it is a block migration: > + * > + * { "status": "active", > + * "ram": { "total": 1057024, "remaining": 1053304, "transferred": 3720 }, > + * "disk": { "total": 20971520, "remaining": 20880384, "transferred": 91136 }} > + */ > +void do_info_migrate(Monitor *mon, QObject **ret_data) [...]