|
From: | Juan Quintela |
Subject: | Re: [PATCH v3 18/21] migration: Make no compression operations into its own structure |
Date: | Fri, 24 Jan 2020 14:39:04 +0100 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
"Dr. David Alan Gilbert" <address@hidden> wrote: > * Juan Quintela (address@hidden) wrote: >> It will be used later. >> >> Signed-off-by: Juan Quintela <address@hidden> >> >> +int migrate_multifd_method(void) >> +{ >> + MigrationState *s; >> + >> + s = migrate_get_current(); >> + >> + return s->parameters.multifd_compress; >> +} > > Shouldn't that be a MultifdCompress enum returned? You are right here. >> >> #define MULTIFD_FLAG_SYNC (1 << 0) >> +#define MULTIFD_FLAG_NOCOMP (1 << 1) > > I don't think this should be a set of individual flags; in later patches > you define a flag for zlib and another for zstd etc etc - but you can't > combine them - you could never have FLAG_NOCOMP|FLAG_ZSTD|FLAG_ZLIB - so > this should be a 3 or 4 bit field which contains a compression id (0 > being none). The ID can't exactly be the migrate_multifd_method() enum > value - because I don't think that's defined to be stable (?). The idea is to catch up if we got an incorrect packet with an incorrect flag. But yes, I agree that it could be the same expecting a value here. The problem is that I already have the flags field. Would it be ok for you if I reserve 3 bits for this? (right now 2 should be enough). Thanks, Juan.
[Prev in Thread] | Current Thread | [Next in Thread] |