Luiz Capitulino <lcapitul...@redhat.com> 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 <lcapitul...@redhat.com> > --- > 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) [...]